feat: backend service

This commit is contained in:
Ilia Denisov
2026-05-06 10:14:55 +03:00
committed by GitHub
parent 3e2622757e
commit f446c6a2ac
1486 changed files with 49720 additions and 266401 deletions
@@ -0,0 +1,29 @@
// Package handlers exposes shared helpers used by the per-domain HTTP
// handlers under `internal/server/handlers_*.go`. The only helper is
// NotImplemented, which serves the standard `501 not_implemented`
// envelope when a route is registered but the handler body is not
// wired (a defensive fallback for new endpoints in flight).
package handlers
import (
"net/http"
"galaxy/backend/internal/server/httperr"
"github.com/gin-gonic/gin"
)
// NotImplemented returns a gin handler that emits the standard
// `501 not_implemented` envelope. operationID names the OpenAPI operation the
// handler will eventually implement; it is interpolated into the human-readable
// message so that contract tests and operators can identify the endpoint.
func NotImplemented(operationID string) gin.HandlerFunc {
message := "endpoint is not implemented yet"
if operationID != "" {
message = "endpoint " + operationID + " is not implemented yet"
}
return func(c *gin.Context) {
httperr.Abort(c, http.StatusNotImplemented, httperr.CodeNotImplemented, message)
}
}