Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrPipelineClosed = errors.New("pipeline is closed")
)
Functions ¶
This section is empty.
Types ¶
type TransformerPipeline ¶
type TransformerPipeline struct {
// contains filtered or unexported fields
}
TransformerPipeline runs a pipeline of transform clients.
Ideally we'd just call the result of each transform to the next one, but transformations are not synchronous calls, so orchestration is needed. That's what this does: it hides the orchestration of the transform clients.
Use it like this:
- Construct a new TransformerPipeline with `New`. Give it a context and a slice of transform clients. - Register a callback for transformed records with `OnOutput`. - Start all transformers with `RunBlocking`. - Send records to the pipeline with `Send`. - When done, close the pipeline with `Close`. Otherwise, `RunBlocking` won't finish.
func (*TransformerPipeline) Close ¶
func (lp *TransformerPipeline) Close()
func (*TransformerPipeline) OnOutput ¶
func (lp *TransformerPipeline) OnOutput(fn func([]byte) error) error
func (*TransformerPipeline) RunBlocking ¶
func (lp *TransformerPipeline) RunBlocking() error
func (*TransformerPipeline) Send ¶
func (lp *TransformerPipeline) Send(data []byte) error
Click to show internal directories.
Click to hide internal directories.