From e91d40e250cbf6453c6b9c1655df1a08d53b1dd3 Mon Sep 17 00:00:00 2001 From: aarifullin Date: Mon, 13 Nov 2023 15:18:07 +0300 Subject: [PATCH 1/2] [#189] client: Make PrmInit fields public for client Signed-off-by: Airat Arifullin --- client/accounting.go | 2 +- client/client.go | 20 +++++++++++++------- client/client_test.go | 5 +++-- client/common.go | 8 ++++---- client/container_delete.go | 4 ++-- client/container_eacl.go | 2 +- client/container_get.go | 2 +- client/container_list.go | 2 +- client/container_put.go | 4 ++-- client/container_set_eacl.go | 4 ++-- client/container_space.go | 2 +- client/netmap.go | 6 +++--- client/object_delete.go | 2 +- client/object_get.go | 6 +++--- client/object_hash.go | 2 +- client/object_put_raw.go | 2 +- client/object_put_single.go | 2 +- client/object_put_transformer.go | 6 +++--- client/object_search.go | 2 +- client/session.go | 4 ++-- pool/pool.go | 14 ++++++++------ 21 files changed, 55 insertions(+), 46 deletions(-) diff --git a/client/accounting.go b/client/accounting.go index 402554f..d0aa653 100644 --- a/client/accounting.go +++ b/client/accounting.go @@ -79,7 +79,7 @@ func (c *Client) BalanceGet(ctx context.Context, prm PrmBalanceGet) (*ResBalance return nil, err } - if err := signature.SignServiceMessage(&c.prm.key, req); err != nil { + if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { return nil, fmt.Errorf("sign request: %w", err) } diff --git a/client/client.go b/client/client.go index ba57b41..c111f02 100644 --- a/client/client.go +++ b/client/client.go @@ -144,21 +144,23 @@ func (c *Client) Close() error { // // See also Init. type PrmInit struct { - disableFrostFSErrorResolution bool + DisableFrostFSErrorResolution bool - key ecdsa.PrivateKey + Key ecdsa.PrivateKey - cbRespInfo func(ResponseMetaInfo) error + ResponseInfoCallback func(ResponseMetaInfo) error - netMagic uint64 + NetMagic uint64 } // SetDefaultPrivateKey sets Client private key to be used for the protocol // communication by default. // // Required for operations without custom key parametrization (see corresponding Prm* docs). +// +// Deprecated: Use PrmInit.Key instead. func (x *PrmInit) SetDefaultPrivateKey(key ecdsa.PrivateKey) { - x.key = key + x.Key = key } // Deprecated: method is no-op. Option is default. @@ -169,14 +171,18 @@ func (x *PrmInit) ResolveFrostFSFailures() { // FrostFS protocol only in resulting structure (see corresponding Res* docs). // These errors are returned from each protocol operation. By default, statuses // are resolved and returned as a Go built-in errors. +// +// Deprecated: Use PrmInit.DisableFrostFSErrorResolution instead. func (x *PrmInit) DisableFrostFSFailuresResolution() { - x.disableFrostFSErrorResolution = true + x.DisableFrostFSErrorResolution = true } // SetResponseInfoCallback makes the Client to pass ResponseMetaInfo from each // FrostFS server response to f. Nil (default) means ignore response meta info. +// +// Deprecated: Use PrmInit.ResponseInfoCallback instead. func (x *PrmInit) SetResponseInfoCallback(f func(ResponseMetaInfo) error) { - x.cbRespInfo = f + x.ResponseInfoCallback = f } // PrmDial groups connection parameters for the Client. diff --git a/client/client_test.go b/client/client_test.go index 16f66e2..1f05544 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -29,8 +29,9 @@ func assertStatusErr(tb testing.TB, res interface{ Status() apistatus.Status }) } func newClient(server frostFSAPIServer) *Client { - var prm PrmInit - prm.SetDefaultPrivateKey(*key) + prm := PrmInit{ + Key: *key, + } var c Client c.Init(prm) diff --git a/client/common.go b/client/common.go index 0df1806..c67084a 100644 --- a/client/common.go +++ b/client/common.go @@ -78,19 +78,19 @@ func (c *Client) prepareRequest(req request, meta *v2session.RequestMetaHeader) meta.SetTTL(ttl) meta.SetVersion(verV2) - meta.SetNetworkMagic(c.prm.netMagic) + meta.SetNetworkMagic(c.prm.NetMagic) req.SetMetaHeader(meta) } // processResponse verifies response signature and converts status to an error if needed. func (c *Client) processResponse(resp responseV2) (apistatus.Status, error) { - if c.prm.cbRespInfo != nil { + if c.prm.ResponseInfoCallback != nil { rmi := ResponseMetaInfo{ key: resp.GetVerificationHeader().GetBodySignature().GetKey(), epoch: resp.GetMetaHeader().GetEpoch(), } - if err := c.prm.cbRespInfo(rmi); err != nil { + if err := c.prm.ResponseInfoCallback(rmi); err != nil { return nil, fmt.Errorf("response callback error: %w", err) } } @@ -101,7 +101,7 @@ func (c *Client) processResponse(resp responseV2) (apistatus.Status, error) { } st := apistatus.FromStatusV2(resp.GetMetaHeader().GetStatus()) - if !c.prm.disableFrostFSErrorResolution { + if !c.prm.DisableFrostFSErrorResolution { return st, apistatus.ErrFromStatus(st) } return st, nil diff --git a/client/container_delete.go b/client/container_delete.go index f750c90..6d4b345 100644 --- a/client/container_delete.go +++ b/client/container_delete.go @@ -52,7 +52,7 @@ func (prm *PrmContainerDelete) buildRequest(c *Client) (*v2container.DeleteReque var sig frostfscrypto.Signature - err := sig.Calculate(frostfsecdsa.SignerRFC6979(c.prm.key), data) + err := sig.Calculate(frostfsecdsa.SignerRFC6979(c.prm.Key), data) if err != nil { return nil, fmt.Errorf("calculate signature: %w", err) } @@ -124,7 +124,7 @@ func (c *Client) ContainerDelete(ctx context.Context, prm PrmContainerDelete) (* return nil, err } - if err := signature.SignServiceMessage(&c.prm.key, req); err != nil { + if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { return nil, fmt.Errorf("sign request: %w", err) } diff --git a/client/container_eacl.go b/client/container_eacl.go index d577b7a..87d32d1 100644 --- a/client/container_eacl.go +++ b/client/container_eacl.go @@ -85,7 +85,7 @@ func (c *Client) ContainerEACL(ctx context.Context, prm PrmContainerEACL) (*ResC return nil, err } - if err := signature.SignServiceMessage(&c.prm.key, req); err != nil { + if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { return nil, fmt.Errorf("sign request: %w", err) } diff --git a/client/container_get.go b/client/container_get.go index 4477973..a6dd6f2 100644 --- a/client/container_get.go +++ b/client/container_get.go @@ -87,7 +87,7 @@ func (c *Client) ContainerGet(ctx context.Context, prm PrmContainerGet) (*ResCon return nil, err } - if err := signature.SignServiceMessage(&c.prm.key, req); err != nil { + if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { return nil, fmt.Errorf("sign request: %w", err) } diff --git a/client/container_list.go b/client/container_list.go index ebe27c3..0fb91c2 100644 --- a/client/container_list.go +++ b/client/container_list.go @@ -80,7 +80,7 @@ func (c *Client) ContainerList(ctx context.Context, prm PrmContainerList) (*ResC return nil, err } - if err := signature.SignServiceMessage(&c.prm.key, req); err != nil { + if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { return nil, fmt.Errorf("sign request: %w", err) } diff --git a/client/container_put.go b/client/container_put.go index 6ff4e5f..e5b8f18 100644 --- a/client/container_put.go +++ b/client/container_put.go @@ -64,7 +64,7 @@ func (x *PrmContainerPut) buildRequest(c *Client) (*v2container.PutRequest, erro var sig frostfscrypto.Signature - err := container.CalculateSignature(&sig, *x.Container, c.prm.key) + err := container.CalculateSignature(&sig, *x.Container, c.prm.Key) if err != nil { return nil, fmt.Errorf("calculate container signature: %w", err) } @@ -132,7 +132,7 @@ func (c *Client) ContainerPut(ctx context.Context, prm PrmContainerPut) (*ResCon return nil, err } - if err := signature.SignServiceMessage(&c.prm.key, req); err != nil { + if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { return nil, fmt.Errorf("sign request: %w", err) } diff --git a/client/container_set_eacl.go b/client/container_set_eacl.go index 8ad808f..b149334 100644 --- a/client/container_set_eacl.go +++ b/client/container_set_eacl.go @@ -64,7 +64,7 @@ func (x *PrmContainerSetEACL) buildRequest(c *Client) (*v2container.SetExtendedA var sig frostfscrypto.Signature - err := sig.Calculate(frostfsecdsa.SignerRFC6979(c.prm.key), eaclV2.StableMarshal(nil)) + err := sig.Calculate(frostfsecdsa.SignerRFC6979(c.prm.Key), eaclV2.StableMarshal(nil)) if err != nil { return nil, fmt.Errorf("calculate signature: %w", err) } @@ -121,7 +121,7 @@ func (c *Client) ContainerSetEACL(ctx context.Context, prm PrmContainerSetEACL) return nil, err } - if err := signature.SignServiceMessage(&c.prm.key, req); err != nil { + if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { return nil, fmt.Errorf("sign request: %w", err) } diff --git a/client/container_space.go b/client/container_space.go index 793f5f4..dda5acc 100644 --- a/client/container_space.go +++ b/client/container_space.go @@ -77,7 +77,7 @@ func (c *Client) ContainerAnnounceUsedSpace(ctx context.Context, prm PrmAnnounce return nil, err } - if err := signature.SignServiceMessage(&c.prm.key, req); err != nil { + if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { return nil, fmt.Errorf("sign request: %w", err) } diff --git a/client/netmap.go b/client/netmap.go index c06f940..f2c2e06 100644 --- a/client/netmap.go +++ b/client/netmap.go @@ -71,7 +71,7 @@ func (c *Client) EndpointInfo(ctx context.Context, prm PrmEndpointInfo) (*ResEnd return nil, err } - if err := signature.SignServiceMessage(&c.prm.key, req); err != nil { + if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { return nil, fmt.Errorf("sign request: %w", err) } @@ -158,7 +158,7 @@ func (c *Client) NetworkInfo(ctx context.Context, prm PrmNetworkInfo) (*ResNetwo return nil, err } - if err := signature.SignServiceMessage(&c.prm.key, req); err != nil { + if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { return nil, fmt.Errorf("sign request: %w", err) } @@ -228,7 +228,7 @@ func (c *Client) NetMapSnapshot(ctx context.Context, _ PrmNetMapSnapshot) (*ResN req.SetBody(&body) c.prepareRequest(&req, &meta) - err := signature.SignServiceMessage(&c.prm.key, &req) + err := signature.SignServiceMessage(&c.prm.Key, &req) if err != nil { return nil, fmt.Errorf("sign request: %w", err) } diff --git a/client/object_delete.go b/client/object_delete.go index 3f72e0c..a9fe8e8 100644 --- a/client/object_delete.go +++ b/client/object_delete.go @@ -131,7 +131,7 @@ func (c *Client) ObjectDelete(ctx context.Context, prm PrmObjectDelete) (*ResObj return nil, err } - key := c.prm.key + key := c.prm.Key if prm.Key != nil { key = *prm.Key } diff --git a/client/object_get.go b/client/object_get.go index 03b91d2..363c1ec 100644 --- a/client/object_get.go +++ b/client/object_get.go @@ -307,7 +307,7 @@ func (c *Client) ObjectGetInit(ctx context.Context, prm PrmObjectGet) (*ObjectRe key := prm.Key if key == nil { - key = &c.prm.key + key = &c.prm.Key } err = signature.SignServiceMessage(key, req) @@ -468,7 +468,7 @@ func (c *Client) ObjectHead(ctx context.Context, prm PrmObjectHead) (*ResObjectH return nil, err } - key := c.prm.key + key := c.prm.Key if prm.Key != nil { key = *prm.Key } @@ -776,7 +776,7 @@ func (c *Client) ObjectRangeInit(ctx context.Context, prm PrmObjectRange) (*Obje key := prm.Key if key == nil { - key = &c.prm.key + key = &c.prm.Key } err = signature.SignServiceMessage(key, req) diff --git a/client/object_hash.go b/client/object_hash.go index e65e948..108e0ce 100644 --- a/client/object_hash.go +++ b/client/object_hash.go @@ -172,7 +172,7 @@ func (c *Client) ObjectHash(ctx context.Context, prm PrmObjectHash) (*ResObjectH return nil, err } - key := c.prm.key + key := c.prm.Key if prm.Key != nil { key = *prm.Key } diff --git a/client/object_put_raw.go b/client/object_put_raw.go index 0669052..dd210a8 100644 --- a/client/object_put_raw.go +++ b/client/object_put_raw.go @@ -28,7 +28,7 @@ func (c *Client) objectPutInitRaw(ctx context.Context, prm PrmObjectPutInit) (*o return nil, fmt.Errorf("open stream: %w", err) } - w.key = &c.prm.key + w.key = &c.prm.Key if prm.Key != nil { w.key = prm.Key } diff --git a/client/object_put_single.go b/client/object_put_single.go index 0ae6bf8..8eaeca9 100644 --- a/client/object_put_single.go +++ b/client/object_put_single.go @@ -142,7 +142,7 @@ func (c *Client) ObjectPutSingle(ctx context.Context, prm PrmObjectPutSingle) (* return nil, err } - key := &c.prm.key + key := &c.prm.Key if prm.Key != nil { key = prm.Key } diff --git a/client/object_put_transformer.go b/client/object_put_transformer.go index 357e94f..c671b55 100644 --- a/client/object_put_transformer.go +++ b/client/object_put_transformer.go @@ -16,7 +16,7 @@ func (c *Client) objectPutInitTransformer(prm PrmObjectPutInit) (*objectWriterTr client: c, prm: prm, } - key := &c.prm.key + key := &c.prm.Key if prm.Key != nil { key = prm.Key } @@ -83,7 +83,7 @@ func (it *internalTarget) putAsStream(ctx context.Context, o *object.Object) err wrt.WritePayloadChunk(ctx, o.Payload()) } it.res, err = wrt.Close(ctx) - if err == nil && it.client.prm.disableFrostFSErrorResolution && !apistatus.IsSuccessful(it.res.st) { + if err == nil && it.client.prm.DisableFrostFSErrorResolution && !apistatus.IsSuccessful(it.res.st) { err = apistatus.ErrFromStatus(it.res.st) } return err @@ -115,7 +115,7 @@ func (it *internalTarget) tryPutSingle(ctx context.Context, o *object.Object) (b statusRes: res.statusRes, obj: id, } - if it.client.prm.disableFrostFSErrorResolution && !apistatus.IsSuccessful(it.res.st) { + if it.client.prm.DisableFrostFSErrorResolution && !apistatus.IsSuccessful(it.res.st) { return true, apistatus.ErrFromStatus(it.res.st) } return true, nil diff --git a/client/object_search.go b/client/object_search.go index 760a6d0..aa02542 100644 --- a/client/object_search.go +++ b/client/object_search.go @@ -284,7 +284,7 @@ func (c *Client) ObjectSearchInit(ctx context.Context, prm PrmObjectSearch) (*Ob key := prm.Key if key == nil { - key = &c.prm.key + key = &c.prm.Key } err = signature.SignServiceMessage(key, req) diff --git a/client/session.go b/client/session.go index 03ed5e8..b49c67b 100644 --- a/client/session.go +++ b/client/session.go @@ -39,7 +39,7 @@ func (x *PrmSessionCreate) UseKey(key ecdsa.PrivateKey) { } func (x *PrmSessionCreate) buildRequest(c *Client) (*v2session.CreateRequest, error) { - ownerKey := c.prm.key.PublicKey + ownerKey := c.prm.Key.PublicKey if x.Key != nil { ownerKey = x.Key.PublicKey } @@ -104,7 +104,7 @@ func (c *Client) SessionCreate(ctx context.Context, prm PrmSessionCreate) (*ResS return nil, err } - if err := signature.SignServiceMessage(&c.prm.key, req); err != nil { + if err := signature.SignServiceMessage(&c.prm.Key, req); err != nil { return nil, fmt.Errorf("sign request: %w", err) } diff --git a/pool/pool.go b/pool/pool.go index c871689..da8f099 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -316,9 +316,10 @@ func (x *wrapperPrm) setGRPCDialOptions(opts []grpc.DialOption) { // newWrapper creates a clientWrapper that implements the client interface. func newWrapper(prm wrapperPrm) *clientWrapper { var cl sdkClient.Client - var prmInit sdkClient.PrmInit - prmInit.SetDefaultPrivateKey(prm.key) - prmInit.SetResponseInfoCallback(prm.responseInfoCallback) + prmInit := sdkClient.PrmInit{ + Key: prm.key, + ResponseInfoCallback: prm.responseInfoCallback, + } cl.Init(prmInit) @@ -371,9 +372,10 @@ func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (healthy, change } var cl sdkClient.Client - var prmInit sdkClient.PrmInit - prmInit.SetDefaultPrivateKey(c.prm.key) - prmInit.SetResponseInfoCallback(c.prm.responseInfoCallback) + prmInit := sdkClient.PrmInit{ + Key: c.prm.key, + ResponseInfoCallback: c.prm.responseInfoCallback, + } cl.Init(prmInit) -- 2.45.2 From 3787477133f34cc55fddb9b685b64314b8469781 Mon Sep 17 00:00:00 2001 From: aarifullin Date: Mon, 13 Nov 2023 15:35:30 +0300 Subject: [PATCH 2/2] [#189] client: Make PrmDial fields public Signed-off-by: Airat Arifullin --- client/client.go | 68 +++++++++++++++++++++++-------------------- client/client_test.go | 5 ++-- client/common.go | 1 - pool/pool.go | 22 +++++++------- 4 files changed, 51 insertions(+), 45 deletions(-) diff --git a/client/client.go b/client/client.go index c111f02..014b3d7 100644 --- a/client/client.go +++ b/client/client.go @@ -78,31 +78,22 @@ func (c *Client) Init(prm PrmInit) { // // See also Init / Close. func (c *Client) Dial(ctx context.Context, prm PrmDial) error { - if prm.endpoint == "" { + if prm.Endpoint == "" { return errorServerAddrUnset } - if prm.timeoutDialSet { - if prm.timeoutDial <= 0 { - return errorNonPositiveTimeout - } - } else { - prm.timeoutDial = 5 * time.Second + if prm.DialTimeout <= 0 { + prm.DialTimeout = defaultDialTimeout } - - if prm.streamTimeoutSet { - if prm.streamTimeout <= 0 { - return errorNonPositiveTimeout - } - } else { - prm.streamTimeout = 10 * time.Second + if prm.StreamTimeout <= 0 { + prm.StreamTimeout = defaultStreamTimeout } c.c = *client.New(append( - client.WithNetworkURIAddress(prm.endpoint, prm.tlsConfig), - client.WithDialTimeout(prm.timeoutDial), - client.WithRWTimeout(prm.streamTimeout), - client.WithGRPCDialOptions(prm.dialOptions), + client.WithNetworkURIAddress(prm.Endpoint, prm.TLSConfig), + client.WithDialTimeout(prm.DialTimeout), + client.WithRWTimeout(prm.StreamTimeout), + client.WithGRPCDialOptions(prm.GRPCDialOptions), )...) c.setFrostFSAPIServer((*coreServer)(&c.c)) @@ -185,21 +176,26 @@ func (x *PrmInit) SetResponseInfoCallback(f func(ResponseMetaInfo) error) { x.ResponseInfoCallback = f } +const ( + defaultDialTimeout = 5 * time.Second + defaultStreamTimeout = 10 * time.Second +) + // PrmDial groups connection parameters for the Client. // // See also Dial. type PrmDial struct { - endpoint string + Endpoint string - tlsConfig *tls.Config + TLSConfig *tls.Config - timeoutDialSet bool - timeoutDial time.Duration + // If DialTimeout is non-positive, then it's set to defaultDialTimeout. + DialTimeout time.Duration - streamTimeoutSet bool - streamTimeout time.Duration + // If StreamTimeout is non-positive, then it's set to defaultStreamTimeout. + StreamTimeout time.Duration - dialOptions []grpc.DialOption + GRPCDialOptions []grpc.DialOption } // SetServerURI sets server URI in the FrostFS network. @@ -215,33 +211,41 @@ type PrmDial struct { // grpcs // // See also SetTLSConfig. +// +// Deprecated: Use PrmDial.Endpoint instead. func (x *PrmDial) SetServerURI(endpoint string) { - x.endpoint = endpoint + x.Endpoint = endpoint } // SetTLSConfig sets tls.Config to open TLS client connection // to the FrostFS server. Nil (default) means insecure connection. // // See also SetServerURI. +// +// Depreacted: Use PrmDial.TLSConfig instead. func (x *PrmDial) SetTLSConfig(tlsConfig *tls.Config) { - x.tlsConfig = tlsConfig + x.TLSConfig = tlsConfig } // SetTimeout sets the timeout for connection to be established. // MUST BE positive. If not called, 5s timeout will be used by default. +// +// Deprecated: Use PrmDial.DialTimeout instead. func (x *PrmDial) SetTimeout(timeout time.Duration) { - x.timeoutDialSet = true - x.timeoutDial = timeout + x.DialTimeout = timeout } // SetStreamTimeout sets the timeout for individual operations in streaming RPC. // MUST BE positive. If not called, 10s timeout will be used by default. +// +// Deprecated: Use PrmDial.StreamTimeout instead. func (x *PrmDial) SetStreamTimeout(timeout time.Duration) { - x.streamTimeoutSet = true - x.streamTimeout = timeout + x.StreamTimeout = timeout } // SetGRPCDialOptions sets the gRPC dial options for new gRPC client connection. +// +// Deprecated: Use PrmDial.GRPCDialOptions instead. func (x *PrmDial) SetGRPCDialOptions(opts ...grpc.DialOption) { - x.dialOptions = opts + x.GRPCDialOptions = opts } diff --git a/client/client_test.go b/client/client_test.go index 1f05544..d2e5274 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -44,8 +44,9 @@ func TestClient_DialContext(t *testing.T) { var c Client // try to connect to any host - var prm PrmDial - prm.SetServerURI("localhost:8080") + prm := PrmDial{ + Endpoint: "localhost:8080", + } assert := func(ctx context.Context, errExpected error) { // expect particular context error according to Dial docs diff --git a/client/common.go b/client/common.go index c67084a..11cec28 100644 --- a/client/common.go +++ b/client/common.go @@ -50,7 +50,6 @@ var ( errorMissingObject = errors.New("missing object") errorAccountNotSet = errors.New("account not set") errorServerAddrUnset = errors.New("server address is unset or empty") - errorNonPositiveTimeout = errors.New("non-positive timeout") errorEACLTableNotSet = errors.New("eACL table not set") errorMissingAnnouncements = errors.New("missing announcements") errorZeroRangeLength = errors.New("zero range length") diff --git a/pool/pool.go b/pool/pool.go index da8f099..a656332 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -341,11 +341,12 @@ func (c *clientWrapper) dial(ctx context.Context) error { return err } - var prmDial sdkClient.PrmDial - prmDial.SetServerURI(c.prm.address) - prmDial.SetTimeout(c.prm.dialTimeout) - prmDial.SetStreamTimeout(c.prm.streamTimeout) - prmDial.SetGRPCDialOptions(c.prm.dialOptions...) + prmDial := sdkClient.PrmDial{ + Endpoint: c.prm.address, + DialTimeout: c.prm.dialTimeout, + StreamTimeout: c.prm.streamTimeout, + GRPCDialOptions: c.prm.dialOptions, + } if err = cl.Dial(ctx, prmDial); err != nil { c.setUnhealthyOnDial() @@ -379,11 +380,12 @@ func (c *clientWrapper) restartIfUnhealthy(ctx context.Context) (healthy, change cl.Init(prmInit) - var prmDial sdkClient.PrmDial - prmDial.SetServerURI(c.prm.address) - prmDial.SetTimeout(c.prm.dialTimeout) - prmDial.SetStreamTimeout(c.prm.streamTimeout) - prmDial.SetGRPCDialOptions(c.prm.dialOptions...) + prmDial := sdkClient.PrmDial{ + Endpoint: c.prm.address, + DialTimeout: c.prm.dialTimeout, + StreamTimeout: c.prm.streamTimeout, + GRPCDialOptions: c.prm.dialOptions, + } if err := cl.Dial(ctx, prmDial); err != nil { c.setUnhealthyOnDial() -- 2.45.2