{"modulePath":"github.com/RedAFD/code-core","version":"v1.14.0-rc8","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package web\n\n## Functions\n\n```go\nfunc Bind(obj interface{}) http.HandlerFunc\n```\nBind binding an obj to a handler\n\n```go\nfunc GetForm(data middleware.DataStore) interface{}\n```\nGetForm returns the validate form information\n\n```go\nfunc Middle(f func(ctx *context.Context)) func(netx http.Handler) http.Handler\n```\nMiddle wrap a context function as a chi middleware\n\n```go\nfunc MiddleAPI(f func(ctx *context.APIContext)) func(netx http.Handler) http.Handler\n```\nMiddleAPI wrap a context function as a chi middleware\n\n```go\nfunc SetForm(data middleware.DataStore, obj interface{})\n```\nSetForm set the form object\n\n```go\nfunc Wrap(handlers ...interface{}) http.HandlerFunc\n```\nWrap converts all kinds of routes to standard library one\n\n## Types\n\n```go\ntype Combo struct {\n\t// contains filtered or unexported fields\n}\n```\nCombo represents a tiny group routes with same pattern\n\n```go\nfunc (c *Combo) Delete(h ...interface{}) *Combo\n```\nDelete deletegate Delete method\n\n```go\nfunc (c *Combo) Get(h ...interface{}) *Combo\n```\nGet deletegate Get method\n\n```go\nfunc (c *Combo) Patch(h ...interface{}) *Combo\n```\nPatch deletegate Patch method\n\n```go\nfunc (c *Combo) Post(h ...interface{}) *Combo\n```\nPost deletegate Post method\n\n```go\nfunc (c *Combo) Put(h ...interface{}) *Combo\n```\nPut deletegate Put method\n\n```go\ntype Route struct {\n\tR chi.Router\n\t// contains filtered or unexported fields\n}\n```\nRoute defines a route based on chi's router\n\n```go\nfunc NewRoute() *Route\n```\nNewRoute creates a new route\n\n```go\nfunc (r *Route) Any(pattern string, h ...interface{})\n```\nAny delegate requests for all methods\n\n```go\nfunc (r *Route) Combo(pattern string, h ...interface{}) *Combo\n```\nCombo deletegate requests to Combo\n\n```go\nfunc (r *Route) Delete(pattern string, h ...interface{})\n```\nDelete delegate delete method\n\n```go\nfunc (r *Route) Get(pattern string, h ...interface{})\n```\nGet delegate get method\n\n```go\nfunc (r *Route) Group(pattern string, fn func(), middlewares ...interface{})\n```\nGroup mounts a sub-Router along a \\`pattern\\` string.\n\n```go\nfunc (r *Route) Head(pattern string, h ...interface{})\n```\nHead delegate head method\n\n```go\nfunc (r *Route) MethodNotAllowed(h http.HandlerFunc)\n```\nMethodNotAllowed defines a handler to respond whenever a method is not allowed.\n\n```go\nfunc (r *Route) Mount(pattern string, subR *Route)\n```\nMount attaches another Route along ./pattern/\\*\n\n```go\nfunc (r *Route) NotFound(h http.HandlerFunc)\n```\nNotFound defines a handler to respond whenever a route could not be found.\n\n```go\nfunc (r *Route) Patch(pattern string, h ...interface{})\n```\nPatch delegate patch method\n\n```go\nfunc (r *Route) Post(pattern string, h ...interface{})\n```\nPost delegate post method\n\n```go\nfunc (r *Route) Put(pattern string, h ...interface{})\n```\nPut delegate put method\n\n```go\nfunc (r *Route) Route(pattern string, methods string, h ...interface{})\n```\nRoute delegate special methods\n\n```go\nfunc (r *Route) ServeHTTP(w http.ResponseWriter, req *http.Request)\n```\nServeHTTP implements http.Handler\n\n```go\nfunc (r *Route) Use(middlewares ...interface{})\n```\nUse supports two middlewares\n\n","path":"github.com/RedAFD/code-core/modules/web","name":"web","synopsis":"","isRedistributable":true}
