Documentation ¶
Index ¶
- func FindMissingNodes(ns NodeStore, hash []byte) [][]byte
- func HashWritable(obj Writable, h crypto.Hash) []byte
- type Base
- type Child
- type HashableNode
- type Key
- type KeyReader
- type LocalNodeStore
- type MerkleSearchTree
- func (t *MerkleSearchTree) Get(key Key) Value
- func (t *MerkleSearchTree) Merge(with *MerkleSearchTree) (*MerkleSearchTree, error)
- func (t *MerkleSearchTree) NodeStore() NodeStore
- func (t *MerkleSearchTree) NumNodes() uint
- func (t *MerkleSearchTree) PrintInOrder()
- func (t *MerkleSearchTree) Put(key Key, val Value) *MerkleSearchTree
- func (t *MerkleSearchTree) RootHash() []byte
- func (t *MerkleSearchTree) WithNodeStore(store NodeStore) *MerkleSearchTree
- func (t *MerkleSearchTree) WithRoot(root []byte) *MerkleSearchTree
- type Node
- type NodeStore
- type UInt32
- type Value
- type ValueReader
- type Writable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindMissingNodes ¶
Types ¶
type LocalNodeStore ¶
type LocalNodeStore struct {
// contains filtered or unexported fields
}
func (*LocalNodeStore) Get ¶
func (ns *LocalNodeStore) Get(k []byte) *Node
func (*LocalNodeStore) Remove ¶
func (ns *LocalNodeStore) Remove(k []byte) NodeStore
func (*LocalNodeStore) Size ¶
func (ns *LocalNodeStore) Size() uint
type MerkleSearchTree ¶
type MerkleSearchTree struct {
// contains filtered or unexported fields
}
func NewLocalMST ¶
func NewLocalMST(base Base, hash crypto.Hash) *MerkleSearchTree
func NewMSTWithRoot ¶
func (*MerkleSearchTree) Get ¶
func (t *MerkleSearchTree) Get(key Key) Value
func (*MerkleSearchTree) Merge ¶
func (t *MerkleSearchTree) Merge(with *MerkleSearchTree) (*MerkleSearchTree, error)
func (*MerkleSearchTree) NodeStore ¶
func (t *MerkleSearchTree) NodeStore() NodeStore
func (*MerkleSearchTree) NumNodes ¶
func (t *MerkleSearchTree) NumNodes() uint
func (*MerkleSearchTree) PrintInOrder ¶
func (t *MerkleSearchTree) PrintInOrder()
func (*MerkleSearchTree) Put ¶
func (t *MerkleSearchTree) Put(key Key, val Value) *MerkleSearchTree
func (*MerkleSearchTree) RootHash ¶
func (t *MerkleSearchTree) RootHash() []byte
func (*MerkleSearchTree) WithNodeStore ¶
func (t *MerkleSearchTree) WithNodeStore(store NodeStore) *MerkleSearchTree
func (*MerkleSearchTree) WithRoot ¶
func (t *MerkleSearchTree) WithRoot(root []byte) *MerkleSearchTree
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents a node in a Merkle Search Tree It should always be true that len(children) > 0, i.e. empty nodes should not exist.
type NodeStore ¶
type NodeStore interface { Get([]byte) *Node Put(*Node) (NodeStore, []byte) Remove([]byte) NodeStore Size() uint }
func NewLocalNodeStore ¶
type ValueReader ¶
Click to show internal directories.
Click to hide internal directories.