Documentation ¶
Index ¶
- func CreateClient(cfg config.RedisConfig, db int) (*redis.Client, error)
- type KeyValueService
- func (c KeyValueService) Delete(key string) (err error)
- func (c KeyValueService) Get(key string) (result []byte, err error)
- func (c KeyValueService) GetHashAll(key string) (map[string]string, error)
- func (c KeyValueService) Set(key string, value []byte) (err error)
- func (c KeyValueService) SetEx(key string, value []byte, expiration time.Duration) (err error)
- func (c KeyValueService) SetHashAll(key string, value map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateClient ¶
CreateClient from RedisConfig and DB number
Types ¶
type KeyValueService ¶
type KeyValueService struct {
// contains filtered or unexported fields
}
KeyValueService implements cockpit.KeyValueService interface using redis
func NewKeyValueService ¶
func NewKeyValueService(redisClient *redis.Client) *KeyValueService
NewKeyValueService construct a new KeyValueService from redis client
func (KeyValueService) Delete ¶
func (c KeyValueService) Delete(key string) (err error)
Delete cache in bytes with key without expiration
func (KeyValueService) Get ¶
func (c KeyValueService) Get(key string) (result []byte, err error)
Get a cache in bytes from a key
func (KeyValueService) GetHashAll ¶
func (c KeyValueService) GetHashAll(key string) (map[string]string, error)
func (KeyValueService) Set ¶
func (c KeyValueService) Set(key string, value []byte) (err error)
Set cache in bytes with key without expiration
func (KeyValueService) SetHashAll ¶
func (c KeyValueService) SetHashAll(key string, value map[string]interface{}) error
Click to show internal directories.
Click to hide internal directories.