Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Separator = string(filepath.Separator)
Functions ¶
func Build ¶
New will extract data from mapper base on following criteria 1. Try to get `fullpath` if any 2. Try to build fullpath with `paths`
func Copy ¶
func Copy(a, b FileSystem) error
func Next ¶
func Next(fs FileSystem, next ...string) []string
Types ¶
type FileSystem ¶
type FileSystem interface { // full absolute path from root directory Abs() string // directory path excluded current position Dirpath() string // upper directory name Dirname() string // filename with extension Basename() string // replace basename without extension Name() string // return relative path from input 'f' Relative(f FileSystem) string // full path separate by path separator Paths() []string Type() Type IsDir() bool IsFile() bool // create parent/current directory Build() error // read files/directories from current position ReadDir() ([]FileSystem, error) // create file reader Reader() (*os.File, error) // read content from current file path Read() ([]byte, error) // create file writer Writer() (*os.File, error) // write content to current file path Write(bs []byte) error // read file/directory information Stat() (*os.FileInfo, error) // modify permission of current file/directory Chmod(mode os.FileMode) error }
func NewDirectories ¶
func NewDirectories(paths [][]string) ([]FileSystem, error)
func NewDirectory ¶
func NewDirectory(paths []string) (FileSystem, error)
func NewFile ¶
func NewFile(paths []string) (FileSystem, error)
func NewFiles ¶
func NewFiles(paths [][]string) ([]FileSystem, error)
func ToFiles ¶
func ToFiles(input []FileSystem) ([]FileSystem, error)
ToFiles will resolve all directory into file The result of this function can be guarantee type file
Click to show internal directories.
Click to hide internal directories.