xmap

package
v0.0.0-...-7ba0316 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShardedMap

type ShardedMap[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewShardedMap

func NewShardedMap[K comparable, V any](shards int) *ShardedMap[K, V]

shards 指定分片数量

func NewShardedMapWithHasher

func NewShardedMapWithHasher[K comparable, V any](shards int, hasher hasher[K]) *ShardedMap[K, V]

func (*ShardedMap[K, V]) Clear

func (sm *ShardedMap[K, V]) Clear()

func (*ShardedMap[K, V]) Empty

func (sm *ShardedMap[K, V]) Empty() bool

func (*ShardedMap[K, V]) Get

func (sm *ShardedMap[K, V]) Get(key K) V

func (*ShardedMap[K, V]) Has

func (sm *ShardedMap[K, V]) Has(key K) bool

func (*ShardedMap[K, V]) Keys

func (sm *ShardedMap[K, V]) Keys() []K

func (*ShardedMap[K, V]) Put

func (sm *ShardedMap[K, V]) Put(key K, value V)

func (*ShardedMap[K, V]) Remove

func (sm *ShardedMap[K, V]) Remove(key K) V

func (*ShardedMap[K, V]) Size

func (sm *ShardedMap[K, V]) Size() int

func (*ShardedMap[K, V]) Values

func (sm *ShardedMap[K, V]) Values() []V

type SyncMap

type SyncMap[K comparable, V any] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSyncMap

func NewSyncMap[K comparable, V any]() *SyncMap[K, V]

func (*SyncMap[K, V]) Clear

func (sm *SyncMap[K, V]) Clear()

func (*SyncMap[K, V]) Empty

func (sm *SyncMap[K, V]) Empty() bool

func (*SyncMap[K, V]) Get

func (sm *SyncMap[K, V]) Get(key K) V

func (*SyncMap[K, V]) Has

func (sm *SyncMap[K, V]) Has(key K) bool

func (*SyncMap[K, V]) Keys

func (sm *SyncMap[K, V]) Keys() []K

func (*SyncMap[K, V]) Put

func (sm *SyncMap[K, V]) Put(key K, value V)

func (*SyncMap[K, V]) Remove

func (sm *SyncMap[K, V]) Remove(key K) V

func (*SyncMap[K, V]) Size

func (sm *SyncMap[K, V]) Size() int

func (*SyncMap[K, V]) Values

func (sm *SyncMap[K, V]) Values() []V

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL