ecode

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OK                      = 0    // Success
	AppKeyInvalid           = -1   // Application does not exist or has been banned
	AccessKeyErr            = -2   // Access Key error
	SignCheckErr            = -3   // API signature check error
	MethodNoPermission      = -4   // Caller has no permission for this method
	NoLogin                 = -101 // Account not logged in
	UserDisabled            = -102 // Account suspended
	LackOfScores            = -103 // Lack of scores
	LackOfCoins             = -104 // Lack of coins
	CaptchaErr              = -105 // Captcha error
	UserInactive            = -106 // Account inactive
	UserNoMember            = -107 // Account not a formal member or in adaptation period
	AppDenied               = -108 // Application does not exist or has been banned
	MobileNoVerfiy          = -110 // Mobile phone not bound
	CsrfNotMatchErr         = -111 // CSRF check failed
	ServiceUpdate           = -112 // System is upgrading
	UserIDCheckInvalid      = -113 // Account not yet verified
	UserIDCheckInvalidPhone = -114 // Please bind your mobile phone first
	UserIDCheckInvalidCard  = -115 // Please complete real-name authentication first

	NotModified           = -304 // Not modified
	TemporaryRedirect     = -307 // Temporary redirect
	RequestErr            = -400 // Request error
	Unauthorized          = -401 // Unauthorized
	AccessDenied          = -403 // Access denied
	NothingFound          = -404 // Nothing found
	MethodNotAllowed      = -405 // Method not allowed
	Conflict              = -409 // Conflict
	Gone                  = -410 // Gone
	ServerErr             = -500 // Server error
	ServiceUnavailable    = -503 // Service unavailable
	Deadline              = -504 // Service call timeout
	LimitExceed           = -509 // Exceed limit
	FileNotExists         = -616 // File does not exist
	FileTooLarge          = -617 // File too large
	FailedTooManyTimes    = -625 // Too many login failures
	UserNotExist          = -626 // User does not exist
	PasswordTooLeak       = -628 // Password too weak
	UsernameOrPasswordErr = -629 // Incorrect username or password
	TargetNumberLimit     = -632 // Operation target number limit
	TargetBlocked         = -643 // Blocked
	UserLevelLow          = -650 // User level too low
	UserDuplicate         = -652 // Duplicate user
	AccessTokenExpires    = -658 // Token expired
	PasswordHashExpires   = -662 // Password timestamp expired
	AreaLimit             = -688 // Geographic area limit
	CopyrightLimit        = -689 // Copyright limit
	FailToAddMoral        = -701 // Failed to deduct moral

	Degrade     = -1200 // Filtered request due to degradation
	RPCNoClient = -1201 // No available client for rpc service
	RPCNoAuth   = -1202 // Client for rpc service not authorized
)

Define all error codes

Functions

func AlreadyExist

func AlreadyExist(k ...string) string

AlreadyExist returns already exist message

func AssertionFailed

func AssertionFailed(k ...any) string

AssertionFailed returns type assertion failed message

func Expired

func Expired(k ...string) string

Expired returns expired message

func Failed

func Failed(k ...string) string

Failed returns failed message

func FieldIsBlank

func FieldIsBlank(k ...string) string

FieldIsBlank returns field blank message

func FieldIsEmpty

func FieldIsEmpty(k ...string) string

FieldIsEmpty returns field empty message

func FieldIsInvalid

func FieldIsInvalid(k ...string) string

FieldIsInvalid returns field invalid message

func FieldIsNil

func FieldIsNil(k ...string) string

FieldIsNil returns field nil message

func FieldIsRequired

func FieldIsRequired(k ...string) string

FieldIsRequired returns field required message

func NotExist

func NotExist(k ...string) string

NotExist returns not exist message

func NotSingular

func NotSingular(k ...string) string

NotSingular returns not singular message

func Success

func Success(k ...string) string

Success returns success message

func Text

func Text(code int) string

Text returns the text corresponding to the error code. If the error code does not exist, it returns a default message.

func TypeMismatch

func TypeMismatch(k ...string) string

TypeMismatch returns type mismatch message

Types

This section is empty.

Jump to

Keyboard shortcuts

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