Documentation ¶
Index ¶
- type Map
- type ShardedMap
- type SyncMap
- type SyncStrSet
- func (s *SyncStrSet) Add(vals ...string)
- func (s *SyncStrSet) Contains(vals ...string) bool
- func (s *SyncStrSet) Get() string
- func (s *SyncStrSet) Intersect(s2 *SyncStrSet) *SyncStrSet
- func (s *SyncStrSet) Remove(x string)
- func (s *SyncStrSet) Size() int
- func (s *SyncStrSet) Walk(walkFn func(item string))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ShardedMap ¶
type ShardedMap struct {
// contains filtered or unexported fields
}
func NewShardedMap ¶
func NewShardedMap(nShards int) *ShardedMap
NewShardedMap returns a map with {nShards} shards. {nShards} must be a power of 2
func (*ShardedMap) Get ¶
func (sm *ShardedMap) Get(key string) interface{}
func (*ShardedMap) GetRand ¶
func (sm *ShardedMap) GetRand() interface{}
func (*ShardedMap) HasKey ¶
func (sm *ShardedMap) HasKey(key string) bool
func (*ShardedMap) Put ¶
func (sm *ShardedMap) Put(key string, val interface{})
func (*ShardedMap) Remove ¶
func (sm *ShardedMap) Remove(key string)
func (*ShardedMap) Size ¶
func (sm *ShardedMap) Size() int
type SyncMap ¶
func NewSyncMap ¶
func NewSyncMap() *SyncMap
type SyncStrSet ¶
SyncStrSet is a collection of unique values
func (*SyncStrSet) Add ¶
func (s *SyncStrSet) Add(vals ...string)
Add adds a value to the SyncStrSet
func (*SyncStrSet) Contains ¶
func (s *SyncStrSet) Contains(vals ...string) bool
Contains returns true if the value is present in the SyncStrSet
func (*SyncStrSet) Intersect ¶
func (s *SyncStrSet) Intersect(s2 *SyncStrSet) *SyncStrSet
Intersect returns the intersection of the two Sets
func (*SyncStrSet) Remove ¶
func (s *SyncStrSet) Remove(x string)
Remove removes element x from the set
func (*SyncStrSet) Size ¶
func (s *SyncStrSet) Size() int
Size returns the number of elements in the SyncStrSet
func (*SyncStrSet) Walk ¶
func (s *SyncStrSet) Walk(walkFn func(item string))
Walk iterates over the set, executing walkFn in a goroutine.
Click to show internal directories.
Click to hide internal directories.