Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var POLL_DURATION time.Duration
Functions ¶
This section is empty.
Types ¶
type FileWatcher ¶
type FileWatcher interface { // BlockUntilExists blocks until the missing file comes into // existence. If the file already exists, returns immediately. BlockUntilExists(tomb.Tomb) error // ChangeEvents returns a channel of events corresponding to the // times the file is ready to be read. The channel will be closed // if the file gets deleted, renamed or truncated. ChangeEvents(tomb.Tomb, os.FileInfo) chan bool }
FileWatcher monitors file-level events.
type InotifyFileWatcher ¶
InotifyFileWatcher uses inotify to monitor file changes.
func NewInotifyFileWatcher ¶
func NewInotifyFileWatcher(filename string) *InotifyFileWatcher
func (*InotifyFileWatcher) BlockUntilExists ¶
func (fw *InotifyFileWatcher) BlockUntilExists(t tomb.Tomb) error
func (*InotifyFileWatcher) ChangeEvents ¶
type PollingFileWatcher ¶
PollingFileWatcher polls the file for changes.
func NewPollingFileWatcher ¶
func NewPollingFileWatcher(filename string) *PollingFileWatcher
func (*PollingFileWatcher) BlockUntilExists ¶
func (fw *PollingFileWatcher) BlockUntilExists(t tomb.Tomb) error
func (*PollingFileWatcher) ChangeEvents ¶
Click to show internal directories.
Click to hide internal directories.