watcher

package
v0.0.0-...-ac4a226 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 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 FileInfo

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

FileInfo structure contains the Buffering structure's pointer

func (*FileInfo) GetBuffer

func (f *FileInfo) GetBuffer() *buffering.Buffering

GetBuffer returns the pointer of the buffering structure

type Watcher

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

Watcher structure contains the fsnotify structures and being watched files information

func NewWatcher

func NewWatcher() (*Watcher, error)

NewWatcher creates Watcher structure Note that this function start to run the Spectator goroutine

func (*Watcher) AddFile

func (w *Watcher) AddFile(filename string, lineProcessingFunction func(string, interface{}) error) error

AddFile adds a file to the Watcher. During the adding file, this also creates the buffering structure

func (*Watcher) Close

func (w *Watcher) Close() error

Close frees resources

func (*Watcher) EventProcessor

func (w *Watcher) EventProcessor(event fsnotify.Event) error

EventProcessor is generic event processor. Note that you must take care of other case always returns it is valid state

func (*Watcher) GetErrorChannel

func (w *Watcher) GetErrorChannel() <-chan error

GetErrorChannel returns the errors channel

func (*Watcher) GetFileInfo

func (w *Watcher) GetFileInfo(filename string) (FileInfo, error)

GetFileInfo returns the FileInfo structure pointer in the Watcher structure

func (*Watcher) GetFileInfoTable

func (w *Watcher) GetFileInfoTable() map[string]FileInfo

GetFileInfoTable return FileInfoTable

func (*Watcher) GetNotifier

func (w *Watcher) GetNotifier() *fsnotify.Watcher

GetNotifier returns the fsnotify.Watcher's address

func (*Watcher) ProcessFile

func (w *Watcher) ProcessFile(filename string) error

ProcessFile prcesses each lines in a file

func (*Watcher) Remove

func (w *Watcher) Remove(filename string) error

Remove removes the specific file hook

func (*Watcher) Spectator

func (w *Watcher) Spectator()

Spectator runs the infinitely before it receives the isStop signal Also it passes an event to the EventProcessor

func (*Watcher) Wait

func (w *Watcher) Wait()

Wait waits the working group in the watcher

Jump to

Keyboard shortcuts

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