Documentation
¶
Index ¶
- type Map
- func (m *Map[K, T]) BinaryDecode(r io.Reader) error
- func (m *Map[K, T]) BinaryEncode(w io.Writer) error
- func (m *Map[K, T]) Clear()
- func (m *Map[K, T]) Delete(key K)
- func (m *Map[K, T]) Exists(key K) bool
- func (m *Map[K, T]) Get(key K) (_ T)
- func (m *Map[K, T]) GetOrSet(key K, fn func() T) (res T)
- func (m *Map[K, T]) Increment(key K, val T) T
- func (m *Map[K, T]) KeyValues() map[K]T
- func (m *Map[K, T]) Keys() []K
- func (m *Map[K, T]) Len() int
- func (m *Map[K, T]) MarshalBinary() ([]byte, error)
- func (m *Map[K, T]) MarshalJSON() ([]byte, error)
- func (m *Map[K, T]) Pop() (key K, value T)
- func (m *Map[K, T]) PopAll() (values map[K]T)
- func (m *Map[K, T]) Random() (key K, value T)
- func (m *Map[K, T]) RandomKey() K
- func (m *Map[K, T]) RandomValue() T
- func (m *Map[K, T]) Set(key K, value T)
- func (m *Map[K, T]) String() string
- func (m *Map[K, T]) UnmarshalBinary(data []byte) error
- func (m *Map[K, T]) UnmarshalJSON(data []byte) error
- func (m *Map[K, T]) Values() []T
- func (m *Map[K, T]) Version() uint64
- type Set
- func (m *Set[K]) BinaryDecode(r io.Reader) (err error)
- func (m *Set[K]) BinaryEncode(w io.Writer) error
- func (m *Set[K]) Clear()
- func (m *Set[K]) Delete(key K)
- func (m *Set[K]) Exists(key K) bool
- func (m *Set[K]) MarshalJSON() ([]byte, error)
- func (m *Set[K]) Pop() (key K)
- func (m *Set[K]) PopAll() (values []K)
- func (m *Set[K]) Random() (key K)
- func (m *Set[K]) Set(key K)
- func (m *Set[K]) Size() int
- func (m *Set[K]) String() string
- func (m *Set[K]) Strings() []string
- func (m *Set[K]) UnmarshalJSON(data []byte) (err error)
- func (m *Set[K]) Values() []K
- func (m *Set[K]) Version() uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map[K comparable, T any] struct { // contains filtered or unexported fields }
A Map is a set of temporary objects that may be individually set, get and deleted.
A Map is safe for use by multiple goroutines simultaneously.
func NewMap ¶
func NewMap[K comparable, T any](values map[K]T) Map[K, T]
func (*Map[K, T]) MarshalBinary ¶
func (*Map[K, T]) MarshalJSON ¶
func (*Map[K, T]) RandomValue ¶
func (m *Map[K, T]) RandomValue() T
func (*Map[K, T]) UnmarshalBinary ¶
func (*Map[K, T]) UnmarshalJSON ¶
type Set ¶
type Set[K comparable] struct { // contains filtered or unexported fields }
A Set is a set of temporary objects that may be individually set, get and deleted.
A Set is safe for use by multiple goroutines simultaneously.
func NewSet ¶
func NewSet[K comparable](values []K) Set[K]
func (*Set[K]) MarshalJSON ¶
func (*Set[K]) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.