Documentation ¶
Overview ¶
Package rpc provides RPC server and clients specific to Cockroach.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Ready chan struct{} // Closed when client is connected *rpc.Client // Embedded RPC client // contains filtered or unexported fields }
Client is a Cockroach-specific RPC client with an embedded go rpc.Client struct.
func NewClient ¶
NewClient returns a client RPC stub for the specified address (usually a TCP host:port, but for testing may be a unix domain socket). The process-wide client RPC cache is consulted first; if the requested client is not present, it's created and the cache is updated. The returned client is returned immediately and may not be healthy.
type HeartbeatService ¶
type HeartbeatService struct{}
A HeartbeatService exposes a method to echo its request params.
func (*HeartbeatService) Ping ¶
func (hs *HeartbeatService) Ping(args *PingRequest, reply *PingResponse) error
Ping echos the contents of the request to the response.
type PingRequest ¶
type PingRequest struct {
Ping string // Echo this string with PingResponse.
}
A PingRequest specifies the string to echo in response.
type PingResponse ¶
type PingResponse struct {
Pong string // An echo of value sent with PingRequest.
}
A PingResponse contains the echoed ping request string.
type Server ¶
type Server struct { *rpc.Server // Embedded RPC server instance // contains filtered or unexported fields }
Server is a Cockroach-specific RPC server with an embedded go RPC server struct.
func (*Server) AddCloseCallback ¶
AddCloseCallback adds a callback to the closeCallbacks slice to be invoked when a connection is closed.
func (*Server) ListenAndServe ¶
func (s *Server) ListenAndServe()
ListenAndServe begins listening and serving. This method should be invoked by goroutine as it will loop serving incoming client and not return until Close() is invoked.