drivers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidFunction = fmt.Errorf("Invalid function")

ErrInvalidFunction is the "Invalid function" error.

View Source
var ErrUnknownDriver = fmt.Errorf("Unknown driver")

ErrUnknownDriver is the "Unknown driver" error.

View Source
var ErrWatchExists = fmt.Errorf("Watch already exists")

ErrWatchExists is the "Watch already exists" error.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	Name() string
	PrefixPath() string
	Watch(path string, identifier string, f func(path string, event string) bool) error
	Unwatch(path string, identifier string) error
}

Driver represents a low-level fs notification driver.

func Load

func Load(ctx context.Context, logger logger.Logger, driverName string, path string) (Driver, error)

Load returns a Driver for an existing low-level FS monitor.

type ErrInvalidPath

type ErrInvalidPath struct {
	PrefixPath string
}

ErrInvalidPath is the "Invalid path" error.

func (*ErrInvalidPath) Error

func (e *ErrInvalidPath) Error() string

Error returns the error string.

type Event

type Event int

Event is a numeric code identifying the event.

const (
	// Add represents the add event.
	Add Event = iota
	// Remove represents the remove event.
	Remove
)

func (Event) String

func (e Event) String() string

Jump to

Keyboard shortcuts

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