Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrTailShutdown = errors.New("tail: shutdown")
)
Functions ¶
Types ¶
type Op ¶
type Op uint32
Op describes a file operation on a watched object. In addition to the fsnotify events, an op mask of DirChild indicates that the event occurred in a watched directory rather than for a watched file itself.
type Shutdown ¶
type Shutdown interface { // Waits for a close event. Dying() <-chan struct{} // Kill the application, which triggers all waiters on shutdown.Dying() // to receive a close event. Kill(error) }
Shutdown is an interface that provides a safe shutdown mechansim. The interface is compatible with tomb.Tomb.
Most channel operations should include a select on Shutdown.Dying() inorder to cleanly exit:
select { case <-shutdown.Dying(): return }
func NewShutdown ¶
func NewShutdown() Shutdown
NewShutdown creates a shutdown object which encapsulates a single channel used to signal that the process is terminating.
type Tail ¶
type Tail struct { Filename string // contains filtered or unexported fields }
Tail maintains a tail-capable file buffer.
type Watcher ¶
type Watcher struct { Events chan Event // contains filtered or unexported fields }
Watcher watches a directory or file and guards against multiple watching events by tracking the registered set, which fsnotify does not do.
func MakeWatcher ¶
func MakeWatcher() *Watcher
func (*Watcher) RemoveWatch ¶
RemoveWatch removes a watch from the watcher, unless it is not already present.