go-vitess.v1: gopkg.in/src-d/go-vitess.v1/vt/concurrency Index | Files

package concurrency

import "gopkg.in/src-d/go-vitess.v1/vt/concurrency"

Index

Package Files

error_recorder.go

type AllErrorAggregator Uses

type AllErrorAggregator func(errors []error) error

AllErrorAggregator aggregates errors.

type AllErrorRecorder Uses

type AllErrorRecorder struct {
    Errors []error
    // contains filtered or unexported fields
}

AllErrorRecorder records all the errors.

func (*AllErrorRecorder) AggrError Uses

func (aer *AllErrorRecorder) AggrError(aggr AllErrorAggregator) error

AggrError runs the provided aggregator over all errors and returns the error from aggregator.

func (*AllErrorRecorder) Error Uses

func (aer *AllErrorRecorder) Error() error

Error returns an aggregate of all errors by concatenation.

func (*AllErrorRecorder) ErrorStrings Uses

func (aer *AllErrorRecorder) ErrorStrings() []string

ErrorStrings returns all errors as string array.

func (*AllErrorRecorder) GetErrors Uses

func (aer *AllErrorRecorder) GetErrors() []error

GetErrors returns a reference to the internal errors array.

Note that the array is not copied, so this should only be used once the recording is complete.

func (*AllErrorRecorder) HasErrors Uses

func (aer *AllErrorRecorder) HasErrors() bool

HasErrors returns true if we ever recorded an error

func (*AllErrorRecorder) RecordError Uses

func (aer *AllErrorRecorder) RecordError(err error)

RecordError records a possible error: - does nothing if err is nil

type ErrorRecorder Uses

type ErrorRecorder interface {
    RecordError(error)
    HasErrors() bool
    Error() error
}

ErrorRecorder offers a way to record errors during complex asynchronous operations. Various implementation will offer different services.

type FirstErrorRecorder Uses

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

FirstErrorRecorder records the first error, logs the others. Error() will return the first recorded error or nil.

func (*FirstErrorRecorder) Error Uses

func (fer *FirstErrorRecorder) Error() error

Error returns the first error we saw, or nil

func (*FirstErrorRecorder) HasErrors Uses

func (fer *FirstErrorRecorder) HasErrors() bool

HasErrors returns true if we ever recorded an error

func (*FirstErrorRecorder) RecordError Uses

func (fer *FirstErrorRecorder) RecordError(err error)

RecordError records a possible error: - does nothing if err is nil - only records the first error reported - the rest is just logged

Package concurrency imports 4 packages (graph) and is imported by 23 packages. Updated 2019-06-13. Refresh now. Tools for package owners.