consts

package
v0.0.0-...-774e91b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL