server

package
v3.0.0-beta.2+incompat... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 AuthTokenValidator

func AuthTokenValidator(authSvc service.AuthSvc, next http.Handler) http.Handler

AuthTokenValidator is middleWare that validates a client authentication token prior to allowing access to protected pages.

Types

type Config

type Config struct {
	Console    bool
	Refresh    bool
	ConfigFile map[string]string

	AuthSvc    service.AuthSvc
	SerialSvc  service.SerialSvc
	LoggerSvc  service.LoggerSvc
	MetaUsbSvc service.MetaUsbSvc
	DataStore  store.DataStore

	Syslog *Syslog
	Router *Router
	Server *Server
}

Master configuration settings.

func NewConfig

func NewConfig(cf string, console, refresh bool) (*Config, error)

NewConfig creates a new master configuration object and reads its config from the provided JSON configuration file.

type Router

type Router struct {
	*mux.Router
	RecoveryStack bool
	AuthSvc       service.AuthSvc
	LoggerSvc     service.LoggerSvc
}

Router is a Gorilla Mux router with additional methods.

func NewRouter

func NewRouter(cf string, authSvc service.AuthSvc, logSvc service.LoggerSvc) (*Router, error)

NewRouter creates and initializes a new Router instance.

func (*Router) AddEndpoints

func (this *Router) AddEndpoints(endpoints []api.Endpoint) *Router

AddEndpoints adds a collection of one or more endpoints to the Router.

type Server

type Server struct {
	*http.Server
}

server extends the http.Server object.

func NewServer

func NewServer(cf string, handler http.Handler) (*Server, error)

NewServer creates and initializes a new Server instance.

func (*Server) String

func (this *Server) String() string

String provides identifying information about the server.

type Syslog

type Syslog struct {
	*srslog.Writer
	Protocol string
	Port     string
	Host     string
	Tag      string
	Facility string
	Severity string
}

Syslog contains the Syslog configuration.

func NewSyslog

func NewSyslog(cf string) (*Syslog, error)

NewSyslog creates and initializes a new Syslog instance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL