Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoServers is returned when no servers are configured or available. ErrNoServers = errors.New("memcache: no servers configured or available") )
Functions ¶
This section is empty.
Types ¶
type ServerList ¶
type ServerList struct {
// contains filtered or unexported fields
}
ServerList is a simple ServerSelector. Its zero value is usable.
func (*ServerList) Each ¶
func (ss *ServerList) Each(f func(net.Addr) error) error
Each iterates over each server calling the given function
func (*ServerList) PickServer ¶
func (ss *ServerList) PickServer(key string) (net.Addr, error)
func (*ServerList) ReturnAddresses ¶
func (ss *ServerList) ReturnAddresses() []net.Addr
func (*ServerList) SetServers ¶
func (ss *ServerList) SetServers(servers ...string) error
SetServers changes a ServerList's set of servers at runtime and is safe for concurrent use by multiple goroutines.
Each server is given equal weight. A server is given more weight if it's listed multiple times.
SetServers returns an error if any of the server names fail to resolve. No attempt is made to connect to the server. If any error is returned, no changes are made to the ServerList.
Click to show internal directories.
Click to hide internal directories.