Versions in this module Expand all Collapse all v1 v1.1.1 Oct 29, 2019 Changes in this version + var ErrAlreadyProcessed = errors.New("already processed") + var ErrNotRequested = errors.New("not requested") + func CacheMisses() int64 + func CacheUnloads() int64 + func VerifyProof(rootHash types.Hash, key []byte, proofDb DatabaseReader) (value []byte, err error, nodes int) + type Database interface + type DatabaseReader interface + Get func(key []byte) (value []byte, err error) + Has func(key []byte) (bool, error) + type DatabaseWriter interface + Put func(key, value []byte) error + type FullNode struct + Children [17]NodeIntf + func (n *FullNode) String() string + func (z *FullNode) DecodeMsg(dc *msgp.Reader) (err error) + func (z *FullNode) EncodeMsg(en *msgp.Writer) (err error) + func (z *FullNode) MarshalMsg(b []byte) (o []byte, err error) + func (z *FullNode) Msgsize() (s int) + func (z *FullNode) UnmarshalMsg(bts []byte) (o []byte, err error) + type HashNode []byte + func (n HashNode) String() string + func (z *HashNode) DecodeMsg(dc *msgp.Reader) (err error) + func (z *HashNode) UnmarshalMsg(bts []byte) (o []byte, err error) + func (z HashNode) EncodeMsg(en *msgp.Writer) (err error) + func (z HashNode) MarshalMsg(b []byte) (o []byte, err error) + func (z HashNode) Msgsize() (s int) + type Iterator struct + Err error + Key []byte + Value []byte + func NewIterator(it NodeIterator) *Iterator + func (it *Iterator) Next() bool + type MissingNodeError struct + NodeHash types.Hash + Path []byte + func (err *MissingNodeError) Error() string + type Node interface + type NodeIntf struct + func (z *NodeIntf) DecodeMsg(dc *msgp.Reader) (err error) + func (z *NodeIntf) UnmarshalMsg(bts []byte) (o []byte, err error) + func (z NodeIntf) EncodeMsg(en *msgp.Writer) (err error) + func (z NodeIntf) MarshalMsg(b []byte) (o []byte, err error) + func (z NodeIntf) Msgsize() (s int) + type NodeIterator interface + Error func() error + Hash func() types.Hash + Leaf func() bool + LeafBlob func() []byte + LeafKey func() []byte + Next func(bool) bool + Parent func() types.Hash + Path func() []byte + func NewDifferenceIterator(a, b NodeIterator) (NodeIterator, *int) + func NewUnionIterator(iters []NodeIterator) (NodeIterator, *int) + type SecureTrie struct + func NewSecure(root types.Hash, db Database, cachelimit uint16) (*SecureTrie, error) + func (t *SecureTrie) Commit() (root types.Hash, err error) + func (t *SecureTrie) CommitTo(db DatabaseWriter) (root types.Hash, err error) + func (t *SecureTrie) Copy() *SecureTrie + func (t *SecureTrie) Delete(key []byte) + func (t *SecureTrie) Get(key []byte) []byte + func (t *SecureTrie) GetKey(shaKey []byte) []byte + func (t *SecureTrie) Hash() types.Hash + func (t *SecureTrie) NodeIterator(start []byte) NodeIterator + func (t *SecureTrie) Root() []byte + func (t *SecureTrie) TryDelete(key []byte) error + func (t *SecureTrie) TryGet(key []byte) ([]byte, error) + func (t *SecureTrie) TryUpdate(key, value []byte) error + func (t *SecureTrie) Update(key, value []byte) + type ShortNode struct + Key []byte + Val NodeIntf + func (n *ShortNode) String() string + func (z *ShortNode) DecodeMsg(dc *msgp.Reader) (err error) + func (z *ShortNode) EncodeMsg(en *msgp.Writer) (err error) + func (z *ShortNode) MarshalMsg(b []byte) (o []byte, err error) + func (z *ShortNode) Msgsize() (s int) + func (z *ShortNode) UnmarshalMsg(bts []byte) (o []byte, err error) + type SyncResult struct + Data []byte + Hash types.Hash + type Trie struct + func New(root types.Hash, db Database) (*Trie, error) + func (t *Trie) Commit() (root types.Hash, err error) + func (t *Trie) CommitTo(db DatabaseWriter) (root types.Hash, err error) + func (t *Trie) Delete(key []byte) + func (t *Trie) Get(key []byte) []byte + func (t *Trie) Hash() types.Hash + func (t *Trie) NodeIterator(start []byte) NodeIterator + func (t *Trie) Prove(key []byte, fromLevel uint, proofDb DatabaseWriter) error + func (t *Trie) Root() []byte + func (t *Trie) SetCacheLimit(l uint16) + func (t *Trie) TryDelete(key []byte) error + func (t *Trie) TryGet(key []byte) ([]byte, error) + func (t *Trie) TryUpdate(key, value []byte) error + func (t *Trie) Update(key, value []byte) + type TrieSync struct + func NewTrieSync(root types.Hash, database DatabaseReader, callback TrieSyncLeafCallback) *TrieSync + func (s *TrieSync) AddRawEntry(hash types.Hash, depth int, parent types.Hash) + func (s *TrieSync) AddSubTrie(root types.Hash, depth int, parent types.Hash, callback TrieSyncLeafCallback) + func (s *TrieSync) Commit(dbw DatabaseWriter) (int, error) + func (s *TrieSync) Missing(max int) []types.Hash + func (s *TrieSync) Pending() int + func (s *TrieSync) Process(results []SyncResult) (bool, int, error) + type TrieSyncLeafCallback func(leaf []byte, parent types.Hash) error + type ValueNode []byte + func (n ValueNode) String() string + func (z *ValueNode) DecodeMsg(dc *msgp.Reader) (err error) + func (z *ValueNode) UnmarshalMsg(bts []byte) (o []byte, err error) + func (z ValueNode) EncodeMsg(en *msgp.Writer) (err error) + func (z ValueNode) MarshalMsg(b []byte) (o []byte, err error) + func (z ValueNode) Msgsize() (s int)