errmapper

package
v3.24.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package errmapper is a service that resolves a given error or error chain to a new single error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MatchType

type MatchType int

MatchType represents the type of matching operation to be performed on a given error chain. Can be either 'MatchAll' or 'MatchAny'.

const (
	MatchAll MatchType = iota
	MatchAny
)

type Rule

type Rule struct {
	Targets   []error
	MatchType MatchType
	Result    error
}

Rule holds information about a rule to be applied to a given error or error chain.

func NewRule

func NewRule(targets []error, matchType MatchType, result error) Rule

NewRule returns a new Rule instance.

type Service

type Service interface {

	// Resolve resolves a given error or error chain to a new single error
	Resolve(err error) error
}

func New

func New(rules []Rule) Service

Jump to

Keyboard shortcuts

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