[#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

@ -509,13 +509,13 @@ func toShortObjectHeader(hdr *object.Object) objectV2.GetHeaderPart {
}
func groupAddressRequestForwarder(f func(network.Address, client.Client) (*objectSDK.Object, error)) getsvc.RequestForwarder {
return func(addrGroup network.AddressGroup, c client.Client) (*objectSDK.Object, error) {
return func(info client.NodeInfo, c client.Client) (*objectSDK.Object, error) {
var (
firstErr error
res *objectSDK.Object
)
addrGroup.IterateAddresses(func(addr network.Address) (stop bool) {
info.AddressGroup().IterateAddresses(func(addr network.Address) (stop bool) {
var err error
defer func() {