Documentation
¶
Overview ¶
Package scratchnamespace owns one isolated restore namespace through a durable create fence and exact Kubernetes deletion preconditions. It never adopts a namespace using its name alone. Callers supply their existing operation checkpoint store and retain it until cleanup is verified.
Index ¶
Constants ¶
const (
QuietWindow = 30 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleanupReceipt ¶
type CleanupReceipt struct {
StartedAt string `json:"startedAt"`
CompletedAt string `json:"completedAt"`
Complete bool `json:"complete"`
TwoSweepQuietWindowSeconds int `json:"twoSweepQuietWindowSeconds"`
Sweeps []Sweep `json:"sweeps"`
}
func Cleanup ¶
func Cleanup(ctx context.Context, opts Options) (CleanupReceipt, error)
Cleanup can be called after Create returns any error, or from a later cleanup-only invocation after process death. A missing create intent never authorizes deletion. The latest resourceVersion is journaled before each exact delete, so legitimate status updates can be handled on a later replay without weakening the original UID fence.
type Identity ¶
type Identity struct {
Name string `json:"name"`
UID string `json:"uid"`
ResourceVersion string `json:"resourceVersion"`
}
type State ¶
type State interface {
Checkpoint(string) (json.RawMessage, bool, error)
WriteCheckpoint(string, json.RawMessage) error
}
State is satisfied by the adapter's write-once, fsync-backed checkpoint store. WriteCheckpoint must reject a different value at an existing name. Callers must serialize users of one operation's state, including cleanup.