mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 04:42:33 +02:00
22 lines
385 B
Go
22 lines
385 B
Go
package uptime
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/yusing/go-proxy/internal/watcher/health"
|
|
)
|
|
|
|
type Status struct {
|
|
Status health.Status
|
|
Latency int64
|
|
Timestamp int64
|
|
}
|
|
|
|
type RouteStatuses map[string][]*Status
|
|
|
|
func (s *Status) MarshalJSONTo(buf []byte) []byte {
|
|
return fmt.Appendf(buf,
|
|
`{"status":"%s","latency":"%d","timestamp":"%d"}`,
|
|
s.Status, s.Latency, s.Timestamp,
|
|
)
|
|
}
|