Documentation ¶
Index ¶
Constants ¶
View Source
const ( // UserNotFoundCodeCode 用户不存在 UserNotFoundCode = AccountCodeInit + iota + 1 // AmountInsufficientCode 用户余额不足 AmountInsufficientCode // TokenValidateFailedCode token验证失败 TokenValidateFailedCode // TokenExpireCode Token到期 TokenExpireCode // LoginFailedCode 登录账户密码验证失败 LoginFailedCode )
View Source
const ( InternalCode = CommonCodeInit + iota + 1 RedisErrCode ExecSqlFailedCode ParamValidateFailedCode RecordNotFoundErrCode DuplicateDataErrCode MongoErrCode KafkaErrCode EtcdErrCode DtmErrCode PulsarErrCode )
View Source
const ( DefaultLanguage = "zh-CN" DefaultCode = InternalCode EtcdPrefixKey = "language/" )
View Source
const ( // PasswordNotMatchCode 密码不匹配 PasswordNotMatchCode = AdminCodeInit + iota + 1 //密码不匹配 )
Variables ¶
View Source
var ( UserNotFound = UserNotFoundCode.Error("") AmountInsufficient = AmountInsufficientCode.Error("") TokenValidateFailed = TokenValidateFailedCode.Error("") TokenExpire = TokenExpireCode.Error("") LoginFailed = LoginFailedCode.Error("") )
View Source
var ( Internal = InternalCode.Error("") RedisErr = RedisErrCode.Error("") ExecSqlFailed = ExecSqlFailedCode.Error("") ParamValidateFailed = ParamValidateFailedCode.Error("") RecordNotFoundErr = RecordNotFoundErrCode.Error("") DuplicateDataErr = DuplicateDataErrCode.Error("") MongoErr = MongoErrCode.Error("") KafkaErr = KafkaErrCode.Error("") EtcdErr = EtcdErrCode.Error("") DtmErr = DtmErrCode.Error("") PulsarErr = PulsarErrCode.Error("") )
View Source
var ( OrderNotFound = OrderNotFoundCode.Error("") OrderHasResolved = OrderHasResolvedCode.Error("") LoOrderCancelFailed = LoOrderCancelFailedCode.Error("") NotBids = NotBidsCode.Error("") NotAsks = NotAsksCode.Error("") ErrPrec = ErrPrecCode.Error("") )
View Source
var PasswordNotMatch = PasswordNotMatchCode.Error("")
Functions ¶
func CastToDtmError ¶
CastToDtmError dtm规定 saga失败如果要补偿的话grpc返回abort 其他错误则为重试 我们的错误只能在msg中体现 refer https://dtm.pub/practice/workflow.html#%E5%88%86%E6%94%AF%E6%93%8D%E4%BD%9C%E7%BB%93%E6%9E%9C
func InitTranslator ¶
func InitTranslator(path string)
func InitTranslatorFromEtcd ¶
func InitTranslatorFromEtcd(etcdConfig etcd.EtcdConfig)
func WarpMessage ¶
Types ¶
type Code ¶
const ( // OrderNotFoundCode 订单为未找到 OrderNotFoundCode Code = OrderCodeInit + iota + 1 // OrderHasResolvedCode 订单已经成交或已经取消 OrderHasResolvedCode // LoOrderCancelFailedCode 市价单不允许手动取消 LoOrderCancelFailedCode // NotBidsCode 订单簿没有买单 NotBidsCode // NotAsksCode 订单簿没有卖单 NotAsksCode ErrPrecCode )
func (Code) DtmErrorMsg ¶
type Translator ¶
Click to show internal directories.
Click to hide internal directories.