Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Shard ¶
type Shard struct { sync.RWMutex // Compose from sync.RWMutex // contains filtered or unexported fields }
Shard represents the data partition
type ShardedMap ¶
type ShardedMap []*Shard
ShardedMap is a *Shards slice of pointers to some number of Shard values. Each Shard includes a map[string]interface{} that contains that shard's data, and a composed sync.RWMutex so that it can be individually locked
func NewShardedMap ¶
func NewShardedMap(nshards int) ShardedMap
NewShardedMap is the constructor function for ShardedMap
func (ShardedMap) Get ¶
func (m ShardedMap) Get(key string) interface{}
Get is an example of a util method attached to ShardedMap that allows users to get a value of from a shard based on key
func (ShardedMap) Keys ¶
func (m ShardedMap) Keys() []string
Keys is used to establish locks on all of the tables concurrently.
func (ShardedMap) Set ¶
func (m ShardedMap) Set(key string, value interface{})
Set is an example of a util method attached to ShardedMap that allows users to set a value to the shards map based on key
Click to show internal directories.
Click to hide internal directories.