Documentation ¶
Index ¶
- func CORS(debug bool, hnd http.Handler, hosts ...string) http.Handler
- func CSRF(key string, secure bool, hnd http.Handler) http.Handler
- func FuncName(f interface{}) string
- type Context
- func (p *Context) Abort(code int, err error)
- func (p *Context) Bind(f interface{}) error
- func (p *Context) ClientIP() string
- func (p *Context) Form(f interface{}) error
- func (p *Context) HTML(c int, l, n string, v H)
- func (p *Context) Header(k, v string)
- func (p *Context) JSON(c int, v interface{})
- func (p *Context) Next()
- func (p *Context) TEXT(c int, n string, v interface{})
- func (p *Context) XML(c int, v interface{})
- type H
- type HandlerFunc
- type LayoutFunc
- type Router
- func (p *Router) DELETE(path string, handlers ...HandlerFunc)
- func (p *Router) FuncMap(n string, f interface{})
- func (p *Router) GET(path string, handlers ...HandlerFunc)
- func (p *Router) Group(path string, router *Router)
- func (p *Router) Handler(views string, debug bool) http.Handler
- func (p *Router) PATCH(path string, handlers ...HandlerFunc)
- func (p *Router) POST(path string, handlers ...HandlerFunc)
- func (p *Router) PUT(path string, handlers ...HandlerFunc)
- func (p *Router) Resources(path string, index, create, show, update, destroy []HandlerFunc)
- func (p *Router) Static(path, dir string)
- func (p *Router) Use(handlers ...HandlerFunc)
- func (p *Router) Walk(f func(method, path string, handlers ...HandlerFunc) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct { Request *http.Request Writer http.ResponseWriter Params map[string]string Payload H // contains filtered or unexported fields }
Context Context is the most important part of gin. It allows us to pass variables between middleware, manage the flow, validate the JSON of a request and render a JSON response for example.
func (*Context) Abort ¶
Abort Abort prevents pending handlers from being called. Note that this will not stop the current handler.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router http router
func (*Router) DELETE ¶
func (p *Router) DELETE(path string, handlers ...HandlerFunc)
DELETE http delete
func (*Router) PATCH ¶
func (p *Router) PATCH(path string, handlers ...HandlerFunc)
PATCH http patch
func (*Router) Resources ¶
func (p *Router) Resources(path string, index, create, show, update, destroy []HandlerFunc)
Resources resources
Click to show internal directories.
Click to hide internal directories.