iterate

package
v0.0.0-...-576298e Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForEach

func ForEach(iter transaction.Iterator, fn Reporter) error

ForEach iterates over a transaction.Iterator and calls a Reporter for each pair. If that Reporter returns an error, the iteration is canceled and the error is returned

func While

While iterates over a transaction.Iterator and checks its pairs against the provided Predicate. The iteration is canceled the first time the Predicate returns false

Types

type Predicate

type Predicate func(value.Key, any) bool

Predicate is called to determine whether to report a key/value pair

type Reporter

type Reporter func(value.Key, any) error

Reporter is called to report a key/value pair to iterating code

Jump to

Keyboard shortcuts

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