Documentation
¶
Overview ¶
Package orderedmap implements two types of generic maps that iterates keys in ordered manner
Index ¶
- type Ordered
- func (o *Ordered[K, V]) Clone() (rv *Ordered[K, V])
- func (o *Ordered[K, V]) Del(key K)
- func (o *Ordered[K, V]) Get(key K) (value V, ok bool)
- func (o *Ordered[K, V]) Has(key K) (yes bool)
- func (o *Ordered[K, V]) Iter(next func(key K, value V) bool)
- func (o *Ordered[K, V]) Len() int
- func (o *Ordered[K, V]) Set(key K, value V)
- type Sorted
- func (s *Sorted[K, V]) Clone() (rv *Sorted[K, V])
- func (s *Sorted[K, V]) Del(key K)
- func (s *Sorted[K, V]) Get(key K) (value V, ok bool)
- func (s *Sorted[K, V]) Has(key K) (yes bool)
- func (s *Sorted[K, V]) Iter(next func(key K, value V) bool)
- func (s *Sorted[K, V]) Len() (rv int)
- func (s *Sorted[K, V]) Set(key K, value V)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ordered ¶
type Ordered[K comparable, V any] struct { // contains filtered or unexported fields }
Ordered represents generic map, it will iterate keys always in same order - as elements were added (FIFO).
func NewOrdered ¶ added in v1.1.0
func NewOrdered[K comparable, V any]() (rv *Ordered[K, V])
NewOrdered creates empty ordered map.
type Sorted ¶
Sorted represents generic map, it will iterate keys in sorted order.
Click to show internal directories.
Click to hide internal directories.