[#607] object/head: Make client constructor to work with group address

Make Object Head service to work with `AddressGroup` instead of `Address`
in order to support multiple addresses of the storage node.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-06-22 15:31:13 +03:00 committed by Leonard Lyubich
parent d0e48c949b
commit 8ac3c62518
3 changed files with 30 additions and 26 deletions

View file

@ -13,7 +13,7 @@ import (
)
type ClientConstructor interface {
Get(network.Address) (client.Client, error)
Get(network.AddressGroup) (client.Client, error)
}
// RemoteHeader represents utility for getting
@ -28,7 +28,7 @@ type RemoteHeader struct {
type RemoteHeadPrm struct {
commonHeadPrm *Prm
node network.Address
node network.AddressGroup
}
var ErrNotFound = errors.New("object header not found")
@ -41,8 +41,8 @@ func NewRemoteHeader(keyStorage *util.KeyStorage, cache ClientConstructor) *Remo
}
}
// WithNodeAddress sets network address of the remote node.
func (p *RemoteHeadPrm) WithNodeAddress(v network.Address) *RemoteHeadPrm {
// WithNodeAddress sets network address group of the remote node.
func (p *RemoteHeadPrm) WithNodeAddress(v network.AddressGroup) *RemoteHeadPrm {
if p != nil {
p.node = v
}