failurestate

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 7 Imported by: 0 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 failurestate admits collaborator failures into closed policy values shared by transfer orchestration and lane scheduling. Diagnostics cannot grant cancellation, retry or output-retirement authority after this boundary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoundaryError

func BoundaryError(failure *Failure, diagnostic error) error

BoundaryError projects an internal normalized reduction back across an error-returning port without leaking internal failure provenance.

func ContentFault

func ContentFault(err error) (fault.Fault, bool)

ContentFault classifies source evidence independently of transport teardown. Each caller supplies its own terminal errors after admitting this evidence.

func Diagnostic

func Diagnostic(err error) error

func Err

func Err(failure *Failure) error

func FaultOf

func FaultOf(err error) fault.Fault

func IsCancellation

func IsCancellation(ctx context.Context, err error) bool

IsCancellation inspects an immediate collaborator result before admitting its policy.

func Join

func Join(candidates ...error) error

func SessionTerminal

func SessionTerminal(err error) bool

Types

type Failure

type Failure struct {
	// contains filtered or unexported fields
}

Failure keeps the closed policy state distinct from its raw diagnostic. It deliberately has no Unwrap method, so code outside the immediate boundary cannot reinterpret the diagnostic graph as authority.

func Admit

func Admit(err error) (*Failure, bool)

Admit accepts only the direct concrete carrier produced by this package. The dynamic-type gate prevents errors.As from granting policy authority to an arbitrary wrapper while still using the standard admission API after that exactness proof.

func ContextCause

func ContextCause(ctx context.Context) *Failure

func DependencyContract

func DependencyContract(cause error) *Failure

func FromCancellation

func FromCancellation(ctx context.Context, diagnostic error) *Failure

func JoinClosed

func JoinClosed(candidates ...*Failure) *Failure

func Merge

func Merge(
	current *Failure,
	candidates ...error,
) *Failure

func New

func New(value fault.Fault, diagnostic error) *Failure

func Normalize

func Normalize(
	ctx context.Context,
	err error,
	classify boundaryFaultClassifier,
) *Failure

Normalize admits an immediate collaborator result once. Policy code receives Failure and therefore cannot recover authority from wrapping shape or joined error topology.

func Reduce

func Reduce(candidates ...error) *Failure

func Require

func Require(err error) *Failure

func (*Failure) Canceled

func (failure *Failure) Canceled() bool

func (*Failure) Cancellation

func (failure *Failure) Cancellation() error

func (*Failure) Diagnostic

func (failure *Failure) Diagnostic() error

func (*Failure) Error

func (failure *Failure) Error() string

func (*Failure) Fault

func (failure *Failure) Fault() fault.Fault

Fault and cancellation remain separate because a sibling cancellation must not erase the fault that explains why the owning operation stopped.

func (*Failure) Is

func (failure *Failure) Is(target error) bool

Is exposes only the closed cancellation signal. Native diagnostic causes are intentionally not searchable after normalization.

Jump to

Keyboard shortcuts

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