taghier

package
v0.0.0-...-25250c4 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff struct {
	Add    []int
	Delete []int
}

func GetDiff

func GetDiff(current, desired []int) *Diff

TODO: move outside, since it just compares ints and has nothing to do with the taghier

type Registry

type Registry interface {
	// If GetParent returns 0, it means "no parent"
	GetParent(id int) (int, error)
}

type TagHier

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

func New

func New(reg Registry) *TagHier

func (*TagHier) Add

func (h *TagHier) Add(id int) error

func (*TagHier) GetAll

func (h *TagHier) GetAll() []int

func (*TagHier) GetLeafs

func (h *TagHier) GetLeafs() []int

func (*TagHier) GetParent

func (h *TagHier) GetParent(n int) int

func (*TagHier) GetPath

func (h *TagHier) GetPath(n int) []int

func (*TagHier) GetRoots

func (h *TagHier) GetRoots() []int

func (*TagHier) IsSubnode

func (h *TagHier) IsSubnode(id1, id2 int) (bool, error)

Returns true if id1 is a subnode of id2.

func (*TagHier) MakeCopy

func (h *TagHier) MakeCopy() *TagHier

func (*TagHier) Move

func (h *TagHier) Move(id, newParentID int, removeNewLeafs bool) error

Jump to

Keyboard shortcuts

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