reader

package
v5.0.0-alpha4+incompat... Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileTruncate = errors.New("detected file being truncated")
	ErrRenamed      = errors.New("file was renamed")
	ErrRemoved      = errors.New("file was removed")
	ErrInactive     = errors.New("file inactive")
)

Functions

func NewLogFileReader

func NewLogFileReader(
	fs source.FileSource,
	config LogFileReaderConfig,
	done chan struct{},
) (*logFileReader, error)

Types

type Line

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

lineReader reads lines from underlying reader, decoding the input stream using the configured codec. The reader keeps track of bytes consumed from raw input stream for every decoded line.

func NewLine

func NewLine(
	input io.Reader,
	codec encoding.Encoding,
	bufferSize int,
) (*Line, error)

func (*Line) Next

func (l *Line) Next() ([]byte, int, error)

type LogFileReaderConfig

type LogFileReaderConfig struct {
	CloseOlder         time.Duration
	BackoffDuration    time.Duration
	MaxBackoffDuration time.Duration
	BackoffFactor      int
	CloseRenamed       bool
	CloseRemoved       bool
	CloseEOF           bool
}

Jump to

Keyboard shortcuts

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