* move "httpsServer" to "config"

This commit is contained in:
Simon Zolin
2019-07-09 18:50:17 +03:00
parent f79008d9d0
commit 2780ace63e
4 changed files with 28 additions and 25 deletions

View File

@@ -39,6 +39,13 @@ type clientObject struct {
SafeBrowsingEnabled bool `yaml:"safesearch_enabled"`
}
type HTTPSServer struct {
server *http.Server
cond *sync.Cond // reacts to config.TLS.Enabled, PortHTTPS, CertificateChain and PrivateKey
sync.Mutex // protects config.TLS
shutdown bool // if TRUE, don't restart the server
}
// configuration is loaded from YAML
// field ordering is important -- yaml fields will mirror ordering from here
type configuration struct {
@@ -63,6 +70,8 @@ type configuration struct {
versionCheckJSON []byte
versionCheckLastTime time.Time
httpsServer HTTPSServer
BindHost string `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to
BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server
AuthName string `yaml:"auth_name"` // AuthName is the basic auth username