test_switch

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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) Code added in v0.2.0

func (i RuneMap) Code() int

Code get original type int value

func (RuneMap) Error

func (i RuneMap) Error() 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 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

func (i RuneMap) IsLocaleSupport(locale string) bool

IsLocaleSupport Check if the specified locale is supported

func (RuneMap) Lang

func (i RuneMap) Lang(ctx context.Context, args ...interface{}) string

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

func (i RuneMap) String() 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

func (i RuneMap) Trans(locale string, args ...interface{}) string

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
const (
	CostRuneMT1 RuneMulti = iota + 1
	CostRuneMT2
	CostRuneMT3
	CostRuneMT4 RuneMulti = 1000 + iota
	CostRuneMT5
)

func (RuneMulti) Code added in v0.2.0

func (i RuneMulti) Code() int

Code get original type int value

func (RuneMulti) Error

func (i RuneMulti) Error() 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 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

func (i RuneMulti) IsLocaleSupport(locale string) bool

IsLocaleSupport Check if the specified locale is supported

func (RuneMulti) Lang

func (i RuneMulti) Lang(ctx context.Context, args ...interface{}) string

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

func (i RuneMulti) String() 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

func (i RuneMulti) Trans(locale string, args ...interface{}) string

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
const (
	CostRuneOT1 RuneOne = iota + 20
	CostRuneOT2
	CostRuneOT3
)

func (RuneOne) Code added in v0.2.0

func (i RuneOne) Code() int

Code get original type int value

func (RuneOne) Error

func (i RuneOne) Error() 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 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

func (i RuneOne) IsLocaleSupport(locale string) bool

IsLocaleSupport Check if the specified locale is supported

func (RuneOne) Lang

func (i RuneOne) Lang(ctx context.Context, args ...interface{}) string

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

func (i RuneOne) String() 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

func (i RuneOne) Trans(locale string, args ...interface{}) string

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

Jump to

Keyboard shortcuts

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