services: refactor NeoFS client naming

There is just NeoFS client/conn.

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
Ekaterina Pavlova 2024-12-16 11:02:05 +03:00
parent e741053f0c
commit f5ea79d649
2 changed files with 6 additions and 6 deletions

View file

@ -80,7 +80,7 @@ func TestServiceConstructor(t *testing.T) {
require.Equal(t, service.IsActive(), false)
})
t.Run("SDK client", func(t *testing.T) {
t.Run("NeoFS client", func(t *testing.T) {
cfg := config.NeoFSBlockFetcher{
InternalService: config.InternalService{
Enabled: true,

View file

@ -56,7 +56,7 @@ type Client interface {
// URI scheme is "neofs:<Container-ID>/<Object-ID/<Command>/<Params>".
// If Command is not provided, full object is requested.
func Get(ctx context.Context, priv *keys.PrivateKey, u *url.URL, addr string) (io.ReadCloser, error) {
c, err := GetSDKClient(ctx, addr, 0)
c, err := GetClient(ctx, addr, 0)
if err != nil {
return clientCloseWrapper{c: c}, fmt.Errorf("failed to create client: %w", err)
}
@ -271,9 +271,9 @@ func ObjectSearch(ctx context.Context, c Client, priv *keys.PrivateKey, containe
return objectIDs, nil
}
// GetSDKClient returns a NeoFS SDK client configured with the specified address and context.
// GetClient returns a NeoFS client configured with the specified address and context.
// If timeout is 0, the default timeout will be used.
func GetSDKClient(ctx context.Context, addr string, timeout time.Duration) (*client.Client, error) {
func GetClient(ctx context.Context, addr string, timeout time.Duration) (*client.Client, error) {
var prmDial client.PrmDial
if addr == "" {
return nil, errors.New("address is empty")
@ -286,11 +286,11 @@ func GetSDKClient(ctx context.Context, addr string, timeout time.Duration) (*cli
}
c, err := client.New(client.PrmInit{})
if err != nil {
return nil, fmt.Errorf("can't create SDK client: %w", err)
return nil, fmt.Errorf("can't create NeoFS client: %w", err)
}
if err := c.Dial(prmDial); err != nil {
return nil, fmt.Errorf("can't init SDK client: %w", err)
return nil, fmt.Errorf("can't init NeoFS client: %w", err)
}
return c, nil