fsnotify

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CheckInterval = 3 * time.Second
)

Functions

This section is empty.

Types

type Event

type Event struct {
	// Path to the file or directory.
	Name string

	// File operation that triggered the event.
	Op Op
}

func (Event) Has

func (e Event) Has(op Op) bool

Has reports if this event has the given operation.

type File

type File struct {
	ModTime    time.Time
	CheckTimes uint64
}

type Op

type Op uint32
const (
	Create Op = 1 << iota

	Write

	Remove
)

func (Op) Has

func (o Op) Has(h Op) bool

Has reports if this operation has the given operation.

type Watcher

type Watcher struct {
	Events chan Event
	Errors chan error
	// contains filtered or unexported fields
}

func NewWatcher

func NewWatcher(fsys fs.FS) *Watcher

func (*Watcher) Add

func (w *Watcher) Add(path string) error

func (*Watcher) Start

func (w *Watcher) Start()

func (*Watcher) Stop

func (w *Watcher) Stop()

Jump to

Keyboard shortcuts

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