Removes Wild Cloud cruft.

This commit is contained in:
2026-07-11 23:05:17 +00:00
parent f9d87ff975
commit ac66ba653d
26 changed files with 745 additions and 1410 deletions

View File

@@ -80,41 +80,4 @@ func RequestLoggingMiddleware(next http.Handler) http.Handler {
})
}
// contextKey is a type for context keys to avoid collisions.
type contextKey string
// Context keys for request values.
const (
InstanceNameKey contextKey = "instanceName"
AppNameKey contextKey = "appName"
NodeNameKey contextKey = "nodeName"
)
// GetInstanceName returns the instance name from request context.
// Falls back to mux.Vars if not in context (for backward compatibility during migration).
func GetInstanceName(r *http.Request) string {
if name, ok := r.Context().Value(InstanceNameKey).(string); ok {
return name
}
return mux.Vars(r)["name"]
}
// GetAppName returns the app name from request context.
// Falls back to mux.Vars if not in context.
func GetAppName(r *http.Request) string {
if name, ok := r.Context().Value(AppNameKey).(string); ok {
return name
}
return mux.Vars(r)["app"]
}
// GetNodeName returns the node name from request context.
// Falls back to mux.Vars if not in context.
func GetNodeName(r *http.Request) string {
if name, ok := r.Context().Value(NodeNameKey).(string); ok {
return name
}
return mux.Vars(r)["node"]
}