tree

package
v0.0.0-...-ee3d063 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Separator = "/"

Variables

View Source
var ErrUnknownSubType = errors.New("unknown sub-type")
View Source
var ErrUnsupported = errors.New("unsupported")
View Source
var ErrWrongPath = errors.New("wrong path")
View Source
var Extractors = map[string]func(msgpack.RawMessage) (Tree, error){}

Functions

This section is empty.

Types

type BasicTree

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

func NewBasicTree

func NewBasicTree(abs Path) *BasicTree

func (*BasicTree) Abs

func (tree *BasicTree) Abs() Path

func (*BasicTree) Create

func (tree *BasicTree) Create(path Path, subTree Tree, replace bool, ctx context.Context) (Tree, error)

func (*BasicTree) Find

func (tree *BasicTree) Find(path Path, ctx context.Context) (Tree, error)

func (*BasicTree) Leaves

func (tree *BasicTree) Leaves() []Tree

func (*BasicTree) List

func (tree *BasicTree) List(ctx context.Context) (map[string]Tree, error)

func (*BasicTree) Merge

func (tree *BasicTree) Merge(other Tree, ctx context.Context) error

func (*BasicTree) Remove

func (tree *BasicTree) Remove(path Path, recurse bool, ctx context.Context) error

func (*BasicTree) Transfer

func (tree *BasicTree) Transfer() (*Transfer, error)

type MountTree

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

func NewMountTree

func NewMountTree(root Tree) *MountTree

func (*MountTree) Abs

func (tree *MountTree) Abs() Path

func (*MountTree) Create

func (tree *MountTree) Create(path Path, subTree Tree, replace bool, ctx context.Context) (old Tree, err error)

func (*MountTree) Find

func (tree *MountTree) Find(path Path, ctx context.Context) (Tree, error)

func (*MountTree) Leaves

func (tree *MountTree) Leaves() []Tree

func (*MountTree) List

func (tree *MountTree) List(ctx context.Context) (map[string]Tree, error)

func (*MountTree) Merge

func (tree *MountTree) Merge(other Tree, ctx context.Context) error

func (*MountTree) Mount

func (tree *MountTree) Mount(subTree Tree, path Path, ctx context.Context) (Tree, error)

func (*MountTree) Remove

func (tree *MountTree) Remove(path Path, recurse bool, ctx context.Context) error

func (*MountTree) Transfer

func (tree *MountTree) Transfer() (*Transfer, error)

type Path

type Path []string

func Join

func Join(path ...Path) Path

func NewPath

func NewPath(path string) Path

func Rel

func Rel(path Path, base Path) (Path, error)

func (Path) IsRel

func (path Path) IsRel() bool

func (Path) Normalize

func (path Path) Normalize() Path

func (Path) Str

func (path Path) Str() string

type Transfer

type Transfer struct {
	SubType string             `msgpack:"sub_type"`
	Desc    msgpack.RawMessage `msgpack:"desc"`
}

type Tree

type Tree interface {
	Abs() Path
	Find(path Path, ctx context.Context) (Tree, error)
	Create(path Path, subTree Tree, replace bool, ctx context.Context) (old Tree, err error)
	Remove(path Path, recurse bool, ctx context.Context) error
	List(ctx context.Context) (map[string]Tree, error)
	Transfer() (*Transfer, error)
	Merge(other Tree, ctx context.Context) error
	Leaves() []Tree
}

func ExtractTransfer

func ExtractTransfer(transfer Transfer) (Tree, error)

Jump to

Keyboard shortcuts

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