frostfs-api-go/rpc/client/conn.go
Leonard Lyubich 22ce8e13cc [#196] rpc/client: Implement Client.Conn method
Implement `Client.Conn` which returns the connection of the underlying
transport client. The method is going to be used for forwarding the
connection to superior clients.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-05-31 10:13:00 +03:00

22 lines
419 B
Go

package client
import (
"io"
)
// Conn returns underlying connection.
//
// Returns non-nil result after the first Init() call
// completed without a connection error.
//
// 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 (c *Client) Conn() io.Closer {
if c != nil {
return c.gRPCClient.Conn()
}
return nil
}