watcher

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

type Watcher struct {
	Trigger chan struct{}
	// contains filtered or unexported fields
}

A Watcher watches a directory for changes and waits a delay until triggering an output event.

func New

func New(ctx context.Context, logger *logrus.Logger, inputDir string, delay time.Duration) (*Watcher, error)

New creates a new filesystem watcher. Need to call Start() to actually start watching.

func (*Watcher) Start

func (w *Watcher) Start(wg *sync.WaitGroup)

Start starts the background routine which watches for filesystem events. The waitgroup is used for tracking the shutdown.

Jump to

Keyboard shortcuts

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