config.go 1014 B

12345678910111213141516171819202122232425262728
  1. package guerrilla
  2. // AppConfig is the holder of the configuration of the app
  3. type AppConfig struct {
  4. Dashboard DashboardConfig `json:"dashboard"`
  5. Servers []ServerConfig `json:"servers"`
  6. AllowedHosts []string `json:"allowed_hosts"`
  7. }
  8. type DashboardConfig struct {
  9. Enabled bool `json:"enabled"`
  10. ListenInterface string `json:"listen_interface"`
  11. }
  12. // ServerConfig specifies config options for a single server
  13. type ServerConfig struct {
  14. IsEnabled bool `json:"is_enabled"`
  15. Hostname string `json:"host_name"`
  16. AllowedHosts []string `json:"allowed_hosts"`
  17. MaxSize int64 `json:"max_size"`
  18. PrivateKeyFile string `json:"private_key_file"`
  19. PublicKeyFile string `json:"public_key_file"`
  20. Timeout int `json:"timeout"`
  21. ListenInterface string `json:"listen_interface"`
  22. StartTLSOn bool `json:"start_tls_on,omitempty"`
  23. TLSAlwaysOn bool `json:"tls_always_on,omitempty"`
  24. MaxClients int `json:"max_clients"`
  25. }