Versions in this module Expand all Collapse all v2 v2.3.8 Nov 1, 2025 Changes in this version + type Enum interface + Name func() string + String func() string + Valid func(checker ...func(T) bool) bool + Value func() T + type Item struct + func NewItem[T comparable](value T, name string) *Item[T] + func NewItemsFromPairs[T comparable](pairs ...Pair[T]) []*Item[T] + func (it *Item[T]) MarshalJSON() ([]byte, error) + func (it *Item[T]) Name() string + func (it *Item[T]) String() string + func (it *Item[T]) UnmarshalJSON(data []byte) error + func (it *Item[T]) Valid(checker ...func(T) bool) bool + func (it *Item[T]) Value() T + type Pair struct + Name string + Value T + type Registry struct + func NewRegistry[T comparable](items ...*Item[T]) *Registry[T] + func (r *Registry[T]) Add(items ...*Item[T]) + func (r *Registry[T]) Contains(value T) bool + func (r *Registry[T]) Filter(predicate func(*Item[T]) bool) []*Item[T] + func (r *Registry[T]) GetByName(name string) (*Item[T], bool) + func (r *Registry[T]) GetByValue(value T) (*Item[T], bool) + func (r *Registry[T]) Items() []*Item[T] + func (r *Registry[T]) Range(fn func(*Item[T]) bool) + func (r *Registry[T]) Remove(value T) bool + func (r *Registry[T]) Size() int + func (r *Registry[T]) SortedItems(less func(*Item[T], *Item[T]) bool) []*Item[T] + func (r *Registry[T]) Update(value T, newName string) bool