Documentation
¶
Overview ¶
shareblocked.go 分享管控拒绝态错误(治理状态机的 typed error 词汇表)。
历史:app/share.ShareBlockedError 与 app/anonymous.BlockedError 曾各持一份 逐字相同的实现(消息文案与 errcode 映射同款,状态常量还一个用 model 常量 一个用字面量,已有漂移),2026-10-10 合并至此;两域以类型别名消费, handler 侧 errors.As / resp.NewTypedError 用法不变。
Index ¶
- Constants
- func GetErrorCode(err error) int
- func GetMessage(code int) string
- func IsAppError(err error) bool
- type AppError
- func BadRequest(message string) *AppError
- func Conflict(message string) *AppError
- func Forbidden(message string) *AppError
- func InternalError(message string) *AppError
- func New(code int, message string) *AppError
- func NotFound(message string) *AppError
- func Unauthorized(message string) *AppError
- func Wrap(code int, message string, cause error) *AppError
- type ShareBlocked
Constants ¶
View Source
const ( CodeSuccess = 0 CodeBadRequest = 1001 CodeForbidden = 1003 CodeNotFound = 1004 CodeConflict = 1005 CodeInternalError = 1006 CodeTooManyRequests = 1008 )
View Source
const ( )
分享治理状态字面量。pkg 层不得 import repo(架构守卫规则 1),故此处独立 定义并与 repo/db/model 的同名常量对齐——app 层测试钉死防漂移断言。
Variables ¶
This section is empty.
Functions ¶
func GetErrorCode ¶
func GetMessage ¶
func IsAppError ¶
Types ¶
type ShareBlocked ¶ added in v0.15.1
type ShareBlocked struct {
}
ShareBlocked 分享处于管控拒绝态(管理员禁用 / 待审核)。 handler 侧按 ErrCode 透传(20012 blocked / 20013 pending_review)。
func (*ShareBlocked) ErrCode ¶ added in v0.15.1
func (e *ShareBlocked) ErrCode() int
func (*ShareBlocked) Error ¶ added in v0.15.1
func (e *ShareBlocked) Error() string
Click to show internal directories.
Click to hide internal directories.