Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultChunkSize is the default value for the option ChunkSize DefaultChunkSize = 1024 // 1K // DefaultBufferSize is the default value for the option BufferSize which // also limits the max line size that can be processed before ErrOverflow DefaultBufferSize = 1 << 20 // 1MB // DefaultIgnoreEmptyLine is the default behavior for option IgnoreEmptyLine DefaultIgnoreEmptyLine = true )
Variables ¶
View Source
var ( // ErrOverflow reports that the line is longer than the internal read buffer // and allows the error state condition Err() to report it was not io.EOF ErrOverflow = errors.New("line overflow") )
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// ChunkSize configures the size of the byte chunk that is read from the input
ChunkSize int
// BufferSize configures the maximum byte size limit of the internal buffer
// Note: This also indirectly limits the max line size
BufferSize int
// IgnoreEmptyLine will skip returning empty line content until io.EOF
IgnoreEmptyLine bool
}
Options configures scanner parameters
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is a reverse (LIFO) tail-to-head line scanner
func NewScanner ¶
NewScanner returns a new reverse (LIFO) tail-to-head line Scanner, because the scanner reads retrograde lines (tail-to-head toward toward zero) the size parameter must be non-zero or a nil Scanner will be returned, nil for Options applies default values
Click to show internal directories.
Click to hide internal directories.