2020-04-30 09:03:05 +07:00
|
|
|
package schema
|
|
|
|
|
|
|
|
// ServerConfiguration represents the configuration of the http server.
|
|
|
|
type ServerConfiguration struct {
|
2021-08-03 16:55:21 +07: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 18:55:30 +07:00
|
|
|
|
2021-08-03 16:55:21 +07:00
|
|
|
TLS ServerTLSConfiguration `koanf:"tls"`
|
2021-08-02 18:55:30 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
// ServerTLSConfiguration represents the configuration of the http servers TLS options.
|
|
|
|
type ServerTLSConfiguration struct {
|
2021-08-03 16:55:21 +07:00
|
|
|
Certificate string `koanf:"certificate"`
|
|
|
|
Key string `koanf:"key"`
|
2020-04-30 09:03:05 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
// DefaultServerConfiguration represents the default values of the ServerConfiguration.
|
|
|
|
var DefaultServerConfiguration = ServerConfiguration{
|
2021-08-02 18:55:30 +07:00
|
|
|
Host: "0.0.0.0",
|
|
|
|
Port: 9091,
|
2020-04-30 09:03:05 +07:00
|
|
|
ReadBufferSize: 4096,
|
|
|
|
WriteBufferSize: 4096,
|
|
|
|
}
|