Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddrSelector ¶
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.
Click to show internal directories.
Click to hide internal directories.