forked from TrueCloudLab/frostfs-sdk-go
commit
3d42ae62d6
2 changed files with 17 additions and 0 deletions
|
@ -8,6 +8,7 @@ import (
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
sessionv2 "github.com/nspcc-dev/neofs-api-go/v2/session"
|
sessionv2 "github.com/nspcc-dev/neofs-api-go/v2/session"
|
||||||
"github.com/nspcc-dev/neofs-sdk-go/accounting"
|
"github.com/nspcc-dev/neofs-sdk-go/accounting"
|
||||||
|
sdkClient "github.com/nspcc-dev/neofs-sdk-go/client"
|
||||||
apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status"
|
apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status"
|
||||||
"github.com/nspcc-dev/neofs-sdk-go/container"
|
"github.com/nspcc-dev/neofs-sdk-go/container"
|
||||||
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
|
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
|
||||||
|
@ -187,3 +188,7 @@ func (m *mockClient) restartIfUnhealthy(ctx context.Context) (healthy bool, chan
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *mockClient) getClient() (*sdkClient.Client, error) {
|
||||||
|
return nil, errors.New("now supported to return sdkClient from mockClient")
|
||||||
|
}
|
||||||
|
|
12
pool/pool.go
12
pool/pool.go
|
@ -76,6 +76,8 @@ type client interface {
|
||||||
dial(ctx context.Context) error
|
dial(ctx context.Context) error
|
||||||
// see clientWrapper.restartIfUnhealthy.
|
// see clientWrapper.restartIfUnhealthy.
|
||||||
restartIfUnhealthy(ctx context.Context) (bool, bool)
|
restartIfUnhealthy(ctx context.Context) (bool, bool)
|
||||||
|
|
||||||
|
getClient() (*sdkClient.Client, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// clientStatus provide access to some metrics for connection.
|
// clientStatus provide access to some metrics for connection.
|
||||||
|
@ -2104,6 +2106,16 @@ func (p *Pool) DeleteObject(ctx context.Context, prm PrmObjectDelete) error {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RawClient returns single client instance to have possibility to work with exact one.
|
||||||
|
func (p *Pool) RawClient() (*sdkClient.Client, error) {
|
||||||
|
conn, err := p.connection()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return conn.getClient()
|
||||||
|
}
|
||||||
|
|
||||||
type objectReadCloser struct {
|
type objectReadCloser struct {
|
||||||
reader *sdkClient.ObjectReader
|
reader *sdkClient.ObjectReader
|
||||||
elapsedTimeCallback func(time.Duration)
|
elapsedTimeCallback func(time.Duration)
|
||||||
|
|
Loading…
Reference in a new issue