storage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidOpts = errors.New("invalid options")
	ErrExist       = errors.New("key already exists")
	ErrNotExist    = errors.New("key does not exist")
	ErrInvalidInt  = errors.New("invalid int")
)

Functions

This section is empty.

Types

type Interface

type Interface interface {
	StringCmd

	Keys(pattern string) ([][]byte, error)
	Del(keys ...[]byte) (int, error)
	Expire(key []byte, dur time.Duration) error
	TTL(key []byte) (int64, error)
	DropAll() error
	Close() error
}

type SetOptions

type SetOptions struct {
	TTL time.Duration
	NX  bool
	XX  bool
}

type StringCmd

type StringCmd interface {
	Set(key, value []byte, opts SetOptions) error
	Get(key []byte) ([]byte, error)
	Add(key []byte, delta int) (int, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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