mirror of
https://github.com/MontFerret/ferret.git
synced 2024-12-14 11:23:02 +02:00
Added IteratorFn
This commit is contained in:
parent
e17ce5a3d5
commit
32bfd4be3d
@ -49,4 +49,11 @@ type (
|
|||||||
Value Value
|
Value Value
|
||||||
Types []Type
|
Types []Type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IteratorFn represents an helper type to create closure based Iterator interface implementation.
|
||||||
|
IteratorFn = func(ctx context.Context) (value Value, key Value, err error)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (fn IteratorFn) Next(ctx context.Context) (value Value, key Value, err error) {
|
||||||
|
return fn(ctx)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user