Apply compat patch

This commit is contained in:
yusing
2026-03-10 15:01:07 +08:00
parent 291fe67c31
commit 0bd134cf47
59 changed files with 261 additions and 266 deletions

View File

@@ -1,8 +1,9 @@
package types
import (
"github.com/bytedance/sonic"
"github.com/moby/moby/api/types/container"
"encoding/json"
"github.com/docker/docker/api/types/container"
"github.com/yusing/ds/ordered"
"github.com/yusing/godoxy/internal/agentpool"
gperr "github.com/yusing/goutils/errs"
@@ -11,7 +12,7 @@ import (
type (
LabelMap = map[string]any
PortMapping = map[int]container.PortSummary
PortMapping = map[int]container.Port
Container struct {
DockerCfg DockerProviderConfig `json:"docker_cfg"`
Image *ContainerImage `json:"image"`
@@ -69,5 +70,5 @@ func (e *ContainerError) Unwrap() error {
func (e *ContainerError) MarshalJSON() ([]byte, error) {
err := e.errs.Error().(gperr.PlainError)
return sonic.Marshal(string(err.Plain()))
return json.Marshal(string(err.Plain()))
}

View File

@@ -7,7 +7,6 @@ import (
"strconv"
"time"
"github.com/bytedance/sonic"
"github.com/yusing/goutils/task"
)
@@ -175,7 +174,7 @@ func (s HealthStatus) MarshalJSON() ([]byte, error) {
func (s *HealthStatus) UnmarshalJSON(data []byte) error {
var v string
if err := sonic.Unmarshal(data, &v); err != nil {
if err := json.Unmarshal(data, &v); err != nil {
return fmt.Errorf("failed to unmarshal health status: %w", err)
}
@@ -191,7 +190,7 @@ func (jsonRepr *HealthJSONRepr) MarshalJSON() ([]byte, error) {
if url == "http://:0" {
url = ""
}
return sonic.Marshal(HealthJSON{
return json.Marshal(HealthJSON{
Name: jsonRepr.Name,
Config: jsonRepr.Config,
Started: jsonRepr.Started.Unix(),