[#425] Adapt the Client's refactoring to the interface
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
b62a2a0f54
commit
383d2494eb
9 changed files with 12 additions and 12 deletions
6
pkg/network/cache/client.go
vendored
6
pkg/network/cache/client.go
vendored
|
@ -11,7 +11,7 @@ type (
|
|||
// already created clients.
|
||||
ClientCache struct {
|
||||
mu *sync.RWMutex
|
||||
clients map[string]*client.Client
|
||||
clients map[string]client.Client
|
||||
opts []client.Option
|
||||
}
|
||||
)
|
||||
|
@ -21,13 +21,13 @@ type (
|
|||
func NewSDKClientCache(opts ...client.Option) *ClientCache {
|
||||
return &ClientCache{
|
||||
mu: new(sync.RWMutex),
|
||||
clients: make(map[string]*client.Client),
|
||||
clients: make(map[string]client.Client),
|
||||
opts: opts,
|
||||
}
|
||||
}
|
||||
|
||||
// Get function returns existing client or creates a new one.
|
||||
func (c *ClientCache) Get(address string) (*client.Client, error) {
|
||||
func (c *ClientCache) Get(address string) (client.Client, error) {
|
||||
c.mu.RLock()
|
||||
if cli, ok := c.clients[address]; ok {
|
||||
// todo: check underlying connection neofs-api-go#196
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue