enumer

package module
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEq added in v1.0.6

func IsEq[A ~string, B ~string](a A) func(B) bool

func Join added in v1.0.10

func Join[A ~string](values []A, sep string) string

func MarshalJSON added in v1.0.6

func MarshalJSON[E ~string](e E) ([]byte, error)

func MarshalXML added in v1.0.20

func MarshalXML[E ~string](e E, enc *xml.Encoder, start xml.StartElement) error

func MarshalYAML added in v1.0.6

func MarshalYAML[E ~string](e E) (interface{}, error)

func Scan added in v1.0.6

func Scan[E ~string](value interface{}, e *E, parser func(string) (E, error)) error

func UnmarshalJSON added in v1.0.6

func UnmarshalJSON[E ~string](data []byte, e *E, parser func(string) (E, error)) error

func UnmarshalXML added in v1.0.20

func UnmarshalXML[E ~string](e *E, parser func(string) (E, error), d *xml.Decoder, start xml.StartElement) error

func UnmarshalYAML added in v1.0.6

func UnmarshalYAML[E ~string](unmarshal func(interface{}) error, e *E, parser func(string) (E, error)) error

func Value added in v1.0.6

func Value[E ~string](e E) (driver.Value, error)

Types

type EnumData added in v1.0.21

type EnumData struct {
	Type        string            `json:"type,omitempty" yaml:"type,omitempty"`
	Struct      string            `json:"struct,omitempty" yaml:"struct,omitempty"`
	Package     string            `json:"package,omitempty" yaml:"package,omitempty"`
	InputPath   string            `json:"input-path,omitempty" yaml:"input-path,omitempty"`
	OutputPath  string            `json:"output-path,omitempty" yaml:"output-path,omitempty"`
	Desc        string            `json:"desc" yaml,omitempty:"desc,omitempty"`
	Header      string            `json:"header,omitempty" yaml:"header,omitempty"`
	HeaderFrom  string            `json:"header-from,omitempty" yaml:"header-from,omitempty"`
	HeaderLines []string          `json:"header-lines,omitempty" yaml:"header-lines,omitempty"`
	SkipFormat  bool              `json:"skip-format,omitempty" yaml:"skip-format,omitempty"`
	Debug       bool              `json:"debug,omitempty" yaml:"debug,omitempty"`
	Overwrite   bool              `json:"overwrite,omitempty" yaml:"overwrite,omitempty"`
	Serialize   EnumSerialize     `json:"serialize,omitempty" yaml:"serialize,omitempty"`
	Values      []EnumValue       `json:"values,omitempty" yaml:"values,omitempty"`
	Translate   map[string]string `json:"translate,omitempty" yaml:"translate,omitempty"`
}

type EnumSerialize added in v1.0.21

type EnumSerialize struct {
	Type  string `json:"type,omitempty" yaml:"type,omitempty"`
	Value string `json:"value,omitempty" yaml:"value,omitempty"`
}

type EnumValue added in v1.0.21

type EnumValue struct {
	Name       string            `json:"name,omitempty" yaml:"name,omitempty"`
	Desc       string            `json:"desc,omitempty" yaml:"desc,omitempty"`
	Serialized string            `json:"serialized,omitempty" yaml:"serialized,omitempty"`
	ParseFrom  []string          `json:"parse-from,omitempty" yaml:"parse-from,omitempty"`
	Translate  map[string]string `json:"translate,omitempty" yaml:"translate,omitempty"`
}

Directories

Path Synopsis
cmd
enum_internal

Jump to

Keyboard shortcuts

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