Documentation ¶
Index ¶
- type I18nRuneMapErrorWrap
- type I18nRuneMultiErrorWrap
- type I18nRuneOneErrorWrap
- type RuneMap
- func (i RuneMap) Code() int
- func (i RuneMap) Error() string
- func (i RuneMap) IsLocaleSupport(locale string) bool
- func (i RuneMap) Lang(ctx context.Context, args ...interface{}) string
- func (i RuneMap) String() string
- func (i RuneMap) Trans(locale string, args ...interface{}) string
- func (i RuneMap) Wrap(err error, locale string, args ...interface{}) *I18nRuneMapErrorWrap
- func (i RuneMap) WrapWithContext(ctx context.Context, err error, args ...interface{}) *I18nRuneMapErrorWrap
- type RuneMulti
- func (i RuneMulti) Code() int
- func (i RuneMulti) Error() string
- func (i RuneMulti) IsLocaleSupport(locale string) bool
- func (i RuneMulti) Lang(ctx context.Context, args ...interface{}) string
- func (i RuneMulti) String() string
- func (i RuneMulti) Trans(locale string, args ...interface{}) string
- func (i RuneMulti) Wrap(err error, locale string, args ...interface{}) *I18nRuneMultiErrorWrap
- func (i RuneMulti) WrapWithContext(ctx context.Context, err error, args ...interface{}) *I18nRuneMultiErrorWrap
- type RuneOne
- func (i RuneOne) Code() int
- func (i RuneOne) Error() string
- func (i RuneOne) IsLocaleSupport(locale string) bool
- func (i RuneOne) Lang(ctx context.Context, args ...interface{}) string
- func (i RuneOne) String() string
- func (i RuneOne) Trans(locale string, args ...interface{}) string
- func (i RuneOne) Wrap(err error, locale string, args ...interface{}) *I18nRuneOneErrorWrap
- func (i RuneOne) WrapWithContext(ctx context.Context, err error, args ...interface{}) *I18nRuneOneErrorWrap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type I18nRuneMapErrorWrap ¶
type I18nRuneMapErrorWrap struct {
// contains filtered or unexported fields
}
I18nRuneMapErrorWrap type i18n error wrapper
WARNING This struct ONLY used to wrap the CONST generated by the i18n-stringer tool, Pass easily obtain internationalized translations through Error, String, Translate WARNING
func (*I18nRuneMapErrorWrap) Error ¶
func (e *I18nRuneMapErrorWrap) Error() string
Error struct as error, get typed message wrap with inside error message
- this method will be formatted wrap error if exist.
- Only for development and debugging, or logging full error message
- if you want to get typed message, please use method String or Translate
func (*I18nRuneMapErrorWrap) Format ¶
func (e *I18nRuneMapErrorWrap) Format() string
Format alias for method Error
- this method will be formatted wrap error if exist.
- Only for development and debugging, or logging full error message
- if you want to get typed message, please use method String or Translate
func (*I18nRuneMapErrorWrap) String ¶
func (e *I18nRuneMapErrorWrap) String() string
String implement fmt.Stringer, get translated string use Translate
func (*I18nRuneMapErrorWrap) Translate ¶
func (e *I18nRuneMapErrorWrap) Translate() string
Translate get translated string
func (*I18nRuneMapErrorWrap) Unwrap ¶
func (e *I18nRuneMapErrorWrap) Unwrap() error
Unwrap an error. Get the error inside
func (*I18nRuneMapErrorWrap) Value ¶
func (e *I18nRuneMapErrorWrap) Value() RuneMap
Value get original type value
type I18nRuneMultiErrorWrap ¶
type I18nRuneMultiErrorWrap struct {
// contains filtered or unexported fields
}
I18nRuneMultiErrorWrap type i18n error wrapper
WARNING This struct ONLY used to wrap the CONST generated by the i18n-stringer tool, Pass easily obtain internationalized translations through Error, String, Translate WARNING
func (*I18nRuneMultiErrorWrap) Error ¶
func (e *I18nRuneMultiErrorWrap) Error() string
Error struct as error, get typed message wrap with inside error message
- this method will be formatted wrap error if exist.
- Only for development and debugging, or logging full error message
- if you want to get typed message, please use method String or Translate
func (*I18nRuneMultiErrorWrap) Format ¶
func (e *I18nRuneMultiErrorWrap) Format() string
Format alias for method Error
- this method will be formatted wrap error if exist.
- Only for development and debugging, or logging full error message
- if you want to get typed message, please use method String or Translate
func (*I18nRuneMultiErrorWrap) String ¶
func (e *I18nRuneMultiErrorWrap) String() string
String implement fmt.Stringer, get translated string use Translate
func (*I18nRuneMultiErrorWrap) Translate ¶
func (e *I18nRuneMultiErrorWrap) Translate() string
Translate get translated string
func (*I18nRuneMultiErrorWrap) Unwrap ¶
func (e *I18nRuneMultiErrorWrap) Unwrap() error
Unwrap an error. Get the error inside
func (*I18nRuneMultiErrorWrap) Value ¶
func (e *I18nRuneMultiErrorWrap) Value() RuneMulti
Value get original type value
type I18nRuneOneErrorWrap ¶
type I18nRuneOneErrorWrap struct {
// contains filtered or unexported fields
}
I18nRuneOneErrorWrap type i18n error wrapper
WARNING This struct ONLY used to wrap the CONST generated by the i18n-stringer tool, Pass easily obtain internationalized translations through Error, String, Translate WARNING
func (*I18nRuneOneErrorWrap) Error ¶
func (e *I18nRuneOneErrorWrap) Error() string
Error struct as error, get typed message wrap with inside error message
- this method will be formatted wrap error if exist.
- Only for development and debugging, or logging full error message
- if you want to get typed message, please use method String or Translate
func (*I18nRuneOneErrorWrap) Format ¶
func (e *I18nRuneOneErrorWrap) Format() string
Format alias for method Error
- this method will be formatted wrap error if exist.
- Only for development and debugging, or logging full error message
- if you want to get typed message, please use method String or Translate
func (*I18nRuneOneErrorWrap) String ¶
func (e *I18nRuneOneErrorWrap) String() string
String implement fmt.Stringer, get translated string use Translate
func (*I18nRuneOneErrorWrap) Translate ¶
func (e *I18nRuneOneErrorWrap) Translate() string
Translate get translated string
func (*I18nRuneOneErrorWrap) Unwrap ¶
func (e *I18nRuneOneErrorWrap) Unwrap() error
Unwrap an error. Get the error inside
func (*I18nRuneOneErrorWrap) Value ¶
func (e *I18nRuneOneErrorWrap) Value() RuneOne
Value get original type value
type RuneMap ¶
type RuneMap int
const ( ConstRuneMaT1 RuneMap = 1000 ConstRuneMaT2 RuneMap = 2000 ConstRuneMaT3 RuneMap = 3000 ConstRuneMaT4 RuneMap = 4000 ConstRuneMaT5 RuneMap = 5000 ConstRuneMaT6 RuneMap = 6000 ConstRuneMaT7 RuneMap = 7000 ConstRuneMaT8 RuneMap = 8000 ConstRuneMaT9 RuneMap = 9000 ConstRuneMaT10 RuneMap = 10000 ConstRuneMaT11 RuneMap = 11000 )
func (RuneMap) Error ¶
WARNING: You should use Trans, Lang, Wrap, WrapWithContext method instead
- You should not use this method in an internationalized language environment, as well as method String.
- Because this method always returns the translation value of the default language.
- This method implements the error interface, so that you can return the value as an error,
- If you understand the above mechanism then you can use this method with confidence
func (RuneMap) IsLocaleSupport ¶
IsLocaleSupport Check if the specified locale is supported
func (RuneMap) Lang ¶
Lang get target translate text use context.Context
- ctx context with Value use Key from _RuneMap_ctxKey, which pass by i18n-stringer flag -ctxkey
- args Optional placeholder replacement value, value type of RuneMap, or type of string
func (RuneMap) String ¶
WARNING: You should use Trans, Lang, Wrap, WrapWithContext method instead
- You should not use this method in an internationalized language environment, as well as method Error.
- Because this method always returns the translation value of the default language.
- This method implements the fmt.Stringer interface, so that you can output it directly by package fmt,
- If you understand the above mechanism then you can use this method with confidence
func (RuneMap) Trans ¶
Trans get target translate text use specified language locale identifier
- locale specified language locale identifier, need pass by IsLocaleSupport
- args Optional placeholder replacement value, value type of RuneMap, or type of string
func (RuneMap) Wrap ¶
func (i RuneMap) Wrap(err error, locale string, args ...interface{}) *I18nRuneMapErrorWrap
Wrap another error with locale set for i18n TYPE Const
- err another error
- locale i18n locale name
- args optional formatting component
func (RuneMap) WrapWithContext ¶
func (i RuneMap) WrapWithContext(ctx context.Context, err error, args ...interface{}) *I18nRuneMapErrorWrap
WrapWithContext wrap another error with context.Context set for i18n TYPE Const
- ctx context with Value use Key from _RuneMap_ctxKey, which pass by i18n-stringer flag -ctxkey
- err another error
- args optional formatting component
type RuneMulti ¶
type RuneMulti int
func (RuneMulti) Error ¶
WARNING: You should use Trans, Lang, Wrap, WrapWithContext method instead
- You should not use this method in an internationalized language environment, as well as method String.
- Because this method always returns the translation value of the default language.
- This method implements the error interface, so that you can return the value as an error,
- If you understand the above mechanism then you can use this method with confidence
func (RuneMulti) IsLocaleSupport ¶
IsLocaleSupport Check if the specified locale is supported
func (RuneMulti) Lang ¶
Lang get target translate text use context.Context
- ctx context with Value use Key from _RuneMulti_ctxKey, which pass by i18n-stringer flag -ctxkey
- args Optional placeholder replacement value, value type of RuneMulti, or type of string
func (RuneMulti) String ¶
WARNING: You should use Trans, Lang, Wrap, WrapWithContext method instead
- You should not use this method in an internationalized language environment, as well as method Error.
- Because this method always returns the translation value of the default language.
- This method implements the fmt.Stringer interface, so that you can output it directly by package fmt,
- If you understand the above mechanism then you can use this method with confidence
func (RuneMulti) Trans ¶
Trans get target translate text use specified language locale identifier
- locale specified language locale identifier, need pass by IsLocaleSupport
- args Optional placeholder replacement value, value type of RuneMulti, or type of string
func (RuneMulti) Wrap ¶
func (i RuneMulti) Wrap(err error, locale string, args ...interface{}) *I18nRuneMultiErrorWrap
Wrap another error with locale set for i18n TYPE Const
- err another error
- locale i18n locale name
- args optional formatting component
func (RuneMulti) WrapWithContext ¶
func (i RuneMulti) WrapWithContext(ctx context.Context, err error, args ...interface{}) *I18nRuneMultiErrorWrap
WrapWithContext wrap another error with context.Context set for i18n TYPE Const
- ctx context with Value use Key from _RuneMulti_ctxKey, which pass by i18n-stringer flag -ctxkey
- err another error
- args optional formatting component
type RuneOne ¶
type RuneOne int
func (RuneOne) Error ¶
WARNING: You should use Trans, Lang, Wrap, WrapWithContext method instead
- You should not use this method in an internationalized language environment, as well as method String.
- Because this method always returns the translation value of the default language.
- This method implements the error interface, so that you can return the value as an error,
- If you understand the above mechanism then you can use this method with confidence
func (RuneOne) IsLocaleSupport ¶
IsLocaleSupport Check if the specified locale is supported
func (RuneOne) Lang ¶
Lang get target translate text use context.Context
- ctx context with Value use Key from _RuneOne_ctxKey, which pass by i18n-stringer flag -ctxkey
- args Optional placeholder replacement value, value type of RuneOne, or type of string
func (RuneOne) String ¶
WARNING: You should use Trans, Lang, Wrap, WrapWithContext method instead
- You should not use this method in an internationalized language environment, as well as method Error.
- Because this method always returns the translation value of the default language.
- This method implements the fmt.Stringer interface, so that you can output it directly by package fmt,
- If you understand the above mechanism then you can use this method with confidence
func (RuneOne) Trans ¶
Trans get target translate text use specified language locale identifier
- locale specified language locale identifier, need pass by IsLocaleSupport
- args Optional placeholder replacement value, value type of RuneOne, or type of string
func (RuneOne) Wrap ¶
func (i RuneOne) Wrap(err error, locale string, args ...interface{}) *I18nRuneOneErrorWrap
Wrap another error with locale set for i18n TYPE Const
- err another error
- locale i18n locale name
- args optional formatting component
func (RuneOne) WrapWithContext ¶
func (i RuneOne) WrapWithContext(ctx context.Context, err error, args ...interface{}) *I18nRuneOneErrorWrap
WrapWithContext wrap another error with context.Context set for i18n TYPE Const
- ctx context with Value use Key from _RuneOne_ctxKey, which pass by i18n-stringer flag -ctxkey
- err another error
- args optional formatting component