recovery

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrContainerNotRunning = errors.New("container is not running")
)

Static errors for better error handling

Functions

This section is empty.

Types

type Config

type Config struct {
	Network     string
	ELClient    string
	CLClient    string
	ELImage     string
	CLImage     string
	ELExtraArgs []string
	CLExtraArgs []string
	ELEnvVars   map[string]string
	CLEnvVars   map[string]string
	EnclaveName string
}

Config represents the configuration needed for recovery operations

type ConfigMatcher

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

ConfigMatcher handles configuration matching logic for recovery operations

func NewConfigMatcher

func NewConfigMatcher(log logrus.FieldLogger) *ConfigMatcher

NewConfigMatcher creates a new configuration matcher

func (*ConfigMatcher) GenerateEnclavePattern

func (cm *ConfigMatcher) GenerateEnclavePattern(cfg *Config) string

GenerateEnclavePattern generates the expected enclave name from configuration

func (*ConfigMatcher) MatchesConfig

func (cm *ConfigMatcher) MatchesConfig(existing, desired *Config) bool

MatchesConfig checks if two configurations are compatible for recovery

func (*ConfigMatcher) ParseEnclaveConfig

func (cm *ConfigMatcher) ParseEnclaveConfig(enclaveName string) (*Config, error)

ParseEnclaveConfig attempts to parse configuration from an enclave name

type RecoveryState

type RecoveryState struct {
	EnclaveName    string                    `json:"enclave_name"`
	TempReportPath string                    `json:"temp_report_path"`
	Config         *Config                   `json:"config"`
	LastUpdate     time.Time                 `json:"last_update"`
	Progress       *report.SyncProgressEntry `json:"progress"`
}

RecoveryState represents the state of a recoverable sync operation

type Service

type Service interface {
	Start(ctx context.Context) error
	Stop() error
	CheckRecoverable(ctx context.Context, cfg *Config) (*RecoveryState, error)
	ValidateEnclave(ctx context.Context, enclaveName string, cfg *Config) error
}

Service defines the interface for recovery operations

func NewService

func NewService(kurtosisClient kurtosis.Client, log logrus.FieldLogger) Service

NewService creates a new recovery service

type StateValidator

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

StateValidator handles enclave state validation for recovery operations

func NewStateValidator

func NewStateValidator(client kurtosis.Client, log logrus.FieldLogger) *StateValidator

NewStateValidator creates a new state validator

func (*StateValidator) CheckServiceHealth

func (sv *StateValidator) CheckServiceHealth(ctx context.Context, enclaveName, serviceName string) error

CheckServiceHealth checks if a service is healthy and accessible

func (*StateValidator) ValidateEnclave

func (sv *StateValidator) ValidateEnclave(ctx context.Context, enclaveName string, cfg *Config) error

ValidateEnclave validates that an enclave is in a recoverable state

Jump to

Keyboard shortcuts

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