Documentation
¶
Overview ¶
Package hashmap implements a map backed by a hash table.
Elements are unordered in the map.
Structure is not thread safe.
Index ¶
- type Map
- func (m *Map[K, V]) Clear()
- func (m *Map[K, V]) Empty() bool
- func (m *Map[K, V]) FromJSON(data []byte) error
- func (m *Map[K, V]) Get(key K) (value V, found bool)
- func (m *Map[K, V]) InterfaceValues() []interface{}
- func (m *Map[K, V]) Keys() []K
- func (m *Map[K, V]) Put(key K, value V)
- func (m *Map[K, V]) Remove(key K)
- func (m *Map[K, V]) Size() int
- func (m *Map[K, V]) String() string
- func (m *Map[K, V]) ToJSON() ([]byte, error)
- func (m *Map[K, V]) Values() []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
Map holds the elements in go's native map
func (*Map[K, V]) FromJSON ¶ added in v1.9.0
FromJSON populates the map from the input JSON representation.
func (*Map[K, V]) Get ¶
Get searches the element in the map by key and returns its value or nil if key is not found in map. Second return parameter is true if key was found, otherwise false.
func (*Map[K, V]) InterfaceValues ¶ added in v1.13.0
func (m *Map[K, V]) InterfaceValues() []interface{}
InterfaceValues returns all elements in the l as type interface{}.
func (*Map[K, V]) Remove ¶
func (m *Map[K, V]) Remove(key K)
Remove removes the element from the map by key.
Click to show internal directories.
Click to hide internal directories.