Example #1
0
// TableTransform Applies a TableTransform transform.
func (t *Transformer) TableTransform(transform func(optimus.Row, chan<- optimus.Row) error) *Transformer {
	return t.Apply(transforms.TableTransform(transform))
}
Example #2
0
			return optimus.Transform(source, transforms.Map(transform))
		},
		Arg: func(row optimus.Row) (optimus.Row, error) {
			return optimus.Row{}, nil
		},
	},
	{
		Name:   "Table",
		Source: defaultSource,
		Actual: func(source optimus.Table, arg interface{}) optimus.Table {
			transform := arg.(func(optimus.Row, chan<- optimus.Row) error)
			return New(source).TableTransform(transform).Table()
		},
		Expected: func(source optimus.Table, arg interface{}) optimus.Table {
			transform := arg.(func(optimus.Row, chan<- optimus.Row) error)
			return optimus.Transform(source, transforms.TableTransform(transform))
		},
		Arg: func(row optimus.Row, out chan<- optimus.Row) error {
			out <- optimus.Row{}
			out <- optimus.Row{}
			out <- optimus.Row{}
			return nil
		},
	},
	{
		Name:   "Select",
		Source: defaultSource,
		Actual: func(source optimus.Table, arg interface{}) optimus.Table {
			filter := arg.(func(optimus.Row) (bool, error))
			return New(source).Select(filter).Table()
		},