Backend: API handlers, WebSocket manager, K8s client, CRDT, auth
This commit is contained in:
26
server/internal/api/handlers/cluster.go
Normal file
26
server/internal/api/handlers/cluster.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type ClusterInfo struct {
|
||||
Name string `json:"name"`
|
||||
Version string `json:"version"`
|
||||
Health bool `json:"health"`
|
||||
ServerURL string `json:"server_url"`
|
||||
}
|
||||
|
||||
func ClusterHandler(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
cluster := ClusterInfo{
|
||||
Name: "local",
|
||||
Version: "v1.29.0",
|
||||
Health: true,
|
||||
ServerURL: "https://kubernetes.default.svc",
|
||||
}
|
||||
|
||||
json.NewEncoder(w).Encode(cluster)
|
||||
}
|
||||
Reference in New Issue
Block a user