Documentation ¶
Index ¶
- Constants
- func WithCacheCapacity(size int) cacheOptFunc
- func WithCleanupInterval(intval time.Duration) cacheOptFunc
- func WithDefaultCacheCapacity() cacheOptFunc
- func WithDefaultExpiration(dur time.Duration) cacheOptFunc
- func WithDefaultSlabSize() cacheOptFunc
- func WithDeleted(cb DeletedCb) cacheOptFunc
- func WithEvicted(cb EvictedCb) cacheOptFunc
- func WithSlabSize(size int) cacheOptFunc
- type Cache
- func (c *Cache) Count() int
- func (c *Cache) Delete(key string) (interface{}, bool)
- func (c *Cache) DeleteExpired()
- func (c *Cache) Get(key string) (interface{}, bool)
- func (c *Cache) Set(key string, value interface{}, dur time.Duration)
- func (c *Cache) SetDefault(key string, value interface{})
- func (c *Cache) SetNoExpire(key string, value interface{})
- func (c *Cache) Upsert(key string, dur time.Duration, cb UpsertCb)
- func (c *Cache) UpsertDefault(key string, cb UpsertCb)
- func (c *Cache) UpsertNoExpire(key string, cb UpsertCb)
- type CacheGetSetDelete
- type CacheGetSetUpsertDelete
- type CacheItemCount
- type CacheItemDeleteExpire
- type DeletedCb
- type EvictedCb
- type UpsertCb
Constants ¶
View Source
const ( AppName string = "concache" Version string = "1.0.3" )
Variables ¶
This section is empty.
Functions ¶
func WithCacheCapacity ¶ added in v1.0.2
func WithCacheCapacity(size int) cacheOptFunc
func WithCleanupInterval ¶ added in v1.0.2
func WithDefaultCacheCapacity ¶ added in v1.0.2
func WithDefaultCacheCapacity() cacheOptFunc
func WithDefaultExpiration ¶ added in v1.0.2
func WithDefaultSlabSize ¶ added in v1.0.2
func WithDefaultSlabSize() cacheOptFunc
func WithDeleted ¶ added in v1.0.2
func WithDeleted(cb DeletedCb) cacheOptFunc
func WithEvicted ¶ added in v1.0.2
func WithEvicted(cb EvictedCb) cacheOptFunc
func WithSlabSize ¶ added in v1.0.2
func WithSlabSize(size int) cacheOptFunc
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) DeleteExpired ¶
func (c *Cache) DeleteExpired()
func (*Cache) SetDefault ¶
func (*Cache) SetNoExpire ¶
func (*Cache) UpsertDefault ¶
func (*Cache) UpsertNoExpire ¶
type CacheGetSetDelete ¶
type CacheGetSetUpsertDelete ¶
type CacheGetSetUpsertDelete interface { CacheGetSetDelete Upsert(key string, dur time.Duration, cb UpsertCb) }
type CacheItemCount ¶
type CacheItemCount interface {
Count() int
}
type CacheItemDeleteExpire ¶
type CacheItemDeleteExpire interface {
DeleteExpired()
}
Click to show internal directories.
Click to hide internal directories.