Documentation ¶
Index ¶
- func IsEmpty[M ~map[K]V, K comparable, V any](m M) bool
- func IsNotEmpty[M ~map[K]V, K comparable, V any](m M) bool
- type Hash
- type Hash64Func
- type Map
- type SegmentMap
- func (m *SegmentMap[K, V]) Clear()
- func (m *SegmentMap[K, V]) Clone() Map[K, V]
- func (m *SegmentMap[K, V]) Delete(key K)
- func (m *SegmentMap[K, V]) DeleteFunc(del func(K, V) bool)
- func (m *SegmentMap[K, V]) Keys() []K
- func (m *SegmentMap[K, V]) Len() int
- func (m *SegmentMap[K, V]) Load(key K) (value V, ok bool)
- func (m *SegmentMap[K, V]) LoadAndDelete(key K) (value V, loaded bool)
- func (m *SegmentMap[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
- func (m *SegmentMap[K, V]) Map() map[K]V
- func (m *SegmentMap[K, V]) Store(key K, value V)
- func (m *SegmentMap[K, V]) Values() []V
- type StdMap
- func (m *StdMap[K, V]) Clear()
- func (m *StdMap[K, V]) Clone() Map[K, V]
- func (m *StdMap[K, V]) Delete(key K)
- func (m *StdMap[K, V]) DeleteFunc(del func(K, V) bool)
- func (m *StdMap[K, V]) Keys() []K
- func (m *StdMap[K, V]) Len() int
- func (m *StdMap[K, V]) Load(key K) (value V, ok bool)
- func (m *StdMap[K, V]) LoadAndDelete(key K) (value V, loaded bool)
- func (m *StdMap[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
- func (m *StdMap[K, V]) Map() map[K]V
- func (m *StdMap[K, V]) Store(key K, value V)
- func (m *StdMap[K, V]) Values() []V
- type SyncMap
- func (m *SyncMap[K, V]) Clear()
- func (m *SyncMap[K, V]) Clone() Map[K, V]
- func (m *SyncMap[K, V]) Delete(key K)
- func (m *SyncMap[K, V]) DeleteFunc(del func(K, V) bool)
- func (m *SyncMap[K, V]) Keys() []K
- func (m *SyncMap[K, V]) Len() int
- func (m *SyncMap[K, V]) Load(key K) (value V, ok bool)
- func (m *SyncMap[K, V]) LoadAndDelete(key K) (value V, loaded bool)
- func (m *SyncMap[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
- func (m *SyncMap[K, V]) Map() map[K]V
- func (m *SyncMap[K, V]) Store(key K, value V)
- func (m *SyncMap[K, V]) Values() []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsEmpty ¶ added in v1.0.2
func IsEmpty[M ~map[K]V, K comparable, V any](m M) bool
func IsNotEmpty ¶ added in v1.0.2
func IsNotEmpty[M ~map[K]V, K comparable, V any](m M) bool
Types ¶
type Hash ¶
type Hash[K comparable] interface { Sum(k K) int64 }
type Hash64Func ¶
type Hash64Func[K comparable] func(k K) int64
func (Hash64Func[K]) Sum ¶
func (f Hash64Func[K]) Sum(k K) int64
type Map ¶
type Map[K comparable, V any] interface { Load(key K) (value V, ok bool) Store(key K, value V) LoadOrStore(key K, value V) (actual V, loaded bool) LoadAndDelete(key K) (value V, loaded bool) Delete(key K) DeleteFunc(del func(K, V) bool) Map() map[K]V Len() int Keys() []K Values() []V Clear() Clone() Map[K, V] }
type SegmentMap ¶
type SegmentMap[K comparable, V any] struct { // contains filtered or unexported fields }
func NewSegmentMap ¶
func NewSegmentMap[K comparable, V any](initSize int, shards int, hasher Hash[K]) *SegmentMap[K, V]
func (*SegmentMap[K, V]) Clear ¶
func (m *SegmentMap[K, V]) Clear()
func (*SegmentMap[K, V]) Clone ¶
func (m *SegmentMap[K, V]) Clone() Map[K, V]
func (*SegmentMap[K, V]) Delete ¶
func (m *SegmentMap[K, V]) Delete(key K)
func (*SegmentMap[K, V]) DeleteFunc ¶
func (m *SegmentMap[K, V]) DeleteFunc(del func(K, V) bool)
func (*SegmentMap[K, V]) Keys ¶
func (m *SegmentMap[K, V]) Keys() []K
func (*SegmentMap[K, V]) Len ¶
func (m *SegmentMap[K, V]) Len() int
func (*SegmentMap[K, V]) Load ¶
func (m *SegmentMap[K, V]) Load(key K) (value V, ok bool)
func (*SegmentMap[K, V]) LoadAndDelete ¶
func (m *SegmentMap[K, V]) LoadAndDelete(key K) (value V, loaded bool)
func (*SegmentMap[K, V]) LoadOrStore ¶
func (m *SegmentMap[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
func (*SegmentMap[K, V]) Map ¶
func (m *SegmentMap[K, V]) Map() map[K]V
func (*SegmentMap[K, V]) Store ¶
func (m *SegmentMap[K, V]) Store(key K, value V)
func (*SegmentMap[K, V]) Values ¶
func (m *SegmentMap[K, V]) Values() []V
type StdMap ¶
type StdMap[K comparable, V any] struct { sync.RWMutex // contains filtered or unexported fields }
func (*StdMap[K, V]) DeleteFunc ¶
func (*StdMap[K, V]) LoadAndDelete ¶
func (*StdMap[K, V]) LoadOrStore ¶
type SyncMap ¶
type SyncMap[K comparable, V any] struct { // contains filtered or unexported fields }
func NewSyncMap ¶
func NewSyncMap[K comparable, V any]() *SyncMap[K, V]
func (*SyncMap[K, V]) DeleteFunc ¶
func (*SyncMap[K, V]) LoadAndDelete ¶
func (*SyncMap[K, V]) LoadOrStore ¶
Click to show internal directories.
Click to hide internal directories.