Documentation
¶
Index ¶
- Constants
- func CopyFile(srcPath, dstPath string) error
- func CopyFolder(srcPath, dstPath string) error
- func FileExists(filename string) bool
- func FindFiles(directory string, options ...FindFileOptions) ([]string, error)
- func RemoveAllUnderHome(path string) error
- func Rename(oldPath, newPath string) error
- func ValidateFolderCopy(srcPath, dstPath string, exclude ...string) ([]string, error)
- type FindFileOptions
Constants ¶
View Source
const ( JSONFile = "json" ProtoFile = "proto" YAMLFile = "yaml" YMLFile = "yml" )
Variables ¶
This section is empty.
Functions ¶
func CopyFolder ¶
CopyFolder copy the source folder to the destination folder.
func FileExists ¶
FileExists check if a file from a given path exists.
func FindFiles ¶
func FindFiles(directory string, options ...FindFileOptions) ([]string, error)
FindFiles searches for files in the specified directory based on the given options. It supports filtering files by extension and prefix. Returns a list of matching files or an error.
func RemoveAllUnderHome ¶
Types ¶
type FindFileOptions ¶
type FindFileOptions func(o *findFileOptions)
func WithExtension ¶
func WithExtension(extension string) FindFileOptions
WithExtension adds a file extension to the search options. It can be called multiple times to add multiple extensions.
func WithPrefix ¶
func WithPrefix(prefix string) FindFileOptions
Click to show internal directories.
Click to hide internal directories.