storage

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2017 License: Apache-2.0 Imports: 2 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Separator = []byte{'/'}

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Key   []byte
	Value []byte
}

type IterOptions

type IterOptions struct {
	Reverse     bool
	FetchValues bool
	FillCache   bool
}

type Iterator

type Iterator interface {
	Rewind()
	Seek([]byte)
	Valid() bool
	ValidForPrefix(prefix []byte) bool
	Item() *Entry
	Next()
	Close() error
}

type MessageIterator

type MessageIterator interface {
	Rewind() *sgproto.Message
	Seek(sandflake.ID) *sgproto.Message
	Valid() bool
	Next() *sgproto.Message
	Close() error
}

type Storage

type Storage interface {
	Get(key []byte) ([]byte, error)
	Put(key, val []byte) error
	BatchPut(entries []*Entry) error
	Iter(*IterOptions) Iterator
	Close() error
	LastKeyForPrefix(prefix []byte) []byte
	LastKVForPrefix(prefix, suffix []byte) []byte
	ForEach(fn func(msg *sgproto.Message) error) error
	ForRange(min, max sandflake.ID, fn func(msg *sgproto.Message) error) error
	ForEachWALEntry(min []byte, fn func(msg *sgproto.Message) error) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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