Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrLogLineToLong = errors.New("log line too long, discarding")
)
Functions ¶
Types ¶
type LogReader ¶
type LogReader struct {
// contains filtered or unexported fields
}
logReader is a custom implementation similar to bufio.Scanner, but provides a way to handle lines (or tokens) that exceed the buffer size.
func NewLogReader ¶
func NewLogReader(reader io.ReadCloser) *LogReader
newLogReader creates a new logReader to read log lines from an io.ReadCloser
func (*LogReader) NextLine ¶
NextLine reads and returns the next log line from the reader. An io.EOF error is returned if the end of the stream has been reached. This implementation is different from bufio.Scanner as it also returns an error if a line is too long to fit into the buffer. In this case, an error is returned together with a limited prefix of the line.
Click to show internal directories.
Click to hide internal directories.