Documentation ¶
Overview ¶
Package server starts a web server with some preset routes and configuration
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type Admin struct {
// contains filtered or unexported fields
}
Admin struct stores resources needed by the API
type Server ¶
type Server struct { Config *config.Config Router *httprouter.Router DB *pgxpool.Pool Log *logging.Logger Cache *webcache.WebCache GzipPool *compress.GzipPool BrotliPool *compress.BrotliPool Limiter *limiter.Limiter // contains filtered or unexported fields }
Server stores configuration for currently running server instance
func (*Server) HandlePanic ¶
func (s *Server) HandlePanic(f http.HandlerFunc) http.HandlerFunc
HandlePanic will recover and log a panic.
func (*Server) Init ¶
func (s *Server) Init()
Init loads the config and sets the server up to be started
func (*Server) Logger ¶
func (s *Server) Logger(f http.HandlerFunc) http.HandlerFunc
Logger writes request info to the configured log file.
type StaticData ¶
type StaticData struct {
// contains filtered or unexported fields
}
StaticData stores the root path for static and root handlers
Click to show internal directories.
Click to hide internal directories.