watcher

package
v1.20.0-dev Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateWatcher

func CreateWatcher(ctx context.Context, desc string, opts *CreateWatcherOpts)

CreateWatcher creates a watcher labelled with the provided description and running with the provided options. The created watcher will create a subcontext from the provided ctx and register it with the process manager.

Types

type CreateWatcherOpts

type CreateWatcherOpts struct {
	// PathsCallback is used to set the required paths to watch
	PathsCallback func(func(path, name string, d fs.DirEntry, err error) error) error

	// BeforeCallback is called before any files are watched
	BeforeCallback func()

	// Between Callback is called between after a watched event has occurred
	BetweenCallback func()

	// AfterCallback is called as this watcher ends
	AfterCallback func()
}

CreateWatcherOpts are options to configure the watcher

Jump to

Keyboard shortcuts

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