dirTree

package
v0.0.0-...-3124197 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2017 License: BSD-3-Clause, BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MIN_KIDS = 100

Variables

This section is empty.

Functions

func Delete

func Delete(root *Node, dir string, file string, isDir bool) (*horcrux.Entry, error)

Delete dir/file with prefix dir in tree at root

func GetMeta

func GetMeta(root *Node) (*horcrux.Meta, error)

Walks the tree and gets the flat Meta data

func Insert

func Insert(root *Node, entry horcrux.Entry) error

Insert entry into tree rooted at root

func NumKids

func NumKids(node *Node) int

Number of kids for the node

func Update

func Update(root *Node, old horcrux.Entry, new horcrux.Entry) error

Update an entry in tree at root

Types

type Node

type Node struct {
	Entry horcrux.Entry
	// contains filtered or unexported fields
}

func Create

func Create(Meta *horcrux.Meta) (*Node, error)

Create a dirTree from the flat Meta info

func GetKid

func GetKid(node *Node, idx int) (Node, error)

Returns i-th kid for the node

func Lookup

func Lookup(node *Node, prefix string, file string) (*Node, error)

Lookup file with prefix in tree rooted at node. Returns the node correspondig to file

Jump to

Keyboard shortcuts

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