errormsg

package
v0.0.0-...-d0a0e58 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZH string = "zh"
	EN string = "en"
)

Variables

This section is empty.

Functions

func ByCtx

func ByCtx(c *gin.Context, key ErrorCode) string

ByCtx - give appropriate message according to custom http header "X-Language"

func ByLangcode

func ByLangcode(langcode string, key ErrorCode) string

Types

type ErrorCode

type ErrorCode int
const (

	// General error
	SearchFailed ErrorCode
	OperationFailed
	ParamsError
	InternalServerError
	NotFoundError
	// Permissions error
	Expire
	Forbidden
	ReviewForbidden
	// Account error
	Unregister
	HasRegistered
	RegisterError
	WrongPassword
	EmailFormatError
	EmailRegistered
	UserOrPasswordError
	PasswordFormatError
	NewPasswordFormatError
	UserTypeError
	AddressError
	SignatureError
	ActorNotFound
	// VCode error
	SendVCodeFailed
	VCodeExpire
	VCodeError
	VCodeNotExist
	TryAgainVCodeRequest
	TooManyVCodeRequest
	// File upload error
	SaveFileFailed
	UploadFailed
	// Query error
	PageError
	PageSizeError

	OwnProviderError
	ScoreError
	TextLengthError
	CustomTextLengthError
	CustomFieldRequiredError
	FileTypeError
)

type MultiLang

type MultiLang struct {
	ZH string `json:"zh"`
	EN string `json:"en"`
}

Jump to

Keyboard shortcuts

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