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 GetKnotAndBranch(height uint64) (Knot, Branch) ContainsKnot(height uint64, hash types.Hash, flag bool) bool HeadHH() (uint64, types.Hash) TailHH() (uint64, types.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 PruneTree() []Branch FindBranch(height uint64, hash types.Hash) Branch ForkBranch(b Branch, height uint64, hash types.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 types.Hash) bool Size() uint64 }
Click to show internal directories.
Click to hide internal directories.