loop

package
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2023 License: MIT Imports: 12 Imported by: 2

Documentation

Overview

Package loop provides helpers for loop operation and iterator implementations

Index

Constants

This section is empty.

Variables

View Source
var ErrBreak = c.ErrBreak

ErrBreak is the 'break' statement of the For, Track methods

Functions

func Append added in v0.0.8

func Append[T any, TS ~[]T](next func() (T, bool, error), out TS) (TS, error)

Append collects the elements retrieved by the 'next' function into the specified 'out' slice

func Contains

func Contains[T comparable](next func() (T, bool, error), example T) (bool, error)

Contains finds the first element that equal to the example and returns true

func ConvAndReduce added in v0.0.8

func ConvAndReduce[From, To any](next func() (From, bool, error), converter func(From) (To, error), merger func(To, To) To) (out To, err error)

ConvAndReduce converts each elements and merges them into one

func ConvertAndReduce added in v0.0.8

func ConvertAndReduce[From, To any](next func() (From, bool, error), converter func(From) To, merger func(To, To) To) (out To, err error)

ConvertAndReduce converts each elements and merges them into one

func First

func First[T any](next func() (T, bool, error), predicate func(T) bool) (T, bool, error)

First returns the first element that satisfies the condition of the 'predicate' function

func Firstt added in v0.0.8

func Firstt[T any](next func() (T, bool, error), predicate func(T) (bool, error)) (T, bool, error)

Firstt returns the first element that satisfies the condition of the 'predicate' function

func For

func For[T any](next func() (T, bool, error), walker func(T) error) error

For applies the 'walker' function for the elements retrieved by the 'next' function. Return the c.ErrBreak to stop

func ForFiltered

func ForFiltered[T any](next func() (T, bool, error), walker func(T) error, predicate func(T) bool) error

ForFiltered applies the 'walker' function to the elements retrieved by the 'next' function that satisfy the 'predicate' function condition

func From

func From[T any](next func() (T, bool)) func() (T, bool, error)

From wrap the next loop to a breakable loop

func Group

func Group[T any, K comparable, V any](next func() (T, bool, error), keyExtractor func(T) K, valExtractor func(T) V) (map[K][]V, error)

Group converts elements retrieved by the 'next' function into a map, extracting a key for each element applying the converter 'keyExtractor'. The keyExtractor converts an element to a key. The valExtractor converts an element to an value.

func GroupByMultiple

func GroupByMultiple[T any, K comparable, V any](next func() (T, bool, error), keysExtractor func(T) []K, valsExtractor func(T) []V) (map[K][]V, error)

GroupByMultiple converts elements retrieved by the 'next' function into a map, extracting multiple keys, values per each element applying the 'keysExtractor' and 'valsExtractor' functions. The keysExtractor retrieves one or more keys per element. The valsExtractor retrieves one or more values per element.

func GroupByMultipleKeys

func GroupByMultipleKeys[T any, K comparable, V any](next func() (T, bool, error), keysExtractor func(T) []K, valExtractor func(T) V) (map[K][]V, error)

GroupByMultipleKeys converts elements retrieved by the 'next' function into a map, extracting multiple keys, one value per each element applying the 'keysExtractor' and 'valExtractor' functions. The keysExtractor retrieves one or more keys per element. The valExtractor converts an element to a value.

func GroupByMultipleValues

func GroupByMultipleValues[T any, K comparable, V any](next func() (T, bool, error), keyExtractor func(T) K, valsExtractor func(T) []V) (map[K][]V, error)

GroupByMultipleValues converts elements retrieved by the 'next' function into a map, extracting one key, multiple values per each element applying the 'keyExtractor' and 'valsExtractor' functions. The keyExtractor converts an element to a key. The valsExtractor retrieves one or more values per element.

func Groupp added in v0.0.10

func Groupp[T any, K comparable, V any](next func() (T, bool, error), keyExtractor func(T) (K, error), valExtractor func(T) (V, error)) (map[K][]V, error)

Groupp converts elements retrieved by the 'next' function into a map, extracting a key for each element applying the converter 'keyExtractor'. The keyExtractor converts an element to a key. The valExtractor converts an element to an value.

func HasAny

func HasAny[T any](next func() (T, bool, error), predicate func(T) bool) (bool, error)

HasAny finds the first element that satisfies the 'predicate' function condition and returns true if successful

func HasAnyy added in v0.0.8

func HasAnyy[T any](next func() (T, bool, error), predicate func(T) (bool, error)) (bool, error)

HasAnyy finds the first element that satisfies the 'predicate' function condition and returns true if successful

func New

func New[S, T any](source S, hasNext func(S) bool, getNext func(S) (T, error)) func() (T, bool, error)

New is the main breakable loop constructor

func Of

func Of[T any](elements ...T) func() (e T, ok bool, err error)

Of wrap the elements by loop function

func Reduce

func Reduce[T any](next func() (T, bool, error), merger func(T, T) T) (out T, e error)

Reduce reduces the elements retrieved by the 'next' function into an one using the 'merge' function

func Reducee added in v0.0.8

func Reducee[T any](next func() (T, bool, error), merger func(T, T) (T, error)) (out T, e error)

Reducee reduces the elements retrieved by the 'next' function into an one using the 'merge' function

func Slice

func Slice[T any](next func() (T, bool, error)) (out []T, err error)

Slice collects the elements retrieved by the 'next' function into a slice

func SliceCap added in v0.0.8

func SliceCap[T any](next func() (T, bool, error), cap int) (out []T, err error)

SliceCap collects the elements retrieved by the 'next' function into a new slice with predefined capacity

func Sum

func Sum[T c.Summable](next func() (T, bool, error)) (T, error)

Sum returns the sum of all elements

func To

func To[T any](next func() (T, bool, error), errConsumer func(error)) func() (T, bool)

To transforms a breakable loop to a simple loop. The errConsumer is a function that is called when an error occurs.

func ToMap added in v0.0.10

func ToMap[T any, K comparable, V any](next func() (T, bool), keyExtractor func(T) K, valExtractor func(T) V) (map[K]V, error)

ToMap collects key\value elements to a map by iterating over the elements

func ToMapResolvv added in v0.0.10

func ToMapResolvv[T any, K comparable, V, VR any](
	next func() (T, bool, error), keyExtractor func(T) (K, error), valExtractor func(T) (V, error),
	resolver func(bool, K, VR, V) (VR, error),
) (m map[K]VR, err error)

ToMapResolvv collects key\value elements to a map by iterating over the elements with resolving of duplicated key values

func ToMapp added in v0.0.10

func ToMapp[T any, K comparable, V any](next func() (T, bool, error), keyExtractor func(T) (K, error), valExtractor func(T) (V, error)) (map[K]V, error)

ToMapp collects key\value elements to a map by iterating over the elements

func Track

func Track[I, T any](next func() (I, T, bool, error), tracker func(I, T) error) error

Track applies the 'tracker' function to position/element pairs retrieved by the 'next' function. Return the c.ErrBreak to stop tracking..

Types

type ConvFiltIter added in v0.0.9

type ConvFiltIter[From, To any] struct {
	// contains filtered or unexported fields
}

ConvFiltIter iterator implementation that retrieves an element by the 'next' function, converts by the 'converter' and addition checks by the 'filter'. If the filter returns true then the converted element is returned as next.

func ConvertAndFilter

func ConvertAndFilter[From, To any](next func() (From, bool, error), converter func(From) (To, error), filter func(To) (bool, error)) ConvFiltIter[From, To]

ConvertAndFilter additionally filters 'To' elements

func FiltAndConv added in v0.0.9

func FiltAndConv[From, To any](next func() (From, bool, error), filter func(From) (bool, error), converter func(From) (To, error)) ConvFiltIter[From, To]

FiltAndConv returns a stream that filters source elements and converts them

func FilterAndConvert

func FilterAndConvert[From, To any](next func() (From, bool, error), filter func(From) bool, converter func(From) To) ConvFiltIter[From, To]

FilterAndConvert returns a stream that filters source elements and converts them

func FilterConvertFilter

func FilterConvertFilter[From, To any](next func() (From, bool, error), filter func(From) (bool, error), converter func(From) (To, error), filterTo func(To) (bool, error)) ConvFiltIter[From, To]

FilterConvertFilter filters source, converts, and filters converted elements

func (ConvFiltIter[From, To]) For added in v0.0.9

func (c ConvFiltIter[From, To]) For(walker func(element To) error) error

For takes elements retrieved by the iterator. Can be interrupt by returning ErrBreak

func (ConvFiltIter[From, To]) Next added in v0.0.9

func (c ConvFiltIter[From, To]) Next() (t To, ok bool, err error)

Next returns the next element. The ok result indicates whether the element was returned by the iterator. If ok == false, then the iteration must be completed.

func (ConvFiltIter[From, To]) Start added in v0.0.10

func (c ConvFiltIter[From, To]) Start() (ConvFiltIter[From, To], To, bool, error)

Start is used with for loop construct like 'for i, val, ok, err := i.Start(); ok || err != nil ; val, ok, err = i.Next() { if err != nil { return err }}'

type ConvertCheckIter

type ConvertCheckIter[From, To any] struct {
	// contains filtered or unexported fields
}

ConvertCheckIter converts and filters elements at the same time

func ConvCheck

func ConvCheck[From, To any](next func() (From, bool, error), converter func(from From) (To, bool, error)) ConvertCheckIter[From, To]

ConvCheck is similar to ConvertFilt, but it checks and transforms elements together

func ConvertCheck

func ConvertCheck[From, To any](next func() (From, bool, error), converter func(from From) (To, bool)) ConvertCheckIter[From, To]

ConvertCheck is similar to ConvFilt, but it checks and transforms elements together

func NoNilPtrVal added in v0.0.10

func NoNilPtrVal[T any](next func() (*T, bool, error)) ConvertCheckIter[*T, T]

NoNilPtrVal creates an iterator that transform only not nil pointers to the values referenced referenced by those pointers. Nil pointers are ignored.

func (ConvertCheckIter[From, To]) For added in v0.0.10

func (c ConvertCheckIter[From, To]) For(walker func(element To) error) error

For takes elements retrieved by the iterator. Can be interrupt by returning ErrBreak

func (ConvertCheckIter[From, To]) Next

func (c ConvertCheckIter[From, To]) Next() (t To, ok bool, err error)

Next returns the next element. The ok result indicates whether the element was returned by the iterator. If ok == false, then the iteration must be completed.

func (ConvertCheckIter[From, To]) Start added in v0.0.10

func (c ConvertCheckIter[From, To]) Start() (ConvertCheckIter[From, To], To, bool, error)

Start is used with for loop construct like 'for i, val, ok, err := i.Start(); ok || err != nil ; val, ok, err = i.Next() { if err != nil { return err }}'

type ConvertIter

type ConvertIter[From, To any] struct {
	// contains filtered or unexported fields
}

ConvertIter iterator implementation that retrieves an element by the 'next' function and converts by the 'converter'

func Conv

func Conv[From, To any](next func() (From, bool, error), converter func(From) (To, error)) ConvertIter[From, To]

Conv instantiates an iterator that converts elements with a converter and returns them.

func Convert

func Convert[From, To any](next func() (From, bool, error), converter func(From) To) ConvertIter[From, To]

Convert instantiates an iterator that converts elements with a converter and returns them.

func PtrVal added in v0.0.10

func PtrVal[T any](next func() (*T, bool, error)) ConvertIter[*T, T]

PtrVal creates an iterator that transform pointers to the values referenced by those pointers. Nil pointers are transformet to zero values.

func (ConvertIter[From, To]) For

func (c ConvertIter[From, To]) For(walker func(element To) error) error

For takes elements retrieved by the iterator. Can be interrupt by returning ErrBreak

func (ConvertIter[From, To]) Next

func (c ConvertIter[From, To]) Next() (t To, ok bool, err error)

Next returns the next element. The ok result indicates whether the element was returned by the iterator. If ok == false, then the iteration must be completed.

func (ConvertIter[From, To]) Start added in v0.0.10

func (c ConvertIter[From, To]) Start() (ConvertIter[From, To], To, bool, error)

Start is used with for loop construct like 'for i, val, ok, err := i.Start(); ok || err != nil ; val, ok, err = i.Next() { if err != nil { return err }}'

type FiltIter

type FiltIter[T any] struct {
	// contains filtered or unexported fields
}

FiltIter is the Iterator wrapper that provides filtering of elements by a Predicate.

func Filt

func Filt[T any](next func() (T, bool, error), filter func(T) (bool, error)) FiltIter[T]

Filt creates an iterator that checks elements by the 'filter' function and returns successful ones.

func Filter

func Filter[T any](next func() (T, bool, error), filter func(T) bool) FiltIter[T]

Filter creates an iterator that checks elements by the 'filter' function and returns successful ones.

func NotNil

func NotNil[T any](next func() (*T, bool, error)) FiltIter[*T]

NotNil creates an iterator that filters nullable elements.

func (FiltIter[T]) For

func (f FiltIter[T]) For(walker func(element T) error) error

For takes elements retrieved by the iterator. Can be interrupt by returning ErrBreak

func (FiltIter[T]) Next

func (f FiltIter[T]) Next() (element T, ok bool, err error)

Next returns the next element. The ok result indicates whether the element was returned by the iterator. If ok == false, then the iteration must be completed.

func (FiltIter[T]) Start added in v0.0.10

func (f FiltIter[T]) Start() (FiltIter[T], T, bool, error)

Start is used with for loop construct like 'for i, val, ok, err := i.Start(); ok || err != nil ; val, ok, err = i.Next() { if err != nil { return err }}'

type FlatIter

type FlatIter[From, To any] struct {
	// contains filtered or unexported fields
}

FlatIter is the Iterator wrapper that converts an element to a slice and iterates over the elements of that slice. For example, FlatIter can be used to iterate over all the elements of a multi-dimensional array as if it were a one-dimensional array ([][]int -> []int).

func Flat

func Flat[From, To any](next func() (From, bool, error), flattener func(From) []To) *FlatIter[From, To]

Flat instantiates an iterator that extracts slices of 'To' by a flattener from elements of 'From' and flattens as one iterable collection of 'To' elements.

func Flatt

func Flatt[From, To any](next func() (From, bool, error), flattener func(From) ([]To, error)) *FlatIter[From, To]

Flatt instantiates an iterator that extracts slices of 'To' by a flattener from elements of 'From' and flattens as one iterable collection of 'To' elements.

func (*FlatIter[From, To]) For

func (i *FlatIter[From, To]) For(walker func(element To) error) error

For takes elements retrieved by the iterator. Can be interrupt by returning ErrBreak

func (*FlatIter[From, To]) Next

func (i *FlatIter[From, To]) Next() (t To, ok bool, err error)

Next returns the next element. The ok result indicates whether the element was returned by the iterator. If ok == false, then the iteration must be completed.

func (*FlatIter[From, To]) Start added in v0.0.10

func (i *FlatIter[From, To]) Start() (*FlatIter[From, To], To, bool, error)

Start is used with for loop construct like 'for i, val, ok, err := i.Start(); ok || err != nil ; val, ok, err = i.Next() { if err != nil { return err }}'

type FlattFiltIter added in v0.0.9

type FlattFiltIter[From, To any] struct {
	// contains filtered or unexported fields
}

FlattFiltIter is the Iterator wrapper that converts an element to a slice with addition filtering of the element by a Predicate and iterates over the slice.

func FiltAndFlat added in v0.0.9

func FiltAndFlat[From, To any](next func() (From, bool, error), filter func(From) (bool, error), flattener func(From) ([]To, error)) *FlattFiltIter[From, To]

FiltAndFlat filters source elements and extracts slices of 'To' by the 'flattener' function

func FiltFlattFilt added in v0.0.9

func FiltFlattFilt[From, To any](next func() (From, bool, error), filterFrom func(From) (bool, error), flattener func(From) ([]To, error), filterTo func(To) (bool, error)) *FlattFiltIter[From, To]

FiltFlattFilt filters source elements, extracts slices of 'To' by the 'flattener' function and filters extracted elements

func FilterAndFlat added in v0.0.9

func FilterAndFlat[From, To any](next func() (From, bool, error), filter func(From) bool, flattener func(From) []To) *FlattFiltIter[From, To]

FilterAndFlat filters source elements and extracts slices of 'To' by the 'flattener' function

func FilterFlatFilter added in v0.0.9

func FilterFlatFilter[From, To any](next func() (From, bool, error), filterFrom func(From) bool, flattener func(From) []To, filterTo func(To) bool) *FlattFiltIter[From, To]

FilterFlatFilter filters source elements, extracts slices of 'To' by the 'flattener' function and filters extracted elements

func FlatAndFilt added in v0.0.9

func FlatAndFilt[From, To any](next func() (From, bool, error), flattener func(From) ([]To, error), filterTo func(To) (bool, error)) *FlattFiltIter[From, To]

FlatAndFilt extracts slices of 'To' by the 'flattener' function and filters extracted elements

func FlattAndFilter

func FlattAndFilter[From, To any](next func() (From, bool, error), flattener func(From) []To, filterTo func(To) bool) *FlattFiltIter[From, To]

FlattAndFilter extracts slices of 'To' by the 'flattener' function and filters extracted elements

func (*FlattFiltIter[From, To]) For added in v0.0.9

func (i *FlattFiltIter[From, To]) For(walker func(element To) error) error

For takes elements retrieved by the iterator. Can be interrupt by returning ErrBreak

func (*FlattFiltIter[From, To]) Next added in v0.0.9

func (i *FlattFiltIter[From, To]) Next() (t To, ok bool, err error)

Next returns the next element. The ok result indicates whether the element was returned by the iterator. If ok == false, then the iteration must be completed.

func (*FlattFiltIter[From, To]) Start added in v0.0.10

func (i *FlattFiltIter[From, To]) Start() (*FlattFiltIter[From, To], To, bool, error)

Start is used with for loop construct like 'for i, val, ok, err := i.Start(); ok || err != nil ; val, ok, err = i.Next() { if err != nil { return err }}'

type KeyValuer

type KeyValuer[T, K, V any] struct {
	// contains filtered or unexported fields
}

KeyValuer is the Iterator wrapper that converts an element to a key\value pair and iterates over these pairs

func ExtraKey added in v0.0.10

func ExtraKey[T, K any](next func() (T, bool, error), keysExtractor func(T) K) KeyValuer[T, K, T]

ExtraKey transforms iterable elements to key/value iterator based on applying key extractor to the elements

func ExtraKeyy added in v0.0.10

func ExtraKeyy[T, K any](next func() (T, bool, error), keyExtractor func(T) (K, error)) KeyValuer[T, K, T]

ExtraKeyy transforms iterable elements to key/value iterator based on applying key extractor to the elements

func ExtraValue added in v0.0.10

func ExtraValue[T, V any](next func() (T, bool, error), valueExtractor func(T) V) KeyValuer[T, T, V]

ExtraValue transforms iterable elements to key/value iterator based on applying value extractor to the elements

func ExtraValuee added in v0.0.10

func ExtraValuee[T, V any](next func() (T, bool, error), valExtractor func(T) (V, error)) KeyValuer[T, T, V]

ExtraValuee transforms iterable elements to key/value iterator based on applying value extractor to the elements

func KeyValue added in v0.0.10

func KeyValue[T any, K, V any](next func() (T, bool, error), keyExtractor func(T) K, valExtractor func(T) V) KeyValuer[T, K, V]

KeyValue transforms iterable elements to key/value iterator based on applying key, value extractors to the elements

func KeyValuee added in v0.0.10

func KeyValuee[T any, K, V any](next func() (T, bool, error), keyExtractor func(T) (K, error), valExtractor func(T) (V, error)) KeyValuer[T, K, V]

KeyValuee transforms iterable elements to key/value iterator based on applying key, value extractors to the elements

func NewKeyValuer

func NewKeyValuer[T any, K, V any](next func() (T, bool, error), keyExtractor func(T) (K, error), valsExtractor func(T) (V, error)) KeyValuer[T, K, V]

NewKeyValuer creates instance of the KeyValuer

func (KeyValuer[T, K, V]) Next

func (kv KeyValuer[T, K, V]) Next() (key K, value V, ok bool, err error)

Next returns the next element. The ok result indicates whether the element was returned by the iterator. If ok == false, then the iteration must be completed.

func (KeyValuer[T, K, V]) Start added in v0.0.10

func (kv KeyValuer[T, K, V]) Start() (KeyValuer[T, K, V], K, V, bool, error)

Start is used with for loop construct like 'for i, k, v, ok, err := i.Start(); ok || err != nil ; k, v, ok, err = i.Next() { if err != nil { return err }}'

func (KeyValuer[T, K, V]) Track

func (kv KeyValuer[T, K, V]) Track(traker func(key K, value V) error) error

Track takes key, value pairs retrieved by the iterator. Can be interrupt by returning ErrBreak

type Looper added in v0.0.8

type Looper[T any, I interface{ Next() (T, bool, error) }] interface {
	Loop() I
}

Looper provides an iterable loop function

type MultipleKeyValuer

type MultipleKeyValuer[T, K, V any] struct {
	// contains filtered or unexported fields
}

MultipleKeyValuer is the Iterator wrapper that converts an element to a key\value pair and iterates over these pairs

func ExtraKeys added in v0.0.10

func ExtraKeys[T, K any](next func() (T, bool, error), keysExtractor func(T) []K) *MultipleKeyValuer[T, K, T]

ExtraKeys transforms iterable elements to key/value iterator based on applying key extractor to the elements

func ExtraKeyss added in v0.0.10

func ExtraKeyss[T, K any](next func() (T, bool, error), keyExtractor func(T) (K, error)) *MultipleKeyValuer[T, K, T]

ExtraKeyss transforms iterable elements to key/value iterator based on applying key extractor to the elements

func ExtraVals added in v0.0.10

func ExtraVals[T, V any](next func() (T, bool, error), valsExtractor func(T) []V) *MultipleKeyValuer[T, T, V]

ExtraVals transforms iterable elements to key/value iterator based on applying value extractor to the elements

func ExtraValss added in v0.0.10

func ExtraValss[T, V any](next func() (T, bool, error), valsExtractor func(T) ([]V, error)) *MultipleKeyValuer[T, T, V]

ExtraValss transforms iterable elements to key/value iterator based on applying values extractor to the elements

func KeyValues added in v0.0.10

func KeyValues[T, K, V any](next func() (T, bool, error), keyExtractor func(T) K, valsExtractor func(T) []V) *MultipleKeyValuer[T, K, V]

KeyValues transforms iterable elements to key/value iterator based on applying key, value extractor to the elements

func KeyValuess added in v0.0.10

func KeyValuess[T, K, V any](next func() (T, bool, error), keyExtractor func(T) (K, error), valsExtractor func(T) ([]V, error)) *MultipleKeyValuer[T, K, V]

KeyValuess transforms iterable elements to key/value iterator based on applying key, value extractor to the elements

func KeysValue added in v0.0.10

func KeysValue[T, K, V any](next func() (T, bool, error), keysExtractor func(T) []K, valExtractor func(T) V) *MultipleKeyValuer[T, K, V]

KeysValue transforms iterable elements to key/value iterator based on applying key, value extractor to the elements

func KeysValuee added in v0.0.10

func KeysValuee[T, K, V any](next func() (T, bool, error), keysExtractor func(T) ([]K, error), valExtractor func(T) (V, error)) *MultipleKeyValuer[T, K, V]

KeysValuee transforms iterable elements to key/value iterator based on applying key, value extractor to the elements

func KeysValues added in v0.0.10

func KeysValues[T, K, V any](next func() (T, bool, error), keysExtractor func(T) ([]K, error), valsExtractor func(T) ([]V, error)) *MultipleKeyValuer[T, K, V]

KeysValues transforms iterable elements to key/value iterator based on applying multiple keys, values extractor to the elements

func NewMultipleKeyValuer

func NewMultipleKeyValuer[T any, K, V any](next func() (T, bool, error), keysExtractor func(T) ([]K, error), valsExtractor func(T) ([]V, error)) *MultipleKeyValuer[T, K, V]

NewMultipleKeyValuer creates instance of the MultipleKeyValuer

func (*MultipleKeyValuer[T, K, V]) Next

func (kv *MultipleKeyValuer[T, K, V]) Next() (key K, value V, ok bool, err error)

Next returns the next element. The ok result indicates whether the element was returned by the iterator. If ok == false, then the iteration must be completed.

func (*MultipleKeyValuer[T, K, V]) Start added in v0.0.10

func (kv *MultipleKeyValuer[T, K, V]) Start() (*MultipleKeyValuer[T, K, V], K, V, bool, error)

Start is used with for loop construct like 'for i, k, v, ok, err := i.Start(); ok || err != nil ; k, v, ok, err = i.Next() { if err != nil { return err }}'

func (*MultipleKeyValuer[T, K, V]) Track

func (kv *MultipleKeyValuer[T, K, V]) Track(traker func(key K, value V) error) error

Track takes key, value pairs retrieved by the iterator. Can be interrupt by returning ErrBreak

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL