Documentation ¶
Index ¶
- Constants
- Variables
- func CallAfterFunc(urlStr string, ctx Context, params ...interface{}) *emity.MsgEmity
- func CallAroundFunc(urlStr string, ctx Context, params ...interface{}) *emity.MsgEmity
- func CallBeforeFunc(urlStr string, ctx Context, params ...interface{}) *emity.MsgEmity
- func CallFuncByUrl(url string, iType RequestType, ctx Context) interface{}
- 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 GetHandleWebsocketFunc(urlKey string, iType RequestType, InterceptorFunc func(ctx Context) bool, ...) func(ctx Context)
- func RegisterAfter(urlStr string, doFunc func(ctx Context, params ...interface{}) *emity.MsgEmity)
- func RegisterAround(urlStr string, doFunc func(ctx Context, params ...interface{}) *emity.MsgEmity)
- func RegisterBefore(urlStr string, doFunc func(ctx Context, params ...interface{}) *emity.MsgEmity)
- 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)
- func WebsocketServe(context Context)
- type Context
- type HttpHandleInfo
- type RequestType
Constants ¶
View Source
const DebugMode = gin.DebugMode
View Source
const ReleaseMode = gin.ReleaseMode
View Source
const TestMode = gin.TestMode
Variables ¶
View Source
var Default = gin.Default
View Source
var SetMode = gin.SetMode
Functions ¶
func CallAfterFunc ¶
*
- 调用Aop-函数执行后调用函数
- @param urlStr 被监听控制Url地址(注册web接口时的url地址)
- @param doFunc 被调用函数
- @return
func CallAroundFunc ¶
*
- 调用Aop-函数执行中调用函数
- @param urlStr 被监听控制Url地址(注册web接口时的url地址)
- @param doFunc 被调用函数
- @return
func CallBeforeFunc ¶
*
- 调用Aop-控制函数执行前调用函数
- @param urlStr 被监听控制Url地址(注册web接口时的url地址)
- @param doFunc 被调用函数
- @return
func CallFuncByUrl ¶
func CallFuncByUrl(url string, iType RequestType, ctx Context) interface{}
*
- 根据url取函数
- @param url
- @param iType
- @param ctx
- @return
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 GetHandleWebsocketFunc ¶
func GetHandleWebsocketFunc(urlKey string, iType RequestType, InterceptorFunc func(ctx Context) bool, controllerMap map[string]HttpHandleInfo) func(ctx Context)
*
- 取注册的Websocket接口
func RegisterAfter ¶
*
- 注册Aop-控制函数执行后调用函数
- @param urlStr 被监听控制Url地址(注册web接口时的url地址)
- @param doFunc 被调用函数
- @return
func RegisterAround ¶
*
- 注册Aop-控制函数执行中调用函数
- @param urlStr 被监听控制Url地址(注册web接口时的url地址)
- @param doFunc 被调用函数
- @return
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" WEBSOCKET RequestType = "WEBSOCKET" )
Click to show internal directories.
Click to hide internal directories.