89be8d3f5a
Add `Conn` method to `Client` interface which must return the underlying connection. Implement new method on the core structure. `Conn` can be used to control the connection (e.g. for closing). Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
21 lines
357 B
Go
21 lines
357 B
Go
package client
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/nspcc-dev/neofs-api-go/rpc/client"
|
|
)
|
|
|
|
// Raw returns underlying raw protobuf client.
|
|
func (c *clientImpl) Raw() *client.Client {
|
|
c.onceInit.Do(func() {
|
|
c.raw = client.New(c.opts.rawOpts...)
|
|
})
|
|
|
|
return c.raw
|
|
}
|
|
|
|
// implements Client.Conn method.
|
|
func (c *clientImpl) Conn() io.Closer {
|
|
return c.raw.Conn()
|
|
}
|