Documentation ¶
Overview ¶
Package connectionbroker is a layer on top of remotes that returns a gRPC connection to a manager. The connection may be a local connection using a local socket such as a UNIX socket.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker is a simple connection broker. It can either return a fresh connection to a remote manager selected with weighted randomization, or a local gRPC connection to the local manager.
func (*Broker) Remotes ¶
Remotes returns the remotes interface used by the broker, so the caller can make observations or see weights directly.
func (*Broker) Select ¶
func (b *Broker) Select(dialOpts ...grpc.DialOption) (*Conn, error)
Select a manager from the set of available managers, and return a connection.
func (*Broker) SelectRemote ¶
func (b *Broker) SelectRemote(dialOpts ...grpc.DialOption) (*Conn, error)
SelectRemote chooses a manager from the remotes, and returns a TCP connection.
func (*Broker) SetLocalConn ¶
func (b *Broker) SetLocalConn(localConn *grpc.ClientConn)
SetLocalConn changes the local gRPC connection used by the connection broker.
type Conn ¶
type Conn struct { *grpc.ClientConn // contains filtered or unexported fields }
Conn is a wrapper around a gRPC client connection.