streams2

package
v0.0.0-...-a45bf93 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForEachBuf

func ForEachBuf[T any](ctx context.Context, it streams.Iterator[T], n int, fn func(*T) error) error

ForEachBuf is a buffered for each, it will read from the iterator in a separate goroutine to a channel.

func NewMapper

func NewMapper[A, B any](inner streams.Iterator[A], fn func(A) B) streams.Iterator[B]

Types

type Mapper

type Mapper[A, B any] struct {
	// contains filtered or unexported fields
}

func (*Mapper[A, B]) Next

func (m *Mapper[A, B]) Next(ctx context.Context, dst *B) error

type SQLIterator

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

func NewSQLIterator

func NewSQLIterator[T any](rows *sqlx.Rows) *SQLIterator[T]

func (*SQLIterator[T]) Next

func (it *SQLIterator[T]) Next(ctx context.Context, dst *T) error

Jump to

Keyboard shortcuts

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