Documentation ¶
Overview ¶
context 跟gin.context 的转换
Index ¶
- func GetKeyValues(ctx context.Context) map[string][]string
- func NewAPIFunc(c *gin.Context) interface{}
- type Context
- func (c *Context) AddHeadToCtx(kv ...string)
- func (c *Context) GetGinCtx() *gin.Context
- func (c *Context) GetValue(key interface{}) interface{}
- func (c *Context) GetVersion() string
- func (c *Context) SetValue(key interface{}, value interface{})
- func (c *Context) WriteHeadToCtx(g *gin.Context)
- func (c *Context) WriteJSON(obj interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAPIFunc ¶
NewAPIFunc default of custom handlefunc
Types ¶
type Context ¶
Context Wrapping gin context to custom context
func (*Context) AddHeadToCtx ¶
AddHeadToCtx 添加一层数据到ctx里面
func (*Context) GetVersion ¶
GetVersion Get the version by req url
func (*Context) SetValue ¶
func (c *Context) SetValue(key interface{}, value interface{})
SetValue 设置key v
func (*Context) WriteHeadToCtx ¶
WriteHeadToCtx 设置头数据到grpc headre里面
Click to show internal directories.
Click to hide internal directories.