watch

package
v0.0.57 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(w *watch) error

func WithDirs

func WithDirs(dirs ...string) Option

func WithErrGroup

func WithErrGroup(eg errgroup.Group) Option

func WithOnChange

func WithOnChange(f func(ctx context.Context, name string) error) Option

func WithOnChmod

func WithOnChmod(f func(ctx context.Context, name string) error) Option

func WithOnCreate

func WithOnCreate(f func(ctx context.Context, name string) error) Option

func WithOnDelete

func WithOnDelete(f func(ctx context.Context, name string) error) Option

func WithOnError

func WithOnError(f func(ctx context.Context, err error) error) Option

func WithOnRename

func WithOnRename(f func(ctx context.Context, name string) error) Option

func WithOnWrite

func WithOnWrite(f func(ctx context.Context, name string) error) Option

type Watcher

type Watcher interface {
	Start(ctx context.Context) (<-chan error, error)
	Add(dirs ...string) error
	Remove(dirs ...string) error
	Stop(ctx context.Context) error
}

Watcher is an interface that represents a file monitor.

func New

func New(opts ...Option) (Watcher, error)

New returns Watcher implementation.

Jump to

Keyboard shortcuts

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