redis: github.com/gokv/redis Index | Files

package redis

import "github.com/gokv/redis"

Package redis defines Store, a Redis driver that partially implements the Store interface defined in "github.com/gokv/store".

This package is a wrapper around "github.com/go-redis/redis".

Index

Package Files

doc.go store.go

Variables

var ErrDuplicateKey = errors.New("duplicate key")

type Store Uses

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

func New Uses

func New(address, password string) Store

func (Store) Add Uses

func (s Store) Add(_ context.Context, v json.Marshaler) (string, error)

Add persists a new object with a new UUIDv4 key. Err is non-nil in case of failure.

func (Store) Close Uses

func (s Store) Close() error

func (Store) Get Uses

func (s Store) Get(_ context.Context, k string, v json.Unmarshaler) (bool, error)

Get returns the value corresponding the key, and a nil error. If no match is found, returns (false, nil).

func (Store) Ping Uses

func (s Store) Ping(ctx context.Context) (err error)

func (Store) Set Uses

func (s Store) Set(_ context.Context, k string, v json.Marshaler) error

Set assigns the given value to the given key, possibly overwriting.

func (Store) SetWithDeadline Uses

func (s Store) SetWithDeadline(ctx context.Context, k string, v json.Marshaler, deadline time.Time) error

SetWithDeadline assigns the given value to the given key, possibly overwriting. The assigned key will clear after deadline.

func (Store) SetWithTimeout Uses

func (s Store) SetWithTimeout(_ context.Context, k string, v json.Marshaler, timeout time.Duration) error

SetWithTimeout assigns the given value to the given key, possibly overwriting. The assigned key will clear after timeout.

Package redis imports 6 packages (graph). Updated 2018-07-30. Refresh now. Tools for package owners.