Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map[Key comparable, Value any] struct { // contains filtered or unexported fields }
Map provides a read-only wrapper around a map.
func (*Map[Key, Value]) Fetch ¶
Fetch retrieves the value associated with the given key and a boolean indicating if the key exists.
func (*Map[Key, Value]) Get ¶
func (r *Map[Key, Value]) Get(key Key) Value
Get retrieves the value associated with the given key. Returns the zero value of Value if the key does not exist.
type MapBuilder ¶
type MapBuilder[Key comparable, Value any] struct { // contains filtered or unexported fields }
MapBuilder builds a Map.
func NewMapBuilder ¶
func NewMapBuilder[Key comparable, Value any]() *MapBuilder[Key, Value]
NewMapBuilder returns a new MapBuilder.
func (*MapBuilder[Key, Value]) Build ¶
func (b *MapBuilder[Key, Value]) Build() *Map[Key, Value]
Build creates a Map from the MapBuilder's entries.
func (*MapBuilder[Key, Value]) Set ¶
func (b *MapBuilder[Key, Value]) Set(entries ...MapEntry[Key, Value]) *MapBuilder[Key, Value]
Set adds entries to the MapBuilder.
func (*MapBuilder[Key, Value]) SetMap ¶
func (b *MapBuilder[Key, Value]) SetMap(otherMap map[Key]Value) *MapBuilder[Key, Value]
SetMap adds entries from another map to the MapBuilder.
type MapEntry ¶
type MapEntry[Key comparable, Value any] struct { Key Key Value Value }
MapEntry is a key-value pair for the MapBuilder.
type Slice ¶
type Slice[T any] struct { // contains filtered or unexported fields }
Slice provides a read-only wrapper around a slice.
type SliceBuilder ¶
type SliceBuilder[T any] struct { // contains filtered or unexported fields }
SliceBuilder builds a Slice.
func NewSliceBuilder ¶
func NewSliceBuilder[T any]() *SliceBuilder[T]
NewSliceBuilder returns a new SliceBuilder.
func (*SliceBuilder[T]) Append ¶
func (b *SliceBuilder[T]) Append(elements ...T) *SliceBuilder[T]
Append adds elements to the SliceBuilder.
func (*SliceBuilder[T]) Build ¶
func (b *SliceBuilder[T]) Build() *Slice[T]
Build creates a Slice from the SliceBuilder's elements.