engine

package
v0.7.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Batch

type Batch interface {
	Put(key []byte, value []byte)
	Delete(key []byte)

	Commit() error
}

WriteBatch write batch

type Driver

type Driver interface {
	Get(key []byte) (value []byte, err error)
	Put(key []byte, value []byte) error
	Delete(key []byte) error
	Close() error

	NewIterator(startKey, endKey []byte) Iterator

	// 批量写入,提交时保证batch里的修改同时对外可见
	NewBatch() Batch

	GetSnapshot() (Snapshot, error)
}

Driver

type Iterator

type Iterator interface {
	// return false if over or error
	Next() bool

	Key() []byte
	Value() []byte

	Error() error

	// Release iterator使用完需要释放
	Release()
}

Iterator iterator

type Snapshot

type Snapshot interface {
	NewIterator(startKey, endKey []byte) Iterator
	Get(key []byte) ([]byte, error)

	// Release snapshot使用完需要释放
	Release()
}

Snapshot snapshot

Jump to

Keyboard shortcuts

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