mirror of
https://github.com/yusing/godoxy.git
synced 2025-07-28 14:43:16 +02:00

* api: enrich provider statistifcs * fix: docker monitor now uses container status * Feat/auto schemas (#48) * use auto generated schemas * go version bump and dependencies upgrade * clarify some error messages --------- Co-authored-by: yusing <yusing@6uo.me> * cleanup some loadbalancer code * api: cleanup websocket code * api: add /v1/health/ws for health bubbles on dashboard * feat: experimental memory logger and logs api for WebUI --------- Co-authored-by: yusing <yusing@6uo.me>
18 lines
502 B
Go
18 lines
502 B
Go
package v1
|
|
|
|
import (
|
|
"net/http"
|
|
"time"
|
|
|
|
"github.com/coder/websocket"
|
|
"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"
|
|
)
|
|
|
|
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())
|
|
})
|
|
}
|