watcher

package
v0.44.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 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 Event

type Event struct {
	Path string
	Kind EventKind
	Prev Fingerprint
	Curr Fingerprint
}

type EventKind

type EventKind int
const (
	EventChanged EventKind = iota
	EventMissing
)

type Fingerprint

type Fingerprint struct {
	Mod  time.Time
	Size int64
	Hash string
}

type Options

type Options struct {
	Interval time.Duration
	Buffer   int
	// HashUnchanged forces a content hash even when modtime and size are unchanged.
	// When false, scans skip hashing if metadata is unchanged.
	HashUnchanged bool
}

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

func New

func New(opts Options) *Watcher

func (*Watcher) Events

func (w *Watcher) Events() <-chan Event

func (*Watcher) Forget

func (w *Watcher) Forget(path string)

func (*Watcher) Scan

func (w *Watcher) Scan()

func (*Watcher) Start

func (w *Watcher) Start()

func (*Watcher) Stop

func (w *Watcher) Stop()

func (*Watcher) Track

func (w *Watcher) Track(path string, data []byte)

Jump to

Keyboard shortcuts

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