Documentation
¶
Index ¶
- Variables
- func MergeErrors(err1, err2 error) error
- func Mnemonize[T any](in func() T) func() T
- func MnemonizeContext[T any](in func(context.Context) T) func(context.Context) T
- func ReadOne[T any](ctx context.Context, ch <-chan T) (T, error)
- func ZeroOf[T any]() T
- type ChannelIterImpl
- type GeneratorIterator
- type MergedError
- type SliceIterImpl
- type SyncIterImpl
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 MnemonizeContext ¶ added in v0.9.3
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 NewChannelIterator ¶ added in v0.9.3
func NewChannelIterator[T any](pipe <-chan T) *ChannelIterImpl[T]
func (*ChannelIterImpl[T]) Close ¶
func (iter *ChannelIterImpl[T]) Close() error
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 NewGeneratorIterator ¶ added in v0.9.3
func NewGeneratorIterator[T any](op func(ctx context.Context) (T, error)) *GeneratorIterator[T]
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
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 ¶
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]) Value ¶
func (iter *SliceIterImpl[T]) Value() T
type SyncIterImpl ¶ added in v0.9.3
type SyncIterImpl[T any] struct { Mtx *sync.Mutex Iter interface { Next(context.Context) bool Value() T Close() error } }
func (SyncIterImpl[T]) Close ¶ added in v0.9.3
func (iter SyncIterImpl[T]) Close() error
func (SyncIterImpl[T]) Next ¶ added in v0.9.3
func (iter SyncIterImpl[T]) Next(ctx context.Context) bool
func (SyncIterImpl[T]) ReadOne ¶ added in v0.9.3
func (iter SyncIterImpl[T]) ReadOne(ctx context.Context) (T, error)
func (SyncIterImpl[T]) Value ¶ added in v0.9.3
func (iter SyncIterImpl[T]) Value() T
Click to show internal directories.
Click to hide internal directories.