stor

package
v0.0.0-...-f22ec09 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultIteratorOptions = IteratorOptions{
	PrefetchValues: true,
	PrefetchSize:   100,
	Reverse:        false,
	AllVersions:    false,
}

Functions

This section is empty.

Types

type DB

type DB interface {
	NewTransaction(update bool) Transaction

	View(fn func(txn Transaction) error) error

	Update(fn func(txn Transaction) error) error
}

type Item

type Item interface {
	Key() []byte

	Value() ([]byte, error)
}

type Iterator

type Iterator interface {
	GetItem() Item

	Rewind()

	Seek(key []byte)

	Valid() bool

	ValidForPrefix(prefix []byte) bool

	Next()

	Close()
}

type IteratorOptions

type IteratorOptions struct {
	PrefetchValues bool
	PrefetchSize   int
	Reverse        bool
	AllVersions    bool
}

type Transaction

type Transaction interface {
	Get(key []byte) ([]byte, error)

	Set(key, value []byte) error

	SetWithTTL(key, value []byte, ttl time.Duration) error

	Del(key []byte) error

	IncrBy(key []byte, v int64) (int64, error)

	IncrByFloat(key []byte, v float64) (float64, error)

	NewIterator(ops IteratorOptions) Iterator

	Commit(callback func(error)) error

	Discard()
}

Jump to

Keyboard shortcuts

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