2021-05-31 06:18:23 +00:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
2024-07-31 12:34:44 +00:00
|
|
|
|
|
|
|
"google.golang.org/grpc"
|
2021-05-31 06:18:23 +00:00
|
|
|
)
|
|
|
|
|
2024-07-31 12:34:44 +00:00
|
|
|
// Conn is an interface for grpc client connection.
|
|
|
|
type Conn interface {
|
|
|
|
grpc.ClientConnInterface
|
|
|
|
io.Closer
|
|
|
|
}
|
|
|
|
|
2021-05-31 06:18:23 +00:00
|
|
|
// Conn returns underlying connection.
|
|
|
|
//
|
|
|
|
// Returns non-nil result after the first Init() call
|
|
|
|
// completed without a connection error.
|
|
|
|
//
|
|
|
|
// Client should not be used after Close() call
|
|
|
|
// on the connection: behavior is undefined.
|
|
|
|
func (c *Client) Conn() io.Closer {
|
2023-02-03 12:22:00 +00:00
|
|
|
return c.conn
|
2021-05-31 06:18:23 +00:00
|
|
|
}
|