index

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

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

func New

func New(logger logger.Logger) *Index

func (*Index) Add

func (index *Index) Add(item *model.Item)

func (*Index) GetAllChildren

func (index *Index) GetAllChildren(route route.Route, expression func(item *model.Item) bool) []*model.Item

Get all children that match the given expression

func (*Index) GetAllItems

func (index *Index) GetAllItems() []*model.Item

GetAllItems returns all items in the index.

func (*Index) GetDirectChildren

func (index *Index) GetDirectChildren(route route.Route) []*model.Item

func (*Index) GetLeafes

func (index *Index) GetLeafes(route route.Route) []*model.Item

func (*Index) GetParent

func (index *Index) GetParent(childRoute route.Route) *model.Item

func (*Index) IsFileMatch

func (index *Index) IsFileMatch(r route.Route) (*model.File, bool)

func (*Index) IsMatch

func (index *Index) IsMatch(r route.Route) (item *model.Item, isMatch bool)

func (*Index) Remove

func (index *Index) Remove(itemRoute route.Route)

func (*Index) Root

func (index *Index) Root() *model.Item

func (*Index) Size

func (index *Index) Size() int

func (*Index) String

func (index *Index) String() string

type ItemTree

type ItemTree struct {
	tree.Tree
	// contains filtered or unexported fields
}

func (*ItemTree) Delete

func (itemTree *ItemTree) Delete(itemRoute route.Route) (bool, error)

func (*ItemTree) GetChildItems

func (itemTree *ItemTree) GetChildItems(route route.Route) []*model.Item

func (*ItemTree) GetItem

func (itemTree *ItemTree) GetItem(route route.Route) *model.Item

func (*ItemTree) Insert

func (itemTree *ItemTree) Insert(item *model.Item)

func (*ItemTree) Root

func (itemTree *ItemTree) Root() *model.Item

func (*ItemTree) Walk

func (itemTree *ItemTree) Walk(expression func(item *model.Item))

Walk visits every node in the current tree. Starting with the root, every child of the root and then recurses down the children.

Jump to

Keyboard shortcuts

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