Documentation ¶
Overview ¶
Copyright (c) 2014-2015 Oliver Eilhard. All rights reserved. Use of this source code is governed by the MIT license. See LICENSE file for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBalancer ¶
func NewBalancer(conns ...balancers.Connection) (balancers.Balancer, error)
NewBalancer creates a new round-robin balancer. It can be initializes by a variable number of connections. To use plain URLs instead of connections, use NewBalancerFromURL.
Types ¶
type Balancer ¶
type Balancer struct { sync.Mutex // guards the following variables // contains filtered or unexported fields }
Balancer implements a round-robin balancer.
func NewBalancerFromURL ¶
NewBalancerFromURL creates a new round-robin balancer for the given list of URLs. It returns an error if any of the URLs is invalid.
func (*Balancer) Connections ¶
func (b *Balancer) Connections() []balancers.Connection
Connections returns a list of all connections.
Click to show internal directories.
Click to hide internal directories.