watcher

package
v2.29.3-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() fx.Option

Module is a fx module that provides filesystem watcher.

func NewWatcher

func NewWatcher(directory, fileExt string) (*watcher, error)

NewWatcher creates a new watcher instance that starts watching a directory via fsnotify.

Types

type Constructor

type Constructor struct {
	// Name of watcher instance where "" means main watcher.
	Name string
	// Config key from which to read directory path from.
	// If the pathkey is empty or is not set then fallback to Path.
	ConfigKey string
	// Directory path to fall back to.
	Path string
	// File types to watch. The extension needs to include leading dot.
	FileExt string
}

Constructor holds fields to create an annotated instance of Watcher.

func (Constructor) Annotate

func (constructor Constructor) Annotate() fx.Option

Annotate creates an annotated instance of filesystem Watcher.

Jump to

Keyboard shortcuts

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