watcher

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Stop = errors.New("stop watching")

Stop informs the watcher to stop.

Functions

func Watch

func Watch(ctx context.Context, dir string, fn func(events []Event) error) error

Watch function

Types

type Event added in v0.2.2

type Event struct {
	Op   Op
	Path string
}

Event is used to track file events

func (Event) String added in v0.2.2

func (e Event) String() string

type Op added in v0.2.2

type Op byte

Op is the type of file event that occurred

const (
	OpCreate Op = 'C'
	OpUpdate Op = 'U'
	OpDelete Op = 'D'
)

Jump to

Keyboard shortcuts

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