sandboxreaperprocess

package
v0.0.0-...-804b954 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package sandboxreaperprocess composes the independently deployable durable sandbox reconciliation owner. It never performs backend cleanup by guess.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loop

func Loop(ctx context.Context, store Store, source clock.Clock, interval time.Duration, pageSize int, wait Wait, observe Observer) error

Loop runs one immediate pass and then finite cancellable intervals.

func Run

func Run(ctx context.Context, config Config, lookup SecretLookup, source clock.Clock, wait Wait, observe Observer) error

Run opens only the declared PostgreSQL authority and reconciles until cancellation. Schema creation and destructive backend cleanup remain separate audited operator/backend responsibilities.

Types

type Config

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

Config is one strict independently scheduled reaper declaration.

func Parse

func Parse(input io.Reader) (Config, error)

Parse decodes exactly one canonical versioned reaper declaration.

type Observer

type Observer func(Summary)

Observer receives one bounded content-free reconciliation summary.

type SecretLookup

type SecretLookup func(string) (string, bool)

SecretLookup resolves only an explicitly named injected value.

type Store

type Store interface {
	RecoverExpiredAssignments(context.Context, time.Time, int) ([]sandboxcontrol.Operation, error)
	ClaimExpiredCleanup(context.Context, time.Time, int) ([]sandboxcontrol.Operation, error)
	Reap(context.Context, time.Time, int) ([]sandboxcontrol.Operation, error)
}

Store is the bounded durable recovery authority required by the reaper.

type Summary

type Summary struct {
	ObservedAt           time.Time
	RecoveredAssignments int
	ClaimedCleanups      int
	ReapedOperations     int
}

Summary reports the durable decisions made by one reconciliation pass.

func ReconcileOnce

func ReconcileOnce(ctx context.Context, store Store, now time.Time, pageSize int) (Summary, error)

ReconcileOnce invokes every durable recovery owner in fixed order.

type Wait

type Wait func(context.Context, time.Duration) error

Wait blocks using the composition owner's cancellable scheduling primitive.

Jump to

Keyboard shortcuts

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