ipo

package module
v0.0.0-...-f5c02d0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2017 License: MIT Imports: 2 Imported by: 0

README

ipo

Input - Processing - Output

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParallelOutputs

func ParallelOutputs(obj interface{}, outputs []Output) error

ParallelOutputs tries to write each output parallelly and returns when all outputs finished.

func SequentialInputs

func SequentialInputs(inputs []Input) (obj interface{}, err error)

SequentialInputs tries each input sequentially and returns the first successful one.

func SequentialOutputs

func SequentialOutputs(obj interface{}, outputs []Output) error

SequentialOutputs tries to write each output sequentially and returns when one fails.

Types

type Input

type Input interface {
	Read() (obj interface{}, err error)
}

Input represents a system that can fetch an object somewhere (e.g. from the network).

type Output

type Output interface {
	Write(obj interface{}) error
}

Output represents a system that saves the object somewhere (e.g. to the filesystem).

type System

type System struct {
	Inputs          []Input
	Outputs         []Output
	InputProcessor  func(inputs []Input) (obj interface{}, err error)
	OutputProcessor func(obj interface{}, outputs []Output) error
}

System represents a full IPO system.

func (*System) Run

func (system *System) Run() error

Run runs the system once for the given data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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