watcher

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IsWatchableFileFunc

type IsWatchableFileFunc func(path string) bool

type Option

type Option func(*Options)

func WithEventDebounceDuration

func WithEventDebounceDuration(duration time.Duration) Option

func WithIsWatchableFileFunc

func WithIsWatchableFileFunc(f IsWatchableFileFunc) Option

func WithLogger

func WithLogger(logger logger.Logger) Option

func WithPaths

func WithPaths(paths ...string) Option

func WithRemoveObjectFunc

func WithRemoveObjectFunc(f RemoveObjectFunc) Option

func WithResolveObjectPathFunc

func WithResolveObjectPathFunc(f ResolveObjectPathFunc) Option

func WithUpdateObjectFunc

func WithUpdateObjectFunc(f UpdateObjectFunc) Option

type Options

type Options struct {
	Logger           logger.Logger
	Paths            []string
	DebounceDuration time.Duration

	UpdateObjectFunc      UpdateObjectFunc
	RemoveObjectFunc      RemoveObjectFunc
	ResolveObjectPathFunc ResolveObjectPathFunc
	IsWatchableFileFunc   IsWatchableFileFunc
}

type RemoveObjectFunc

type RemoveObjectFunc func(path string) error

type ResolveObjectPathFunc

type ResolveObjectPathFunc func(path string) string

type UpdateObjectFunc

type UpdateObjectFunc func(path string) error

type Watcher

type Watcher interface {
	Close() error
	SetPaths(paths ...string) error
}

func New

func New(opts ...Option) (Watcher, error)

Jump to

Keyboard shortcuts

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