Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileWatcher ¶
type FileWatcher struct {
// contains filtered or unexported fields
}
FileWatcher tracks file changes and issues a callback when a file has changed. The file is polled on given intervals to see if it has been changed and a callback is done if there is a change. If the file is deleted you will not get notified before a new file is in place.
func NewFileWatcher ¶
func NewFileWatcher(ctx context.Context, filename string, callback func(string), interval time.Duration) (*FileWatcher, error)
NewFileWatcher creates a new filewatcher. The watcher is created if err is nil. A watcher is created even if the file does not exist when started.
Click to show internal directories.
Click to hide internal directories.