messages

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLIMessages_BaseDirDescription                          messageKey = "CLIMessages_BaseDirDescription"
	CLIMessages_DisableTelemetryDescription                 messageKey = "CLIMessages_DisableTelemetryDescription"
	CLIMessages_DisplayModeDescription                      messageKey = "CLIMessages_DisplayModeDescription"
	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_BadValueForEnvVar                         messageKey = "StartupErrors_BadValueForEnvVar"
	StartupErrors_DuplicateParameter                        messageKey = "StartupErrors_DuplicateParameter"
	StartupErrors_FailedToCreateDirectory                   messageKey = "StartupErrors_FailedToCreateDirectory"
	StartupErrors_FailedToCreateFile                        messageKey = "StartupErrors_FailedToCreateFile"
	StartupErrors_FailedToCreateLogFile                     messageKey = "StartupErrors_FailedToCreateLogFile"
	StartupErrors_FailedToCreateSubdirectory                messageKey = "StartupErrors_FailedToCreateSubdirectory"
	StartupErrors_FailedToGetExecutablePath                 messageKey = "StartupErrors_FailedToGetExecutablePath"
	StartupErrors_FailedToStartWatchdogProcess              messageKey = "StartupErrors_FailedToStartWatchdogProcess"
	StartupErrors_GenericInitializeFailure                  messageKey = "StartupErrors_GenericInitializeFailure"
	StartupErrors_InvalidDisplayMode                        messageKey = "StartupErrors_InvalidDisplayMode"
	StartupErrors_InvalidLogLevel                           messageKey = "StartupErrors_InvalidLogLevel"
	StartupErrors_InvalidParameterKey                       messageKey = "StartupErrors_InvalidParameterKey"
	StartupErrors_InvalidParameterType                      messageKey = "StartupErrors_InvalidParameterType"
	StartupErrors_MissingValue                              messageKey = "StartupErrors_MissingValue"
	StartupErrors_ParseFailed                               messageKey = "StartupErrors_ParseFailed"
)
View Source
const (
	Locale_en_US localeKey = "en_US"
)

Variables

View Source
var AnError = &anError{} //nolint:gochecknoglobals // AnError is an error

AnError is a test helper analogous to assert.AnError but satisfying messages.Error. Use it in tests when verifying error propagation paths that require messages.Error.

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 FromErrorMultiLocale(err Error, locale LocaleKey) string

func FromGeneralError

func FromGeneralError(catalog LocaleSpecificCatalog, err error) (string, bool)

func FromGeneralErrorMultiLocale

func FromGeneralErrorMultiLocale(err error, locale LocaleKey) (string, bool)

func LocaleFromString

func LocaleFromString(locale string) (localeKey, bool)

Types

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

Catalog provides access to the messages for a specific locale.

func NewCatalog

func NewCatalog(key LocaleKey) *Catalog

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 Error

type Error interface {
	Error() string
	// contains filtered or unexported methods
}

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

type StartupErrors_BadFlag_Error struct {
	Attr0 string
	Attr1 string
	Attr2 string
}

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

Error makes StartupErrors_BadFlag_Error satisfy the error interface.

type StartupErrors_BadSyntax_Error

type StartupErrors_BadSyntax_Error struct {
	Attr0 string
	Attr1 string
	Attr2 string
}

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

Error makes StartupErrors_BadSyntax_Error satisfy the error interface.

type StartupErrors_BadValueForEnvVar_Error added in v0.5.1

type StartupErrors_BadValueForEnvVar_Error struct {
	Attr0 string
	Attr1 string
}

StartupErrors_BadValueForEnvVar_Error defines an error corresponding to the "StartupErrors_BadValueForEnvVar" message catalog message

func New_StartupErrors_BadValueForEnvVar_Error added in v0.5.1

func New_StartupErrors_BadValueForEnvVar_Error(
	attr0 string,
	attr1 string,
) *StartupErrors_BadValueForEnvVar_Error

New_StartupErrors_BadValueForEnvVar_Error makes a new StartupErrors_BadValueForEnvVar_Error error.

func (*StartupErrors_BadValueForEnvVar_Error) Error added in v0.5.1

Error makes StartupErrors_BadValueForEnvVar_Error satisfy the error interface.

type StartupErrors_BadValue_Error

type StartupErrors_BadValue_Error struct {
	Attr0 string
	Attr1 string
}

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

Error makes StartupErrors_BadValue_Error satisfy the error interface.

type StartupErrors_DuplicateParameter_Error added in v0.5.1

type StartupErrors_DuplicateParameter_Error struct {
	Attr0 string
	Attr1 string
	Attr2 string
}

StartupErrors_DuplicateParameter_Error defines an error corresponding to the "StartupErrors_DuplicateParameter" message catalog message

func New_StartupErrors_DuplicateParameter_Error added in v0.5.1

func New_StartupErrors_DuplicateParameter_Error(
	attr0 string,
	attr1 string,
	attr2 string,
) *StartupErrors_DuplicateParameter_Error

New_StartupErrors_DuplicateParameter_Error makes a new StartupErrors_DuplicateParameter_Error error.

func (*StartupErrors_DuplicateParameter_Error) Error added in v0.5.1

Error makes StartupErrors_DuplicateParameter_Error satisfy the error interface.

type StartupErrors_FailedToCreateDirectory_Error added in v0.4.1

type StartupErrors_FailedToCreateDirectory_Error struct {
	Attr0 string
}

StartupErrors_FailedToCreateDirectory_Error defines an error corresponding to the "StartupErrors_FailedToCreateDirectory" message catalog message

func New_StartupErrors_FailedToCreateDirectory_Error added in v0.4.1

func New_StartupErrors_FailedToCreateDirectory_Error(
	attr0 string,
) *StartupErrors_FailedToCreateDirectory_Error

New_StartupErrors_FailedToCreateDirectory_Error makes a new StartupErrors_FailedToCreateDirectory_Error error.

func (*StartupErrors_FailedToCreateDirectory_Error) Error added in v0.4.1

Error makes StartupErrors_FailedToCreateDirectory_Error satisfy the error interface.

type StartupErrors_FailedToCreateFile_Error added in v0.4.1

type StartupErrors_FailedToCreateFile_Error struct {
	Attr0 string
}

StartupErrors_FailedToCreateFile_Error defines an error corresponding to the "StartupErrors_FailedToCreateFile" message catalog message

func New_StartupErrors_FailedToCreateFile_Error added in v0.4.1

func New_StartupErrors_FailedToCreateFile_Error(
	attr0 string,
) *StartupErrors_FailedToCreateFile_Error

New_StartupErrors_FailedToCreateFile_Error makes a new StartupErrors_FailedToCreateFile_Error error.

func (*StartupErrors_FailedToCreateFile_Error) Error added in v0.4.1

Error makes StartupErrors_FailedToCreateFile_Error satisfy the error interface.

type StartupErrors_FailedToCreateLogFile_Error added in v0.4.1

type StartupErrors_FailedToCreateLogFile_Error struct {
	Attr0 string
}

StartupErrors_FailedToCreateLogFile_Error defines an error corresponding to the "StartupErrors_FailedToCreateLogFile" message catalog message

func New_StartupErrors_FailedToCreateLogFile_Error added in v0.4.1

func New_StartupErrors_FailedToCreateLogFile_Error(
	attr0 string,
) *StartupErrors_FailedToCreateLogFile_Error

New_StartupErrors_FailedToCreateLogFile_Error makes a new StartupErrors_FailedToCreateLogFile_Error error.

func (*StartupErrors_FailedToCreateLogFile_Error) Error added in v0.4.1

Error makes StartupErrors_FailedToCreateLogFile_Error satisfy the error interface.

type StartupErrors_FailedToCreateSubdirectory_Error added in v0.4.1

type StartupErrors_FailedToCreateSubdirectory_Error struct {
	Attr0 string
}

StartupErrors_FailedToCreateSubdirectory_Error defines an error corresponding to the "StartupErrors_FailedToCreateSubdirectory" message catalog message

func New_StartupErrors_FailedToCreateSubdirectory_Error added in v0.4.1

func New_StartupErrors_FailedToCreateSubdirectory_Error(
	attr0 string,
) *StartupErrors_FailedToCreateSubdirectory_Error

New_StartupErrors_FailedToCreateSubdirectory_Error makes a new StartupErrors_FailedToCreateSubdirectory_Error error.

func (*StartupErrors_FailedToCreateSubdirectory_Error) Error added in v0.4.1

Error makes StartupErrors_FailedToCreateSubdirectory_Error satisfy the error interface.

type StartupErrors_FailedToGetExecutablePath_Error added in v0.4.1

type StartupErrors_FailedToGetExecutablePath_Error struct {
}

StartupErrors_FailedToGetExecutablePath_Error defines an error corresponding to the "StartupErrors_FailedToGetExecutablePath" message catalog message

func New_StartupErrors_FailedToGetExecutablePath_Error added in v0.4.1

func New_StartupErrors_FailedToGetExecutablePath_Error() *StartupErrors_FailedToGetExecutablePath_Error

New_StartupErrors_FailedToGetExecutablePath_Error makes a new StartupErrors_FailedToGetExecutablePath_Error error.

func (*StartupErrors_FailedToGetExecutablePath_Error) Error added in v0.4.1

Error makes StartupErrors_FailedToGetExecutablePath_Error satisfy the error interface.

type StartupErrors_FailedToStartWatchdogProcess_Error added in v0.4.1

type StartupErrors_FailedToStartWatchdogProcess_Error struct {
}

StartupErrors_FailedToStartWatchdogProcess_Error defines an error corresponding to the "StartupErrors_FailedToStartWatchdogProcess" message catalog message

func New_StartupErrors_FailedToStartWatchdogProcess_Error added in v0.4.1

func New_StartupErrors_FailedToStartWatchdogProcess_Error() *StartupErrors_FailedToStartWatchdogProcess_Error

New_StartupErrors_FailedToStartWatchdogProcess_Error makes a new StartupErrors_FailedToStartWatchdogProcess_Error error.

func (*StartupErrors_FailedToStartWatchdogProcess_Error) Error added in v0.4.1

Error makes StartupErrors_FailedToStartWatchdogProcess_Error satisfy the error interface.

type StartupErrors_InvalidDisplayMode_Error added in v0.5.0

type StartupErrors_InvalidDisplayMode_Error struct {
	Attr0 string
}

StartupErrors_InvalidDisplayMode_Error defines an error corresponding to the "StartupErrors_InvalidDisplayMode" message catalog message

func New_StartupErrors_InvalidDisplayMode_Error added in v0.5.0

func New_StartupErrors_InvalidDisplayMode_Error(
	attr0 string,
) *StartupErrors_InvalidDisplayMode_Error

New_StartupErrors_InvalidDisplayMode_Error makes a new StartupErrors_InvalidDisplayMode_Error error.

func (*StartupErrors_InvalidDisplayMode_Error) Error added in v0.5.0

Error makes StartupErrors_InvalidDisplayMode_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

Error makes StartupErrors_InvalidLogLevel_Error satisfy the error interface.

type StartupErrors_InvalidParameterKey_Error added in v0.5.1

type StartupErrors_InvalidParameterKey_Error struct {
	Attr0 string
}

StartupErrors_InvalidParameterKey_Error defines an error corresponding to the "StartupErrors_InvalidParameterKey" message catalog message

func New_StartupErrors_InvalidParameterKey_Error added in v0.5.1

func New_StartupErrors_InvalidParameterKey_Error(
	attr0 string,
) *StartupErrors_InvalidParameterKey_Error

New_StartupErrors_InvalidParameterKey_Error makes a new StartupErrors_InvalidParameterKey_Error error.

func (*StartupErrors_InvalidParameterKey_Error) Error added in v0.5.1

Error makes StartupErrors_InvalidParameterKey_Error satisfy the error interface.

type StartupErrors_InvalidParameterType_Error added in v0.5.1

type StartupErrors_InvalidParameterType_Error struct {
	Attr0 string
	Attr1 string
}

StartupErrors_InvalidParameterType_Error defines an error corresponding to the "StartupErrors_InvalidParameterType" message catalog message

func New_StartupErrors_InvalidParameterType_Error added in v0.5.1

func New_StartupErrors_InvalidParameterType_Error(
	attr0 string,
	attr1 string,
) *StartupErrors_InvalidParameterType_Error

New_StartupErrors_InvalidParameterType_Error makes a new StartupErrors_InvalidParameterType_Error error.

func (*StartupErrors_InvalidParameterType_Error) Error added in v0.5.1

Error makes StartupErrors_InvalidParameterType_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

Error makes StartupErrors_MissingValue_Error satisfy the error interface.

type StartupErrors_ParseFailed_Error

type StartupErrors_ParseFailed_Error struct {
	Attr0 string
	Attr1 string
}

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

Error makes StartupErrors_ParseFailed_Error satisfy the error interface.

Jump to

Keyboard shortcuts

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