Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher is file watcher that polls a file for changes in the background. For convenience, it also supports single content loads without a background watcher.
func New ¶
New creates and new Watcher and starts the background watch goroutine if needed. The first poll is done immediately and any error there will be immediately returned and not further polling done in this case. The OnChange callback is not called for this first poll. The background goroutine can be cancelled through the passed context.
Click to show internal directories.
Click to hide internal directories.