Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCannotSetPlaceholder = errors.New("mapstore.Interface: ms.Set: cannot set the value of the placeholder ([]byte{0,0,0...})")
ErrCannotSetPlaceholder is the error returned when Interface.Set is called with the placeholder key.
var ErrDeleteNotSupported = errors.New("mapstore.Interface: ms.Delete not implemented")
ErrDeleteNotSupported is the error returned when Interface.Delete is not implemented.
var ErrSkipBranch = errors.New("<ErrSkipBranch>")
ErrSkipBranch is returned by NodeHandler to indicate that children of the current node do not need to be traversed. This error will be ignored if returned by LeafHandler.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base interface { Get(key []byte) ([]byte, error) Set(key, value []byte) error Delete(key []byte) error Size() int ProcessKeys(keys []KeyInfo) error }
Base is a simplified MapStore. It implements lazyledger/smt.MapStore and can be converted into a dt-compatible MapStore with Wrap(). Base.Delete does not need to be implemented (it may return ErrDeleteNotImplemented).
type Interface ¶
type Interface interface { Get(key []byte) ([]byte, error) Set(key, value []byte) error Delete(key []byte) error Size() int HashSize() int Placeholder() []byte TraverseNodes(root []byte, nodeFn NodeHandler, leafFn LeafHandler) error SaveNodesForRoot(root []byte) error }
Interface is the interface implemented by all dt-compatible MapStores. It is an extension of Base.
type LeafHandler ¶
LeafHandler is used in TraverseNodes.
type NodeHandler ¶
NodeHandler is used in TraverseNodes.