Documentation ¶
Index ¶
- func WithCustomHasher[K comparable, V any](h func(key K) uint64) func(csMap *CsMap[K, V])
- func WithShardCount[K comparable, V any](count uint64) func(csMap *CsMap[K, V])
- func WithSize[K comparable, V any](size uint64) func(csMap *CsMap[K, V])
- type CsMap
- func (m *CsMap[K, V]) Clear()
- func (m *CsMap[K, V]) Count() int
- func (m *CsMap[K, V]) Delete(key K) bool
- func (m *CsMap[K, V]) DeleteIf(key K, condition func(value V) bool) bool
- func (m *CsMap[K, V]) DeleteRetrieve(key K) V
- func (m *CsMap[K, V]) Has(key K) bool
- func (m *CsMap[K, V]) IsEmpty() bool
- func (m *CsMap[K, V]) Load(key K) (V, bool)
- func (m *CsMap[K, V]) LoadLocked(key K, loader func(value V)) bool
- func (m *CsMap[K, V]) MarshalJSON() ([]byte, error)
- func (m *CsMap[K, V]) Range(f func(key K, value V) (stop bool))
- func (m *CsMap[K, V]) RangeDelete(f func(key K, value V) (stop bool))
- func (m *CsMap[K, V]) SetIf(key K, ...)
- func (m *CsMap[K, V]) SetIfAbsent(key K, value V)
- func (m *CsMap[K, V]) SetIfPresent(key K, value V)
- func (m *CsMap[K, V]) Store(key K, value V)
- func (m *CsMap[K, V]) StoreCompute(key K, compute func(value V) V) V
- func (m *CsMap[K, V]) StoreComputeSinglton(key K, compute func(value V) V) V
- func (m *CsMap[K, V]) UnmarshalJSON(b []byte) error
- type HashShardPair
- type Tuple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCustomHasher ¶
func WithCustomHasher[K comparable, V any](h func(key K) uint64) func(csMap *CsMap[K, V])
func WithShardCount ¶
func WithShardCount[K comparable, V any](count uint64) func(csMap *CsMap[K, V])
Types ¶
type CsMap ¶
type CsMap[K comparable, V any] struct { // contains filtered or unexported fields }
func (*CsMap[K, V]) DeleteRetrieve ¶ added in v1.0.1
func (m *CsMap[K, V]) DeleteRetrieve(key K) V
func (*CsMap[K, V]) LoadLocked ¶ added in v1.0.3
func (*CsMap[K, V]) MarshalJSON ¶
func (*CsMap[K, V]) RangeDelete ¶ added in v1.0.2
Range If the callback function returns true iteration will stop.
func (*CsMap[K, V]) SetIfAbsent ¶
func (m *CsMap[K, V]) SetIfAbsent(key K, value V)
func (*CsMap[K, V]) SetIfPresent ¶
func (m *CsMap[K, V]) SetIfPresent(key K, value V)
func (*CsMap[K, V]) StoreCompute ¶
func (m *CsMap[K, V]) StoreCompute(key K, compute func(value V) V) V
func (*CsMap[K, V]) StoreComputeSinglton ¶ added in v1.0.6
func (m *CsMap[K, V]) StoreComputeSinglton(key K, compute func(value V) V) V
func (*CsMap[K, V]) UnmarshalJSON ¶
type HashShardPair ¶
type HashShardPair[K comparable, V any] struct { // contains filtered or unexported fields }
type Tuple ¶
type Tuple[K comparable, V any] struct { Key K Val V }
Click to show internal directories.
Click to hide internal directories.