Documentation ¶
Index ¶
- Variables
- func ConsumeCommonPrefix(left []uint8, right []uint8) [][]uint8
- func EncodeNode(node Node, codec InterfaceCodec) []uint8
- func GetCommonPrefixLength(left []uint8, right []uint8) int
- func GetNodeType(node Node) int
- func IsBranchNode(node interface{}) bool
- func IsEmptyNode(node interface{}) bool
- func IsExtensionNode(node Node) bool
- func IsKvNode(node interface{}) bool
- func IsLeafNode(node Node) bool
- func IsMultiSlice(value interface{}) bool
- func IsNull(node interface{}) bool
- func KeyEquals(key []uint8, test []uint8) bool
- func KeyStartsWith(key []uint8, partial []uint8) bool
- func NewFirstUint8ListFromNode(node Node) []uint8
- func NewUint8FromNode(value interface{}) []uint8
- func NewUint8ListFromNode(value interface{}) [][]uint8
- func Size(value interface{}) int
- type Checkpoint
- type EncodedPath
- type Impl
- func (i *Impl) DebugLog(ifcs ...interface{})
- func (i *Impl) Del(node Node, trieKey []uint8) Node
- func (i *Impl) DelBranchNode(inode Node, trieKey []uint8) Node
- func (i *Impl) DelKvNode(node Node, trieKey []uint8) Node
- func (i *Impl) Get(node Node, trieKey []uint8) Node
- func (i *Impl) GetBranchNode(node []Node, trieKey []uint8) Node
- func (i *Impl) GetKvNode(node []Node, trieKey []uint8) Node
- func (i *Impl) GetNode(hash interface{}) Node
- func (i *Impl) NodeToDBMapping(node Node) (interface{}, []uint8)
- func (i *Impl) NormalizeBranchNode(node []Node) Node
- func (i *Impl) PersistNode(node Node) Node
- func (i *Impl) Put(node Node, trieKey []uint8, value []uint8) Node
- func (i *Impl) PutBranchNode(node Node, trieKey []uint8, value []uint8) Node
- func (i *Impl) PutKvNode(node []Node, trieKey []uint8, value []uint8) Node
- func (i *Impl) SetDebug(enabled bool)
- func (i *Impl) SetRootNode(node Node)
- func (i *Impl) Snapshot(dest *TrieDB, fn db.ProgressCB, root []byte, keys int, percent int, depth int) int
- type InterfaceCodec
- type InterfaceTrieDB
- type Node
- type NodeEncoded
- type NodeType
- type RLPCodec
- type TrieCodec
- type TrieDB
- func (t *TrieDB) Close()
- func (t *TrieDB) DebugLog(i ...interface{})
- func (t *TrieDB) Del(key []uint8)
- func (t *TrieDB) Drop()
- func (t *TrieDB) Empty()
- func (t *TrieDB) Get(key []uint8) []uint8
- func (t *TrieDB) GetNode(hash []byte) Node
- func (t *TrieDB) GetRoot() []byte
- func (t *TrieDB) Maintain(fn *db.ProgressCB) error
- func (t *TrieDB) Open()
- func (t *TrieDB) Put(key, value []uint8)
- func (t *TrieDB) Rename(base, file string)
- func (t *TrieDB) SetDebug(enabled bool)
- func (t *TrieDB) SetRoot(rootHash []byte)
- func (t *TrieDB) Size() int
- func (t *TrieDB) Snapshot(dest *TrieDB, fn db.ProgressCB) int
- func (t *TrieDB) Transaction(fn func() bool) (bool, error)
- type TxDB
Constants ¶
This section is empty.
Variables ¶
var NodeTypeBranch = 3
NodeTypeBranch ...
var NodeTypeEmpty = 0
NodeTypeEmpty ...
var NodeTypeExtension = 2
NodeTypeExtension ...
var NodeTypeLeaf = 1
NodeTypeLeaf ...
Functions ¶
func ConsumeCommonPrefix ¶
ConsumeCommonPrefix ...
func GetCommonPrefixLength ¶
GetCommonPrefixLength ...
func NewFirstUint8ListFromNode ¶
NewFirstUint8ListFromNode ...
func NewUint8ListFromNode ¶
func NewUint8ListFromNode(value interface{}) [][]uint8
NewUint8ListFromNode ...
Types ¶
type Checkpoint ¶
type Checkpoint struct {
// contains filtered or unexported fields
}
Checkpoint ...
func (*Checkpoint) CommitCheckpoint ¶
func (c *Checkpoint) CommitCheckpoint() []byte
CommitCheckpoint ...
func (*Checkpoint) CreateCheckpoint ¶
func (c *Checkpoint) CreateCheckpoint() []byte
CreateCheckpoint ...
func (*Checkpoint) RevertCheckpoint ¶
func (c *Checkpoint) RevertCheckpoint() []byte
RevertCheckpoint ...
type EncodedPath ¶
type EncodedPath []uint8
EncodedPath ...
func ComputeExtensionKey ¶
func ComputeExtensionKey(nibbles []uint8) EncodedPath
ComputeExtensionKey ...
type Impl ¶
type Impl struct { Debug bool // contains filtered or unexported fields }
Impl ...
func (*Impl) DelBranchNode ¶
DelBranchNode ... NOTE: node must be NodeBranch NOTE: node branch must have 17 items, either single dimension array or nil
func (*Impl) GetBranchNode ¶
GetBranchNode ...
func (*Impl) NodeToDBMapping ¶
NodeToDBMapping ... NOTE: return can be single dimension or nil or same node back with no value
func (*Impl) NormalizeBranchNode ¶
NormalizeBranchNode ... NOTE: node can be either NodeKv | NodeBranch
func (*Impl) PersistNode ¶
PersistNode ... NOTE: Node should nil or single dimension array
func (*Impl) PutBranchNode ¶
PutBranchNode ...
type InterfaceCodec ¶
type InterfaceCodec interface { Encode(value interface{}) ([]uint8, error) Decode(encoded []byte, decoded interface{}) error }
InterfaceCodec ....
type InterfaceTrieDB ¶
type InterfaceTrieDB interface { GetRoot() []uint8 SetRoot(rootHash []uint8) Snapshot(dest *TrieDB, fn db.ProgressCB) int64 }
InterfaceTrieDB ....
type RLPCodec ¶
type RLPCodec struct {
Name string
}
RLPCodec ...
type TrieCodec ¶
type TrieCodec struct {
Name string
}
TrieCodec ...
type TrieDB ¶
type TrieDB struct { Debug bool // contains filtered or unexported fields }
TrieDB ...
func NewTrieDB ¶
func NewTrieDB(db db.TXDB, rootHash []byte, codec InterfaceCodec) *TrieDB
NewTrieDB ...