Documentation
¶
Overview ¶
Package repeat implements the repeat-reader. A repeat-reader outputs a given constant byte sequence repeatedly.
This package was originally written for testing and profiling parsers. A typical use may look something like this:
input := "some line to be parsed\n"
r := NewReader([]byte(input), 1000)
parser := myparse.NewParser(r)
(start profiling)
for range parser.Items() {} // Exhaust parser.
(stop profiling)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader outputs a given constant byte sequence repeatedly.
func NewReader ¶
NewReader returns a reader that outputs data n times. If n is negative, repeats infinitely. Copies the contents of data.
Click to show internal directories.
Click to hide internal directories.