watcher

package
v0.0.0-...-455eedf Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

File is a file watcher that notifies when a file has been changed

func NewFile

func NewFile() (*File, error)

NewFile is a standard constructor

func (*File) Add

func (f *File) Add(filepath string) error

Add adds a file to start watching

func (*File) Shutdown

func (f *File) Shutdown()

Shutdown stop the file watching run loop

func (*File) Start

func (f *File) Start(notifier Notification)

Start is a runloop to watch for files changes from the file paths added from Add()

type Notification

type Notification interface {
	WatcherItemDidChange(string)
	WatcherDidError(error)
}

Notification is the delegate methods from the Notifier

type Notifier

type Notifier interface {
	Start(Notification)
	Add(string) error
	Shutdown()
}

Notifier is the base interface for file watching

Jump to

Keyboard shortcuts

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