redisdriver

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Version = 1

Version declares the version of unikv which this driver supports

Variables

View Source
var Descriptor = &unikv.DriverDescriptor{
	Name:        "redis",
	Constructor: Constructor,
}

Descriptor describes redis driver

Functions

func Constructor

func Constructor(prefix string, ctx unikv.DriverContextRaw) (unikv.Driver, error)

Constructor constructs new redis drivers

Types

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

Driver is the memorydriver

func NewDriver

func NewDriver(prefix string, ctx *DriverContext) (*Driver, error)

NewDriver creates a driver

func (*Driver) Close

func (d *Driver) Close() error

Close closes driver

func (*Driver) Get

func (d *Driver) Get(key string) (string, error)

Get gets data

func (*Driver) List added in v0.3.0

func (d *Driver) List() (interface{}, error)

List lists the keys

func (*Driver) Put

func (d *Driver) Put(key string, value string) error

Put puts data

func (*Driver) Unset

func (d *Driver) Unset(key string) error

Unset unsets data

type DriverContext

type DriverContext struct {
	Server     string `json:"server"`
	Options    []redis.DialOption
	RawOptions map[string]interface{} `json:"options"`
}

DriverContext is the context specificated for this driver

Jump to

Keyboard shortcuts

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