rclone: github.com/rclone/rclone/fs/dirtree Index | Files

package dirtree

import "github.com/rclone/rclone/fs/dirtree"

Package dirtree contains the DirTree type which is used for building filesystem heirachies in memory.


Package Files


type DirTree Uses

type DirTree map[string]fs.DirEntries

DirTree is a map of directories to entries

func New Uses

func New() DirTree

New returns a fresh DirTree

func (DirTree) Add Uses

func (dt DirTree) Add(entry fs.DirEntry)

Add an entry to the tree it doesn't create parents

func (DirTree) AddDir Uses

func (dt DirTree) AddDir(entry fs.DirEntry)

AddDir adds a directory entry to the tree this creates the directory itself if required it doesn't create parents

func (DirTree) AddEntry Uses

func (dt DirTree) AddEntry(entry fs.DirEntry)

AddEntry adds the entry and creates the parents for it regardless of whether it is a file or a directory.

func (DirTree) CheckParent Uses

func (dt DirTree) CheckParent(root, dirPath string)

CheckParent checks that dirPath has a *Dir in its parent

func (DirTree) CheckParents Uses

func (dt DirTree) CheckParents(root string)

CheckParents checks every directory in the tree has *Dir in its parent

func (DirTree) Dirs Uses

func (dt DirTree) Dirs() (dirNames []string)

Dirs returns the directories in sorted order

func (DirTree) Find Uses

func (dt DirTree) Find(filePath string) (parentPath string, entry fs.DirEntry)

Find returns the DirEntry for filePath or nil if not found

func (DirTree) Prune Uses

func (dt DirTree) Prune(dirNames map[string]bool) error

Prune remove directories from a directory tree. dirNames contains all directories to remove as keys, with true as values. dirNames will be modified in the function.

func (DirTree) Sort Uses

func (dt DirTree) Sort()

Sort sorts all the Entries

func (DirTree) String Uses

func (dt DirTree) String() string

String emits a simple representation of the DirTree

Package dirtree imports 7 packages (graph) and is imported by 21 packages. Updated 2019-07-28. Refresh now. Tools for package owners.