Documentation ¶
Index ¶
- Constants
- func Handle(h http.HandlerFunc, middleware ...Middleware) http.HandlerFunc
- func Listen(host string, port int, router http.Handler) error
- func ListenWithTLS(host string, port int, caFile, certFile, keyFile string, router http.Handler) error
- type MethodNotAllowedHandler
- type Middleware
- type NotFoundHandler
- type Route
Constants ¶
View Source
const ( MethodGet = http.MethodGet MethodHead = http.MethodHead MethodPost = http.MethodPost MethodPut = http.MethodPut MethodPatch = http.MethodPatch MethodDelete = http.MethodDelete MethodConnect = http.MethodConnect MethodOptions = http.MethodOptions MethodTrace = http.MethodTrace )
Variables ¶
This section is empty.
Functions ¶
func Handle ¶
func Handle(h http.HandlerFunc, middleware ...Middleware) http.HandlerFunc
Types ¶
type MethodNotAllowedHandler ¶
func (MethodNotAllowedHandler) ServeHTTP ¶
func (MethodNotAllowedHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
type Middleware ¶
type Middleware func(http.HandlerFunc) http.HandlerFunc
type NotFoundHandler ¶
func (NotFoundHandler) ServeHTTP ¶
func (NotFoundHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
type Route ¶
type Route struct { Path string Handler func(w http.ResponseWriter, r *http.Request) Middleware []Middleware Method string }
Click to show internal directories.
Click to hide internal directories.