[#2] rpc/client: Allow to override low-level gRPC options
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
cc8da15242
commit
45358d4551
3 changed files with 31 additions and 17 deletions
|
@ -1,5 +1,10 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
)
|
||||
|
||||
// Client represents client for exchanging messages
|
||||
// with a remote server using Protobuf RPC.
|
||||
type Client struct {
|
||||
|
@ -15,5 +20,9 @@ func New(opts ...Option) *Client {
|
|||
opt(&c.cfg)
|
||||
}
|
||||
|
||||
if c.tlsCfg != nil {
|
||||
c.grpcDialOpts = append(c.grpcDialOpts, grpc.WithTransportCredentials(credentials.NewTLS(c.tlsCfg)))
|
||||
}
|
||||
|
||||
return &c
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue