directory

package
v0.0.0-...-cf07509 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERR_CANT_BE_USED_ON_NON_DIRECTORY = errors.New("can't be used for not dir")

Functions

This section is empty.

Types

type File

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

func NewFile

func NewFile(
	parent *File,
	name string,
	is_directory bool,
	value interface{},
) *File

func NewTree

func NewTree() *File

func (*File) Delete

func (self *File) Delete(name string) error

func (*File) FindFile

func (self *File) FindFile(pattern string) ([]string, error)

func (*File) Get

func (self *File) Get(name string, not_found_is_error bool) (*File, error)

func (*File) GetByPath

func (self *File) GetByPath(
	pth []string,
	create_if_not_exists bool,
	last_element_is_file bool,
	value interface{},
) (*File, error)

func (*File) GetRoot

func (self *File) GetRoot() *File

func (*File) GetValue

func (self *File) GetValue() interface{}

func (*File) Have

func (self *File) Have(name string) (bool, error)

func (*File) IsDir

func (self *File) IsDir() bool

func (*File) ListDir

func (self *File) ListDir() ([]*File, []*File, error)

func (*File) ListDirNoSep

func (self *File) ListDirNoSep() ([]*File, error)

func (*File) MkDir

func (self *File) MkDir(
	name string,
	value interface{},
) (*File, error)

func (*File) MkFile

func (self *File) MkFile(
	name string,
	value interface{},
) (*File, error)

func (*File) Name

func (self *File) Name() string

func (*File) Parent

func (self *File) Parent() *File

func (*File) Path

func (self *File) Path() ([]*File, error)

func (*File) PathString

func (self *File) PathString() (string, error)

func (*File) SetValue

func (self *File) SetValue(value interface{})

func (*File) TreeString

func (self *File) TreeString() (string, error)

func (*File) Walk

func (self *File) Walk(
	target func(path, dirs, files []*File) error,
) error

type FileSlice

type FileSlice []*File

func (FileSlice) Len

func (self FileSlice) Len() int

func (FileSlice) Less

func (self FileSlice) Less(i, j int) bool

func (FileSlice) Swap

func (self FileSlice) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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