dirtree

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirTree

type DirTree struct {
	// Root is the root node of the directory tree
	Root    *DirTreeNode
	NodeMap map[string]*DirTreeNode // quickly find node when deleting
}

DirTree is a struct that represents a directory tree

func NewDirTree

func NewDirTree() *DirTree

NewDirTree Creates a new instance of DirTree

func (*DirTree) DebugDirTree

func (d *DirTree) DebugDirTree()

DebugDirTree Print the directory tree for debug

func (*DirTree) DeleteDir

func (d *DirTree) DeleteDir(path string) bool

func (*DirTree) DeleteFile

func (d *DirTree) DeleteFile(path string) bool

func (*DirTree) InsertFile

func (d *DirTree) InsertFile(path string) bool

func (*DirTree) MkDir

func (d *DirTree) MkDir(path string) bool

MkDir Inserts a new DirTreeNode into the DirTree

type DirTreeInterface

type DirTreeInterface interface {
	// InsertFile inserts a file into the directory tree
	InsertFile(path string) bool
	// DeleteFile deletes a file from the directory tree
	DeleteFile(filename string) bool
	// DeleteDir deletes a directory from the directory tree
	DeleteDir(path string) bool
	// MkDir creates a directory in the directory tree
	MkDir(path string) bool
}

type DirTreeNode

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

DirTreeNode is a struct that represents a directory tree node

Jump to

Keyboard shortcuts

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