* move HTTP server code

This commit is contained in:
Simon Zolin
2020-02-19 15:24:55 +03:00
parent 0789e4b20d
commit 8e4bc29103
6 changed files with 234 additions and 159 deletions

View File

@@ -2,7 +2,6 @@ package home
import (
"io/ioutil"
"net/http"
"os"
"path/filepath"
"sync"
@@ -29,14 +28,6 @@ type logSettings struct {
Verbose bool `yaml:"verbose"` // If true, verbose logging is enabled
}
// HTTPSServer - HTTPS Server
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 {