mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-21 16:49:03 +01:00
fix various endpoints
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/yusing/go-proxy/agent/pkg/agent"
|
||||
"github.com/yusing/go-proxy/internal/utils/functional"
|
||||
)
|
||||
@@ -22,11 +20,11 @@ func GetAgent(addr string) (agent *agent.AgentConfig, ok bool) {
|
||||
return
|
||||
}
|
||||
|
||||
func (cfg *Config) GetAgent(agentDockerHost string) (*agent.AgentConfig, bool) {
|
||||
if !agent.IsDockerHostAgent(agentDockerHost) {
|
||||
panic(errors.New("invalid use of GetAgent with docker host: " + agentDockerHost))
|
||||
func (cfg *Config) GetAgent(agentAddrOrDockerHost string) (*agent.AgentConfig, bool) {
|
||||
if !agent.IsDockerHostAgent(agentAddrOrDockerHost) {
|
||||
return GetAgent(agentAddrOrDockerHost)
|
||||
}
|
||||
return GetAgent(agent.GetAgentAddrFromDockerHost(agentDockerHost))
|
||||
return GetAgent(agent.GetAgentAddrFromDockerHost(agentAddrOrDockerHost))
|
||||
}
|
||||
|
||||
func (cfg *Config) ListAgents() []*agent.AgentConfig {
|
||||
|
||||
@@ -41,7 +41,7 @@ type (
|
||||
Statistics() map[string]any
|
||||
RouteProviderList() []string
|
||||
Context() context.Context
|
||||
GetAgent(agentDockerHost string) (*agent.AgentConfig, bool)
|
||||
GetAgent(agentAddrOrDockerHost string) (*agent.AgentConfig, bool)
|
||||
ListAgents() []*agent.AgentConfig
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user