recovery

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int
const (
	ActionFail Action = iota
	ActionSkip
	ActionFix
	ActionWarn
)

type Context

type Context interface{ Done() <-chan struct{} }

type LenientStrategy

type LenientStrategy struct {
	// In a real implementation, we might have a logger here.
	// For now, we just accumulate errors if needed, or just return ActionWarn/ActionFix.
	Errors []error
}

LenientStrategy implements a best-effort recovery strategy. It logs errors (if a logger were available) and attempts to continue.

func NewLenientStrategy

func NewLenientStrategy() *LenientStrategy

func (*LenientStrategy) OnError

func (s *LenientStrategy) OnError(ctx Context, err error, location Location) Action

type Location

type Location struct {
	ByteOffset int64
	ObjectNum  int
	ObjectGen  int
	Component  string
}

type Strategy

type Strategy interface {
	OnError(ctx Context, err error, location Location) Action
}

type StrictStrategy

type StrictStrategy struct{}

StrictStrategy implements a fail-fast recovery strategy.

func NewStrictStrategy

func NewStrictStrategy() *StrictStrategy

func (*StrictStrategy) OnError

func (s *StrictStrategy) OnError(ctx Context, err error, location Location) Action

Jump to

Keyboard shortcuts

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