multierr

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: BSD-3-Clause Imports: 5 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrGroup

type ErrGroup struct {
	*errgroup.Group
	// contains filtered or unexported fields
}

ErrGroup implements a group of parallel running tasks allowing to wait for all routines to terminate, as well as error handling.

func NewErrGroup

func NewErrGroup(ctx context.Context) (*ErrGroup, context.Context)

NewErrGroup creates a new ErrGroup using passed context.

func (*ErrGroup) Go

func (g *ErrGroup) Go(f func() error)

Go starts a new goroutine. Termination of all functions can be checked via Wait or WaitChan. The ErrGroup closes the internal context when the first go-routine returns with an error.

func (*ErrGroup) Wait

func (g *ErrGroup) Wait() *multierror.Error

Wait blocks until all goroutines of the error group have terminated and returns the accumulated errors.

func (*ErrGroup) WaitChan added in v1.1.0

func (g *ErrGroup) WaitChan() <-chan *multierror.Error

WaitChan returns a channel that is closed after the error group terminates, possibly containing the error

type Errors

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

Errors represent a list of errors triggered during the execution of a goka view/processor. Normally, the first error leads to stopping the processor/view, but during shutdown, more errors might occur. DEPRECATED. This will be removed one day, we migrated to the implementation in github.com/hashicorp/go-multierror

func (*Errors) Collect

func (e *Errors) Collect(err error) *Errors

func (*Errors) Error

func (e *Errors) Error() string

func (*Errors) HasErrors

func (e *Errors) HasErrors() bool

func (*Errors) Merge

func (e *Errors) Merge(o *Errors) *Errors

func (*Errors) NilOrError

func (e *Errors) NilOrError() error

type MultiWait added in v1.0.0

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

func NewMultiWait added in v1.0.0

func NewMultiWait(ctx context.Context, num int) *MultiWait

func (*MultiWait) Add added in v1.0.0

func (mw *MultiWait) Add(done <-chan struct{})

func (*MultiWait) Done added in v1.0.0

func (mw *MultiWait) Done() <-chan struct{}

func (*MultiWait) Wait added in v1.0.0

func (mw *MultiWait) Wait() bool

Jump to

Keyboard shortcuts

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