Documentation
¶
Overview ¶
Package server contains Http server and routes for processing requests
Package server Generic simple http server
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chain ¶
func Chain(f http.HandlerFunc, middlewares ...Middleware) http.HandlerFunc
Chain applies middlewares to a http.HandlerFunc
func StartServer ¶
StartServer Start Http server on given port If bindAll is true, will bind to all interfaces Otherwise, will bind to localhost only
Types ¶
type Middleware ¶
type Middleware func(http.HandlerFunc) http.HandlerFunc
Middleware - Define middleware method
func Logging ¶
func Logging(isDebug bool) Middleware
Logging is Generic http request logging Logging logs all requests with its path and the time it took to process
func Method ¶
func Method(m string) Middleware
Method ensures that url can only be requested with a specific method, else returns a 400 Bad Request
Click to show internal directories.
Click to hide internal directories.