[#645] *: Construct clients from client.NodeInfo in API client cache

There is a need to have the ability to expand the data needed for client
construction.

Replace `network.AddressGroup` parameter of client cache interfaces with
`client.NodeInfo`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-09-28 07:46:10 +03:00 committed by Alex Vanin
parent 91cc33bdb9
commit 7b228b7603
25 changed files with 114 additions and 72 deletions

View file

@ -6,7 +6,6 @@ import (
"github.com/nspcc-dev/neofs-node/pkg/core/client"
"github.com/nspcc-dev/neofs-node/pkg/core/netmap"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
"github.com/nspcc-dev/neofs-node/pkg/network"
"github.com/nspcc-dev/neofs-node/pkg/services/object/util"
"github.com/nspcc-dev/neofs-node/pkg/services/object_manager/placement"
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
@ -23,11 +22,11 @@ type Service struct {
type Option func(*cfg)
type searchClient interface {
searchObjects(*execCtx, network.AddressGroup) ([]*object.ID, error)
searchObjects(*execCtx, client.NodeInfo) ([]*object.ID, error)
}
type ClientConstructor interface {
Get(network.AddressGroup) (client.Client, error)
Get(client.NodeInfo) (client.Client, error)
}
type cfg struct {
@ -38,7 +37,7 @@ type cfg struct {
}
clientConstructor interface {
get(network.AddressGroup) (searchClient, error)
get(client.NodeInfo) (searchClient, error)
}
traverserGenerator interface {