Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ErrorCodeArgumentLack 缺少参数 ErrorCodeArgumentLack = 100 // ErrorCodeArgumentTypeInvalid 参数类型错误 ErrorCodeArgumentTypeInvalid = 101 // ErrorCodeInvalidSignature 签名错误 ErrorCodeInvalidSignature = 102 // ErrorCodeExpiredRequest 请求已过期 ErrorCodeExpiredRequest = 103 // ErrorCodeArgumentValueInvalid 非法参数值 ErrorCodeArgumentValueInvalid = 104 )
Variables ¶
View Source
var (
ErrorMessageFile = "config/error_msg.yaml"
)
Functions ¶
func Init ¶
func Init() map[string]*ErrorMessage
func ReadConfig ¶
func ReadConfig(exit bool) map[string]*ErrorMessage
Types ¶
type ErrorMessage ¶
type ErrorMessage struct { Code int `json:"code" yaml:"code"` Title string `json:"title" yaml:"title"` Content string `json:"content" yaml:"content"` Message string `json:"message" yaml:"message"` }
func Get ¶
func Get(key string) *ErrorMessage
Click to show internal directories.
Click to hide internal directories.