Documentation
¶
Index ¶
- type ConcurrentDict
- func (dict *ConcurrentDict) ForEach(consumer Consumer)
- func (dict *ConcurrentDict) Get(key string) (val interface{}, exists bool)
- func (dict *ConcurrentDict) Keys() []string
- func (dict *ConcurrentDict) Len() int
- func (dict *ConcurrentDict) Put(key string, val interface{}) (result int)
- func (dict *ConcurrentDict) PutIfAbsent(key string, val interface{}) (result int)
- func (dict *ConcurrentDict) PutIfExists(key string, val interface{}) (result int)
- func (dict *ConcurrentDict) RandomDistinctKeys(limit int) []string
- func (dict *ConcurrentDict) RandomKeys(limit int) []string
- func (dict *ConcurrentDict) Remove(key string) (result int)
- type Consumer
- type Dict
- type Shard
- type SimpleDict
- func (dict *SimpleDict) ForEach(consumer Consumer)
- func (dict *SimpleDict) Get(key string) (val interface{}, exists bool)
- func (dict *SimpleDict) Keys() []string
- func (dict *SimpleDict) Len() int
- func (dict *SimpleDict) Put(key string, val interface{}) (result int)
- func (dict *SimpleDict) PutIfAbsent(key string, val interface{}) (result int)
- func (dict *SimpleDict) PutIfExists(key string, val interface{}) (result int)
- func (dict *SimpleDict) RandomDistinctKeys(limit int) []string
- func (dict *SimpleDict) RandomKeys(limit int) []string
- func (dict *SimpleDict) Remove(key string) (result int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcurrentDict ¶
type ConcurrentDict struct {
// contains filtered or unexported fields
}
func MakeConcurrent ¶
func MakeConcurrent(shardCount int) *ConcurrentDict
func (*ConcurrentDict) ForEach ¶
func (dict *ConcurrentDict) ForEach(consumer Consumer)
* may not contains new entry inserted during traversal
func (*ConcurrentDict) Get ¶
func (dict *ConcurrentDict) Get(key string) (val interface{}, exists bool)
func (*ConcurrentDict) Keys ¶
func (dict *ConcurrentDict) Keys() []string
func (*ConcurrentDict) Len ¶
func (dict *ConcurrentDict) Len() int
func (*ConcurrentDict) Put ¶
func (dict *ConcurrentDict) Put(key string, val interface{}) (result int)
return the number of new inserted key-value
func (*ConcurrentDict) PutIfAbsent ¶
func (dict *ConcurrentDict) PutIfAbsent(key string, val interface{}) (result int)
return the number of updated key-value
func (*ConcurrentDict) PutIfExists ¶
func (dict *ConcurrentDict) PutIfExists(key string, val interface{}) (result int)
return the number of updated key-value
func (*ConcurrentDict) RandomDistinctKeys ¶
func (dict *ConcurrentDict) RandomDistinctKeys(limit int) []string
func (*ConcurrentDict) RandomKeys ¶
func (dict *ConcurrentDict) RandomKeys(limit int) []string
func (*ConcurrentDict) Remove ¶
func (dict *ConcurrentDict) Remove(key string) (result int)
return the number of deleted key-value
type Dict ¶
type Dict interface {
Get(key string) (val interface{}, exists bool)
Len() int
Put(key string, val interface{}) (result int)
PutIfAbsent(key string, val interface{}) (result int)
PutIfExists(key string, val interface{}) (result int)
Remove(key string) (result int)
ForEach(consumer Consumer)
Keys() []string
RandomKeys(limit int) []string
RandomDistinctKeys(limit int) []string
}
type SimpleDict ¶
type SimpleDict struct {
// contains filtered or unexported fields
}
func MakeSimple ¶
func MakeSimple() *SimpleDict
func (*SimpleDict) ForEach ¶
func (dict *SimpleDict) ForEach(consumer Consumer)
func (*SimpleDict) Get ¶
func (dict *SimpleDict) Get(key string) (val interface{}, exists bool)
func (*SimpleDict) Keys ¶
func (dict *SimpleDict) Keys() []string
func (*SimpleDict) Len ¶
func (dict *SimpleDict) Len() int
func (*SimpleDict) Put ¶
func (dict *SimpleDict) Put(key string, val interface{}) (result int)
func (*SimpleDict) PutIfAbsent ¶
func (dict *SimpleDict) PutIfAbsent(key string, val interface{}) (result int)
func (*SimpleDict) PutIfExists ¶
func (dict *SimpleDict) PutIfExists(key string, val interface{}) (result int)
func (*SimpleDict) RandomDistinctKeys ¶
func (dict *SimpleDict) RandomDistinctKeys(limit int) []string
func (*SimpleDict) RandomKeys ¶
func (dict *SimpleDict) RandomKeys(limit int) []string
func (*SimpleDict) Remove ¶
func (dict *SimpleDict) Remove(key string) (result int)
Click to show internal directories.
Click to hide internal directories.