Claude Code session 1.

This commit is contained in:
Kalzu Rekku
2026-01-08 12:11:26 +02:00
parent c59523060d
commit 6db2e58dcd
20 changed files with 5497 additions and 83 deletions

View File

@@ -200,11 +200,39 @@ func cacheJanitor(cooldownMinutes int) {
// ... [rest of the logic remains the same: process, readSource, runPing, etc.]
// ServiceInfo represents service metadata for discovery
type ServiceInfo struct {
ServiceType string `json:"service_type"`
Version string `json:"version"`
Name string `json:"name"`
InstanceID string `json:"instance_id"`
Capabilities []string `json:"capabilities"`
}
func serviceInfoHandler(w http.ResponseWriter, r *http.Request) {
hostname, _ := os.Hostname()
if hostname == "" {
hostname = "unknown"
}
info := ServiceInfo{
ServiceType: "ping",
Version: VERSION,
Name: "ping_service",
InstanceID: hostname,
Capabilities: []string{"ping", "traceroute"},
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(info)
}
func startHealthCheckServer(port int) {
http.HandleFunc("/health", healthCheckHandler)
http.HandleFunc("/service-info", serviceInfoHandler)
http.HandleFunc("/ready", readinessHandler)
http.HandleFunc("/metrics", metricsHandler)
addr := fmt.Sprintf(":%d", port)
log.Printf("Starting health check server on %s", addr)