Documentation
¶
Index ¶
- Constants
- Variables
- type Amount
- type Entry
- type Node
- type Test
- type Tree
- func (t *Tree) Get(parent *Node, index interface{})
- func (t *Tree) NewNode(index interface{}, value interface{}) (*Node, error)
- func (t *Tree) RecursiveFind(parent *Node, index interface{})
- func (t *Tree) SearchParentNodeAndAddChild(startNode *Node, parentIndex interface{}, childIndex interface{}, ...)
Constants ¶
View Source
const LeafsSize = 32
Variables ¶
View Source
var ( // ErrAmountUnderflow indicates the value is negative, which is not allowed. ErrAmountUnderflow = errors.New("amount: underflow (value is negative)") // ErrAmountInvalidString indicates the string is not valid when converted to amount. ErrAmountInvalidString = errors.New("amount: invalid string to amount") )
View Source
var ( ErrNodeNotFound = errors.New("ERROR: Node not found in tree") ErrCantCreateEmptyNode = errors.New("ERROR: Node index and value must not be empty") )
Functions ¶
This section is empty.
Types ¶
type Amount ¶
Amount implements an unsigned integer type with arbitrary/no upper bound. It is based on big.Int.
func NewAmountFromBigInt ¶
NewAmountFromBigInt returns a new Amount struct with given big.Int representation.
func NewAmountFromBytes ¶
func NewAmountFromString ¶
NewAmountFromString returns a new Amount struct given string representation of an integer in base 10.
func (*Amount) Sub ¶
Sub returns difference of a - b. Returns nil with ErrAmountUnderflow if the result is negative (a < b)
type Node ¶
type Node struct {
Entries []Entry
Parent *Node
Children []*Node
Height uint
// contains filtered or unexported fields
}
entries include the node's entry itself as the first entry and its childrens' entry following
Click to show internal directories.
Click to hide internal directories.