package
0.1.1
Repository: https://github.com/puppetlabs/leg.git
Documentation: pkg.go.dev

# Functions

If runs a callback function if the given Rule matches the error.
IfMarked runs a callback function if the error is marked with the given Marker.
Mark marks an error with a particular Marker.
Marked returns true if the given error has had a particular Marker applied.
MarkedShort returns true if the given error has been marked short.
MarkedTransient returns true if the given error has been marked transient.
MarkedUser returns true if the given error has been marked as a user error.
Markers returns a set of all the markers that are present on the given error.
MarkIf marks an error with a particular Marker if the given Rule matches the error.
MarkShort marks an error as short.
MarkShortIf marks an error as short if the error matches the given Rule.
MarkTransient marks an error as transient.
MarkTransientIf marks an error as transient if the error matches the given Rule.
MarkUser marks an error as a user error.
MarkUserIf marks an error as a user error if the error matches the given Rule.
Matches returns true if the given Rule matches the error.
NewMarker creates a Marker with the given name.
NewMarkerSet creates a collection of Markers with the given values after deduplicating.
RuleAll applies several rules in sequence.
RuleAny applies several rules in sequence.
RuleExact matches an error if it is exactly the wanted error.
RuleIs matches an error if errors.Is() would return true for the wanted error.
RuleMarked matches an error if the error has been marked with the given Marker.
RuleNot inverts the result of a delegate rule.
RulePredicate evalutes a delegate rule when a predicate is satisfied at the time an error is passed to the rule.
RuleType matches an error if errors.As() would return true for a target of a pointer to the type given.
Unless runs a callback function if the given Rule does not match the error.
UnlessMarked runs a callback function if the error is not marked with the given Marker.

# Variables

RuleAlways succeeds against every error.
RuleMarkedShort is a Rule that matches an error if that error has been marked Short.
RuleMarkedTransient is a Rule that matches an error if that error has been marked Transient.
RuleMarkedUser is a Rule that matches an error if the error has been marked as a user error.
RuleNever fails against every error.
Short is a Marker for indicating that the representation of an error should be abbreviated.
Transient is a Marker for indicating that a given error is temporary in nature.
User is a Marker for indicating that an error was caused by user action and not by a system error.

# Structs

Marker represents a named identifier that logically groups one or more arbitrary errors.
MarkerSet is a unique collection of Markers.

# Interfaces

Rule tests an error against an arbitrary condition.

# Type aliases

RuleFunc allows a function to be used as a Rule.