Documentation
¶
Index ¶
- Constants
- func WithCacheCapacity(size int) cmapOptionFunc
- func WithHashFunc(hashFunc CMapHashFunc) cmapOptionFunc
- func WithSlabSize(size int) cmapOptionFunc
- type CMap
- func (c *CMap) Get(key string) (interface{}, bool)
- func (c *CMap) GetRLocked(key string, fn GetFunc) interface{}
- func (c *CMap) Keys() []string
- func (c *CMap) Len() int
- func (c *CMap) Remove(key string) (interface{}, bool)
- func (c *CMap) RemoveIf(key string, fn RemoveIfFunc) (removed bool)
- func (c *CMap) Set(key string, value interface{})
- func (c *CMap) SetIf(key string, fn SetIfFunc)
- func (c *CMap) SetIfAbsent(key string, value interface{}) (updated bool)
- func (c *CMap) Upsert(key string, fn UpsertFunc) (newValue interface{})
- type CMapHashFunc
- type Cache
- type GetFunc
- type RemoveIfFunc
- type SetIfFunc
- type UpsertFunc
Constants ¶
View Source
const ( AppName string = "cmap" Version string = "1.0.3" )
Variables ¶
This section is empty.
Functions ¶
func WithCacheCapacity ¶
func WithCacheCapacity(size int) cmapOptionFunc
func WithHashFunc ¶
func WithHashFunc(hashFunc CMapHashFunc) cmapOptionFunc
func WithSlabSize ¶
func WithSlabSize(size int) cmapOptionFunc
Types ¶
type CMap ¶
type CMap struct {
// contains filtered or unexported fields
}
func (*CMap) GetRLocked ¶ added in v1.0.2
func (*CMap) SetIfAbsent ¶
func (*CMap) Upsert ¶
func (c *CMap) Upsert(key string, fn UpsertFunc) (newValue interface{})
type CMapHashFunc ¶
func NewFNV64HashFun ¶
func NewFNV64HashFun() CMapHashFunc
func NewXXHashFunc ¶
func NewXXHashFunc() CMapHashFunc
type GetFunc ¶ added in v1.0.2
type GetFunc func(exists bool, value interface{}) (processedValue interface{})
type RemoveIfFunc ¶
type UpsertFunc ¶
type UpsertFunc func(exists bool, oldValue interface{}) (newValue interface{})
Click to show internal directories.
Click to hide internal directories.