enumer

package module
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 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" yaml:"type"`
	Struct      string        `json:"struct" yaml:"struct"`
	Package     string        `json:"package" yaml:"package"`
	InputPath   string        `json:"input-path" yaml:"input-path"`
	OutputPath  string        `json:"output-path" yaml:"output-path"`
	Desc        string        `json:"desc" yaml:"desc"`
	Header      string        `json:"header" yaml:"header"`
	HeaderFrom  string        `json:"header-from" yaml:"header-from"`
	HeaderLines []string      `json:"header-lines" yaml:"header-lines"`
	SkipFormat  bool          `json:"skip-format" yaml:"skip-format"`
	Debug       bool          `json:"debug" yaml:"debug"`
	Overwrite   bool          `json:"overwrite" yaml:"overwrite"`
	Serialize   EnumSerialize `json:"serialize" yaml:"serialize"`
	Values      []EnumValue   `json:"values" yaml:"values"`
}

type EnumSerialize added in v1.0.21

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

type EnumValue added in v1.0.21

type EnumValue struct {
	Name       string `json:"name" yaml:"name"`
	Serialized string `json:"serialized" yaml:"serialized"`
}

Directories

Path Synopsis
cmd
enum_internal

Jump to

Keyboard shortcuts

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