Documentation ¶
Index ¶
- Constants
- type Constructor
- type HttpTreeMuxRouter
- func (r *HttpTreeMuxRouter) Any(path string, handler http.HandlerFunc, handlers ...Constructor)
- func (r *HttpTreeMuxRouter) DELETE(path string, handler http.HandlerFunc, handlers ...Constructor)
- func (r *HttpTreeMuxRouter) GET(path string, handler http.HandlerFunc, handlers ...Constructor)
- func (r *HttpTreeMuxRouter) Group(path string) Router
- func (r *HttpTreeMuxRouter) HEAD(path string, handler http.HandlerFunc, middleware ...Constructor)
- func (r *HttpTreeMuxRouter) Handle(method string, path string, handler http.HandlerFunc, handlers ...Constructor)
- func (r *HttpTreeMuxRouter) OPTIONS(path string, handler http.HandlerFunc, middleware ...Constructor)
- func (r *HttpTreeMuxRouter) PATCH(path string, handler http.HandlerFunc, handlers ...Constructor)
- func (r *HttpTreeMuxRouter) POST(path string, handler http.HandlerFunc, handlers ...Constructor)
- func (r *HttpTreeMuxRouter) PUT(path string, handler http.HandlerFunc, handlers ...Constructor)
- func (r *HttpTreeMuxRouter) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *HttpTreeMuxRouter) Use(handlers ...Constructor) Router
- type ListenPathMatcher
- type Params
- type Router
Constants ¶
View Source
const ParamsContextKey = "params.context.key"
ParamsContextKey is used to retrieve a path's params map from a request's context.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpTreeMuxRouter ¶
type HttpTreeMuxRouter struct {
// contains filtered or unexported fields
}
func NewHttpTreeMuxRouter ¶
func NewHttpTreeMuxRouter() *HttpTreeMuxRouter
func (*HttpTreeMuxRouter) Any ¶
func (r *HttpTreeMuxRouter) Any(path string, handler http.HandlerFunc, handlers ...Constructor)
func (*HttpTreeMuxRouter) DELETE ¶
func (r *HttpTreeMuxRouter) DELETE(path string, handler http.HandlerFunc, handlers ...Constructor)
func (*HttpTreeMuxRouter) GET ¶
func (r *HttpTreeMuxRouter) GET(path string, handler http.HandlerFunc, handlers ...Constructor)
func (*HttpTreeMuxRouter) Group ¶
func (r *HttpTreeMuxRouter) Group(path string) Router
func (*HttpTreeMuxRouter) HEAD ¶
func (r *HttpTreeMuxRouter) HEAD(path string, handler http.HandlerFunc, middleware ...Constructor)
func (*HttpTreeMuxRouter) Handle ¶
func (r *HttpTreeMuxRouter) Handle(method string, path string, handler http.HandlerFunc, handlers ...Constructor)
func (*HttpTreeMuxRouter) OPTIONS ¶
func (r *HttpTreeMuxRouter) OPTIONS(path string, handler http.HandlerFunc, middleware ...Constructor)
func (*HttpTreeMuxRouter) PATCH ¶
func (r *HttpTreeMuxRouter) PATCH(path string, handler http.HandlerFunc, handlers ...Constructor)
func (*HttpTreeMuxRouter) POST ¶
func (r *HttpTreeMuxRouter) POST(path string, handler http.HandlerFunc, handlers ...Constructor)
func (*HttpTreeMuxRouter) PUT ¶
func (r *HttpTreeMuxRouter) PUT(path string, handler http.HandlerFunc, handlers ...Constructor)
func (*HttpTreeMuxRouter) ServeHTTP ¶
func (r *HttpTreeMuxRouter) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*HttpTreeMuxRouter) Use ¶
func (r *HttpTreeMuxRouter) Use(handlers ...Constructor) Router
type ListenPathMatcher ¶
type ListenPathMatcher struct {
// contains filtered or unexported fields
}
func NewListenPathMatcher ¶
func NewListenPathMatcher() *ListenPathMatcher
func (*ListenPathMatcher) Extract ¶
func (l *ListenPathMatcher) Extract(listenPath string) string
func (*ListenPathMatcher) Match ¶
func (l *ListenPathMatcher) Match(listenPath string) bool
type Params ¶
type Params struct {
// contains filtered or unexported fields
}
func FromContext ¶
FromContext returns the params map associated with the given context if one exists. Otherwise, an empty map is returned.
type Router ¶
type Router interface { Handle(method string, path string, handler http.HandlerFunc, handlers ...Constructor) Any(path string, handler http.HandlerFunc, handlers ...Constructor) GET(path string, handler http.HandlerFunc, handlers ...Constructor) POST(path string, handler http.HandlerFunc, handlers ...Constructor) PUT(path string, handler http.HandlerFunc, handlers ...Constructor) DELETE(path string, handler http.HandlerFunc, handlers ...Constructor) PATCH(path string, handler http.HandlerFunc, handlers ...Constructor) HEAD(path string, handler http.HandlerFunc, handlers ...Constructor) OPTIONS(path string, handler http.HandlerFunc, handlers ...Constructor) Group(path string) Router Use(handlers ...Constructor) Router }
Click to show internal directories.
Click to hide internal directories.