Documentation
¶
Overview ¶
Package scan accepts a bufio.SplitFunc and generalizes batches to non-line oriented input, e.g. XML.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Processor ¶
type Processor struct { BatchSize int SplitFunc bufio.SplitFunc NumWorkers int Verbose bool R io.Reader W io.Writer F func([]byte) ([]byte, error) }
Processor can process lines in parallel.
func NewProcessor ¶
NewProcessor creates a new line processor.
type TagSplitter ¶
type TagSplitter struct { // Tag to split on. Nested tags with the same name are not supperted // currently (they will cause an error). Tag string // MaxBytesApprox is the approximate number of bytes in a batch. A batch // will always contain at least one element, which may exceed this number. // By default, we use 16MB per batch. MaxBytesApprox uint // contains filtered or unexported fields }
TagSplitter splits input on XML elements. It will batch content up to approximately MaxBytesApprox bytes. It is guaranteed that each batch contains at least one complete element content.
Click to show internal directories.
Click to hide internal directories.