Documentation ¶
Index ¶
- func SortStrings(i string, j string) bool
- type Map
- func (orderedMap *Map[K, V]) At(index int) V
- func (orderedMap *Map[K, V]) Equal(other *Map[K, V]) bool
- func (orderedMap *Map[K, V]) Filter(callback func(key K, value V) bool) *Map[K, V]
- func (orderedMap *Map[K, V]) Get(key K) V
- func (orderedMap *Map[K, V]) Has(key K) bool
- func (orderedMap *Map[K, V]) Iterate(callback func(key K, value V))
- func (orderedMap *Map[K, V]) Len() int
- func (orderedMap *Map[K, V]) Map(callback func(key K, value V) V) *Map[K, V]
- func (orderedMap *Map[K, V]) MarshalJSON() ([]byte, error)
- func (orderedMap *Map[K, V]) Remove(key K)
- func (orderedMap *Map[K, V]) Set(key K, value V)
- func (orderedMap *Map[K, V]) Sort(lessFunc func(i K, j K) bool)
- func (orderedMap *Map[K, V]) UnmarshalJSON(raw []byte) error
- func (orderedMap *Map[K, V]) Values() []V
- type Pair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortStrings ¶
Types ¶
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
func New ¶
func New[K comparable, V any]() *Map[K, V]
func (*Map[K, V]) MarshalJSON ¶
func (*Map[K, V]) Sort ¶
Sort sorts the keys using the provided less function, keeping equal elements in their original order.
func (*Map[K, V]) UnmarshalJSON ¶
FIXME: does not preserve order
Click to show internal directories.
Click to hide internal directories.