Documentation
¶
Index ¶
Constants ¶
View Source
const ( EnvDev = "/dev" EnvFat = "/fat" EnvUat = "/uat" EnvPro = "/pro" )
View Source
const ( ErrCodeSysBadRequest = 1100 // 请求错误 ErrCodeSysTokenExpired = 1101 // Token失效 ErrCodeSysAuthFailed = 1102 // 权限校验失败 ErrCodeRequestLimit = 1103 // 请求频率限制 ErrCodeTimeout = 1104 // 请求超时 ErrCodeIPLimit = 1105 // IP限制 ErrCodeImageSizeLimit = 1106 // 图片大小限制 ErrCodeImageSuffix = 1107 // 图片后缀错误 )
2、定义Code
View Source
const ( CfgMySQL = "/config/%s/mysql" CfgRedis = "/config/%s/redis" CfgRocketMQ = "/config/%s/rocketmq" CfgTelegram = "/config/%s/telegram" CfgEs = "/config/%s/es" CfgNats = "/config/%s/nats" CfgPulsar = "/config/%s/pulsar" CfgTelemetry = "/config/%s/telemetry" CfgPrometheus = "/config/%s/prometheus" CfgServer = "/config/%s/server/%s" CfgMinio = "/config/%s/minio" )
View Source
const ( CN = "cn" EN = "en" )
View Source
const ( FileType = "application/octet-stream" DefaultExpireTime = 30 * time.Minute )
View Source
const ( KcRandKindNum = iota // 纯数字 KcRandKindLower // 小写字母 KcRandKindUpper // 大写字母 KcRandKindAll // 数字、大小写字母 )
随机数类型
View Source
const ( PrefixDeposit = "DP" // 存款前缀 PrefixWithdrawal = "DW" // 取款前缀 )
View Source
const (
DefaultImgLimit = 3 // 默认图片大小3MB
)
Variables ¶
View Source
var ( ErrTokenExpired = strx.S2b("Token has expired") // Token 过期 ErrIdempotence = strx.S2b("Requests limit, please try again later") // 请求限制,请稍后再试 ErrAuthorizationExpired = strx.S2b("Authorization has expired") )
View Source
var ( ErrSysBadRequest = errors.New("网络异常,请稍后重试") ErrSysTokenExpired = errors.New("token失效") ErrSysAuthFailed = errors.New("权限校验失败") ErrRequestLimit = errors.New("请求频率限制") ErrTimeout = errors.New("请求超时") ErrIPLimit = errors.New("IP限制") ErrImageSizeLimit = errors.New("图片大小限制") ErrImageSuffix = errors.New("图片后缀错误") )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.