recovery

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0 Imports: 8 Imported by: 1 module, 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

Index

Constants

View Source
const (
	AttentionRecoveryUnavailable = output.AttentionRecoveryUnavailable
	AttentionNone                = output.AttentionNone
	AttentionDestination         = output.AttentionDestination
	AttentionRegistry            = output.AttentionRegistry
	AttentionLease               = output.AttentionLease
	AttentionOperation           = output.AttentionOperation
	AttentionCleanup             = output.AttentionCleanup
)

Variables

View Source
var ErrBusy = output.ErrBusy
View Source
var ErrContract = errors.New("recovery authority violated its contract")

Functions

func AuthorityCloseFailure

func AuthorityCloseFailure(err error) error

AuthorityCloseFailure identifies release failures independently of whether the requested discard itself reached a terminal state.

Types

type AttentionReason

type AttentionReason = output.AttentionReason

type Authority

type Authority interface {
	List(context.Context) (Snapshot, error)
	Discard(context.Context, receivecontract.OperationID) (DiscardReport, error)
}

Authority reacquires the destination and exact operation ownership for each call. A prior list is evidence for user selection, never deletion authority. Discard must release its leases before returning, preserving any close error.

type BlockedItem

type BlockedItem struct {
	ArtifactPath string
	PathKnown    bool
	Reason       BlockedReason
}

func (BlockedItem) Valid

func (item BlockedItem) Valid() bool

type BlockedReason

type BlockedReason uint8
const (
	BlockedPublicationUnknown BlockedReason = iota + 1
	BlockedCheckpointInvalid
	BlockedOwnedObjectUnknown
	BlockedRevisionConflict
)

func (BlockedReason) String

func (reason BlockedReason) String() string

func (BlockedReason) Valid

func (reason BlockedReason) Valid() bool

type DiscardReport

type DiscardReport struct {
	Status       DiscardStatus
	ID           receivecontract.OperationID
	Attention    AttentionReason
	BlockedItems []BlockedItem
}

func (DiscardReport) Valid

func (report DiscardReport) Valid() bool

type DiscardResult

type DiscardResult struct {
	Report       DiscardReport
	Failure      *Failure
	Err          error
	CleanupError error
	// The facade supplies a completed, bounded stream after native leases join.
	Observations <-chan task.Observation
}

func (DiscardResult) Successful

func (result DiscardResult) Successful() bool

type DiscardStatus

type DiscardStatus string
const (
	Discarded             DiscardStatus = "discarded"
	DiscardCleanupPending DiscardStatus = "cleanup-pending"
	DiscardNeedsAttention DiscardStatus = "operation-needs-attention"
)

type Failure

type Failure struct {
	Kind         FailureKind
	Reason       string
	Detail       FailureDetail
	Cause        error
	Observations <-chan task.Observation
}

func DestinationFailure

func DestinationFailure(err error) *Failure

DestinationFailure classifies authority acquisition separately from an operation race: the same lock failure needs a different user action.

func (*Failure) Error

func (failure *Failure) Error() string

func (*Failure) Unwrap

func (failure *Failure) Unwrap() error

type FailureDetail

type FailureDetail struct {
	Stage output.FailureStage
}

func (FailureDetail) Valid

func (detail FailureDetail) Valid() bool

type FailureKind

type FailureKind uint8
const (
	FailureNeedsAttention FailureKind = iota + 1
	FailureBusy
	FailureChanged
	FailureCancelled
)

type Inventory

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

func Inspect

func Inspect(ctx context.Context, authority Authority) (*Inventory, error)

func (*Inventory) CheckDiscard

func (inventory *Inventory) CheckDiscard(id receivecontract.OperationID) *Failure

func (*Inventory) Discard

func (inventory *Inventory) Discard(ctx context.Context, id receivecontract.OperationID) DiscardResult

func (*Inventory) DiscardRestriction

func (inventory *Inventory) DiscardRestriction() *Failure

func (*Inventory) Snapshot

func (inventory *Inventory) Snapshot() (Snapshot, error)

type Observation

type Observation struct {
	Phase          Phase
	OperationID    receivecontract.OperationID
	OperationCount int
	NeedsAttention bool
	FailureKind    FailureKind
	DiscardStatus  DiscardStatus
	Failed         bool
}

Observation records authority decisions without carrying terminal ordinals or making the delivery of a diagnostic part of native resource ownership.

func (Observation) EngineEvent

func (Observation) EngineEvent()

type Operation

type Operation struct {
	ID           receivecontract.OperationID
	State        OperationState
	Attention    AttentionReason
	Running      bool
	BlockedItems []BlockedItem
}

func (Operation) Valid

func (operation Operation) Valid() bool

type OperationState

type OperationState uint8
const (
	OperationIncomplete OperationState = iota + 1
	OperationResumable
	OperationCleanupPending
	OperationNeedsAttention
)

func (OperationState) String

func (state OperationState) String() string

func (OperationState) Valid

func (state OperationState) Valid() bool

type Phase

type Phase uint8
const (
	InspectStarted Phase = iota + 1
	InspectCompleted
	DiscardStarted
	DiscardCompleted
)

type Snapshot

type Snapshot struct {
	Operations      []Operation
	RegistryUnknown bool
}

func NewSnapshot

func NewSnapshot(operations []Operation, registryUnknown bool) (Snapshot, error)

func (Snapshot) Clone

func (snapshot Snapshot) Clone() Snapshot

func (Snapshot) NeedsAttention

func (snapshot Snapshot) NeedsAttention() bool

func (Snapshot) Valid

func (snapshot Snapshot) Valid() bool

Jump to

Keyboard shortcuts

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