Documentation ¶
Overview ¶
Package tpack provides tools to pack a Go workflow as a Unix-style pipeline command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FunctionProcessor ¶
type FunctionProcessor struct {
// contains filtered or unexported fields
}
FunctionProcessor implements Processor using a function to process messages.
func NewFunctionProcessor ¶
func NewFunctionProcessor(function func(in []byte) ([][]byte, error)) *FunctionProcessor
NewFunctionProcessor returns a new FunctionProcessor with the specified function.
func (*FunctionProcessor) ErrChannel ¶
func (fp *FunctionProcessor) ErrChannel() chan []byte
ErrChannel returns the error output communication channel.
func (*FunctionProcessor) InChannel ¶
func (fp *FunctionProcessor) InChannel() chan []byte
InChannel returns the input communication channel.
func (*FunctionProcessor) OutChannel ¶
func (fp *FunctionProcessor) OutChannel() chan []byte
OutChannel returns the output communication channel.
type Packer ¶
Packer is the representation of a packed processing unit.
func NewPackerStd ¶
NewPackerStd returns a new Packer with the standard streams as communication channels.
func NewPackerStdOut ¶
NewPackerStdOut returns a new Packer with the standard output and standard error as output communication channels and the specified input io.Reader.
type Processor ¶
type Processor interface { // InChannel returns the input communication channel. InChannel() chan []byte // OutChannel returns the output communication channel. OutChannel() chan []byte // ErrChannel returns the error output communication channel. ErrChannel() chan []byte }
Processor represents a generic stream processor.