i18n

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFieldErrorString

func GetFieldErrorString(p *Printer, fe fieldError) string

GetFieldErrorString ...

func GetPrinter

func GetPrinter(r *http.Request) *message.Printer

GetPrinter ...

func GetTag

func GetTag(r *http.Request) language.Tag

GetTag ...

Types

type ErrorCode

type ErrorCode int

ErrorCode ...

const (
	ErrOK             ErrorCode = iota // ok
	ErrSystemError                     // system error
	ErrSystemFailed                    // system faild
	ErrSystemPause                     // system pause
	ErrSystemReadonly                  // system readonly

	ErrNotFound      // 404
	ErrForbiddedn    // 403
	ErrParamRequired // need some param or value input
	ErrParamInvalid  // invalid param

	ErrLoginFailed    // Incorrect username or password
	ErrAuthRequired   // 401 need login
	ErrVerifySend     // old error (1402, "😓发送验证码失败")
	ErrRegistFaild    // old error (1403, "😓注册失败")
	ErrNoneMobile     // old error (1404, "😓没有这个手机号!")
	ErrBadAlias       // old error (1405, "🤔貌似不像合法的名称?")
	ErrBadEmail       // old error (1408, "🤔您确认这是邮箱地址?")
	ErrBadMobile      // old error (1406, "🤔您确认这是手机号码?")
	ErrAliasTaken     // old error (1407, "😓此用户已存在,请直接登录")
	ErrMobileTaken    // old error (1416, "😓此手机号已存在")
	ErrBadVerifyCode  // old error (1409, "😓验证码不正确")
	ErrTokenExpired   // old error (1410, "😓登录身份已过期")
	ErrTokenInvalid   // old error (1411, "😓登录身份无效或已过期")
	ErrOldPassword    // old error (1412, "😓原密码不正确")
	ErrEmptyPassword  // old error (1413, "😓密码不能为空")
	ErrSimplePassword // old error (1415, "😓您的密码太简单了")
	ErrMultiOnline    // old error (1414, "🤔您似乎已经登录了")
	ErrEqualOldMobile // old error (1417, "😓新手机号和旧的一样唉")
	ErrAliasTooFew    // 有一些必需的别名不能解绑

	ErrEnableTwoFactor // old error (1420, "😓两步认证未开启,请先开启两步认证")
	ErrTwoFactorCode   // old error (1421, "😓两步认证验证码输入有误")

	ErrSNSInfoLost   // 第三方(绑定)信息因过期而丢失
	ErrSNSBindFailed // 绑定第三方信息失败

)

consts of error value

func (ErrorCode) Code

func (ev ErrorCode) Code() int

Code ...

func (ErrorCode) Error

func (ev ErrorCode) Error() string

func (ErrorCode) ErrorString

func (ev ErrorCode) ErrorString(p *Printer) string

ErrorString return locale string with message printer

func (ErrorCode) String

func (i ErrorCode) String() string

type Printer

type Printer = message.Printer

Printer ...

Jump to

Keyboard shortcuts

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