Documentation
¶
Index ¶
- Variables
- type Map
- func (o *Map[K, V]) Clear()
- func (o *Map[K, V]) Clone() *Map[K, V]
- func (o *Map[K, V]) Contains(key K) bool
- func (o *Map[K, V]) Del(key K)
- func (o *Map[K, V]) Get(key K) V
- func (o *Map[K, V]) Iter(yield func(key K, value V) bool)
- func (o *Map[K, V]) IterKeys(yield func(key K) bool)
- func (o *Map[K, V]) IterValues(yield func(value V) bool)
- func (o *Map[K, V]) Keys() []K
- func (o *Map[K, V]) Len() int
- func (o *Map[K, V]) MarshalJSON() ([]byte, error)
- func (o *Map[K, V]) Reverse()
- func (o *Map[K, V]) Set(key K, value V)
- func (o *Map[K, V]) TryGet(key K) (V, bool)
- func (o *Map[K, V]) Values() []V
- type Option
- type Set
- func (s *Set[T]) Add(key T)
- func (s *Set[T]) Clear()
- func (s *Set[T]) Clone() *Set[T]
- func (s *Set[T]) Contains(key T) bool
- func (s *Set[T]) Iter(yield func(key T) bool)
- func (s *Set[T]) Len() int
- func (s *Set[T]) MarshalJSON() ([]byte, error)
- func (s *Set[T]) Remove(key T)
- func (s *Set[T]) Reverse()
- func (s *Set[T]) UnmarshalJSON(data []byte) error
- func (s *Set[T]) Values() []T
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrKeyTypeNotString = errors.New("key type must be string") ErrNilOrderedMap = errors.New("calling MarshalJSON on nil OrderedMap") )
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
func MapMerge ¶ added in v0.3.0
func MapMerge[K comparable, V any](m ...*Map[K, V]) *Map[K, V]
OrderedMapMerge merges the given ordered maps into a new ordered map. Similar to array_merge in PHP.
func (*Map[K, V]) IterValues ¶ added in v0.3.0
func (*Map[K, V]) MarshalJSON ¶
type Set ¶ added in v0.3.0
type Set[T comparable] struct { // contains filtered or unexported fields }
func NewSet ¶ added in v0.3.0
func NewSet[T comparable](opts ...Option) *Set[T]
func (*Set[T]) MarshalJSON ¶ added in v0.3.0
func (*Set[T]) UnmarshalJSON ¶ added in v0.3.0
Click to show internal directories.
Click to hide internal directories.