forked from TrueCloudLab/frostfs-api-go
[#2] rpc/client: Remove additional wrapper
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
513e3e137d
commit
cc8da15242
12 changed files with 82 additions and 268 deletions
|
@ -7,28 +7,11 @@ import (
|
|||
"net"
|
||||
"net/url"
|
||||
|
||||
"github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc"
|
||||
grpcstd "google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
)
|
||||
|
||||
func (c *Client) createGRPCClient(ctx context.Context) (err error) {
|
||||
c.gRPCClientOnce.Do(func() {
|
||||
if err = c.openGRPCConn(ctx); err != nil {
|
||||
err = fmt.Errorf("open gRPC connection: %w", err)
|
||||
return
|
||||
}
|
||||
|
||||
c.gRPCClient = grpc.New(
|
||||
grpc.WithClientConnection(c.conn),
|
||||
grpc.WithRWTimeout(c.rwTimeout),
|
||||
)
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
var errInvalidEndpoint = errors.New("invalid endpoint options")
|
||||
|
||||
func (c *Client) openGRPCConn(ctx context.Context) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue