Documentation ¶
Index ¶
- func ControllerRegister(url string, handler func(ctx Context) interface{}, iTypes ...RequestType)
- func Cors() gin.HandlerFunc
- func GetController() map[string]HttpHandleInfo
- func GetGin(ginMode, webRoot, Port string, InterceptorFunc func(ctx Context) bool) *http.Server
- func GetHandleFunc(urlKey string, iType RequestType, InterceptorFunc func(ctx Context) bool, ...) func(ctx Context)
- func RegisterController(url string, iTypes interface{}, handler func(ctx Context) interface{})
- func RegisterControllers(url string, iTypes interface{}, handler func(ctx Context) interface{})
- func SetCors(r *gin.Engine)
- func SetStatic(r *gin.Engine, webroot string)
- func Shutdown(ctx Context)
- type Context
- type HttpHandleInfo
- type RequestType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ControllerRegister ¶
func ControllerRegister(url string, handler func(ctx Context) interface{}, iTypes ...RequestType)
注册web接口
func GetHandleFunc ¶
func GetHandleFunc(urlKey string, iType RequestType, InterceptorFunc func(ctx Context) bool, controllerMap map[string]HttpHandleInfo) func(ctx Context)
*
- 取注册的web接口
func RegisterController ¶
注册web接口
func RegisterControllers ¶
注册web接口
Types ¶
type HttpHandleInfo ¶
type HttpHandleInfo struct { Url string Type RequestType Fun func(ctx 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.