recovery

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoRecovery

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

AutoRecovery 自动恢复管理器

func NewAutoRecovery

func NewAutoRecovery(serviceManager service.ServiceManager, logger *zap.Logger) *AutoRecovery

NewAutoRecovery 创建自动恢复管理器

func (*AutoRecovery) GetRecoveryState

func (r *AutoRecovery) GetRecoveryState(serviceID string) (*RecoveryState, bool)

GetRecoveryState 获取恢复状态

func (*AutoRecovery) HandleUnhealthy

func (r *AutoRecovery) HandleUnhealthy(ctx context.Context, service *domain.Service) error

HandleUnhealthy 处理不健康的服务

func (*AutoRecovery) ResetRecoveryState

func (r *AutoRecovery) ResetRecoveryState(serviceID string)

ResetRecoveryState 重置恢复状态(服务恢复健康时调用)

type RecoveryState

type RecoveryState struct {
	ServiceID     string
	RestartCount  int
	LastRestart   time.Time
	NextRestart   time.Time
	BackoffDelay  time.Duration
	MaxRestarts   int
	BackoffFactor float64
	MaxBackoff    time.Duration
}

RecoveryState 恢复状态

Jump to

Keyboard shortcuts

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