file

package
v0.0.0-...-ad17f4e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2021 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tailer

type Tailer struct {
	// contains filtered or unexported fields
}

Tailer is an abstraction for reading newly appended content from a file, implementing TailerT (i.e. returning newly appended bytes on calls to Next()). After idleDuration of file inactivity (no new content), calls to Next() also invoke a rotation check.

func NewTailer

func NewTailer(path string, idleDuration time.Duration) (*Tailer, error)

NewTailer creates a new Tailer object configured to read data from the file at the supplied path (and performing rotation checks after idleDuration of inactivity).

func (*Tailer) Next

func (t *Tailer) Next() ([]byte, error)

Next will return content newly read from the log file. If no new content is available, and this condition has persisted for at least the idleDuration, a rotation check will be performed.

type TailerT

type TailerT interface {
	Next() ([]byte, error)
}

TailerT is an interface representing a Tailer (useful for mocks).

Directories

Path Synopsis
Package mock_tailer is a generated GoMock package.
Package mock_tailer is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL