redis

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAddr = ":6379"

Variables

View Source
var (
	ErrRedisConfig = errors.New("missing redis config address")
	ErrIndexRange  = errors.New("K/V index out of range")
)

Functions

This section is empty.

Types

type Store

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

func New

func New(cfg *config.Config) (*Store, error)

func (*Store) Close

func (s *Store) Close()

func (*Store) Delete

func (s *Store) Delete(key string) error

func (*Store) Get

func (s *Store) Get(key string) (*stores.KVByte, error)

func (*Store) List

func (s *Store) List(prefix string) (stores.KVBytes, error)

List redis requires two operations in order to obtain the values from a key prefix. First we append the '*' needed by the `KEYS` lookup. Then use the return values as a variadic argument for the `MGET` request. See `fetchKeys` and `fetchVals` for implementation.

func (*Store) Register

func (s *Store) Register(cb func(kvb stores.KVBytes))

func (*Store) Set

func (s *Store) Set(key string, bts []byte) error

func (*Store) UpdateKeys

func (s *Store) UpdateKeys()

func (*Store) Updated

func (s *Store) Updated(kvs interface{})

func (*Store) Watch

func (s *Store) Watch() error

Jump to

Keyboard shortcuts

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