mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 16:58:31 +02:00
refactor(agent): move agent pool to agent package, rename route.Agent() to route.GetAgent()
This commit is contained in:
@@ -39,7 +39,7 @@ func NewReverseProxyRoute(base *Route) (*ReveseProxyRoute, gperr.Error) {
|
||||
proxyURL := base.ProxyURL
|
||||
|
||||
var trans *http.Transport
|
||||
a := base.Agent()
|
||||
a := base.GetAgent()
|
||||
if a != nil {
|
||||
trans = a.Transport()
|
||||
proxyURL = nettypes.NewURL(agent.HTTPProxyURL)
|
||||
|
||||
@@ -351,7 +351,7 @@ func (r *Route) Type() route.RouteType {
|
||||
panic(fmt.Errorf("unexpected scheme %s for alias %s", r.Scheme, r.Alias))
|
||||
}
|
||||
|
||||
func (r *Route) Agent() *agent.AgentConfig {
|
||||
func (r *Route) GetAgent() *agent.AgentConfig {
|
||||
if r.Container == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -359,7 +359,7 @@ func (r *Route) Agent() *agent.AgentConfig {
|
||||
}
|
||||
|
||||
func (r *Route) IsAgent() bool {
|
||||
return r.Container != nil && r.Container.Agent != nil
|
||||
return r.GetAgent() != nil
|
||||
}
|
||||
|
||||
func (r *Route) HealthMonitor() health.HealthMonitor {
|
||||
|
||||
@@ -38,7 +38,7 @@ type (
|
||||
HomepageItem() *homepage.Item
|
||||
ContainerInfo() *docker.Container
|
||||
|
||||
Agent() *agent.AgentConfig
|
||||
GetAgent() *agent.AgentConfig
|
||||
|
||||
IsDocker() bool
|
||||
IsAgent() bool
|
||||
|
||||
Reference in New Issue
Block a user