Documentation
¶
Overview ¶
Copyright 2019-2020 Axetroy. All rights reserved. Apache License 2.0.
Index ¶
- func Router(ctrl controllerFunc) func(c *gin.Context)
- type Context
- func (c *Context) GetHeader(key string) string
- func (c *Context) GetParam(key string) string
- func (c *Context) GetQuery(key string) string
- func (c *Context) SetHeader(key, value string)
- func (c *Context) ShouldBindJSON(inputPointer interface{}) error
- func (c *Context) ShouldBindQuery(inputPointer interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct { Uid string `json:"uid"` // 操作人的用户 ID UserAgent string `json:"user_agent"` // 用户代理 Ip string `json:"ip"` // IP地址 // contains filtered or unexported fields }
控制器的上下文
func NewContext ¶
func (*Context) ShouldBindJSON ¶
校验 body 中的 JSON 字段
func (*Context) ShouldBindQuery ¶
校验 url 中的 query
Click to show internal directories.
Click to hide internal directories.