refactor health module

This commit is contained in:
yusing
2024-11-13 06:46:01 +08:00
parent 6a2638c70c
commit f3b21e6bd9
9 changed files with 37 additions and 29 deletions

View File

@@ -12,6 +12,7 @@ import (
"github.com/yusing/go-proxy/internal/net/http/middleware"
"github.com/yusing/go-proxy/internal/task"
"github.com/yusing/go-proxy/internal/watcher/health"
"github.com/yusing/go-proxy/internal/watcher/health/monitor"
)
// TODO: stats of each server.
@@ -248,7 +249,7 @@ func (lb *LoadBalancer) MarshalJSON() ([]byte, error) {
extra[v.Name] = v.healthMon
})
return (&health.JSONRepresentation{
return (&monitor.JSONRepresentation{
Name: lb.Name(),
Status: lb.Status(),
Started: lb.startTime,