tree

package
v0.0.1-rc4 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: ISC Imports: 10 Imported by: 0

Documentation

Overview

This package provides operations on the tree data structure defined in the api package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepCopyInto

func DeepCopyInto(src, dst *api.Node)

DeepCopyInto copies the tree rooted at src into dst.

func Flatten

func Flatten(tree api.Tree) (flat api.Flat)

Flatten returns a flat representation of the tree.

func FromSource

func FromSource(source api.Source) (tree api.Tree, err error)

FromSource returns a tree representation of the source.

func Get

func Get(tree api.Tree, path string) *api.Node

Get returns the node at the given path.

func Insert

func Insert(tree api.Tree, dir string, stat api.Stat) error

Insert inserts an individual node into the tree. If any parent of the node does not exist, it will be created with default values. If the node already exists, it will be overwritten.

func Unflatten

func Unflatten(flat api.Flat) (tree api.Tree)

Unflatten returns a tree representation of the flat.

Types

type TreeFS

type TreeFS struct {
	api.Tree
	api.CASReader
}

TreeFS implements io/fs.FS and io/fs.ReadDirFS for a tree.

func (*TreeFS) Open

func (t *TreeFS) Open(name string) (fs.File, error)

func (*TreeFS) ReadDir

func (t *TreeFS) ReadDir(name string) ([]fs.DirEntry, error)

func (*TreeFS) Record

func (t *TreeFS) Record(w io.Writer) error

Record records all file contents of the tree to a io.Writer. The format is compatible with the recorder protocol.

Jump to

Keyboard shortcuts

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