Documentation
¶
Index ¶
- Constants
- func CleanSlashPath(path string) string
- func CopyFile(src, dst string) error
- func Dir(path string) string
- func Exists(path string) (bool, error)
- func GenCSVBooknamePattern(dir, bookName string) string
- func GetDirectParentDirName(path string) string
- func HasSubdirPrefix(path string, subdirs []string) bool
- func IsSamePath(leftPath, rightPath string) bool
- func Join(elem ...string) string
- func ParseCSVBooknamePatternFrom(filename string) (string, error)
- func ParseCSVFilenamePattern(filename string) (bookName, sheetName string, err error)
- func RangeFilesByFormat(dir string, fmt format.Format, callback func(bookPath string) error) error
- func Rel(basepath string, targetpath string) (string, error)
- func RewriteSubdir(path string, subdirRewrites map[string]string) string
Constants ¶
const ( DefaultDirPerm fs.FileMode = 0755 // drwxr-xr-x DefaultFilePerm fs.FileMode = 0644 // -rw-r--r-- )
Variables ¶
This section is empty.
Functions ¶
func CleanSlashPath ¶
CleanSlashPath returns clean and slash path.
func CopyFile ¶
CopyFile copies a file from src to dst. If src and dst files exist, and are the same, then return success. Otherise, attempt to create a hard link between the two files. If that fails, copy the file contents from src to dst.
func Dir ¶
Dir returns all but the last element of path, typically the path's directory. The result is a clean and slash path.
func GenCSVBooknamePattern ¶
func GetDirectParentDirName ¶
GetDirectParentDirName returns the name of the direct parent directory of the given path. E.g.: "/parent/to/file.txt" -> "to".
func HasSubdirPrefix ¶
HasSubdirPrefix returns whether the given path has the given prefix.
func IsSamePath ¶
IsSamePath checks if two paths are same based on clean slash path.
func ParseCSVFilenamePattern ¶
func RangeFilesByFormat ¶
RangeFilesByFormat traveses the given directory with the given format, and invoke the given callback for each file.
Types ¶
This section is empty.