config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DecodingStrategyStrict        = DecodingStrategy("strict")
	DecodingStrategyDiscriminator = DecodingStrategy("discriminator")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Types            TypesList        `yaml:"types"`
	DecodingStrategy DecodingStrategy `yaml:"decoding_strategy"`
	MarkerMethod     string           `yaml:"marker_method"`
	Output           *OutputConfig    `yaml:"output"`
	Package          string           `yaml:"package"`
}

func (*Config) String

func (c *Config) String() string

type DecodingStrategy

type DecodingStrategy string

func (DecodingStrategy) IsDiscriminator

func (s DecodingStrategy) IsDiscriminator() bool

func (DecodingStrategy) IsStrict

func (s DecodingStrategy) IsStrict() bool

func (DecodingStrategy) IsValid

func (s DecodingStrategy) IsValid() bool

func (DecodingStrategy) String

func (s DecodingStrategy) String() string

type DiscriminatorDefinition

type DiscriminatorDefinition struct {
	Field   string            `yaml:"field"`
	Mapping map[string]string `yaml:"mapping"`
}

type OutputConfig

type OutputConfig struct {
	Filename string `yaml:"filename"`
}

type Package

type Package string

func (Package) Dir

func (p Package) Dir() string

func (Package) Name

func (p Package) Name() string

func (Package) String

func (p Package) String() string

type TypeDefinition

type TypeDefinition struct {
	Name             string                  `yaml:"name"`
	Variants         []string                `yaml:"variants,omitempty"`
	MarkerMethod     string                  `yaml:"marker_method,omitempty"`
	DecodingStrategy DecodingStrategy        `yaml:"decoding_strategy,omitempty"`
	Discriminator    DiscriminatorDefinition `yaml:"discriminator,omitempty"`
	Package          string                  `yaml:"package,omitempty"`
	Output           *OutputConfig           `yaml:"output,omitempty"`
}

type TypesList

type TypesList []*TypeDefinition

func (TypesList) AssociateByOutput

func (tts TypesList) AssociateByOutput() map[string]TypesList

func (TypesList) AssociateByPkgName

func (tts TypesList) AssociateByPkgName() map[string]TypesList

func (TypesList) AssociateByTypeName

func (tts TypesList) AssociateByTypeName() map[string]*TypeDefinition

Jump to

Keyboard shortcuts

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