Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultCatchAndReturnMiddleware() func(m *Dog)
- func DefaultDog()
- func DefaultHeaderMiddleware() func(m *Dog)
- func DefaultLogMiddleware() func(m *Dog)
- func GET(apiPath string, desc string, params interface{}, react func(d *Dog))
- func GetAccess(access string) string
- func InitRouteLogMiddleware() func(r Router)
- func NewDog()
- func POST(Path string, desc string, params interface{}, react func(d *Dog))
- func Run()
- func Use(f func(m *Dog))
- func UseRouterInit(f func(r Router))
- type Dog
- func (c *Dog) Close()
- func (c *Dog) GetParams(paramsValue interface{})
- func (c *Dog) GetUserAes(data string) string
- func (c *Dog) GetUserKey() string
- func (c *Dog) Next()
- func (c *Dog) SetCode(code int, note string)
- func (c *Dog) SetCount(count interface{})
- func (c *Dog) SetMsg(key string, info interface{})
- func (c *Dog) SetNote(note string)
- func (c *Dog) SetResult(result interface{})
- func (c *Dog) SetToken(token string)
- func (c *Dog) SetUserAes(data string) string
- type Router
- type Token
Constants ¶
View Source
const ( FetchGet = "GET" // get请求 FetchPost = "POST" // post请求 )
Variables ¶
Functions ¶
func DefaultCatchAndReturnMiddleware ¶
func DefaultCatchAndReturnMiddleware() func(m *Dog)
默认异常捕获及返回请求结果
Types ¶
type Dog ¶
type Dog struct { Code int // 状态码 Note string // 提示信息 Result interface{} // 返回结果 Info map[string]interface{} // 返回其他信息 Count int64 // 总数据条数 Token string // token UserId int64 // 用户ID Router *Router // 路由信息 Params map[string]interface{} // 请求入参 W http.ResponseWriter R *http.Request Handlers []func(d *Dog) Index int // 当前中间件序号 Res interface{} // 返回对象 StartTime int64 // 开始时间 ApiName string // api名称 }
func (*Dog) GetUserAes ¶
func (*Dog) SetUserAes ¶
type Token ¶
type Token struct { Id int64 `title:"用户id"` Platform int `title:"平台"` // 平台 1androi 2ios 3web Time int64 `title:"授权有效期"` // 时间戳 Code string `title:"授权编码"` Device string `title:"设备码"` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.