Documentation ¶
Index ¶
- type ConcurrentDict
- func (c *ConcurrentDict) AddVersion(key string, delta int64) (val interface{}, exist bool)
- func (c *ConcurrentDict) Count() int
- func (c *ConcurrentDict) Delete(key string) (interface{}, int)
- func (c *ConcurrentDict) DeleteWithLock(key string) (val interface{}, result int)
- func (c *ConcurrentDict) ForEach(consumer Consumer)
- func (c *ConcurrentDict) Get(key string) (val interface{}, exist bool)
- func (c *ConcurrentDict) GetWithLock(key string) (val interface{}, exists bool)
- func (c *ConcurrentDict) Put(key string, val interface{}) int
- func (c *ConcurrentDict) PutIfAbsent(key string, val interface{}) int
- func (c *ConcurrentDict) PutIfAbsentWithLock(key string, val interface{}) int
- func (c *ConcurrentDict) PutIfExist(key string, val interface{}) int
- func (c *ConcurrentDict) PutIfExistWithLock(key string, val interface{}) int
- func (c *ConcurrentDict) PutWithLock(key string, val interface{}) int
- func (c *ConcurrentDict) RWLock(readKeys, writeKeys []string)
- func (c *ConcurrentDict) RWUnLock(readKeys, writeKeys []string)
- type Consumer
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 (*ConcurrentDict) AddVersion ¶
func (c *ConcurrentDict) AddVersion(key string, delta int64) (val interface{}, exist bool)
AddVersion 对key增加版本号
func (*ConcurrentDict) Delete ¶
func (c *ConcurrentDict) Delete(key string) (interface{}, int)
删除key
func (*ConcurrentDict) DeleteWithLock ¶
func (c *ConcurrentDict) DeleteWithLock(key string) (val interface{}, result int)
func (*ConcurrentDict) Get ¶
func (c *ConcurrentDict) Get(key string) (val interface{}, exist bool)
获取key保存的值
func (*ConcurrentDict) GetWithLock ¶
func (c *ConcurrentDict) GetWithLock(key string) (val interface{}, exists bool)
func (*ConcurrentDict) Put ¶
func (c *ConcurrentDict) Put(key string, val interface{}) int
保存key(insert or update)
func (*ConcurrentDict) PutIfAbsent ¶
func (c *ConcurrentDict) PutIfAbsent(key string, val interface{}) int
保存key( only insert)
func (*ConcurrentDict) PutIfAbsentWithLock ¶
func (c *ConcurrentDict) PutIfAbsentWithLock(key string, val interface{}) int
保存key( only insert)
func (*ConcurrentDict) PutIfExist ¶
func (c *ConcurrentDict) PutIfExist(key string, val interface{}) int
保存key (only update)
func (*ConcurrentDict) PutIfExistWithLock ¶
func (c *ConcurrentDict) PutIfExistWithLock(key string, val interface{}) int
保存key (only update)
func (*ConcurrentDict) PutWithLock ¶
func (c *ConcurrentDict) PutWithLock(key string, val interface{}) int
保存key(insert or update)
func (*ConcurrentDict) RWLock ¶
func (c *ConcurrentDict) RWLock(readKeys, writeKeys []string)
加【读写锁】
func (*ConcurrentDict) RWUnLock ¶
func (c *ConcurrentDict) RWUnLock(readKeys, writeKeys []string)
解【读写锁】
Click to show internal directories.
Click to hide internal directories.