redis

package
v0.0.0-...-ca399ba Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provisioner

type Provisioner interface {
	SetKV(string, string, time.Duration) error
	GetValue(string) (string, error)
	KeyExists(string) (bool, error)
	RemoveKey(string) (bool, error)
}

Provisioner is the interface to use for a provisioner based on redis

func New

func New(address string, password string, db int64) (Provisioner, error)

New creates a new redis Provisioner and returns it or an error if it fails

type ProvisionerRedis

type ProvisionerRedis struct {
	RedisClient *redis.Client
}

ProvisionerRedis provides the definition of redis provisioner

func (ProvisionerRedis) GetValue

func (e ProvisionerRedis) GetValue(key string) (string, error)

GetValue gets the value corresponding to the passed key from redis

func (ProvisionerRedis) KeyExists

func (e ProvisionerRedis) KeyExists(key string) (bool, error)

KeyExists checks if the passed key exists already in redis

func (ProvisionerRedis) RemoveKey

func (e ProvisionerRedis) RemoveKey(key string) (bool, error)

RemoveKey removes the passed key from redis

func (ProvisionerRedis) SetKV

func (e ProvisionerRedis) SetKV(key string, value string, expiration time.Duration) error

SetKV sets the value corresponding to the passed key in redis

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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