internal

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackgroundContext = context.Background()

use internally for iterations we know are cannot block. USE WITH CAUTION

Functions

func MergeErrors added in v0.8.5

func MergeErrors(err1, err2 error) error

func ReadOne added in v0.7.0

func ReadOne[T any](ctx context.Context, ch <-chan T) (T, error)

func ZeroOf added in v0.8.0

func ZeroOf[T any]() T

ZeroOf returns the zero-value for the type T specified as an argument.

Types

type ChannelIterImpl

type ChannelIterImpl[T any] struct {
	Pipe <-chan T

	Error  error
	Ctx    context.Context
	Closer context.CancelFunc
	WG     sync.WaitGroup
	// contains filtered or unexported fields
}

func (*ChannelIterImpl[T]) Close

func (iter *ChannelIterImpl[T]) Close() error

func (*ChannelIterImpl[T]) Next

func (iter *ChannelIterImpl[T]) Next(ctx context.Context) bool

func (*ChannelIterImpl[T]) Value

func (iter *ChannelIterImpl[T]) Value() T

type GeneratorIterator added in v0.8.5

type GeneratorIterator[T any] struct {
	Operation func(context.Context) (T, error)
	Closer    context.CancelFunc
	Error     error
	// contains filtered or unexported fields
}

func (*GeneratorIterator[T]) Close added in v0.8.5

func (iter *GeneratorIterator[T]) Close() error

func (*GeneratorIterator[T]) Next added in v0.8.5

func (iter *GeneratorIterator[T]) Next(ctx context.Context) bool

func (*GeneratorIterator[T]) Value added in v0.8.5

func (iter *GeneratorIterator[T]) Value() T

type MergedError added in v0.6.1

type MergedError struct {
	Current error
	Wrapped error
}

func (*MergedError) As added in v0.6.1

func (dwe *MergedError) As(target any) bool

func (*MergedError) Error added in v0.6.1

func (dwe *MergedError) Error() string

func (*MergedError) Is added in v0.6.1

func (dwe *MergedError) Is(target error) bool

func (*MergedError) Unwrap added in v0.6.1

func (dwe *MergedError) Unwrap() error

type SliceIterImpl

type SliceIterImpl[T any] struct {
	Vals  []T
	Index int
	// contains filtered or unexported fields
}

func NewSliceIter added in v0.6.3

func NewSliceIter[T any](in []T) *SliceIterImpl[T]

func (*SliceIterImpl[T]) Close

func (iter *SliceIterImpl[T]) Close() error

func (*SliceIterImpl[T]) Next

func (iter *SliceIterImpl[T]) Next(ctx context.Context) bool

func (*SliceIterImpl[T]) Value

func (iter *SliceIterImpl[T]) Value() T

Jump to

Keyboard shortcuts

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