Documentation ¶
Index ¶
- func CheckTree(t Tree) error
- func CheckTreeRing(tr Tree) error
- func CheckTreeSize(t Tree) error
- func NewTree() *tree
- func PrintBranchInfo(b Branch) map[string]interface{}
- func PrintTree(b Tree) map[string]interface{}
- func PrintTreeJson(b Tree) string
- type Branch
- type BranchBase
- type BranchType
- type Knot
- type Tree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTree ¶
func NewTree() *tree
Types ¶
type Branch ¶
type Branch interface { BranchBase GetKnot(height uint64, flag bool) Knot GetHash(height uint64, flag bool) *common.Hash GetKnotAndBranch(height uint64) (Knot, Branch) GetHashAndBranch(height uint64) (*common.Hash, Branch) ContainsKnot(height uint64, hash common.Hash, flag bool) bool HeadHH() (uint64, common.Hash) TailHH() (uint64, common.Hash) Linked(root Branch) bool Size() uint64 Root() Branch ID() string Type() BranchType }
type BranchBase ¶
type Tree ¶
type Tree interface { Root() Branch Main() Branch Branches() map[string]Branch Brothers(b Branch) []Branch PruneTree() []Branch FindBranch(height uint64, hash common.Hash) Branch ForkBranch(b Branch, height uint64, hash common.Hash) Branch RootHeadAdd(k Knot) error AddHead(b Branch, k Knot) error RemoveTail(b Branch, k Knot) error AddTail(b Branch, k Knot) error SwitchMainTo(b Branch) error SwitchMainToEmpty() error FindForkPointFromMain(target Branch) (Knot, Knot, error) Init(name string, root Branch) error Exists(hash common.Hash) bool Size() uint64 }
Click to show internal directories.
Click to hide internal directories.