input

package
v0.0.9-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

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 Argument

type Argument struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
	Type        string `yaml:"type"`
}

type Arguments

type Arguments []Argument

func (*Arguments) UnmarshalYAML

func (a *Arguments) UnmarshalYAML(value *yaml.Node) error

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"`
	Deprecated      string        `yaml:"deprecated"`
	Arguments       Arguments     `yaml:"arguments"`
	Title           string        `yaml:"title"`
	InternalMessage string        `yaml:"internal_message"`
	PublicMessage   string        `yaml:"public_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"`
	Domain        string       `yaml:"domain"`
	Namespace     string       `yaml:"namespace"`
	DefaultLocale string       `yaml:"default_locale"`
	Errors        ErrorEntries `yaml:"errors"`
}

type Localization

type Localization struct {
	Arguments       LocalizationArguments `yaml:"arguments"`
	Description     Translations          `yaml:"description"`
	Title           Translations          `yaml:"title"`
	InternalMessage Translations          `yaml:"internal_message"`
	PublicMessage   Translations          `yaml:"public_message"`
	Deprecated      Translations          `yaml:"deprecated"`
}

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 Translation struct {
	Lang  string
	Value string
}

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

func (*YAMLImporter) Import

func (i *YAMLImporter) Import(src io.Reader) (core.Spec, error)

Jump to

Keyboard shortcuts

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