Skip to content

Commit

Permalink
services: refactor NeoFS client naming
Browse files Browse the repository at this point in the history
There is just NeoFS client/conn.

Signed-off-by: Ekaterina Pavlova <[email protected]>
  • Loading branch information
AliceInHunterland committed Dec 16, 2024
1 parent e741053 commit f5ea79d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/services/blockfetcher/blockfetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions pkg/services/helpers/neofs/neofs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 59 in pkg/services/helpers/neofs/neofs.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/helpers/neofs/neofs.go#L59

Added line #L59 was not covered by tests
if err != nil {
return clientCloseWrapper{c: c}, fmt.Errorf("failed to create client: %w", err)
}
Expand Down Expand Up @@ -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) {

Check warning on line 276 in pkg/services/helpers/neofs/neofs.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/helpers/neofs/neofs.go#L276

Added line #L276 was not covered by tests
var prmDial client.PrmDial
if addr == "" {
return nil, errors.New("address is empty")
Expand All @@ -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)

Check warning on line 289 in pkg/services/helpers/neofs/neofs.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/helpers/neofs/neofs.go#L289

Added line #L289 was not covered by tests
}

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)

Check warning on line 293 in pkg/services/helpers/neofs/neofs.go

View check run for this annotation

Codecov / codecov/patch

pkg/services/helpers/neofs/neofs.go#L293

Added line #L293 was not covered by tests
}

return c, nil
Expand Down

0 comments on commit f5ea79d

Please sign in to comment.