state

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchError

type BatchError struct {
	// contains filtered or unexported fields
}

BatchError collects multiple errors from concurrent workers and can expose them either as one joined error or as a cloned slice.

func (*BatchError) Add

func (be *BatchError) Add(err error)

Add records a non-nil error for later aggregation.

func (*BatchError) Err

func (be *BatchError) Err() error

Err joins all recorded errors. It returns nil when no error was added.

func (*BatchError) Unwrap

func (be *BatchError) Unwrap() []error

Unwrap returns a snapshot of the recorded errors in insertion order.

type Handle

type Handle interface {
	Add(err error, panicOnTerminal bool)
	Err() error
	ShouldPanic() bool
}

Handle abstracts local and merged stream error state.

func NewMerged

func NewMerged(parents ...Handle) Handle

NewMerged creates a state that adds local errors on top of the current error state from parents.

func NewStream

func NewStream() Handle

NewStream returns an empty local stream error state.

Jump to

Keyboard shortcuts

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