Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyTree = errors.New("empty tree") ErrElementNotFound = errors.New("element not found") )
View Source
var ( ErrInvalidIndex = errors.New("invalid index") ErrListNodeNotFound = errors.New("list node not found") ErrEmptyList = errors.New("empty list") )
View Source
var (
ErrDuplicateElement = errors.New("duplicate element")
)
View Source
var (
ErrTokenizer = FragmentTreeError("not a simple URL")
)
Functions ¶
Types ¶
type BinaryTree ¶
type BinaryTree struct {
// contains filtered or unexported fields
}
A binary search tree
func (*BinaryTree) AddNode ¶
func (b *BinaryTree) AddNode(val string) (res *string, err error)
Add a node to the tree.
func (*BinaryTree) GetNode ¶
func (b *BinaryTree) GetNode(key string) (res *string, err error)
Retrieve a node by index
func (*BinaryTree) RemoveNode ¶
func (b *BinaryTree) RemoveNode(key string) (err error)
Remove a node by key from the tree. (oh yeah, it rhymes, deal with it).
func (*BinaryTree) Size ¶
func (b *BinaryTree) Size() int
Return the size of the tree (nr. of nodes).
func (*BinaryTree) String ¶
func (b *BinaryTree) String() string
A string representation of the binary tree.
func (*BinaryTree) Walk ¶
func (b *BinaryTree) Walk(f func(Node))
Iterate over each node in the tree and perform the function f.
type BinaryTreeNode ¶
type BinaryTreeNode struct {
// contains filtered or unexported fields
}
func (BinaryTreeNode) Value ¶
func (b BinaryTreeNode) Value() string
type FragmentTree ¶
type FragmentTree struct {
// contains filtered or unexported fields
}
The data structure that allows for lower storage requirements by fragmenting urls and storing each fragment as a key. For this to be succesfull, a large number of links need to stored (compared to a simple string list.
func NewFragmentTree ¶
func NewFragmentTree() (t *FragmentTree, err error)
Make a new FragmentTree object.
type FragmentTreeError ¶
type FragmentTreeError string
func (FragmentTreeError) Error ¶
func (e FragmentTreeError) Error() string
type List ¶
type List struct {
// contains filtered or unexported fields
}
func (*List) RemoveNode ¶
Remove the node from the list.
Click to show internal directories.
Click to hide internal directories.