Documentation ¶
Index ¶
- Variables
- func CleanPath(path, separator string) string
- func SplitPath(rootPath, separator, path string) []string
- type AddMismatchedIsDir
- type Entry
- type Tree
- func (t *Tree) Add(path string, isDir bool) error
- func (t *Tree) Copy() []*Entry
- func (t *Tree) Exists(path string) (isDir bool, exists bool)
- func (t *Tree) IsLocked(path string) error
- func (t *Tree) Lock(path string) error
- func (t *Tree) Remove(path string) error
- func (t *Tree) Unlock(path string) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type AddMismatchedIsDir ¶
func (*AddMismatchedIsDir) Error ¶
func (e *AddMismatchedIsDir) Error() string
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
func (*Tree) Add ¶
Add adds the path to the tree. isDir specifies if the leaf is a directory. Any directories in the path will be created if they do not exist. Returns ErrExist if attempting to add a leaf that already exists. Returns AddMismatchedIsDir if mismatched isDir values are encountered.
func (*Tree) IsLocked ¶
IsLocked takes a path and returns one of three errors depending on the status of the path: - ErrLocked if the path is locked. - ErrUnlocked if the path is unlocked. - ErrNotExist if the path does not exist.
func (*Tree) Lock ¶
Lock locks the given path. Returns true if the operation was successful. The error will be ErrNotExist if the path does not exist.
Click to show internal directories.
Click to hide internal directories.