feat(multiplayer): expose server shutdown acknowledgement

This commit is contained in:
Josh Creek
2026-09-01 16:50:26 +01:00
parent 1d926e705b
commit cc12260225
9 changed files with 224 additions and 3 deletions
+13
View File
@@ -74,6 +74,19 @@ func ServerRegistrarFromStore(db *sql.DB) ServerRegistrar {
return postgresServerRegistrar{db: db}
}
type postgresServerShutdowner struct{ db *sql.DB }
func (p postgresServerShutdowner) ShutdownServer(ctx context.Context, binding domain.WorkloadBinding, reason, idempotencyKey string, now time.Time) error {
return store.RecordServerShutdown(ctx, p.db, binding, reason, idempotencyKey, now)
}
func ServerShutdownerFromStore(db *sql.DB) ServerShutdowner {
if db == nil {
return nil
}
return postgresServerShutdowner{db: db}
}
// WorkloadVerifierFromSignedToken builds WorkloadVerify from a control-plane
// -owned signed token instead of a Kubernetes-projected JWT (see
// workload/signed_token.go for why: it needs no live cluster to verify).