Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Chunker ¶
type Chunker struct {
// contains filtered or unexported fields
}
A Chunker is used to find segments in text.
func NewChunker ¶
func NewChunker(t *testing.T, b []byte) *Chunker
NewChunker returns a new chunker.
func (*Chunker) Bytes ¶
func (c *Chunker) Bytes() []byte
Bytes returns the segment captured by the last call to Next or Find.
func (*Chunker) Find ¶
func (c *Chunker) Find(key string) bool
Find searches for key from the current position and sets the current segment to the text from current position up till the key's position. If successful, the position is updated to point directly after the occurrence of key.
func (*Chunker) Next ¶
func (c *Chunker) Next(beg, end string) bool
Next finds the first occurrence from the current scan position of beg, records the segment from that position until the first occurrence of end and then updates the current position. It reports whether a segment enclosed by beg and end can be found.
Click to show internal directories.
Click to hide internal directories.