Versions in this module Expand all Collapse all v0 v0.1.0 Aug 15, 2026 Changes in this version + const CodeNumConflict + const CodeNumDatabaseUnavail + const CodeNumDuplicate + const CodeNumEmailExists + const CodeNumForbidden + const CodeNumInternal + const CodeNumInvalidCredentials + const CodeNumInvalidParams + const CodeNumInvalidToken + const CodeNumMissingToken + const CodeNumNotFound + const CodeNumPermInsufficient + const CodeNumProviderErr + const CodeNumQuotaExceeded + const CodeNumRateLimited + const CodeNumRegisterDisabled + const CodeNumServiceUnavail + const CodeNumTenantMismatch + const CodeNumTenantNotFound + const CodeNumTenantSuspended + const CodeNumUnauthorized + const CodeNumUpstreamTimeout + const CodeNumUserUnavailable + const CodeNumValidationFailed + const CodeSuccess + const KeyAuthEmailNotRegistered + const KeyAuthEmailSameAsCurrent + const KeyAuthInvalidCredentials + const KeyAuthInvalidToken + const KeyAuthMissingToken + const KeyConflict + const KeyCreated + const KeyDeleted + const KeyDuplicate + const KeyForbidden + const KeyInternalError + const KeyInvalidBody + const KeyInvalidParams + const KeyNotFound + const KeyPermInsufficient + const KeyQuotaExceeded + const KeyRateLimited + const KeyServiceUnavailable + const KeySuccess + const KeyTenantEmailExists + const KeyTenantMismatch + const KeyTenantNotFound + const KeyTenantRegisterDisabled + const KeyTenantSuspended + const KeyTenantUserUnavailable + const KeyUnauthorized + const KeyUpdated + const KeyUpstreamTimeout + const KeyValidationCaptchaInvalid + const KeyValidationCaptchaRequired + const KeyValidationEmail + const KeyValidationMax + const KeyValidationMin + const KeyValidationPasswordShort + const KeyValidationRequired + const KeyValidationUsernameFormat + const KeyValidationUsernameShort + func EnvelopeData(data any) map[string]any + func EnvelopeError(msg string) map[string]any + func ErrCodeFor(code Code) int + func FormatDetails(ae *AppError) string + func HTTPStatusFor(code Code) int + func HTTPStatusOf(ae *AppError) int + func I18nKeyFor(code Code) string + func IsAppError(err error) bool + type AppError struct + Cause error + Code Code + Details map[string]any + HTTPStatus int + Message string + MsgArgs []any + MsgKey string + func AsAppError(err error) *AppError + func Err(code Code) *AppError + func From(err error) *AppError + func New(code Code, message string) *AppError + func NewI18n(code Code, msgKey string, args ...any) *AppError + func Newf(code Code, format string, args ...any) *AppError + func Wrap(code Code, message string, cause error) *AppError + func WrapErr(code Code, cause error) *AppError + func WrapI18n(code Code, msgKey string, cause error, args ...any) *AppError + func (ae *AppError) NumCode() int + func (e *AppError) Error() string + func (e *AppError) Is(target error) bool + func (e *AppError) Unwrap() error + func (e *AppError) WithArg(arg any) *AppError + func (e *AppError) WithArgs(args ...any) *AppError + func (e *AppError) WithCause(cause error) *AppError + func (e *AppError) WithDetails(d map[string]any) *AppError + func (e *AppError) WithStatus(status int) *AppError + type ChainResolver struct + Resolvers []MessageResolver + func (r *ChainResolver) Resolve(key string, args ...any) string + type Code string + const CodeAuthFailed + const CodeBadRequest + const CodeConflict + const CodeCredentialInvalid + const CodeDuplicate + const CodeForbidden + const CodeInternal + const CodeNotFound + const CodeProviderError + const CodeQuotaExceeded + const CodeRateLimited + const CodeServiceUnavail + const CodeTenantMismatch + const CodeUnauthorized + const CodeUpstreamTimeout + const CodeValidation + func CodeForHTTPStatus(status int) Code + type ErrorResponse struct + Code int + Data any + Details map[string]any + Error string + Message string + func ErrorEnvelope(ae *AppError, resolver MessageResolver) *ErrorResponse + type MessageResolver interface + Resolve func(key string, args ...any) string + var NoopResolver MessageResolver = ResolverFunc(func(key string, _ ...any) string { ... }) + type Page struct + List any + Page int + Size int + Total int64 + TotalPage int + func NewPage(list any, total int64, page, size int) *Page + type ResolverFunc func(key string, args ...any) string + func (f ResolverFunc) Resolve(key string, args ...any) string + type Response struct + Code int + Data any + Message string + func Success(data any) *Response + func SuccessMsg(msg string, data any) *Response + type StaticResolver struct + Messages map[string]string + func (r *StaticResolver) Resolve(key string, args ...any) string