defaultselector

package
v0.0.0-...-62717ef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL