refactor(agent): move agent pool to agent package, rename route.Agent() to route.GetAgent()

This commit is contained in:
yusing
2025-06-14 20:04:39 +08:00
parent cabb840a91
commit 7d17a01de1
13 changed files with 23 additions and 55 deletions

View File

@@ -12,7 +12,6 @@ import (
"github.com/docker/docker/api/types/container"
"github.com/docker/go-connections/nat"
"github.com/yusing/go-proxy/agent/pkg/agent"
config "github.com/yusing/go-proxy/internal/config/types"
"github.com/yusing/go-proxy/internal/gperr"
idlewatcher "github.com/yusing/go-proxy/internal/idlewatcher/types"
"github.com/yusing/go-proxy/internal/serialization"
@@ -102,7 +101,7 @@ func FromDocker(c *container.SummaryTrimmed, dockerHost string) (res *Container)
if agent.IsDockerHostAgent(dockerHost) {
var ok bool
res.Agent, ok = config.GetInstance().GetAgent(dockerHost)
res.Agent, ok = agent.GetAgent(dockerHost)
if !ok {
res.addError(fmt.Errorf("agent %q not found", dockerHost))
}