[#1087] *: Adopt SDK changes
- Update `neofs-sdk-go`: v0.0.0-20211230072947-1fe37df88f80 => v0.0.0-20220113123743-7f3162110659 - Add client interface that duplicates SDK's client behaviour and new `MultiAddressClient` interface that has method that iterates over wrapped clients. - Also start using simple client mode that does not require parsing statuses outside the SDK library. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
58d90eec7d
commit
7c02a2e251
32 changed files with 151 additions and 180 deletions
6
pkg/network/cache/client.go
vendored
6
pkg/network/cache/client.go
vendored
|
@ -14,7 +14,7 @@ type (
|
|||
// already created clients.
|
||||
ClientCache struct {
|
||||
mu *sync.RWMutex
|
||||
clients map[string]client.Client
|
||||
clients map[string]clientcore.Client
|
||||
opts []client.Option
|
||||
}
|
||||
)
|
||||
|
@ -24,13 +24,13 @@ type (
|
|||
func NewSDKClientCache(opts ...client.Option) *ClientCache {
|
||||
return &ClientCache{
|
||||
mu: new(sync.RWMutex),
|
||||
clients: make(map[string]client.Client),
|
||||
clients: make(map[string]clientcore.Client),
|
||||
opts: opts,
|
||||
}
|
||||
}
|
||||
|
||||
// Get function returns existing client or creates a new one.
|
||||
func (c *ClientCache) Get(info clientcore.NodeInfo) (client.Client, error) {
|
||||
func (c *ClientCache) Get(info clientcore.NodeInfo) (clientcore.Client, error) {
|
||||
netAddr := info.AddressGroup()
|
||||
|
||||
// multiaddr is used as a key in client cache since
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue