Documentation ¶
Index ¶
- Variables
- func Run(addr string, router *Router, opts ...Option) error
- func Shutdown(addrs ...string)
- type Context
- type Handler
- type Map
- type Option
- type Request
- func (r *Request) BindJSON(dst interface{}) error
- func (r *Request) BindQuery(dst interface{}, tag ...string) error
- func (r *Request) Body() []byte
- func (r *Request) File(key string) []*multipart.FileHeader
- func (r *Request) Forms(key string) string
- func (r *Request) Header(key string) string
- func (r *Request) JSON(key string) interface{}
- func (r *Request) Method() string
- func (r *Request) Path() string
- func (r *Request) Query(key string, defaultValue ...string) string
- func (r *Request) RawQuery() string
- func (r *Request) URI() string
- type Response
- type Router
- func (r *Router) Add(routeFunc func(r *Router)) *Router
- func (r *Router) DELETE(pattern string, handler Handler) *trie
- func (r *Router) GET(pattern string, handler Handler) *trie
- func (r *Router) Group(pattern string, routeFunc func(r *Router)) *Router
- func (r *Router) HEAD(pattern string, handler Handler) *trie
- func (r *Router) Handle(pattern string, handler Handler) *trie
- func (r *Router) MethodNotAllowed(handler Handler)
- func (r *Router) Mount(pattern string, router *Router)
- func (r *Router) NotFound(handler Handler)
- func (r *Router) OPTIONS(pattern string, handler Handler) *trie
- func (r *Router) PATCH(pattern string, handler Handler) *trie
- func (r *Router) POST(pattern string, handler Handler) *trie
- func (r *Router) PUT(pattern string, handler Handler) *trie
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Router) Use(middlewares ...Handler)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MaxMultipartMemory int64 = 8 << 20
)
Functions ¶
Types ¶
type Context ¶
type Context struct { Request Request Response Response PathParams map[string]string Err error Bucket map[string]interface{} // contains filtered or unexported fields }
func (*Context) Abort ¶
func (c *Context) Abort()
Abort prevents pending handlers from being called.
type Map ¶ added in v0.4.1
type Map map[string]interface{}
Map is a shortcut for map[string]interface{}
type Request ¶ added in v0.4.1
type Response ¶ added in v0.4.1
type Response struct { http.ResponseWriter StatusCode int // contains filtered or unexported fields }
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) MethodNotAllowed ¶
MethodNotAllowed defines a handler to respond whenever a method is not allowed.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.