examples/squaring_numbers/node_structs.go
package squaringNumbers
import "github.com/tushar2708/conveyor"
// NumberSource generates a sequence of numbers (0...CountLimit) when it is run with conveyor
type NumberSource struct {
*conveyor.ConcreteNodeExecutor
CountLimit int
}
// SquareOperator squares the numbers generated by NumberSource, when it is run with conveyor
type SquareOperator struct {
*conveyor.ConcreteNodeExecutor
}
// PrinterSink prints the final numbers calculated by Operators, when it is run with conveyor
type PrinterSink struct {
*conveyor.ConcreteNodeExecutor
}
/*
Some more nodes, for getting into further details
*/
// AdditionOperator adds a configurable number to square generated by NumberSource, when it is run with conveyor
type AdditionOperator struct {
*conveyor.ConcreteNodeExecutor
ToAdd int
}
// PrinterSink1 composes "PrinterSink", and has slightly different Execute() method
type PrinterSink1 struct {
*PrinterSink
}
// PrinterSink2 composes "PrinterSink", and has slightly different Execute() method
type PrinterSink2 struct {
*PrinterSink
}
// PrinterSink3 composes "PrinterSink", and has slightly different Execute() method
type PrinterSink3 struct {
*PrinterSink
}