Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidType is returned when an invalid type is used for an enum // This is usually caused when a type is deserialized from a network request and we want to validate its in the Set ErrInvalidType = errors.New("invalid enum type") )
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set[T ID] struct { // contains filtered or unexported fields }
Set is a generic set of enums This enables users to create a set of enums keyed by a custom type This set provides functionality for adding, getting, and validating enums of that type within the set
func NewSetFromMap ¶
func (*Set[T]) GetOrError ¶
GetOrError returns the enum item by its id or an error if the item is not found
Click to show internal directories.
Click to hide internal directories.