frostfs-api-go/rpc/client/conn.go
Airat Arifullin 2ae34b5458
All checks were successful
DCO action / DCO (pull_request) Successful in 40s
Tests and linters / Lint (pull_request) Successful in 45s
Tests and linters / Tests (pull_request) Successful in 54s
Tests and linters / Tests with -race (pull_request) Successful in 1m12s
[#115] rpcclient: Fix type getters
* Add type instance check for nil to avoid panic by
  accessing fields.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2024-09-06 12:14:04 +03:00

28 lines
493 B
Go

package client
import (
"io"
"google.golang.org/grpc"
)
// Conn is an interface for grpc client connection.
type Conn interface {
grpc.ClientConnInterface
io.Closer
}
// 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 {
if c == nil {
return nil
}
return c.conn
}