Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LineReader ¶
type LineReader struct {
// contains filtered or unexported fields
}
func NewLineReader ¶
func NewLineReader(src io.ReaderAt) LineReader
func (*LineReader) LineExists ¶
func (l *LineReader) LineExists(line int64) bool
LineExists returns true if the given line is in the file.
func (*LineReader) Populate ¶
func (l *LineReader) Populate()
Populate scans the file, populating the offsetCache, so that future lookups will be faster.
func (*LineReader) ReadLine ¶
func (l *LineReader) ReadLine(p []byte, line int64) (n int, err error)
ReadLine reads up to len(p) bytes from line number line from the source. It returns the numbers of bytes written and any error encountered. If n < len(p), err is set to a non-nil value explaining why. See io.ReaderAt for full description of return values.
func (*LineReader) SearchLine ¶
SearchLine runs Regexp.FindAllIndex on the given line, providing the same return value.
Click to show internal directories.
Click to hide internal directories.