Documentation ¶
Index ¶
Constants ¶
const DefaultSleepDuration = 1 * time.Second
DefaultSleepDuration represents the amount of time the tailer waits before reading new data when no data is received
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements the logic to retrieve at most filesLimit Files defined in sources
func (*Provider) CollectFiles ¶
CollectFiles returns all the files matching the source path.
func (*Provider) FilesToTail ¶
FilesToTail returns all the Files matching paths in sources, it cannot return more than filesLimit Files. For now, there is no way to prioritize specific Files over others, they are just returned in reverse lexicographical order, see `searchFiles`
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner checks all files provided by fileProvider and create new tailers or update the old ones if needed
type Tailer ¶
type Tailer struct {
// contains filtered or unexported fields
}
Tailer tails one file and sends messages to an output channel
func NewTailer ¶
func NewTailer(outputChan chan *message.Message, source *config.LogSource, path string, sleepDuration time.Duration, isWildcardPath bool) *Tailer
NewTailer returns an initialized Tailer
func (*Tailer) GetReadOffset ¶
GetReadOffset returns the position of the last byte read in file
func (*Tailer) Identifier ¶
Identifier returns a string that uniquely identifies a source
func (*Tailer) StartFromBeginning ¶
StartFromBeginning lets the tailer start tailing its file from the beginning
func (*Tailer) Stop ¶
func (t *Tailer) Stop()
Stop stops the tailer and returns only when the decoder is flushed
func (*Tailer) StopAfterFileRotation ¶
func (t *Tailer) StopAfterFileRotation()
StopAfterFileRotation prepares the tailer to stop after a timeout to finish reading its file that has been log-rotated