Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultDialer = net.Dialer{}
Functions ¶
func NormalizeRoute ¶ added in v1.10.3
NormalizeRoute canonicalizes a route string from a backend
This function performs the following on the instance:
(1) If instance is a blank string, e.g. contains only whitespace or is empty, an empty string is returned with an error (2) If the instance with whitespace trimmed off is not a valid instance, an error is returned with the trimmed instance string. This function is intentionally lenient on what is a valid instance string, e.g. "foobar.com", "foobar.com:8080", "asdf://foobar.com", etc (3) If there was no scheme prepended to the route, http will be used
Types ¶
type Resolver ¶
type Resolver interface { Dial // Add adds the resolver to the methods of creating the IPv4 and IPv6 addresses Add(r Lookup) error // Remove removes the resolver to the methods of creating the IPv4 and IPv6 addresses Remove(r Lookup) error }
Resolver represents how to generate the address and how to create the connection
type RoundRobin ¶
type RoundRobin struct {
// contains filtered or unexported fields
}
func NewRoundRobinBalancer ¶
func NewRoundRobinBalancer() *RoundRobin
func (*RoundRobin) Add ¶
func (robin *RoundRobin) Add(route Route) error
func (*RoundRobin) Get ¶
func (robin *RoundRobin) Get() ([]Route, error)
func (*RoundRobin) Remove ¶
func (robin *RoundRobin) Remove(route Route) error
func (*RoundRobin) Update ¶
func (robin *RoundRobin) Update(routes []Route)
Click to show internal directories.
Click to hide internal directories.