Documentation ¶
Index ¶
Constants ¶
View Source
const ( NewLineNotify int = iota NewFileNotify TickerNotify )
Variables ¶
View Source
var ( // ErrStop tailを停止 ErrStop = fmt.Errorf("tail should now stop") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // File-specifc Location *SeekInfo // Seek to this location before tailing ReOpen bool // Reopen recreated files (tail -F) ReOpenDelay time.Duration // Reopen Delay MustExist bool // Fail early if the file does not exist Poll bool // Poll for file changes instead of using inotify TruncateReOpen bool // copytruncate rotate RenameReOpen bool // rename rotate LinesChanSize int // Lines channel size // Generic IO NotifyInterval time.Duration // Notice interval of the elapsed time }
Config is used to specify how a file must be tailed.
type Tail ¶
type Tail struct { Filename string Lines chan *Line Config WorkLimit chan bool Ctx context.Context Cancel context.CancelFunc // 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.