errorer

package
v1.0.37 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatFn added in v1.0.33

func FormatFn(format string, errs ...error) func(a ...any) error

func ValueFn added in v1.0.33

func ValueFn(errs ...error) func(v any) error

Types

type Errorer added in v1.0.28

type Errorer struct {
	Errors []error
}

func Errorf

func Errorf(format string, a ...any) *Errorer

func FromList added in v1.0.33

func FromList(errs ...error) *Errorer

func New added in v1.0.28

func New(message string) *Errorer

func (*Errorer) Add added in v1.0.33

func (e *Errorer) Add(errs ...error) *Errorer

Add appends an error to the internal ist of errors.

func (Errorer) Error added in v1.0.28

func (e Errorer) Error() string

func (Errorer) FormatFn added in v1.0.33

func (e Errorer) FormatFn(format string) func(a ...any) error

FormatFn takes a format string as the input and returns a function that accepts a list of input arguments which will be supplied to the format string to create a new instance with the created error appended to it's internal list.

func (*Errorer) Is added in v1.0.33

func (e *Errorer) Is(err error) bool

func (Errorer) List added in v1.0.33

func (e Errorer) List() []string

List returns the extracted error messages from the internal list of errors.

func (*Errorer) MarshalJSON added in v1.0.28

func (e *Errorer) MarshalJSON() ([]byte, error)

func (Errorer) String added in v1.0.28

func (e Errorer) String() string

func (Errorer) Sub added in v1.0.33

func (e Errorer) Sub(errs ...error) *Errorer

Sub returns a new instance with the errs included in it's internal list.

func (Errorer) Subf added in v1.0.33

func (e Errorer) Subf(format string, a ...any) *Errorer

Sub returns a new instance with an error created using fmt.Errorf and appended internal list of errors.

func (*Errorer) UnmarshalJSON added in v1.0.28

func (e *Errorer) UnmarshalJSON(data []byte) error

func (*Errorer) Unwrap added in v1.0.28

func (e *Errorer) Unwrap() []error

func (Errorer) ValueFn added in v1.0.33

func (e Errorer) ValueFn() func(v any) error

ValueFn returns a function that accepts an input argument which will be supplied to the format string to create a new instance with the created error appended to it's internal list.

This function basically perform the following:

FormatFn("%v")

func (Errorer) WithValue added in v1.0.33

func (e Errorer) WithValue(v any) error

WithValue returns an error the supplied value appened as and error appended to it's internal list.

This function basically perform the following:

ValueFn()(v)

Jump to

Keyboard shortcuts

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