func (t *Transport) Endpoints() []string {
	return t.endpoints
}
Endpoints returns the current endpoints for this service.
This can be those set via the serverset.Watch or manually via SetEndpoints()
package httpset
import (
	"net/http"
	"sync/atomic"
	"time"
)
type Transport struct {
	Watcher
	UseHTTPS bool  
	BaseTransport http.RoundTripper
	LastEvent  time.Time
	EventCount int
	event     chan struct{}
	count     int64
	endpoints []string
}
func NewTransport(watch Watcher) *Transport {
	t := &Transport{
		Watcher: watch,
		event:   make(chan struct{}, 1),
	}
	if watch != nil {
		t.setEndpoints(watch.Endpoints())
		go func() {
			for {
				select {
				case <-watch.Event():
					t.SetEndpoints(watch.Endpoints())
				}
				if watch.IsClosed() {
					break
				}
			}
			watcherClosed()
		}()
	}
	return t
}
var watcherClosed = func() {}
func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {
	err := t.replaceHost(req)
	if err != nil {
		return nil, err
	}
	if t.BaseTransport == nil {
		return http.DefaultTransport.RoundTrip(req)
	}
	return t.BaseTransport.RoundTrip(req)
}
func (t *Transport) replaceHost(req *http.Request) error {
	host, err := t.RotateEndpoint()
	if err != nil {
		return err
	}
	req.URL.Host = host
	if req.URL.Scheme == "" {
		if t.UseHTTPS {
			req.URL.Scheme = "https"
		} else {
			req.URL.Scheme = "http"
		}
	}
	return nil
}