iterators

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterfaceToSlice

func InterfaceToSlice(data interface{}) ([]interface{}, error)

func NewIterator

func NewIterator(conf Conf) (pipeline.Handler, error)

Types

type Chunker

type Chunker struct {
	Conf
	// contains filtered or unexported fields
}

func NewChunker

func NewChunker(conf Conf) (*Chunker, error)

func (Chunker) Handle

func (selector Chunker) Handle(ctx context.Context, reqRes *pipeline.HandleRes) (respRes *pipeline.HandleRes, err error)

type Conf

type Conf struct {
	Type            string `json:"type" desc:"enum: map|reduce|select" validate:"required"`
	InterpreterName string `json:"interpreter_name" desc:"interpreter name" validate:"required"`
	Script          string `json:"script" desc:"iterator script" validate:"required"`
}

func (Conf) Build

func (itr Conf) Build() (pipeline.Handler, error)

type Mapper

type Mapper struct {
	Conf
	// contains filtered or unexported fields
}

func NewMapper

func NewMapper(conf Conf) (*Mapper, error)

func (Mapper) Handle

func (selector Mapper) Handle(ctx context.Context, reqRes *pipeline.HandleRes) (respRes *pipeline.HandleRes, err error)

type Reducer

type Reducer struct {
	Conf
	// contains filtered or unexported fields
}

func NewReducer

func NewReducer(conf Conf) (*Reducer, error)

func (Reducer) Handle

func (selector Reducer) Handle(ctx context.Context, reqRes *pipeline.HandleRes) (respRes *pipeline.HandleRes, err error)

type Selector

type Selector struct {
	Conf
	// contains filtered or unexported fields
}

func NewSelector

func NewSelector(conf Conf) (*Selector, error)

func (Selector) Handle

func (selector Selector) Handle(ctx context.Context, reqRes *pipeline.HandleRes) (respRes *pipeline.HandleRes, err error)

Jump to

Keyboard shortcuts

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