Versions in this module Expand all Collapse all v0 v0.1.0 Oct 18, 2026 Changes in this version + const DefaultRollbackTimeout + var ErrConflict = errors.New("reconciliation: conflict error") + var ErrDuplicateAction = errors.New("reconciliation: duplicate action") + var ErrDuplicateDependency = errors.New("reconciliation: duplicate dependency") + var ErrInvalidActionID = errors.New("reconciliation: invalid action ID") + var ErrInvalidCondition = errors.New("reconciliation: invalid condition") + var ErrInvalidDesired = errors.New("reconciliation: invalid desired state") + var ErrInvalidGeneration = errors.New("reconciliation: invalid generation") + var ErrInvalidKey = errors.New("reconciliation: invalid key") + var ErrInvalidPlan = errors.New("reconciliation: invalid plan") + var ErrInvalidPolicy = errors.New("reconciliation: invalid policy") + var ErrInvalidResult = errors.New("reconciliation: invalid result") + var ErrMissingDependency = errors.New("reconciliation: missing dependency") + var ErrNilAdapter = errors.New("reconciliation: nil adapter") + var ErrNilClock = errors.New("reconciliation: nil clock") + var ErrNilCloneSpec = errors.New("reconciliation: nil specification clone function") + var ErrNilReconciler = errors.New("reconciliation: nil reconciler") + var ErrPermanent = errors.New("reconciliation: permanent error") + var ErrPlanCycle = errors.New("reconciliation: plan cycle") + var ErrSuperseded = errors.New("reconciliation: superseded generation") + var ErrTransient = errors.New("reconciliation: transient error") + func Conflict(err error) error + func Permanent(err error) error + func Transient(err error) error + func ValidatePlan[A any](plan Plan[A]) error + func WithStatusSink(ctx context.Context, sink StatusSink) context.Context + type Action struct + DependsOn []ActionID + ID ActionID + Reversible bool + Value A + func Ordered[A any](plan Plan[A]) ([]Action[A], error) + type ActionID string + type Adapter interface + Apply func(context.Context, Action[A]) (Undo[U], error) + Observe func(context.Context, Key) (O, error) + Plan func(context.Context, Desired[S], O) (Plan[A], error) + Undo func(context.Context, Undo[U]) error + type Clock interface + After func(time.Duration) <-chan time.Time + type CloneSpec func(S) S + type Condition struct + LastTransitionTime time.Time + Message string + Reason string + Status ConditionStatus + Type string + func (condition Condition) Validate() error + type ConditionStatus string + const ConditionFalse + const ConditionTrue + const ConditionUnknown + type Decision struct + Delay time.Duration + Retry bool + type Desired struct + Generation Generation + Key Key + Spec S + func (desired Desired[S]) Validate() error + type Engine struct + func NewEngine[S, O, A, U any](adapter Adapter[S, O, A, U], policy Policy, options ...EngineOption) *Engine[S, O, A, U] + func (engine *Engine[S, O, A, U]) Reconcile(ctx context.Context, desired Desired[S]) (result Result[O], reconcileErr error) + type EngineOption func(*engineConfig) + func WithClock(clock Clock) EngineOption + type EventStream struct + func NewEventStream(capacity int) (*EventStream, error) + func (stream *EventStream) Close() + func (stream *EventStream) Publish(event StatusEvent) + func (stream *EventStream) Subscribe() <-chan StatusEvent + type Generation uint64 + func (generation Generation) Validate() error + type Key string + func (key Key) Validate() error + type Manager struct + func NewManager[S, O any](reconciler Reconciler[S, O], limit int, cloneSpec CloneSpec[S], ...) (*Manager[S, O], error) + func (manager *Manager[S, O]) Close(ctx context.Context) error + func (manager *Manager[S, O]) Pending() []Pending[S] + func (manager *Manager[S, O]) Submit(ctx context.Context, desired Desired[S]) *concurrency.Future[Result[O]] + type ManagerClock interface + After func(time.Duration) <-chan time.Time + Now func() time.Time + type ManagerOption func(*managerConfig) + func WithManagerClock(clock ManagerClock) ManagerOption + func WithManagerStatusSink(sink StatusSink) ManagerOption + type Pending struct + Desired Desired[S] + RetryAt time.Time + type Plan struct + Actions []Action[A] + type Policy struct + AttemptTimeout time.Duration + BaseDelay time.Duration + Jitter func(time.Duration) time.Duration + MaxAttempts int + MaxDelay time.Duration + RollbackTimeout time.Duration + func (policy Policy) Decide(attempt int, err error) Decision + func (policy Policy) Validate() error + type Reconciler interface + Reconcile func(context.Context, Desired[S]) (Result[O], error) + type Result struct + Changed bool + Conditions []Condition + Generation Generation + Key Key + Observed O + RequeueAfter time.Duration + func (result Result[O]) Clone() Result[O] + func (result Result[O]) Validate() error + type StatusEvent struct + ActionID ActionID + Attempt int + Dropped uint64 + Err error + Generation Generation + Key Key + Phase StatusPhase + type StatusPhase string + const StatusApplying + const StatusDropped + const StatusFailed + const StatusObserving + const StatusPlanning + const StatusQueued + const StatusRetrying + const StatusRollingBack + const StatusSucceeded + type StatusSink interface + Publish func(StatusEvent) + type Undo struct + ActionID ActionID + Value U