Documentation ¶
Overview ¶
Package etl provides a simple iterator interface.
Index ¶
- Variables
- func Collect[T any](it Iter) ([]T, error)
- func CollectContext[T any](ctx context.Context, it Iter) ([]T, error)
- func Consume[T any](it Iter, fn func(T) error) error
- func ConsumeContext[T any](ctx context.Context, it Iter, fn func(T) error) error
- func Count(it Iter) (int, error)
- func Print(it Iter) error
- func Take[T any](it Iter, n int) ([]T, error)
- func WorkersConsume[Ti any](it Iter, workers int, fn func(context.Context, Ti) error) error
- func WorkersConsumeContext[Ti any](ctx context.Context, it Iter, workers int, fn func(context.Context, Ti) error) error
- type Custom
- type Gen
- type Iter
- func Chan[T any](ch <-chan T) Iter
- func ErrIter(err error) Iter
- func Filter[T any](it Iter, fn func(T) bool) Iter
- func FlatMap[Ti, To any](it Iter, fn func(Ti) []To) Iter
- func Limit(it Iter, n int) Iter
- func MakeGen[T any](g Gen[T]) Iter
- func MakeIter[T any](c Custom[T]) Iter
- func Map[Ti, To any](it Iter, fn func(Ti) To) Iter
- func MapE[Ti, To any](it Iter, fn func(Ti) (To, error)) Iter
- func NewIter[IT, DT any](start func() (IT, error), next func(context.Context, IT) (DT, error), ...) Iter
- func Peek[T any](it Iter, fn func(v T)) Iter
- func Seq(start, end, step int) Iter
- func Values[T any](vs ...T) Iter
- func Workers[To any](it Iter, workers int, fn func(context.Context, W[To]) error) Iter
- func WorkersValue[Ti, To any](it Iter, workers int, fn func(context.Context, Ti, Y[To]) error) Iter
- func Yield[Ti, To any](it Iter, fn func(Ti, Y[To]) error) Iter
- type W
- type Y
Constants ¶
This section is empty.
Variables ¶
var EOI = io.EOF
EOI is returned when iterator doesn't have more data.
var ErrCancelled = errors.New("iterator cancelled")
Functions ¶
func CollectContext ¶
Collect collects all iterator values into a slice.
func ConsumeContext ¶
func WorkersConsume ¶
WorkersConsume creates a pool of workers that call fn for every iteration value. this will close the consumed Iter upon finish.
Types ¶
type Iter ¶
Iter iterator interface.
func Filter ¶
Filter returns an iterator that filters the values of the source given the func fn if fn returns true the value is passed through
func Limit ¶
Limit returns an iterator that returns at most n values from the given iterator Closing the returned iterator will close the given iterator.
func Map ¶
Map returns an interator that transforms the values of the source iterator using the func fn.
func MapE ¶
Map returns an interator that transforms the values of the source iterator using the func fn.
func WorkersValue ¶
WorkersValue is a convinitent func that calls fn for every consumed value, it will yield any value by calling the yield func.
Directories ¶
Path | Synopsis |
---|---|
Package etlcsv contains iterators that handle csv data.
|
Package etlcsv contains iterators that handle csv data. |
Package etldrow contains functions to manipulate iter.Iter of drow.Row.
|
Package etldrow contains functions to manipulate iter.Iter of drow.Row. |
Package iterfs provides file system iterators.
|
Package iterfs provides file system iterators. |
Package etlhttp contains iterators that handle http.
|
Package etlhttp contains iterators that handle http. |
Package etlio contains logic do handle io stuff.
|
Package etlio contains logic do handle io stuff. |
Package etljson provides iterators to handle json.
|
Package etljson provides iterators to handle json. |
Package itermetrics contains utils to debug and measure iterators.
|
Package itermetrics contains utils to debug and measure iterators. |
Package etlutil contains basic iter utils.
|
Package etlutil contains basic iter utils. |
Package etlzip iterates over zip files data.
|
Package etlzip iterates over zip files data. |
x
|
|
etlcloud
Package etlcloud provides etl iters based on gocloud.dev
|
Package etlcloud provides etl iters based on gocloud.dev |