Port to newest cclib. Use metricstore as library.

This commit is contained in:
2026-01-26 09:59:29 +01:00
parent ede0cb10c9
commit 6aca448c18
32 changed files with 1215 additions and 4188 deletions

View File

@@ -1,7 +1,8 @@
// Copyright (C) NHR@FAU, University Erlangen-Nuremberg.
// All rights reserved.
// All rights reserved. This file is part of cc-metric-store.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package api
import (
@@ -21,29 +22,29 @@ func MountRoutes(r *http.ServeMux) {
}
publicKey := ed25519.PublicKey(buf)
// Compatibility
r.Handle("POST /api/free", authHandler(http.HandlerFunc(handleFree), publicKey))
r.Handle("POST /api/write", authHandler(http.HandlerFunc(handleWrite), publicKey))
r.Handle("POST /api/free", authHandler(http.HandlerFunc(freeMetrics), publicKey))
r.Handle("POST /api/write", authHandler(http.HandlerFunc(writeMetrics), publicKey))
r.Handle("GET /api/query", authHandler(http.HandlerFunc(handleQuery), publicKey))
r.Handle("GET /api/debug", authHandler(http.HandlerFunc(handleDebug), publicKey))
r.Handle("GET /api/healthcheck", authHandler(http.HandlerFunc(handleHealthCheck), publicKey))
r.Handle("GET /api/debug", authHandler(http.HandlerFunc(debugMetrics), publicKey))
r.Handle("GET /api/healthcheck", authHandler(http.HandlerFunc(metricsHealth), publicKey))
// Refactor
r.Handle("POST /api/free/", authHandler(http.HandlerFunc(handleFree), publicKey))
r.Handle("POST /api/write/", authHandler(http.HandlerFunc(handleWrite), publicKey))
r.Handle("POST /api/free/", authHandler(http.HandlerFunc(freeMetrics), publicKey))
r.Handle("POST /api/write/", authHandler(http.HandlerFunc(writeMetrics), publicKey))
r.Handle("GET /api/query/", authHandler(http.HandlerFunc(handleQuery), publicKey))
r.Handle("GET /api/debug/", authHandler(http.HandlerFunc(handleDebug), publicKey))
r.Handle("GET /api/healthcheck/", authHandler(http.HandlerFunc(handleHealthCheck), publicKey))
r.Handle("GET /api/debug/", authHandler(http.HandlerFunc(debugMetrics), publicKey))
r.Handle("GET /api/healthcheck/", authHandler(http.HandlerFunc(metricsHealth), publicKey))
} else {
// Compatibility
r.HandleFunc("POST /api/free", handleFree)
r.HandleFunc("POST /api/write", handleWrite)
r.HandleFunc("POST /api/free", freeMetrics)
r.HandleFunc("POST /api/write", writeMetrics)
r.HandleFunc("GET /api/query", handleQuery)
r.HandleFunc("GET /api/debug", handleDebug)
r.HandleFunc("GET /api/healthcheck", handleHealthCheck)
r.HandleFunc("GET /api/debug", debugMetrics)
r.HandleFunc("GET /api/healthcheck", metricsHealth)
// Refactor
r.HandleFunc("POST /api/free/", handleFree)
r.HandleFunc("POST /api/write/", handleWrite)
r.HandleFunc("POST /api/free/", freeMetrics)
r.HandleFunc("POST /api/write/", writeMetrics)
r.HandleFunc("GET /api/query/", handleQuery)
r.HandleFunc("GET /api/debug/", handleDebug)
r.HandleFunc("GET /api/healthcheck/", handleHealthCheck)
r.HandleFunc("GET /api/debug/", debugMetrics)
r.HandleFunc("GET /api/healthcheck/", metricsHealth)
}
}