Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallOption ¶
type CallOption func(*callParameters)
CallOption is a messaging session option within RPC.
func WithContext ¶
func WithContext(ctx context.Context) CallOption
WithContext returns option to set RPC context.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents client for exchanging messages with a remote server using gRPC protocol.
func (*Client) Conn ¶ added in v1.27.0
Conn returns underlying connection.
Conn is NPE-safe: returns nil if Client is nil.
Client should not be used after Close() call on the connection: behavior is undefined.
func (*Client) Init ¶
func (c *Client) Init(info common.CallMethodInfo, opts ...CallOption) (MessageReadWriter, error)
Init initiates a messaging session within the RPC configured by options.
type MessageReadWriter ¶
type MessageReadWriter interface { // ReadMessage reads the next message from the remote server, // and writes it to the argument. ReadMessage(Message) error // WriteMessage sends message from argument to remote server. WriteMessage(Message) error // Closes the communication session with the remote server. // // All calls to send/receive messages must be done before closing. io.Closer }
MessageReadWriter is a component interface for transmitting raw messages over gRPC protocol.
type Option ¶
type Option func(*cfg)
Option is a Client's constructor option.
func WithClientConnection ¶
func WithClientConnection(con *grpc.ClientConn) Option
WithClientConnection returns option to set gRPC connection to the remote server.