raftpicker

package
v0.0.0-...-f0983eb Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddrSelector

type AddrSelector interface {
	LeaderAddr() (string, error)
}

AddrSelector is interface which should track cluster for its leader address.

type ConnSelector

type ConnSelector struct {
	// contains filtered or unexported fields
}

ConnSelector is struct for obtaining connection with raftpicker.

func NewConnSelector

func NewConnSelector(cluster RaftCluster, opts ...grpc.DialOption) *ConnSelector

NewConnSelector returns new ConnSelector with cluster and grpc.DialOpts which will be used for Dial on first call of Conn.

func (*ConnSelector) Conn

func (c *ConnSelector) Conn() (*grpc.ClientConn, error)

Conn returns *grpc.ClientConn with picker which picks raft cluster leader. Internal connection estabilished lazily on this call. It can return error if cluster wasn't ready at the moment of initial call.

type RaftCluster

type RaftCluster interface {
	AddrSelector
	IsLeader() bool
}

RaftCluster is interface which combines useful methods for clustering.

Jump to

Keyboard shortcuts

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