Documentation ¶
Index ¶
- func MkdirAllReset(path string, perm fs.FileMode) error
- func Save(f fs.FS, path string) error
- func SaveBytesTemp(data []byte, prefix string, perm os.FileMode) (path string, cleanup func(), err error)
- func SaveTemp(f fs.FS) (path string, cleanup func(), err error)
- func Search(path, pattern string) ([]string, error)
- func Watch(ctx context.Context, paths []string, options ...WatcherOption) error
- type WatcherOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MkdirAllReset ¶
MkdirAllReset is same as os.MkdirAll except it deletes path before creating it.
func SaveBytesTemp ¶
func SaveBytesTemp(data []byte, prefix string, perm os.FileMode) (path string, cleanup func(), err error)
SaveBytesTemp saves data bytes to a temporary file location at path.
func SaveTemp ¶
SaveTemp saves file system f to a temporary path in the local file system and returns that path.
Types ¶
type WatcherOption ¶
type WatcherOption func(*watcher)
WatcherOption used to configure watcher.
func WatcherIgnoreExt ¶
func WatcherIgnoreExt(exts ...string) WatcherOption
WatcherIgnoreExt ignores files with matching file extensions.
func WatcherIgnoreHidden ¶
func WatcherIgnoreHidden() WatcherOption
WatcherIgnoreHidden ignores hidden(dot) files.
func WatcherOnChange ¶
func WatcherOnChange(hook func()) WatcherOption
WatcherOnChange sets a hook that executed on every change on filesystem.
func WatcherPollingInterval ¶
func WatcherPollingInterval(d time.Duration) WatcherOption
WatcherPollingInterval overwrites default polling interval to check filesystem changes.
func WatcherWorkdir ¶
func WatcherWorkdir(path string) WatcherOption
WatcherWorkdir to set as a root to paths needs to be watched.
Click to show internal directories.
Click to hide internal directories.