Documentation ¶
Index ¶
- type Element
- type OrderedMap
- func (orderedMap *OrderedMap) Delete(key interface{}) bool
- func (orderedMap *OrderedMap) ForEach(consumer func(key, value interface{}) bool) bool
- func (orderedMap *OrderedMap) Get(key interface{}) (interface{}, bool)
- func (orderedMap *OrderedMap) Set(key interface{}, newValue interface{}) bool
- func (orderedMap *OrderedMap) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
Element defines the model of each element of the orderedMap.
type OrderedMap ¶
type OrderedMap struct {
// contains filtered or unexported fields
}
OrderedMap provides a concurrent-safe ordered map.
func (*OrderedMap) Delete ¶
func (orderedMap *OrderedMap) Delete(key interface{}) bool
Delete deletes the given key (and related value) from the orderedMap. It returns false if the key is not found.
func (*OrderedMap) ForEach ¶
func (orderedMap *OrderedMap) ForEach(consumer func(key, value interface{}) bool) bool
ForEach iterates through the orderedMap and calls the consumer function for every element. The iteration can be aborted by returning false in the consumer.
func (*OrderedMap) Get ¶
func (orderedMap *OrderedMap) Get(key interface{}) (interface{}, bool)
Get returns the value mapped to the given key if exists.
func (*OrderedMap) Set ¶
func (orderedMap *OrderedMap) Set(key interface{}, newValue interface{}) bool
Set adds a key-value pair to the orderedMap. It returns false if the same pair already exists.
func (*OrderedMap) Size ¶
func (orderedMap *OrderedMap) Size() int
Size returns the size of the orderedMap.
Click to show internal directories.
Click to hide internal directories.