Documentation
¶
Index ¶
- type BadgerCache
- func (c *BadgerCache) Clean() error
- func (c *BadgerCache) Del(key string) error
- func (c *BadgerCache) Get(key string) ([]byte, error)
- func (c *BadgerCache) PrefixScanKey(prefixStr string) ([]string, error)
- func (c *BadgerCache) Set(key string, value interface{}) error
- func (c *BadgerCache) SetNX(key string, value interface{}) error
- func (c *BadgerCache) SetWithTTL(key string, value string, duration time.Duration) error
- type Cache
- type MemoryCache
- type OptFunc
- type Options
- type RedisCache
- type RedisOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadgerCache ¶
type BadgerCache struct {
// contains filtered or unexported fields
}
func NewBadgerCache ¶
func NewBadgerCache(dir string, inMemory bool) (*BadgerCache, error)
func NewBadgerCacheDB ¶
func NewBadgerCacheDB(db *badger.DB) *BadgerCache
func (*BadgerCache) Clean ¶
func (c *BadgerCache) Clean() error
func (*BadgerCache) Del ¶
func (c *BadgerCache) Del(key string) error
func (*BadgerCache) PrefixScanKey ¶
func (c *BadgerCache) PrefixScanKey(prefixStr string) ([]string, error)
func (*BadgerCache) Set ¶
func (c *BadgerCache) Set(key string, value interface{}) error
func (*BadgerCache) SetNX ¶
func (c *BadgerCache) SetNX(key string, value interface{}) error
func (*BadgerCache) SetWithTTL ¶
type Cache ¶
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
func NewMemoryCache ¶
func NewMemoryCache() *MemoryCache
func (*MemoryCache) Del ¶
func (c *MemoryCache) Del(key string) error
func (*MemoryCache) Set ¶
func (c *MemoryCache) Set(key string, value interface{}) error
func (*MemoryCache) SetWithTTL ¶
type OptFunc ¶
func WithCacheDir ¶
func WithInMemory ¶
func WithInMemory() OptFunc
func WithRedis ¶
func WithRedis(redis *RedisOptions) OptFunc
func WithRedisCmdable ¶
func WithRedisCmdable(redisCmdable redis.Cmdable) OptFunc
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func NewRedisCache ¶
func NewRedisCache(options *RedisOptions) (*RedisCache, error)
func NewRedisCacheDB ¶
func NewRedisCacheDB(client redis.Cmdable) (*RedisCache, error)
func (*RedisCache) Del ¶
func (s *RedisCache) Del(key string) error
func (*RedisCache) Set ¶
func (s *RedisCache) Set(key string, value interface{}) error
func (*RedisCache) SetWithTTL ¶
Click to show internal directories.
Click to hide internal directories.