filewatcher

package
v0.0.0-...-cfc0f1e Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event = fsnotify.Event

type FileWatcher

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

func Configure

func Configure() *FileWatcher

func (*FileWatcher) Do

func (this *FileWatcher) Do(h Handler) *FileWatcher

Do adds a handler to watch to the actual watch list. If a handler is added a new empty pending watch list is started

func (*FileWatcher) EnqueueCommand

func (this *FileWatcher) EnqueueCommand(c controller.Interface, cmd string) *FileWatcher

Do adds a command handler to watch to the actual watch list If a handler is added to a non empty pending watchlist this watchlist becomes the actual one and a new empty pending list is started.

func (*FileWatcher) For

func (this *FileWatcher) For(file string) *FileWatcher

For adds a file to watch to the actually pending watch list

func (*FileWatcher) Start

func (this *FileWatcher) Start(ctx context.Context, logger logger.LogContext, name string) error

func (*FileWatcher) StartWith

func (this *FileWatcher) StartWith(ctx WatchContext, name string) error

type Handler

type Handler func(Event)

type WatchContext

type WatchContext interface {
	GetContext() context.Context
	logger.LogContext
}

Jump to

Keyboard shortcuts

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