watcher

package
v0.0.0-...-47ed896 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 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 Interface

type Interface interface {
	Alert() <-chan struct{}
	Shutdown()
}

Interface describes the watcher interface

func Start

func Start(options ...Option) (Interface, error)

Start a watcher with the provided options.

type Option

type Option func(*watcher) error

An Option is a function that can manipulate a watcher during construction

func Directory

func Directory(paths ...string) Option

Directory specifies one or more directories to watch recursively. If no directories are specified, the current working directory is watched.

func Exclude

func Exclude(patterns ...string) Option

Exclude specifies one or more file patterns to exclude from the watch. If no patterns are specified, only files starting with a dot are excluded. If a file matches both an include and an exclude pattern, it is excluded.

func Include

func Include(patterns ...string) Option

Include specifies one or more file patterns to include in the watch. If no patterns are specified, all files not starting with a dot are included.

Jump to

Keyboard shortcuts

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