errmapper

package
v3.24.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: GPL-3.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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