Documentation ¶
Index ¶
- Variables
- func Wrap(handle HandlerFunc) gin.HandlerFunc
- type Context
- type Gin
- func (g *Gin) Any(relativePath string, handlers ...HandlerFunc) gin.IRoutes
- func (g *Gin) DELETE(path string, hs ...HandlerFunc) gin.IRoutes
- func (g *Gin) GET(path string, hs ...HandlerFunc) gin.IRoutes
- func (g *Gin) HEAD(path string, hs ...HandlerFunc) gin.IRoutes
- func (g *Gin) Handle(httpMethod, path string, hs ...HandlerFunc) gin.IRoutes
- func (g *Gin) MultipleHandle(path, receiveMethod string, hs ...HandlerFunc)
- func (g *Gin) OPTIONS(path string, hs ...HandlerFunc) gin.IRoutes
- func (g *Gin) PATCH(path string, hs ...HandlerFunc) gin.IRoutes
- func (g *Gin) POST(path string, hs ...HandlerFunc) gin.IRoutes
- func (g *Gin) PUT(path string, hs ...HandlerFunc) gin.IRoutes
- type HandlerFunc
- type Map
- type Middleware
- type ResponseData
Constants ¶
This section is empty.
Variables ¶
View Source
var GMid = new(Middleware)
GMid 全局对象
Functions ¶
Types ¶
type Gin ¶
Gin framework
func (*Gin) Any ¶
func (g *Gin) Any(relativePath string, handlers ...HandlerFunc) gin.IRoutes
Any registers a route that matches all the HTTP methods. GET, POST, PUT, PATCH, HEAD, OPTIONS, DELETE, CONNECT, TRACE.
func (*Gin) DELETE ¶
func (g *Gin) DELETE(path string, hs ...HandlerFunc) gin.IRoutes
DELETE is a shortcut for router.Handle("DELETE", path, handle).
func (*Gin) GET ¶
func (g *Gin) GET(path string, hs ...HandlerFunc) gin.IRoutes
GET is a shortcut for router.Handle("GET", path, handle).
func (*Gin) HEAD ¶
func (g *Gin) HEAD(path string, hs ...HandlerFunc) gin.IRoutes
HEAD is a shortcut for router.Handle("HEAD", path, handle).
func (*Gin) Handle ¶
func (g *Gin) Handle(httpMethod, path string, hs ...HandlerFunc) gin.IRoutes
Handle ...
func (*Gin) MultipleHandle ¶
func (g *Gin) MultipleHandle(path, receiveMethod string, hs ...HandlerFunc)
MultipleHandle ...多路操作
func (*Gin) OPTIONS ¶
func (g *Gin) OPTIONS(path string, hs ...HandlerFunc) gin.IRoutes
OPTIONS is a shortcut for router.Handle("OPTIONS", path, handle).
func (*Gin) PATCH ¶
func (g *Gin) PATCH(path string, hs ...HandlerFunc) gin.IRoutes
PATCH is a shortcut for router.Handle("PATCH", path, handle).
type HandlerFunc ¶
HandlerFunc ...
func WrapGinHandler ¶
func WrapGinHandler(handler gin.HandlerFunc) HandlerFunc
WrapGinHandler wrap gin handlerFunc to HandlerFunc
type ResponseData ¶
type ResponseData struct { Code int `json:"code"` Message interface{} `json:"message"` Hints interface{} `json:"hints,omitempty"` Data interface{} `json:"data,omitempty"` sync.RWMutex Map `json:"extend,omitempty"` }
ResponseData 请求返回结构体
func NewResponse ¶
func NewResponse(httpCode int, msg ...interface{}) (p *ResponseData)
NewResponse 返回ResponseData
func (*ResponseData) AddValue ¶
func (r *ResponseData) AddValue(k string, value interface{})
AddValue ...添加一个数据
func (*ResponseData) Error ¶
func (r *ResponseData) Error() string
Click to show internal directories.
Click to hide internal directories.