mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 00:14:00 +00:00
feat(multiplayer): expose server shutdown acknowledgement
This commit is contained in:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user