Documentation
¶
Index ¶
- Constants
- func FromError(catalog LocaleSpecificCatalog, err Error) string
- func FromErrorMultiLocale(err Error, locale LocaleKey) string
- func FromGeneralError(catalog LocaleSpecificCatalog, err error) (string, bool)
- func FromGeneralErrorMultiLocale(err error, locale LocaleKey) (string, bool)
- func LocaleFromString(locale string) (localeKey, bool)
- type Catalog
- type Error
- type LocaleKey
- type LocaleSpecificCatalog
- type MessageKey
- type MultiLocaleCatalog
- type StartupErrors_BadFlag_Error
- type StartupErrors_BadSyntax_Error
- type StartupErrors_BadValue_Error
- type StartupErrors_InvalidLogLevel_Error
- type StartupErrors_MissingValue_Error
- type StartupErrors_ParseFailed_Error
Constants ¶
const ( CLIMessages_BaseDirDescription messageKey = "CLIMessages_BaseDirDescription" CLIMessages_DisableTelemetryDescription messageKey = "CLIMessages_DisableTelemetryDescription" CLIMessages_HelpDescription messageKey = "CLIMessages_HelpDescription" CLIMessages_InitializeMATLABOnStartupDescription messageKey = "CLIMessages_InitializeMATLABOnStartupDescription" CLIMessages_InternalUseDescription messageKey = "CLIMessages_InternalUseDescription" CLIMessages_LogLevelDescription messageKey = "CLIMessages_LogLevelDescription" CLIMessages_PreferredLocalMATLABRootDescription messageKey = "CLIMessages_PreferredLocalMATLABRootDescription" CLIMessages_PreferredMATLABStartingDirectoryDescription messageKey = "CLIMessages_PreferredMATLABStartingDirectoryDescription" CLIMessages_UseSingleMATLABSessionDescription messageKey = "CLIMessages_UseSingleMATLABSessionDescription" CLIMessages_VersionDescription messageKey = "CLIMessages_VersionDescription" StartupErrors_BadFlag messageKey = "StartupErrors_BadFlag" StartupErrors_BadSyntax messageKey = "StartupErrors_BadSyntax" StartupErrors_BadValue messageKey = "StartupErrors_BadValue" StartupErrors_GenericInitializeFailure messageKey = "StartupErrors_GenericInitializeFailure" StartupErrors_InvalidLogLevel messageKey = "StartupErrors_InvalidLogLevel" StartupErrors_MissingValue messageKey = "StartupErrors_MissingValue" StartupErrors_ParseFailed messageKey = "StartupErrors_ParseFailed" )
const (
Locale_en_US localeKey = "en_US"
)
Variables ¶
This section is empty.
Functions ¶
func FromError ¶
func FromError(catalog LocaleSpecificCatalog, err Error) string
FromError retrieves the message corresponding to the passed error from the message catalog. The holes in the message are filled from the error attributes.
func FromErrorMultiLocale ¶
func FromGeneralError ¶
func FromGeneralError(catalog LocaleSpecificCatalog, err error) (string, bool)
func LocaleFromString ¶
Types ¶
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog provides access to the messages for a specific locale.
func NewCatalog ¶
NewCatalog creates a Catalog corresponding to a specific locale.
func (*Catalog) Get ¶
func (c *Catalog) Get(key MessageKey) string
Get returns the message corresponding to the provided key.
type LocaleKey ¶
type LocaleKey interface {
// contains filtered or unexported methods
}
LocaleKey is a specific type to signify message catalog locales.
type LocaleSpecificCatalog ¶
type LocaleSpecificCatalog interface {
Get(MessageKey) string
}
type MessageKey ¶
type MessageKey interface {
// contains filtered or unexported methods
}
MessageKey is a specific type to signify message catalog keys.
type MultiLocaleCatalog ¶
type MultiLocaleCatalog struct{}
MultiLocaleCatalog provides access to messages across all locales.
func NewMultiLocaleCatalog ¶
func NewMultiLocaleCatalog() *MultiLocaleCatalog
NewMultiLocaleCatalog creates a new multi-locale catalog.
func (*MultiLocaleCatalog) Get ¶
func (c *MultiLocaleCatalog) Get(key MessageKey, locale LocaleKey) string
Get returns the message corresponding to the provided key and locale.
type StartupErrors_BadFlag_Error ¶
StartupErrors_BadFlag_Error defines an error corresponding to the "StartupErrors_BadFlag" message catalog message
func New_StartupErrors_BadFlag_Error ¶
func New_StartupErrors_BadFlag_Error( attr0 string, attr1 string, attr2 string, ) *StartupErrors_BadFlag_Error
New_StartupErrors_BadFlag_Error makes a new StartupErrors_BadFlag_Error error.
func (*StartupErrors_BadFlag_Error) Error ¶
func (e *StartupErrors_BadFlag_Error) Error() string
Error makes StartupErrors_BadFlag_Error satisfy the error interface.
type StartupErrors_BadSyntax_Error ¶
StartupErrors_BadSyntax_Error defines an error corresponding to the "StartupErrors_BadSyntax" message catalog message
func New_StartupErrors_BadSyntax_Error ¶
func New_StartupErrors_BadSyntax_Error( attr0 string, attr1 string, attr2 string, ) *StartupErrors_BadSyntax_Error
New_StartupErrors_BadSyntax_Error makes a new StartupErrors_BadSyntax_Error error.
func (*StartupErrors_BadSyntax_Error) Error ¶
func (e *StartupErrors_BadSyntax_Error) Error() string
Error makes StartupErrors_BadSyntax_Error satisfy the error interface.
type StartupErrors_BadValue_Error ¶
StartupErrors_BadValue_Error defines an error corresponding to the "StartupErrors_BadValue" message catalog message
func New_StartupErrors_BadValue_Error ¶
func New_StartupErrors_BadValue_Error( attr0 string, attr1 string, ) *StartupErrors_BadValue_Error
New_StartupErrors_BadValue_Error makes a new StartupErrors_BadValue_Error error.
func (*StartupErrors_BadValue_Error) Error ¶
func (e *StartupErrors_BadValue_Error) Error() string
Error makes StartupErrors_BadValue_Error satisfy the error interface.
type StartupErrors_InvalidLogLevel_Error ¶
type StartupErrors_InvalidLogLevel_Error struct {
Attr0 string
}
StartupErrors_InvalidLogLevel_Error defines an error corresponding to the "StartupErrors_InvalidLogLevel" message catalog message
func New_StartupErrors_InvalidLogLevel_Error ¶
func New_StartupErrors_InvalidLogLevel_Error( attr0 string, ) *StartupErrors_InvalidLogLevel_Error
New_StartupErrors_InvalidLogLevel_Error makes a new StartupErrors_InvalidLogLevel_Error error.
func (*StartupErrors_InvalidLogLevel_Error) Error ¶
func (e *StartupErrors_InvalidLogLevel_Error) Error() string
Error makes StartupErrors_InvalidLogLevel_Error satisfy the error interface.
type StartupErrors_MissingValue_Error ¶
type StartupErrors_MissingValue_Error struct {
Attr0 string
}
StartupErrors_MissingValue_Error defines an error corresponding to the "StartupErrors_MissingValue" message catalog message
func New_StartupErrors_MissingValue_Error ¶
func New_StartupErrors_MissingValue_Error( attr0 string, ) *StartupErrors_MissingValue_Error
New_StartupErrors_MissingValue_Error makes a new StartupErrors_MissingValue_Error error.
func (*StartupErrors_MissingValue_Error) Error ¶
func (e *StartupErrors_MissingValue_Error) Error() string
Error makes StartupErrors_MissingValue_Error satisfy the error interface.
type StartupErrors_ParseFailed_Error ¶
StartupErrors_ParseFailed_Error defines an error corresponding to the "StartupErrors_ParseFailed" message catalog message
func New_StartupErrors_ParseFailed_Error ¶
func New_StartupErrors_ParseFailed_Error( attr0 string, attr1 string, ) *StartupErrors_ParseFailed_Error
New_StartupErrors_ParseFailed_Error makes a new StartupErrors_ParseFailed_Error error.
func (*StartupErrors_ParseFailed_Error) Error ¶
func (e *StartupErrors_ParseFailed_Error) Error() string
Error makes StartupErrors_ParseFailed_Error satisfy the error interface.