package
Version:
v2.0.4
Opens a new window with list of versions in this module.
Published: Aug 31, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
Documentation
¶
func SetDefaultCode(code int)
SetDefaultCode 设置默认返回code码
func SetDefaultData(data interface{})
SetDefaultData 设置默认返回data内容
func SetDefaultMsg(msg string)
SetDefaultMsg 设置默认返回msg内容
NewContext 初始化上下文包含context.Context
对链路信息进行判断并且在Response时返回TraceId信息
func (c *Context) Success(data interface{})
Success 返回正常数据
type Response struct {
Code int `json:"code"`
Data interface{} `json:"data"`
Msg string `json:"msg"`
}
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.