parsing

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMappers   = 1
	DefaultReducers  = 10
	DefaultShufflers = 10
	DefaultBulkSize  = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Convertible added in v0.0.28

type Convertible interface {
	Convert() *model.Operation
}

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 *model.Resource, rc io.ReadCloser) (resErr error)

func (*MapReduce) WithMapper

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

func (*MapReduce) WithReducer

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

func (*MapReduce) WithShuffler added in v0.0.28

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

type Mapper

type Mapper interface {
	Map(context.Context, *csv.Reader, chan<- []Convertible) error
}

type Reducer

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

func NewReducer

func NewReducer(repo domain.OperationRepository) Reducer

type Shuffler

type Shuffler interface {
	Shuffle(context.Context, *model.Resource, <-chan []Convertible, chan<- []model.Operation) error
}

func NewShuffler

func NewShuffler() Shuffler

Jump to

Keyboard shortcuts

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