redis

package
v0.0.0-...-6a35e63 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClient

func CreateClient(cfg config.RedisConfig, db int) (*redis.Client, error)

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) SetEx

func (c KeyValueService) SetEx(key string, value []byte, expiration time.Duration) (err error)

SetEx cache in bytes with key with expiration

func (KeyValueService) SetHashAll

func (c KeyValueService) SetHashAll(key string, value map[string]interface{}) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL