func (e *envoy) SetBackup(proxy *Proxy) Envoy {
	e.updateTransport(proxy)
	e.backup = proxy
	return e
}
SetBackup sets the backup proxy client for envoy
package common
import (
	log "github.com/sirupsen/logrus"
	"net/http"
	"sync/atomic"
	"time"
)
type Envoy interface {
	SetPrimary(*Proxy) Envoy
	SetBackup(*Proxy) Envoy
	GetPrimary() *Proxy
	GetBackup() *Proxy
	GetActiveProxy() *Proxy
	SetPrimaryHTTPClient(*http.Client) Envoy
	SetBackupHTTPClient(*http.Client) Envoy
	GetPrimaryHTTPClient() *http.Client
	GetBackupHTTPClient() *http.Client
	GetActiveHTTPClient() *http.Client
	RemoveBackupProxy()
	RemoveBackupHTTPClient()
	ConfigureHealthParams(int, int, time.Duration)
	HasHealthDeteriorated() bool
}
func NewEnvoy(proxy *Proxy) Envoy {
	e := &envoy{
		healthMonitor: NewProxyHealth(),
	}
	e.setPrimary(proxy)
	return e
}
var _ Envoy = new(envoy)
type envoy struct {
	primary       *Proxy
	backup        *Proxy
	primaryHTTP   *http.Client
	backupHTTP    *http.Client
	healthMonitor ProxyHealth
	active        int32
}
func (e *envoy) updateTransport(proxy *Proxy) {
	transport := proxy.ReverseProxy.Transport
	proxy.ReverseProxy.Transport = &Transport{
		RoundTripper:  transport,
		HealthHandler: e.healthHandler,
	}
}
func (e *envoy) updateHTTPClientTransport(client *http.Client) {
	transport := client.Transport
	client.Transport = &Transport{
		RoundTripper:  transport,
		HealthHandler: e.healthHandler,
	}
}
func (e *envoy) setPrimary(proxy *Proxy) Envoy {
	e.updateTransport(proxy)
	e.primary = proxy
	return e
}
func (e *envoy) SetPrimary(proxy *Proxy) Envoy {
	return e.setPrimary(proxy)
}