Documentation ¶
Index ¶
- func Bind(obj interface{}) http.HandlerFunc
- func GetForm(data middleware.DataStore) interface{}
- func Middle(f func(ctx *context.Context)) func(next http.Handler) http.Handler
- func MiddleAPI(f func(ctx *context.APIContext)) func(next http.Handler) http.Handler
- func MiddleCancel(f func(ctx *context.Context) goctx.CancelFunc) func(netx http.Handler) http.Handler
- func SetForm(data middleware.DataStore, obj interface{})
- func Wrap(handlers ...interface{}) http.HandlerFunc
- func WrapWithPrefix(pathPrefix string, handler http.HandlerFunc, friendlyName ...string) func(next http.Handler) http.Handler
- type Combo
- type Route
- func (r *Route) Any(pattern string, h ...interface{})
- func (r *Route) Combo(pattern string, h ...interface{}) *Combo
- func (r *Route) Delete(pattern string, h ...interface{})
- func (r *Route) Get(pattern string, h ...interface{})
- func (r *Route) GetOptions(pattern string, h ...interface{})
- func (r *Route) Group(pattern string, fn func(), middlewares ...interface{})
- func (r *Route) Head(pattern string, h ...interface{})
- func (r *Route) MethodNotAllowed(h http.HandlerFunc)
- func (r *Route) Mount(pattern string, subR *Route)
- func (r *Route) NotFound(h http.HandlerFunc)
- func (r *Route) Options(pattern string, h ...interface{})
- func (r *Route) Patch(pattern string, h ...interface{})
- func (r *Route) Post(pattern string, h ...interface{})
- func (r *Route) PostOptions(pattern string, h ...interface{})
- func (r *Route) Put(pattern string, h ...interface{})
- func (r *Route) Route(pattern, methods string, h ...interface{})
- func (r *Route) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Route) Use(middlewares ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetForm ¶
func GetForm(data middleware.DataStore) interface{}
GetForm returns the validate form information
func MiddleCancel ¶ added in v1.14.2
func MiddleCancel(f func(ctx *context.Context) goctx.CancelFunc) func(netx http.Handler) http.Handler
MiddleCancel wrap a context function as a chi middleware
func Wrap ¶
func Wrap(handlers ...interface{}) http.HandlerFunc
Wrap converts all kinds of routes to standard library one
func WrapWithPrefix ¶ added in v1.17.0
func WrapWithPrefix(pathPrefix string, handler http.HandlerFunc, friendlyName ...string) func(next http.Handler) http.Handler
WrapWithPrefix wraps a provided handler function at a prefix
Types ¶
type Combo ¶
type Combo struct {
// contains filtered or unexported fields
}
Combo represents a tiny group routes with same pattern
type Route ¶
Route defines a route based on chi's router
func (*Route) GetOptions ¶ added in v1.15.0
GetOptions delegate get and options method
func (*Route) MethodNotAllowed ¶
func (r *Route) MethodNotAllowed(h http.HandlerFunc)
MethodNotAllowed defines a handler to respond whenever a method is not allowed.
func (*Route) NotFound ¶
func (r *Route) NotFound(h http.HandlerFunc)
NotFound defines a handler to respond whenever a route could not be found.
func (*Route) PostOptions ¶ added in v1.15.0
PostOptions delegate post and options method
Click to show internal directories.
Click to hide internal directories.