Files
josh 9bb4b09a04
CI / Lint + build + test (push) Has been cancelled
Initial commit: full Phases 1-6 implementation
Post-repair hardware validation pipeline for Proxmox cluster hosts.
Go orchestrator + in-image agent + mkosi live image + bundled dnsmasq
PXE + SQLite + HTMX/SSE UI + notify registry + janitor + full docs.
2026-04-17 21:32:10 -04:00

34 lines
855 B
Go

package janitor
import (
"context"
"time"
"vetting/internal/logs"
"vetting/internal/store"
)
// StoreAdapter bridges the concrete orchestrator stores to the Janitor's
// dependency interface. Kept in the janitor package so the orchestrator
// wire-up stays a single-line: janitor.New(cfg, &janitor.StoreAdapter{...}).
type StoreAdapter struct {
Runs *store.Runs
Artifacts *store.Artifacts
Logs *logs.Hub
}
func (a *StoreAdapter) CompletedOlderThan(ctx context.Context, cutoff time.Time) ([]int64, error) {
return a.Runs.CompletedOlderThan(ctx, cutoff)
}
func (a *StoreAdapter) DeleteArtifactsForRun(ctx context.Context, runID int64) ([]store.Artifact, error) {
return a.Artifacts.DeleteForRun(ctx, runID)
}
func (a *StoreAdapter) LogPathFor(runID int64) string {
if a.Logs == nil {
return ""
}
return a.Logs.PathFor(runID)
}