fs

package
v0.0.0-...-2c88b72 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dest string) error

CopyFile copies the source path to the destination path.

func MoveFile

func MoveFile(src, dest string) error

MoveFile copies the source path to the destination path, and then removes it.

Types

type FileEvent

type FileEvent struct {
	// Path to the file
	Path string
}

FileEvent signals that a file is in the watch directory is ready to be processed.

type StableFileWatcher

type StableFileWatcher struct {

	// StableThreshold is the duration that a file must not change
	// before a signaling an event for the file.
	StableThreshold time.Duration

	// Events signal when a file has stabilized.
	Events chan FileEvent
	// contains filtered or unexported fields
}

StableFile watches for new files, waiting for the file to be completely written before signaling an event.

func NewStableFileWatcher

func NewStableFileWatcher(watchDir string, stableThreshold time.Duration) (*StableFileWatcher, error)

NewStableFileWatcher watcher for a directory.

func (*StableFileWatcher) Close

func (w *StableFileWatcher) Close()

Close all channels.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL