Documentation
¶
Index ¶
- type OrderedMap
- func (om *OrderedMap) Clear()
- func (om *OrderedMap) Copy() *OrderedMap
- func (om *OrderedMap) Delete(key any)
- func (om *OrderedMap) Get(key any) (any, bool)
- func (om *OrderedMap) Has(key any) bool
- func (om *OrderedMap) Keys() []any
- func (om *OrderedMap) Len() int
- func (om *OrderedMap) Range(f func(key, value any) bool)
- func (om *OrderedMap) Set(key, value any)
- func (om *OrderedMap) String() string
- func (om *OrderedMap) Values() []any
- type Pair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrderedMap ¶
type OrderedMap struct {
// contains filtered or unexported fields
}
OrderedMap represents an ordered map data structure
func NewOrderedMap ¶ added in v1.2.0
func NewOrderedMap() *OrderedMap
NewOrderedMap creates a new instance of OrderedMap
func (*OrderedMap) Copy ¶
func (om *OrderedMap) Copy() *OrderedMap
Copy returns a new OrderedMap with the same elements
func (*OrderedMap) Delete ¶
func (om *OrderedMap) Delete(key any)
Delete removes the element with the given key
func (*OrderedMap) Get ¶
func (om *OrderedMap) Get(key any) (any, bool)
Get returns the value associated with the given key
func (*OrderedMap) Has ¶
func (om *OrderedMap) Has(key any) bool
Has returns true if the key exists in the map
func (*OrderedMap) Len ¶
func (om *OrderedMap) Len() int
Len returns the number of elements in the map
func (*OrderedMap) Range ¶
func (om *OrderedMap) Range(f func(key, value any) bool)
Range iterates over the map in order and calls the given function for each key-value pair If the function returns false, the iteration stops
func (*OrderedMap) Set ¶
func (om *OrderedMap) Set(key, value any)
Set adds a new key-value pair or updates an existing one
func (*OrderedMap) String ¶
func (om *OrderedMap) String() string
String returns the string representation of the map
Click to show internal directories.
Click to hide internal directories.