Documentation ¶
Overview ¶
Most of the code here is taken from the Google OAuth2 client library at https://github.com/golang/oauth2, especially https://github.com/golang/oauth2/blob/master/transport.go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoConn = errors.New("no connection")
ErrNoConn no connection error
Functions ¶
Types ¶
type Balancer ¶
type Balancer interface { Get() (Connection, error) Connections() []Connection }
type Connection ¶
type HttpConnection ¶
func NewHttpConnection ¶
func NewHttpConnection(url *url.URL) *HttpConnection
func (*HttpConnection) Close ¶
func (c *HttpConnection) Close() error
func (*HttpConnection) HeartbeatDuration ¶
func (c *HttpConnection) HeartbeatDuration(d time.Duration) *HttpConnection
func (*HttpConnection) IsBroken ¶
func (c *HttpConnection) IsBroken() bool
func (*HttpConnection) URL ¶
func (c *HttpConnection) URL() *url.URL
type Roundrobin ¶
Roundrobin load balancer
func NewRoundrobin ¶
func NewRoundrobin(conns ...Connection) (*Roundrobin, error)
NewRoundrobin new round robin with connection
func NewRoundrobinFromURL ¶
func NewRoundrobinFromURL(urls ...string) (*Roundrobin, error)
NewRoundrobinFromURL creates a new round-robin balancer from the given urls. it returns error if any of URLs is invalid
func (*Roundrobin) Connections ¶
func (r *Roundrobin) Connections() []Connection
Connections return connections
Click to show internal directories.
Click to hide internal directories.