Documentation ¶
Index ¶
- type BadgerCache
- func (b *BadgerCache) Close() error
- func (b *BadgerCache) Empty() error
- func (b *BadgerCache) EmptyByMatch(key string) error
- func (b *BadgerCache) Forget(key string) error
- func (b *BadgerCache) Get(key string) (interface{}, error)
- func (b *BadgerCache) GetConnection() any
- func (b *BadgerCache) Has(str string) (bool, error)
- func (b *BadgerCache) Set(key string, value interface{}, expires ...int) error
- type BadgerConfig
- type BadgerLogger
- type Cache
- type Entry
- type RedisCache
- func (r *RedisCache) Close() error
- func (c *RedisCache) Empty() error
- func (c *RedisCache) EmptyByMatch(key string) error
- func (c *RedisCache) Forget(key string) error
- func (c *RedisCache) Get(key string) (interface{}, error)
- func (r *RedisCache) GetConnection() any
- func (c *RedisCache) Has(key string) (bool, error)
- func (c *RedisCache) Set(key string, value interface{}, expires ...int) error
- type RedisConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadgerCache ¶
BadgerCache
TODO: add own logger
func CreateBadgerCache ¶
func CreateBadgerCache(c BadgerConfig, log ...*logger.Logger) (*BadgerCache, error)
func (*BadgerCache) Close ¶
func (b *BadgerCache) Close() error
func (*BadgerCache) Empty ¶
func (b *BadgerCache) Empty() error
func (*BadgerCache) EmptyByMatch ¶
func (b *BadgerCache) EmptyByMatch(key string) error
func (*BadgerCache) Forget ¶
func (b *BadgerCache) Forget(key string) error
func (*BadgerCache) Get ¶
func (b *BadgerCache) Get(key string) (interface{}, error)
func (*BadgerCache) GetConnection ¶
func (b *BadgerCache) GetConnection() any
type BadgerConfig ¶
type BadgerLogger ¶
BadgerLogger replaces the default badger logger with a zerolog logger
func (*BadgerLogger) Debugf ¶
func (bl *BadgerLogger) Debugf(msg string, v ...interface{})
func (*BadgerLogger) Errorf ¶
func (bl *BadgerLogger) Errorf(msg string, v ...interface{})
func (*BadgerLogger) Infof ¶
func (bl *BadgerLogger) Infof(msg string, v ...interface{})
func (*BadgerLogger) Warningf ¶
func (bl *BadgerLogger) Warningf(msg string, v ...interface{})
type Cache ¶
type Cache interface { // GetConnection returns the underlying connection which can be casted to the respective type GetConnection() any // Close closes the cache pool Close() error Has(key string) (bool, error) Get(key string) (interface{}, error) Set(key string, value interface{}, expiry ...int) error Forget(key string) error EmptyByMatch(key string) error Empty() error }
type RedisCache ¶
func CreateRedisCache ¶
func CreateRedisCache(c RedisConfig) (*RedisCache, error)
func (*RedisCache) Close ¶
func (r *RedisCache) Close() error
func (*RedisCache) Empty ¶
func (c *RedisCache) Empty() error
func (*RedisCache) EmptyByMatch ¶
func (c *RedisCache) EmptyByMatch(key string) error
func (*RedisCache) Forget ¶
func (c *RedisCache) Forget(key string) error
func (*RedisCache) Get ¶
func (c *RedisCache) Get(key string) (interface{}, error)
func (*RedisCache) GetConnection ¶
func (r *RedisCache) GetConnection() any
Click to show internal directories.
Click to hide internal directories.