Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyExists = errors.New("already exists")
ErrAlreadyExists is returned when a pre-image already exists in the KV store.
View Source
var ErrNotFound = errors.New("not found")
ErrNotFound is returned when a pre-image cannot be found in the KV store.
Functions ¶
This section is empty.
Types ¶
type DiskKV ¶
DiskKV is a disk-backed key-value store, every key-value pair is a hex-encoded .txt file, with the value as content. DiskKV is safe for concurrent use with a single DiskKV instance. DiskKV is not safe for concurrent use between different DiskKV instances of the same disk directory: a Put needs to be completed before another DiskKV Get retrieves the values.
type KV ¶
type KV interface {
// Put puts the pre-image value v in the key-value store with key k.
// It returns ErrAlreadyExists when the key already exists.
// KV store implementations may return additional errors specific to the KV storage.
Put(k common.Hash, v []byte) error
// Get retrieves the pre-image with key k from the key-value store.
// It returns ErrNotFound when the pre-image cannot be found.
// KV store implementations may return additional errors specific to the KV storage.
Get(k common.Hash) ([]byte, error)
}
KV is a Key-Value store interface for pre-image data.
Click to show internal directories.
Click to hide internal directories.