i18n

package
v0.0.0-...-115e584 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(opts ...Option)

func NewI18n

func NewI18n(opts ...Option) *i18n

func Parse

func Parse(errCode ErrCode) error

Types

type ErrCode

type ErrCode int
const (
	CodeSuccess ErrCode = iota // CodeSuccess:请求成功
	CodeFail                   // CodeFail:请求失败
	// 二级错误码
	AuthFailureInvalidSecretId // AuthFailure.InvalidSecretId:秘钥非法
	AuthFailureTokenFailure    // AuthFailure.TokenFailure:token 错误
)

type ErrCodeEn

type ErrCodeEn int
const (
	CodeSuccessEn ErrCodeEn = iota // CodeSuccess:this request is success
	CodeFailEn                     // CodeFail:this request is fail
	// 二级错误码
	AuthFailureInvalidSecretIdEn // AuthFailure.InvalidSecretId:illegal key
	AuthFailureTokenFailureEn    // AuthFailure.TokenFailure:token error
)

type Option

type Option func(*Options)

func WithLang

func WithLang(lang string) Option

type Options

type Options struct {
	Lang string
}

Jump to

Keyboard shortcuts

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