Documentation ¶
Index ¶
- type FileInfo
- type Watcher
- func (w *Watcher) AddFile(filename string, lineProcessingFunction func(string, interface{}) error) error
- func (w *Watcher) Close() error
- func (w *Watcher) EventProcessor(event fsnotify.Event) error
- func (w *Watcher) GetErrorChannel() <-chan error
- func (w *Watcher) GetFileInfo(filename string) (FileInfo, error)
- func (w *Watcher) GetFileInfoTable() map[string]FileInfo
- func (w *Watcher) GetNotifier() *fsnotify.Watcher
- func (w *Watcher) ProcessFile(filename string) error
- func (w *Watcher) Remove(filename string) error
- func (w *Watcher) Spectator()
- func (w *Watcher) Wait()
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
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher structure contains the fsnotify structures and being watched files information
func NewWatcher ¶
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) EventProcessor ¶
EventProcessor is generic event processor. Note that you must take care of other case always returns it is valid state
func (*Watcher) GetErrorChannel ¶
GetErrorChannel returns the errors channel
func (*Watcher) GetFileInfo ¶
GetFileInfo returns the FileInfo structure pointer in the Watcher structure
func (*Watcher) GetFileInfoTable ¶
GetFileInfoTable return FileInfoTable
func (*Watcher) GetNotifier ¶
GetNotifier returns the fsnotify.Watcher's address
func (*Watcher) ProcessFile ¶
ProcessFile prcesses each lines in a file