2020-04-30 02:03:05 +00:00
|
|
|
package schema
|
|
|
|
|
|
|
|
// ServerConfiguration represents the configuration of the http server.
|
|
|
|
type ServerConfiguration struct {
|
2021-08-03 09:55:21 +00:00
|
|
|
Host string `koanf:"host"`
|
|
|
|
Port int `koanf:"port"`
|
|
|
|
Path string `koanf:"path"`
|
|
|
|
ReadBufferSize int `koanf:"read_buffer_size"`
|
|
|
|
WriteBufferSize int `koanf:"write_buffer_size"`
|
|
|
|
EnablePprof bool `koanf:"enable_endpoint_pprof"`
|
|
|
|
EnableExpvars bool `koanf:"enable_endpoint_expvars"`
|
2021-08-02 11:55:30 +00:00
|
|
|
|
2021-08-03 09:55:21 +00:00
|
|
|
TLS ServerTLSConfiguration `koanf:"tls"`
|
2021-08-02 11:55:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ServerTLSConfiguration represents the configuration of the http servers TLS options.
|
|
|
|
type ServerTLSConfiguration struct {
|
2021-08-03 09:55:21 +00:00
|
|
|
Certificate string `koanf:"certificate"`
|
|
|
|
Key string `koanf:"key"`
|
2020-04-30 02:03:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// DefaultServerConfiguration represents the default values of the ServerConfiguration.
|
|
|
|
var DefaultServerConfiguration = ServerConfiguration{
|
2021-08-02 11:55:30 +00:00
|
|
|
Host: "0.0.0.0",
|
|
|
|
Port: 9091,
|
2020-04-30 02:03:05 +00:00
|
|
|
ReadBufferSize: 4096,
|
|
|
|
WriteBufferSize: 4096,
|
|
|
|
}
|