feat: gamemaster

This commit is contained in:
Ilia Denisov
2026-05-03 07:59:03 +02:00
committed by GitHub
parent a7cee15115
commit 3e2622757e
229 changed files with 41521 additions and 1098 deletions
@@ -0,0 +1,25 @@
package handlers
import "net/http"
// newInvalidateMembershipsHandler returns the handler for
// `POST /api/v1/internal/games/{game_id}/memberships/invalidate`. The
// underlying cache invalidation is a fire-and-forget local operation,
// so the handler always responds with `204 No Content` once the path
// parameter validates.
func newInvalidateMembershipsHandler(deps Dependencies) http.HandlerFunc {
return func(writer http.ResponseWriter, request *http.Request) {
if deps.InvalidateMemberships == nil {
writeError(writer, http.StatusInternalServerError, errorCodeInternal, "membership cache invalidator is not wired")
return
}
gameID, ok := extractGameID(writer, request)
if !ok {
return
}
deps.InvalidateMemberships.Invalidate(gameID)
writeNoContent(writer)
}
}