forked from TrueCloudLab/frostfs-api-go
22ce8e13cc
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>
22 lines
419 B
Go
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
|
|
}
|