23 lines
774 B
Go
23 lines
774 B
Go
package ports
|
|
|
|
import (
|
|
"context"
|
|
|
|
"galaxy/rtmanager/internal/domain/health"
|
|
)
|
|
|
|
// HealthSnapshotStore stores the latest technical-health observation per
|
|
// game. Adapters keep one row per game_id; later observations overwrite.
|
|
type HealthSnapshotStore interface {
|
|
// Upsert installs snapshot as the latest observation for
|
|
// snapshot.GameID. Adapters validate snapshot through
|
|
// health.HealthSnapshot.Validate before touching the store.
|
|
Upsert(ctx context.Context, snapshot health.HealthSnapshot) error
|
|
|
|
// Get returns the latest snapshot for gameID. It returns
|
|
// runtime.ErrNotFound (declared in
|
|
// `galaxy/rtmanager/internal/domain/runtime`) when no snapshot has
|
|
// been recorded yet.
|
|
Get(ctx context.Context, gameID string) (health.HealthSnapshot, error)
|
|
}
|