Versions in this module Expand all Collapse all v0 v0.1.1 Sep 17, 2021 v0.1.0 Jan 14, 2021 Changes in this version + var RuleAlways = RuleAll() + var RuleMarkedShort = RuleMarked(Short) + var RuleMarkedTransient = RuleMarked(Transient) + var RuleMarkedUser = RuleMarked(User) + var RuleNever = RuleAny() + var Short = NewMarker("short") + var Transient = NewMarker("transient") + var User = NewMarker("user") + func If(err error, rule Rule, fn func(err error)) + func IfMarked(err error, m *Marker, fn func(err error)) + func Mark(err error, m *Marker) error + func MarkIf(err error, m *Marker, rule Rule) error + func MarkShort(err error) error + func MarkShortIf(err error, rule Rule) error + func MarkTransient(err error) error + func MarkTransientIf(err error, rule Rule) error + func MarkUser(err error) error + func MarkUserIf(err error, rule Rule) error + func Marked(err error, m *Marker) bool + func MarkedShort(err error) bool + func MarkedTransient(err error) bool + func MarkedUser(err error) bool + func Matches(err error, rule Rule) bool + func Unless(err error, rule Rule, fn func(err error)) + func UnlessMarked(err error, m *Marker, fn func(err error)) + type Marker struct + func NewMarker(name string) *Marker + func (m *Marker) Name() string + type MarkerSet struct + func Markers(err error) *MarkerSet + func NewMarkerSet(values ...*Marker) *MarkerSet + func (ms *MarkerSet) Has(m *Marker) bool + func (ms *MarkerSet) Merge(other *MarkerSet) *MarkerSet + func (ms *MarkerSet) Names() []string + type Rule interface + Matches func(err error) bool + func RuleAll(rules ...Rule) Rule + func RuleAny(rules ...Rule) Rule + func RuleExact(want error) Rule + func RuleIs(want error) Rule + func RuleMarked(m *Marker) Rule + func RuleNot(delegate Rule) Rule + func RulePredicate(delegate Rule, when func() bool) Rule + func RuleType(want interface{}) Rule + type RuleFunc func(err error) bool + func (rf RuleFunc) Matches(err error) bool