mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-24 18:11:19 +01:00
refactor: refactor to adapt new custom json marshaler
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
package monitor
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"github.com/yusing/go-proxy/pkg/json"
|
||||
|
||||
agentPkg "github.com/yusing/go-proxy/agent/pkg/agent"
|
||||
"github.com/yusing/go-proxy/internal/watcher/health"
|
||||
)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package health
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"github.com/yusing/go-proxy/pkg/json"
|
||||
)
|
||||
|
||||
type Status uint8
|
||||
|
||||
@@ -35,10 +37,6 @@ func (s Status) String() string {
|
||||
}
|
||||
}
|
||||
|
||||
func (s Status) MarshalJSON() ([]byte, error) {
|
||||
return []byte(`"` + s.String() + `"`), nil
|
||||
}
|
||||
|
||||
func (s *Status) UnmarshalJSON(data []byte) error {
|
||||
var str string
|
||||
if err := json.Unmarshal(data, &str); err != nil {
|
||||
|
||||
@@ -24,7 +24,7 @@ type (
|
||||
task.TaskStarter
|
||||
task.TaskFinisher
|
||||
fmt.Stringer
|
||||
utils.MapMarshaller
|
||||
utils.MapMarshaler
|
||||
WithHealthInfo
|
||||
Name() string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user