Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( FacilityMap = map[string]srslog.Priority{ `LOG_KERN`: srslog.LOG_KERN, `LOG_USER`: srslog.LOG_USER, `LOG_MAIL`: srslog.LOG_MAIL, `LOG_DAEMON`: srslog.LOG_DAEMON, `LOG_AUTH`: srslog.LOG_AUTH, `LOG_SYSLOG`: srslog.LOG_SYSLOG, `LOG_LPR`: srslog.LOG_LPR, `LOG_NEWS`: srslog.LOG_NEWS, `LOG_UUCP`: srslog.LOG_UUCP, `LOG_CRON`: srslog.LOG_CRON, `LOG_AUTHPRIV`: srslog.LOG_AUTHPRIV, `LOG_FTP`: srslog.LOG_FTP, `LOG_LOCAL0`: srslog.LOG_LOCAL0, `LOG_LOCAL1`: srslog.LOG_LOCAL1, `LOG_LOCAL2`: srslog.LOG_LOCAL2, `LOG_LOCAL3`: srslog.LOG_LOCAL3, `LOG_LOCAL4`: srslog.LOG_LOCAL4, `LOG_LOCAL5`: srslog.LOG_LOCAL5, `LOG_LOCAL6`: srslog.LOG_LOCAL6, `LOG_LOCAL7`: srslog.LOG_LOCAL7, } SeverityMap = map[string]srslog.Priority{ `LOG_ALERT`: srslog.LOG_ALERT, `LOG_CRIT`: srslog.LOG_CRIT, `LOG_ERR`: srslog.LOG_ERR, `LOG_WARNING`: srslog.LOG_WARNING, `LOG_NOTICE`: srslog.LOG_NOTICE, `LOG_INFO`: srslog.LOG_INFO, `LOG_DEBUG`: srslog.LOG_DEBUG, } )
Functions ¶
func AuthTokenHandler ¶
AuthTokenHandler is middleWare that validates a client authentication token prior to allowing access to protected pages.
func MaxConnectionHandler ¶
MaxConnectionHandler limits the number of concurrent connections using a counting semephore modeled with a buffered channel. At maxConnections active clients, new requests queue until a 'slot' becomes available. From https://pauladamsmith.com/blog/2016/04/max-clients-go-net-http.html.
func SigHandler ¶
func SigHandler(conf *Config)
SignalHandler runs in an endless loop, blocking on the signal channel until a signal arrives, then handles the signal.
Types ¶
type Config ¶
type Config struct { Console bool Refresh bool RecoveryStack bool MaxConnections int ServerTimeout time.Duration ConfigFile map[string]string AuthSvc service.AuthSvc SerialSvc service.SerialSvc LoggerSvc service.LoggerSvc MetaUsbSvc service.MetaUsbSvc DataStore store.DataStore AccessLog log.MLogger SystemLog log.MLogger ErrorLog log.MLogger Syslog *Syslog Router *Router Server *Server Profiler *Profiler }
Master configuration settings.
func NewConfig ¶
NewConfig creates a new master configuration object and reads its config from the provided JSON configuration file.
func (*Config) LoadMetaData ¶
func (this *Config) LoadMetaData()
LoadMetaData loads the metadata tables in the datastore.
func (*Config) LogDataStoreInfo ¶
func (this *Config) LogDataStoreInfo()
LogDataStoreInfo logs information about the datastore to the system log.
func (*Config) LogRouteInfo ¶
func (this *Config) LogRouteInfo()
LogRouteInfo logs information about API endpoint routes.
func (*Config) LogServerInfo ¶
func (this *Config) LogServerInfo()
LogServerInfo logs information about the server to the system log.
func (*Config) RefreshMetaData ¶
func (this *Config) RefreshMetaData()
RefreshMetaData downloads a fresh copy of the device metadata.
type Router ¶
Router is a Gorilla Mux router with additional methods.