Documentation ¶
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(k K) (V, bool)
- func (m *Map[K, V]) GetKey(v V) (K, bool)
- func (m *Map[K, V]) Keys() []K
- func (m *Map[K, V]) Put(key K, value V)
- func (m *Map[K, V]) Remove(k 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 comparable] struct { // contains filtered or unexported fields }
Map is the structure that implements the map. key map to value and value map to key.
func (*Map[K, V]) Clear ¶
func (m *Map[K, V]) Clear()
Clear removes all key-value pairs from the map.
func (*Map[K, V]) Put ¶
func (m *Map[K, V]) Put(key K, value V)
Put puts the key-value pair into the map.
func (*Map[K, V]) Remove ¶
func (m *Map[K, V]) Remove(k K)
Remove removes the key-value pair from the map.
Click to show internal directories.
Click to hide internal directories.