Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoHostAvailable when the backend don't have hosts ErrNoHostAvailable = errors.New("No host available") )
Functions ¶
This section is empty.
Types ¶
type CustomDialer ¶
type CustomDialer struct {
// contains filtered or unexported fields
}
CustomDialer implements a roundrobin connection pool based on the resources in the backend. Could be IP or hosts. If is hosts it will refresh the DNS resolution every 5s and will all the returned IPs in the slice of hosts
func (*CustomDialer) Addr ¶
func (cd *CustomDialer) Addr() string
func (*CustomDialer) DialContext ¶
DialContext will use one IP from the resources using the round-robin and call to the original net.DialContext
func (*CustomDialer) DialTLSContext ¶
type HealthCheck ¶
type Resource ¶
type Resource struct { Protocol string Host string Transport *http.Transport HealthCheck HealthCheck // contains filtered or unexported fields }
func New ¶
func New(p discoverlib.Plugin, host string, useTLS bool, Healthcheck HealthCheck) *Resource
Click to show internal directories.
Click to hide internal directories.