watcher

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRealWatcher

func NewRealWatcher(header WatcherDesc, logger io.Writer) (watcher, error)

Types

type Action

type Action func(context.Context, string, string) error

type BehaviourDesc

type BehaviourDesc struct {
	Event EventTypes
	Entry EntryRules
	Retry RetryRules

	Throttle ThrottlingRules
}

type EntryNamesRules

type EntryNamesRules []string

type EntryRules

type EntryRules struct {
	NameRules EntryNamesRules
}

func NewEntryRules

func NewEntryRules() EntryRules

func (EntryRules) WithNameRule

func (e EntryRules) WithNameRule(rule string) EntryRules

type EventTypes

type EventTypes map[fsnotify.Op]struct{}

func NewEventTypes

func NewEventTypes() EventTypes

func (EventTypes) WithChmod

func (e EventTypes) WithChmod() EventTypes

func (EventTypes) WithCreate

func (e EventTypes) WithCreate() EventTypes

func (EventTypes) WithRemove

func (e EventTypes) WithRemove() EventTypes

func (EventTypes) WithRename

func (e EventTypes) WithRename() EventTypes

func (EventTypes) WithWrite

func (e EventTypes) WithWrite() EventTypes

type NonRecursiveNotifier

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

func (NonRecursiveNotifier) Errors

func (e NonRecursiveNotifier) Errors() chan error

func (NonRecursiveNotifier) Events

func (e NonRecursiveNotifier) Events() chan fsnotify.Event

type Notifier

type Notifier interface {
	Errors() chan error
	Events() chan fsnotify.Event
}

type RecursiveNotifier

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

func (RecursiveNotifier) Errors

func (e RecursiveNotifier) Errors() chan error

func (RecursiveNotifier) Events

func (e RecursiveNotifier) Events() chan fsnotify.Event

type RetryRules

type RetryRules struct {
	Attempts uint
}

type ThrottlingRules

type ThrottlingRules struct {
	DelayAfterEvent time.Duration
	Interval        time.Duration
}

type WatcherDesc

type WatcherDesc struct {
	Do Action

	Name string
	Path string

	Behave BehaviourDesc

	Recursive bool
}

type Watchers

type Watchers []watcher

func (*Watchers) Watch

func (w *Watchers) Watch(ctx context.Context) error

Jump to

Keyboard shortcuts

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