Documentation
¶
Overview ¶
Package database provides KV database for meta-information
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("key not found")
)
Errors for Storage
Functions ¶
This section is empty.
Types ¶
type Batch ¶ added in v1.5.0
type Batch interface {
Writer
// Write closes batch and send accumulated writes to the database
Write() error
}
Batch provides a way to pack many writes.
type PrefixReader ¶ added in v1.5.0
type PrefixReader interface {
HasPrefix(prefix []byte) bool
ProcessByPrefix(prefix []byte, proc StorageProcessor) error
KeysByPrefix(prefix []byte) [][]byte
FetchByPrefix(prefix []byte) [][]byte
}
PrefixReader provides prefixed operations
type ReaderWriter ¶ added in v1.5.0
ReaderWriter combines Reader and Writer
type Storage ¶
type Storage interface {
Reader
Writer
PrefixReader
CreateBatch() Batch
OpenTransaction() (Transaction, error)
CreateTemporary() (Storage, error)
Open() error
Close() error
CompactDB() error
Drop() error
}
Storage is an interface to KV storage
type StorageProcessor ¶ added in v1.0.0
StorageProcessor is a function to process one single storage entry
type Transaction ¶ added in v1.5.0
Transaction provides isolated atomic way to perform updates.
Transactions might be expensive. Transaction should always finish with either Discard() or Commit()
Click to show internal directories.
Click to hide internal directories.