Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidDB indicates invalid operation attempted to Blockchain database ErrInvalidDB = errors.New("invalid DB operation") // ErrNotExist indicates certain item does not exist in Blockchain database ErrNotExist = errors.New("not exist in DB") // ErrAlreadyExist indicates certain item already exists in Blockchain database ErrAlreadyExist = errors.New("already exist in DB") )
Functions ¶
This section is empty.
Types ¶
type KVStore ¶
type KVStore interface { service.Service // Put insert or update a record identified by (namespace, key) Put(string, []byte, []byte) error // BatchPut insert or update a slice of records identified by (namespace, key) BatchPut(string, [][]byte, [][]byte) error // Put puts a record only if (namespace, key) doesn't exist, otherwise return ErrAlreadyExist PutIfNotExists(string, []byte, []byte) error // Get gets a record by (namespace, key) Get(string, []byte) ([]byte, error) // Delete deletes a record by (namespace, key) Delete(string, []byte) error }
KVStore is the interface of KV store.
Click to show internal directories.
Click to hide internal directories.