Documentation
¶
Overview ¶
Package Enum provides a way to define enums.
type MyEnum Enum.Int[struct { One MyEnum `gd:"ONE"` Two MyEnum `gd:"TWO"` }] var MyEnums = Enum.Values[MyEnum]()
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Int ¶
type Int[T any] struct { // contains filtered or unexported fields }
Int is an enum backed by an increasing integer. T should be a struct with fields of the defined type.
func (Int) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (Int) String ¶
func (m Int) String() string
String returns the name of the enum value or an empty string if the value is not defined.
func (*Int) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
Click to show internal directories.
Click to hide internal directories.