func (be *T) String() string {
	return fmt.Sprintf("backend(%v)", &be.id)
}
String returns string backend representation to be used in logs.
package backend
import (
	"fmt"
	"net"
	"net/http"
	"net/url"
	"sync"
	"github.com/pkg/errors"
	log "github.com/sirupsen/logrus"
	"github.com/vulcand/vulcand/engine"
	"github.com/vulcand/vulcand/proxy"
)
type T struct {
	mu          sync.Mutex
	id          string
	httpCfg     engine.HTTPBackendSettings
	httpTp      *http.Transport
	srvCfgsSeen bool
	srvs        []Srv
}
type Srv struct {
	id        string
	rawURL    string
	parsedURL *url.URL
}
func (s *Srv) Cfg() engine.Server {
	return engine.Server{
		Id:  s.id,
		URL: s.rawURL,
	}
}
type SrvURLKey struct {
	scheme string
	host   string
}
func NewSrvURLKey(u *url.URL) SrvURLKey {
	return SrvURLKey{scheme: u.Scheme, host: u.Host}
}
func NewServer(beSrvCfg engine.Server) (Srv, error) {
	parsedURL, err := url.Parse(beSrvCfg.URL)
	if err != nil {
		return Srv{}, errors.Wrapf(err, "bad url %v", beSrvCfg.URL)
	}
	return Srv{
		id:        beSrvCfg.Id,
		rawURL:    beSrvCfg.URL,
		parsedURL: parsedURL,
	}, nil
}
func (s *Srv) URL() *url.URL {
	return s.parsedURL
}
func (s *Srv) URLKey() SrvURLKey {
	return NewSrvURLKey(s.parsedURL)
}
func New(beCfg engine.Backend, opts proxy.Options, beSrvs []Srv) (*T, error) {
	tpCfg, err := newTransportCfg(beCfg.HTTPSettings(), opts)
	if err != nil {
		return nil, errors.Wrap(err, "bad config")
	}
	return &T{
		id:      beCfg.Id,
		httpCfg: beCfg.HTTPSettings(),
		httpTp:  newTransport(tpCfg),
		srvs:    beSrvs,
	}, nil
}
func (be *T) Key() engine.BackendKey {
	return engine.BackendKey{Id: be.id}
}