Documentation
¶
Overview ¶
Package deadentity owns workspace-scoped failure streaks and durable dead-runtime recovery.
Index ¶
- Constants
- Variables
- type FailureClass
- type Option
- type ProbeDecision
- type Service
- func (s *Service) BeforeProbe(ctx context.Context, key store.DeadEntityKey) (ProbeDecision, error)
- func (s *Service) List(ctx context.Context, workspaceID string) ([]store.DeadEntity, error)
- func (s *Service) RecordFailure(ctx context.Context, key store.DeadEntityKey, class FailureClass, ...) error
- func (s *Service) RecordSuccess(ctx context.Context, key store.DeadEntityKey) error
- func (s *Service) Status(ctx context.Context, key store.DeadEntityKey) (Status, error)
- type Status
Constants ¶
const ( DefaultPermanentFailureThreshold = 5 DefaultRecoveryInterval = time.Minute )
Variables ¶
var ErrInvalidFailureClass = errors.New("deadentity: invalid failure class")
Functions ¶
This section is empty.
Types ¶
type FailureClass ¶
type FailureClass uint8
FailureClass describes whether one failed attempt confirms a stable fault.
const ( FailureTransient FailureClass = iota FailurePermanent )
type Option ¶
type Option func(*Service)
Option configures a Service.
func WithEventStore ¶
func WithEventStore(events store.EventSummaryStore) Option
WithEventStore enables public transition summaries.
func WithLogger ¶
WithLogger injects the diagnostic logger used for fail-open persistence paths.
func WithPermanentFailureThreshold ¶
WithPermanentFailureThreshold overrides the production threshold for tests.
func WithRecoveryInterval ¶
WithRecoveryInterval overrides the production recovery interval for tests.
type ProbeDecision ¶
ProbeDecision tells a runtime adapter whether it may contact an external entity.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service coordinates durable dead marks and opportunistic recovery attempts.
func New ¶
func New(deadStore store.DeadEntityStore, opts ...Option) *Service
New constructs a workspace-scoped dead-entity coordinator.
func (*Service) BeforeProbe ¶
func (s *Service) BeforeProbe(ctx context.Context, key store.DeadEntityKey) (ProbeDecision, error)
BeforeProbe admits ordinary live attempts and one due recovery attempt per interval.
func (*Service) List ¶
List returns durable dead marks for one workspace for diagnostic projections.
func (*Service) RecordFailure ¶
func (s *Service) RecordFailure( ctx context.Context, key store.DeadEntityKey, class FailureClass, reason string, ) error
RecordFailure advances or resets the permanent-failure streak for one attempted probe.
func (*Service) RecordSuccess ¶
RecordSuccess clears a durable mark and restores ordinary admission.