Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrderedMap ¶
type OrderedMap[T comparable, V any] struct { // contains filtered or unexported fields }
OrderedMap is a map with a deterministic iteration order this datastructure is thread-safe
func NewOrderedMap ¶
func NewOrderedMap[T comparable, V any]() *OrderedMap[T, V]
NewOrderedMap returns a new OrderedMap
func (*OrderedMap[T, V]) Delete ¶
func (m *OrderedMap[T, V]) Delete(key T)
Delete removes a key-value pair from the map
func (*OrderedMap[T, V]) Get ¶
func (m *OrderedMap[T, V]) Get(key T) (V, bool)
Get returns the value for a given key
func (*OrderedMap[T, V]) Has ¶
func (m *OrderedMap[T, V]) Has(key T) bool
Has returns true if the map contains the given key
func (*OrderedMap[T, V]) Keys ¶
func (m *OrderedMap[T, V]) Keys() []T
Keys returns all keys in the map
func (*OrderedMap[T, V]) Put ¶
func (m *OrderedMap[T, V]) Put(key T, val V)
Put adds a key-value pair to the map
func (*OrderedMap[T, V]) Values ¶
func (m *OrderedMap[T, V]) Values() []V
Values returns all values in the map
Click to show internal directories.
Click to hide internal directories.