Documentation ¶
Overview ¶
Package file provides an abstraction over files and named pipes being tailed by `mtail`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { Name string // Given name for the file (possibly relative, used for displau) Pathname string // Full absolute path of the file used internally // contains filtered or unexported fields }
File contains the state for a tailed file.
func New ¶
func New(fs afero.Fs, pathname string, lines chan<- *logline.LogLine, seenBefore, seekToStart bool) (*File, error)
New returns a new File named by the given pathname. seenBefore indicates thta mtail believes it's seen this pathname nbefore, and seekToStart indicates that the file should be tailed from offset 0, not EOF.
func (*File) Follow ¶
Follow reads from the file until EOF. It tracks log rotations (i.e new inode or device).
Click to show internal directories.
Click to hide internal directories.