watcher

package
v0.0.0-...-a8e4c5d Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NumericEventFlagInvalid           = NumericEventFlag(0)
	NumericEventFlagPlatformSpecific  = NumericEventFlag(1)
	NumericEventFlagCreated           = NumericEventFlag(2)
	NumericEventFlagUpdated           = NumericEventFlag(4)
	NumericEventFlagRemoved           = NumericEventFlag(8)
	NumericEventFlagRenamed           = NumericEventFlag(16)
	NumericEventFlagOwnerModified     = NumericEventFlag(32)
	NumericEventFlagAttributeModified = NumericEventFlag(64)
	NumericEventFlagMovedFrom         = NumericEventFlag(128)
	NumericEventFlagMovedTo           = NumericEventFlag(256)
	NumericEventFlagIsFile            = NumericEventFlag(512)
	NumericEventFlagIsDir             = NumericEventFlag(1024)
	NumericEventFlagIsSymLink         = NumericEventFlag(2048)
	NumericEventFlagIsLink            = NumericEventFlag(4096)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FSEventsWatcher

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

func NewFSEventsWatcher

func NewFSEventsWatcher(absoluteDirectory string) *FSEventsWatcher

func (*FSEventsWatcher) Events

func (w *FSEventsWatcher) Events() <-chan WatchEvent

func (*FSEventsWatcher) Run

func (w *FSEventsWatcher) Run(ctx context.Context) error

type INotifyWatcher

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

func NewINotifyWatcher

func NewINotifyWatcher(absoluteDirectory string) *INotifyWatcher

func (*INotifyWatcher) Events

func (w *INotifyWatcher) Events() <-chan WatchEvent

func (*INotifyWatcher) Run

func (w *INotifyWatcher) Run(ctx context.Context) error

type NumericEventFlag

type NumericEventFlag uint64

type WatchEvent

type WatchEvent struct {
	ReceivedAt       time.Time
	Flags            NumericEventFlag
	RelativeFilename string
}

type Watcher

type Watcher interface {
	Events() <-chan WatchEvent
	Run(context.Context) error
}

func NewWatcher

func NewWatcher(absoluteDirectory string) Watcher

Jump to

Keyboard shortcuts

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