@@ -18,8 +18,6 @@ import (
18
18
"github.com/nspcc-dev/neofs-sdk-go/object"
19
19
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
20
20
"github.com/nspcc-dev/neofs-sdk-go/user"
21
- "google.golang.org/grpc/codes"
22
- "google.golang.org/grpc/status"
23
21
)
24
22
25
23
const (
@@ -58,7 +56,7 @@ type Client interface {
58
56
// URI scheme is "neofs:<Container-ID>/<Object-ID/<Command>/<Params>".
59
57
// If Command is not provided, full object is requested.
60
58
func Get (ctx context.Context , priv * keys.PrivateKey , u * url.URL , addr string ) (io.ReadCloser , error ) {
61
- c , err := GetSDKClient (ctx , addr , 0 )
59
+ c , err := GetClient (ctx , addr , 0 )
62
60
if err != nil {
63
61
return clientCloseWrapper {c : c }, fmt .Errorf ("failed to create client: %w" , err )
64
62
}
@@ -273,9 +271,9 @@ func ObjectSearch(ctx context.Context, c Client, priv *keys.PrivateKey, containe
273
271
return objectIDs , nil
274
272
}
275
273
276
- // GetSDKClient returns a NeoFS SDK client configured with the specified address and context.
274
+ // GetClient returns a NeoFS client configured with the specified address and context.
277
275
// If timeout is 0, the default timeout will be used.
278
- func GetSDKClient (ctx context.Context , addr string , timeout time.Duration ) (* client.Client , error ) {
276
+ func GetClient (ctx context.Context , addr string , timeout time.Duration ) (* client.Client , error ) {
279
277
var prmDial client.PrmDial
280
278
if addr == "" {
281
279
return nil , errors .New ("address is empty" )
@@ -288,14 +286,11 @@ func GetSDKClient(ctx context.Context, addr string, timeout time.Duration) (*cli
288
286
}
289
287
c , err := client .New (client.PrmInit {})
290
288
if err != nil {
291
- return nil , fmt .Errorf ("can't create SDK client: %w" , err )
289
+ return nil , fmt .Errorf ("can't create NeoFS client: %w" , err )
292
290
}
293
291
294
292
if err := c .Dial (prmDial ); err != nil {
295
- if status .Code (err ) == codes .Unimplemented {
296
- return c , nil
297
- }
298
- return nil , fmt .Errorf ("can't init SDK client: %w" , err )
293
+ return nil , fmt .Errorf ("can't init NeoFS client: %w" , err )
299
294
}
300
295
301
296
return c , nil
0 commit comments