func (e *Endpoint) GetValidAddress() (WeightedAddress, bool) {
	for i := 0; i < len(e.Addresses); i++ {
		we := e.Addresses[i]
		if we.HasExpired() {
			e.Addresses = append(e.Addresses[:i], e.Addresses[i+1:]...)
			i--
			continue
		}
		return we, true
	}
	return WeightedAddress{}, false
}
GetValidAddress will return a non-expired weight endpoint
package crr
import (
	"net/url"
	"sort"
	"strings"
	"time"
	"github.com/aws/aws-sdk-go/aws"
)
type Endpoint struct {
	Key       string
	Addresses WeightedAddresses
}
type WeightedAddresses []WeightedAddress
type WeightedAddress struct {
	URL     *url.URL
	Expired time.Time
}
func (e WeightedAddress) HasExpired() bool {
	return e.Expired.Before(time.Now())
}
func (e *Endpoint) Add(addr WeightedAddress) {
	e.Addresses = append(e.Addresses, addr)
}
func (e *Endpoint) Len() int {
	validEndpoints := 0
	for _, endpoint := range e.Addresses {
		if endpoint.HasExpired() {
			continue
		}
		validEndpoints++
	}
	return validEndpoints
}