api: added some endpoints for dashboard filter to work

This commit is contained in:
yusing
2025-01-20 06:17:18 +08:00
parent bcc7faa8e5
commit 68771ce399
13 changed files with 82 additions and 34 deletions

View File

@@ -8,11 +8,11 @@ import (
"github.com/coder/websocket/wsjson"
U "github.com/yusing/go-proxy/internal/api/v1/utils"
config "github.com/yusing/go-proxy/internal/config/types"
"github.com/yusing/go-proxy/internal/route/routes"
"github.com/yusing/go-proxy/internal/route/routes/routequery"
)
func HealthWS(cfg config.ConfigInstance, w http.ResponseWriter, r *http.Request) {
U.PeriodicWS(cfg, w, r, 1*time.Second, func(conn *websocket.Conn) error {
return wsjson.Write(r.Context(), conn, routes.HealthMap())
return wsjson.Write(r.Context(), conn, routequery.HealthMap())
})
}