Documentation
¶
Index ¶
- Variables
- func Build(m, variable mapper.Mapper) (*wrapper, error)
- func BuildMFpMap(fp string) mapper.Mapper
- func BuildMPMap(paths ...[]string) mapper.Mapper
- func BuildMdFpMap(fp string) mapper.Mapper
- func BuildMdPMap(paths ...[]string) mapper.Mapper
- func BuildMfFpMap(fp string) mapper.Mapper
- func BuildMfPMap(paths ...[]string) mapper.Mapper
- func BuildSFpMap(fp string) mapper.Mapper
- func BuildSPMap(paths ...string) mapper.Mapper
- func BuildSdFpMap(fp string) mapper.Mapper
- func BuildSdPMap(paths ...string) mapper.Mapper
- func BuildSfFpMap(fp string) mapper.Mapper
- func BuildSfPMap(paths ...string) mapper.Mapper
- func Copy(a, b FileSystem) error
- func Next(fs FileSystem, next ...string) []string
- type FileSystem
- type Mode
- type Result
- type Type
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 BuildMFpMap ¶
Build multiple 'file or directory' full path map
func BuildMPMap ¶
Build multiple 'file or directory' path list map
func BuildMdFpMap ¶
Build multiple directory full path map
func BuildMdPMap ¶
Build multiple directory path list map
func BuildMfPMap ¶
Build multiple file path list map
func BuildSFpMap ¶
Build single 'file or directory' full path map
func BuildSPMap ¶
Build single 'file or directory' path list map
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.