Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConfigNotJSON = errors.New("config file not JSON")
errors declarations
Functions ¶
func PushFiles ¶
func PushFiles(w http.ResponseWriter, files ...string) error
PushFiles takes an http.ResponseWriter and a variadic amount of file strings the function will iterate through each file and performa an HTTP/2 Push if HTTP/2 is supported AND if the files are valid. Otherwise, will return error
func RedirectHTTPS ¶
func RedirectHTTPS(httpsHost string) func(http.ResponseWriter, *http.Request)
RedirectHTTPS can redirect all http traffic to corresponding https addresses
Types ¶
type Server ¶
Server ...
type ServerConfig ¶
type ServerConfig struct { Host string `json:"host"` Port string `json:"port"` IP string `json:"IP"` ChooseIP bool `json:"chooseIP"` HTTPS bool `json:"secure"` DebugLog bool `json:"debugLog"` CacheMaxAge int `json:"cacheMaxAge"` ShutdownCode int `json:"shutdownCode"` UserShutdown bool `json:"userShutdown"` CertFile string `json:"certFile"` KeyFile string `json:"keyFile"` RootCA string `json:"rootCA"` }
ServerConfig is the general struct holds parsed JSON config info
func LoadConfig ¶
func LoadConfig(filename string) (ServerConfig, error)
LoadConfig returns a config struct given a valid config.json file
func (*ServerConfig) Print ¶
func (cfg *ServerConfig) Print()
Print provides a pretty formatted print of a ServerConfig
Click to show internal directories.
Click to hide internal directories.