Documentation ¶
Overview ¶
Package connection provides functionality to establish the connection between the client and the server. It is an internal package to be used only by the Doorman system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { Stub pb.CapacityClient Opts *Options // contains filtered or unexported fields }
Connection contains information about connection between the server and the client.
func New ¶
func New(addr string, options ...Option) (*Connection, error)
New creates a new Connection with the given server address.
func (*Connection) Close ¶
func (connection *Connection) Close()
Close closes the connection of the client to the server.
func (*Connection) ExecuteRPC ¶
func (connection *Connection) ExecuteRPC(callback func() (HasMastership, error)) (interface{}, error)
ExecuteRPC executes an RPC against the current master.
func (*Connection) String ¶
func (connection *Connection) String() string
type HasMastership ¶
type HasMastership interface {
GetMastership() *pb.Mastership
}
HasMastership is an interface that is implemented by RPC responses that may contain changing mastership information.
type Option ¶
type Option func(*Options)
Option configures the connection parameters.
func DialOpts ¶
func DialOpts(dialOpts ...rpc.DialOption) Option
DialOpts sets dial options for the connection.
func MinimumRefreshInterval ¶
MinimumRefreshInterval sets the minimum refresh interval for the connection's establishing.