[#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
|
@ -1,29 +1,19 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/TrueCloudLab/frostfs-api-go/v2/rpc/grpc"
|
||||
)
|
||||
|
||||
// Client represents client for exchanging messages
|
||||
// with a remote server using Protobuf RPC.
|
||||
type Client struct {
|
||||
*cfg
|
||||
|
||||
gRPCClientOnce sync.Once
|
||||
gRPCClient *grpc.Client
|
||||
cfg
|
||||
}
|
||||
|
||||
// New creates, configures via options and returns new Client instance.
|
||||
func New(opts ...Option) *Client {
|
||||
c := defaultCfg()
|
||||
var c Client
|
||||
c.initDefault()
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(c)
|
||||
opt(&c.cfg)
|
||||
}
|
||||
|
||||
return &Client{
|
||||
cfg: c,
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue