Documentation
¶
Index ¶
- func SortByKey[K cmp.Ordered, V any](om *Map[K, V])
- func SortByValue[K comparable, V cmp.Ordered](om *Map[K, V])
- func SortFunc[K comparable, V any](om *Map[K, V], cmpFn func(a, b Pair[K, V]) int)
- type Map
- func From[K comparable, V any](seq iter.Seq2[K, V]) *Map[K, V]
- func New[K comparable, V any]() *Map[K, V]
- func SortedByKey[K cmp.Ordered, V any](om *Map[K, V]) *Map[K, V]
- func SortedByValue[K comparable, V cmp.Ordered](om *Map[K, V]) *Map[K, V]
- func SortedFunc[K comparable, V any](om *Map[K, V], cmpFn func(Pair[K, V], Pair[K, V]) int) *Map[K, V]
- func (om *Map[K, V]) All() iter.Seq2[K, V]
- func (om *Map[K, V]) Clear()
- func (om *Map[K, V]) Clone() *Map[K, V]
- func (om *Map[K, V]) Delete(k K) V
- func (om *Map[K, V]) DeleteOk(k K) (V, bool)
- func (om *Map[K, V]) Entries() []Pair[K, V]
- func (om *Map[K, V]) Get(k K) V
- func (om *Map[K, V]) GetOk(k K) (V, bool)
- func (om *Map[K, V]) Keys() iter.Seq[K]
- func (om *Map[K, V]) Len() int
- func (om *Map[K, V]) MarshalJSON() ([]byte, error)
- func (om *Map[K, V]) Push(k K, v V)
- func (om *Map[K, V]) Set(k K, v V)
- func (om *Map[K, V]) String() string
- func (om *Map[K, V]) UnmarshalJSON(data []byte) error
- func (om *Map[K, V]) Values() iter.Seq[V]
- type Pair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortByValue ¶ added in v1.2.0
func SortByValue[K comparable, V cmp.Ordered](om *Map[K, V])
Types ¶
type Map ¶ added in v1.1.0
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
func New ¶
func New[K comparable, V any]() *Map[K, V]
func SortedByValue ¶ added in v1.2.0
func SortedByValue[K comparable, V cmp.Ordered](om *Map[K, V]) *Map[K, V]
func SortedFunc ¶ added in v1.2.0
func (*Map[K, V]) MarshalJSON ¶ added in v1.4.0
func (*Map[K, V]) UnmarshalJSON ¶ added in v1.4.0
type Pair ¶
type Pair[K comparable, V any] struct { Key K Value V }
Click to show internal directories.
Click to hide internal directories.