frostfs-api-go/pkg/client/raw.go
Leonard Lyubich 89be8d3f5a [#196] pkg/client: Extend Client interface with Conn method
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>
2021-05-31 10:13:00 +03:00

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()
}