parsing

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMappers   = 100
	DefaultReducers  = 2
	DefaultShufflers = 2
	DefaultBulkSize  = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity interface{}

type MapReduce

type MapReduce struct {
	// contains filtered or unexported fields
}

func NewMapReduce

func NewMapReduce() *MapReduce

func (*MapReduce) Parse

func (mr *MapReduce) Parse(ctx context.Context, resource *domain.Resource, r *bulkreader.BulkReader) (resErr error)

func (*MapReduce) WithMapper

func (mr *MapReduce) WithMapper(mapper Mapper) *MapReduce

func (*MapReduce) WithReducer

func (mr *MapReduce) WithReducer(reducer Reducer) *MapReduce

func (*MapReduce) WithsShuffler

func (mr *MapReduce) WithsShuffler(shuffler Shuffler) *MapReduce

type Mapper

type Mapper interface {
	Map(context.Context, *domain.Resource, <-chan []string, chan<- Entity) error
}

func NewMapper

func NewMapper() Mapper

type Reducer

type Reducer interface {
	Reduce(context.Context, <-chan []Entity) error
}

func NewReducer

func NewReducer(repo domain.OperationRepository) Reducer

type Shuffler

type Shuffler interface {
	Shuffle(context.Context, <-chan Entity, chan<- []Entity) error
}

func NewShuffler

func NewShuffler(size int) Shuffler

Jump to

Keyboard shortcuts

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