Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrStop = errors.New("tail should now stop")
)
Functions ¶
Types ¶
type Config ¶
type Config struct {
Logger log.Logger
// Seek to this location before tailing
Location *SeekInfo
PollOptions watch.PollingFileWatcherOptions
// Change the decoder if the file is not UTF-8.
// If the tailer doesn't use the right decoding, the output text may be gibberish.
// For example, if the file is "UTF-16 LE" encoded, the tailer would not separate
// the new lines properly and the output could come out as chinese characters.
Decoder *encoding.Decoder
}
Config is used to specify how a file must be tailed.
type Tail ¶
type Tail struct {
Filename string
Lines chan *Line
Config
tomb.Tomb // provides: Done, Kill, Dying
// contains filtered or unexported fields
}
func TailFile ¶
TailFile begins tailing the file. Output stream is made available via the `Tail.Lines` channel. To handle errors during tailing, invoke the `Wait` or `Err` method after finishing reading from the `Lines` channel.
Click to show internal directories.
Click to hide internal directories.