Documentation ¶
Index ¶
- func GetGin(ginMode, webRoot string, InterceptorFunc func(ctx *gin.Context) bool, ...) *gin.Engine
- type GinUtil
- func (gu GinUtil) ControllerRegister(url string, handler func(ctx *gin.Context) interface{}, iTypes ...RequestType)
- func (gu GinUtil) Cors() gin.HandlerFunc
- func (gu GinUtil) GetController() map[string]HttpHandleInfo
- func (gu GinUtil) GetHandleFunc(urlKey string, iType RequestType, InterceptorFunc func(ctx *gin.Context) bool, ...) func(ctx *gin.Context)
- func (gu GinUtil) RegisterController(url string, iTypes interface{}, handler func(ctx *gin.Context) interface{})
- func (gu GinUtil) RegisterControllers(url string, iTypes interface{}, handler func(ctx *gin.Context) interface{})
- func (gu GinUtil) SetCors(r *gin.Engine)
- func (gu GinUtil) SetStatic(r *gin.Engine, webroot string)
- type HttpHandleInfo
- type RequestType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GinUtil ¶
type GinUtil struct{}
func (GinUtil) ControllerRegister ¶
func (gu GinUtil) ControllerRegister(url string, handler func(ctx *gin.Context) interface{}, iTypes ...RequestType)
注册web接口
func (GinUtil) GetController ¶
func (gu GinUtil) GetController() map[string]HttpHandleInfo
取注册的web接口
func (GinUtil) GetHandleFunc ¶
func (gu GinUtil) GetHandleFunc(urlKey string, iType RequestType, InterceptorFunc func(ctx *gin.Context) bool, controllerMap map[string]HttpHandleInfo) func(ctx *gin.Context)
取注册的web接口
func (GinUtil) RegisterController ¶
func (gu GinUtil) RegisterController(url string, iTypes interface{}, handler func(ctx *gin.Context) interface{})
注册web接口
type HttpHandleInfo ¶
type HttpHandleInfo struct { Url string Type RequestType Fun func(ctx *gin.Context) interface{} }
http控制层接口信息
type RequestType ¶
type RequestType string
请求类型枚举
const ( GET RequestType = "GET" POST RequestType = "POST" DELETE RequestType = "DELETE" PUT RequestType = "PUT" OPTIONS RequestType = "OPTIONS" )
Click to show internal directories.
Click to hide internal directories.