index

package
v1.4.3-dev Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2018 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	NOOP iterflag = iota
	STOP
)

Variables

View Source
var (
	ErrNodeNotFound = errors.New("Node not found")
)

Functions

This section is empty.

Types

type Element

type Element interface {
	// Returns the identifier of the node
	Self() string

	// Returns the string respresentation of the nodes parent (usually it's ID)
	Parent() string

	// Deep copy of the node
	Copy() Element
}

type Index

type Index struct {
	// contains filtered or unexported fields
}

func NewIndex

func NewIndex() *Index

func (*Index) Delete

func (i *Index) Delete(nodeID string) (Element, error)

Delete deletes a leaf node

func (*Index) Get

func (i *Index) Get(nodeID string) (Element, error)

Get returns a Copy of the named node.

func (*Index) HasChildren

func (i *Index) HasChildren(nodeID string) (bool, error)

HasChildren returns whether a node has children or not

func (*Index) Insert

func (i *Index) Insert(n Element) error

Insert inserts a copy of the given node to the tree under the given parent.

func (*Index) List

func (i *Index) List() ([]Element, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL