blob

package
Version: v0.0.0-...-40d92e5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func Var

func Var(fl *flag.FlagSet, name, usage string) func(context.Context, Logger) (Storable, error)

Types

type Loc

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

func NewMock

func NewMock(base, ns string, l Logger) Loc

func (Loc) Get

func (loc Loc) Get(ctx context.Context, key string, v interface{}) error

func (Loc) Set

func (loc Loc) Set(ctx context.Context, key string, v interface{}) error

type Logger

type Logger interface {
	Printf(format string, v ...interface{})
}

type Storable

type Storable interface {
	Get(ctx context.Context, key string, v interface{}) error
	Set(ctx context.Context, key string, v interface{}) error
}

type Store

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

func New

func New(ctx context.Context, urlstr string, l Logger) (*Store, error)

New opens a Bucket at the provided URL

func (*Store) Get

func (store *Store) Get(ctx context.Context, key string, getv interface{}) (err error)

Get calls GET in Redis and converts values from JSON bytes

func (*Store) Set

func (store *Store) Set(ctx context.Context, key string, setv interface{}) (err error)

Set converts values to JSON bytes and calls SET in Redis

Jump to

Keyboard shortcuts

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