Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertErrorEntriesEquality ¶
func AssertErrorEntriesEquality(t *testing.T, expected, actual ErrorEntries)
AssertErrorEntriesEquality asserts that two ErrorEntries are equal. Used for testing only.
Types ¶
type ErrorEntries ¶
type ErrorEntries []ErrorEntry
ErrorEntries is used to customize YAML unmarshalling of ErrorEntry.
func (*ErrorEntries) UnmarshalYAML ¶
func (p *ErrorEntries) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implements yaml.Unmarshaler interface.
type ErrorEntry ¶
type ErrorEntry struct {
Code string `yaml:"code"`
GRPCCode codes.Code `yaml:"grpc_code"`
HTTPCode int `yaml:"http_code"`
Description string `yaml:"description"`
IsDeprecated bool `yaml:"is_deprecated"`
Arguments Arguments `yaml:"arguments"`
Message string `yaml:"message"`
Localization *Localization `yaml:"localization"`
}
ErrorEntry represents a single error entry in the error codes file. It is used only for unmarshalling from the source file.
type ErrorListSpecification ¶
type ErrorListSpecification struct {
SpecVersion string `yaml:"spec_version"`
DefaultLocale string `yaml:"default_locale"`
Errors ErrorEntries `yaml:"errors"`
}
type Localization ¶
type Localization struct {
Arguments LocalizationArguments `yaml:"arguments"`
Description Translations `yaml:"description"`
Message Translations `yaml:"message"`
}
type LocalizationArgument ¶
type LocalizationArgument struct {
Name string `yaml:"name"`
Description Translations `yaml:"description"`
}
type LocalizationArguments ¶
type LocalizationArguments []LocalizationArgument
func (*LocalizationArguments) UnmarshalYAML ¶
func (a *LocalizationArguments) UnmarshalYAML(value *yaml.Node) error
type Translation ¶
type Translations ¶
type Translations []Translation
func (*Translations) UnmarshalYAML ¶
func (t *Translations) UnmarshalYAML(value *yaml.Node) error
type YAMLImporter ¶
type YAMLImporter struct{}
func NewYAMLImporter ¶
func NewYAMLImporter() *YAMLImporter
Click to show internal directories.
Click to hide internal directories.