scan

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 4 Imported by: 0

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

New is a preferred way to create a new parallel processor.

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

func NewProcessor(r io.Reader, w io.Writer, f func([]byte) ([]byte, error)) *Processor

NewProcessor creates a new line processor.

func (*Processor) Run

func (p *Processor) Run() error

Run starts the workers, crunching through the input.

func (*Processor) Split

func (p *Processor) Split(f bufio.SplitFunc)

Split set the splitter function to use.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL