Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileServe ¶
func FileServe(dir string) http.HandlerFunc
FileServe returns a new http.HandlerFunc that serves files from dir. Using routes must provide the *filepath parameter.
Types ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router wraps httprouter.Router and adds support for prefixed sub-routers.
func (*Router) Del ¶
func (r *Router) Del(path string, h http.HandlerFunc)
Del registers a new DELETE route.
func (*Router) Get ¶
func (r *Router) Get(path string, h http.HandlerFunc)
Get registers a new GET route.
func (*Router) Post ¶
func (r *Router) Post(path string, h http.HandlerFunc)
Post registers a new POST route.
func (*Router) ServeHTTP ¶
func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP implements http.Handler.
func (*Router) WithPrefix ¶
WithPrefix returns a router that prefixes all registered routes with prefix.
Click to show internal directories.
Click to hide internal directories.