Documentation
¶
Index ¶
Constants ¶
const Version = "R7"
Version holds the version numer of MaguroHTTP
Variables ¶
This section is empty.
Functions ¶
func LoadConfigFromFile ¶
LoadConfigFromFile is a function which a loads the Config type microConfig from a json file
Types ¶
type AutoCertConfig ¶
AutoCertConfig is part of MaguroHTTP core/tls configuration
type Config ¶
type Config struct {
Core CoreConfig
Serve serveConfig
Errors map[string]string
Proxy proxyConfig
Guard guardConfig
}
Config is type holding the main configurtion
func NewConfig ¶
func NewConfig() Config
NewConfig returns a pointer to a config, initialised with default values
func NewVhostConfig ¶
func NewVhostConfig() Config
NewVhostConfig returns a pointer to a config, initialised with default values
type CoreConfig ¶
type CoreConfig struct {
Address string
Port string
FileDir string
LogLevel int
LogOut string
ReadTimeout int
ReadHeaderTimeout int
WriteTimeout int
WebDAV bool
VirtualHosting bool
VirtualHosts map[string]string
TLS TLSConfig
Metrics MetricsConfig
}
CoreConfig is part of the main configuration. coreConfig is not used by vhosts
type HSTSConfig ¶
HSTSConfig type, part of MaguroHTTP core/tls config
type MetricsConfig ¶
MetricsConfig type, part of MaguroHTTP config
type Server ¶
type Server struct {
// Cfg is of type Config and holds the configuration of instance
Cfg Config
// vhosts holds the information of each vhost
Vhosts map[string]Config
// Router holds the router of the server instance
Router *router.SRouter
// HTTP transport
Transport http.RoundTripper
// contains filtered or unexported fields
}
Server is a type holding a MaguroHTTP server instance
func NewInstance ¶
func NewInstance(c CoreConfig) *Server
NewInstance returns a pointer to a new MaguroHTTP server based on supplied config
func NewInstanceFromConfig ¶
NewInstanceFromConfig will create a new instance from a config file
func (*Server) HandleError ¶
HandleError is a function to write HTTP error to ResponseWriter
func (*Server) LogNetwork ¶
LogNetwork is a function to log network activity using the debug.Logger type
type TLSConfig ¶
type TLSConfig struct {
Enabled bool
TLSCert string
TLSKey string
PrivateCA []string
AutoCert AutoCertConfig
HSTS HSTSConfig
}
TLSConfig holds information about TLS and is part of MaguroHTTP core config