forked from TrueCloudLab/frostfs-sdk-go
Merge pull request #8 from roman-khimov/api-go-session-token
pool: don't use deprecated token.SessionToken
This commit is contained in:
commit
f16d38c7b9
1 changed files with 4 additions and 4 deletions
|
@ -11,7 +11,7 @@ import (
|
||||||
|
|
||||||
"github.com/nspcc-dev/neofs-api-go/pkg/client"
|
"github.com/nspcc-dev/neofs-api-go/pkg/client"
|
||||||
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
|
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
|
||||||
"github.com/nspcc-dev/neofs-api-go/pkg/token"
|
"github.com/nspcc-dev/neofs-api-go/pkg/session"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/keepalive"
|
"google.golang.org/grpc/keepalive"
|
||||||
)
|
)
|
||||||
|
@ -83,13 +83,13 @@ func (pb *Builder) Build(ctx context.Context, options *BuilderOptions) (Pool, er
|
||||||
|
|
||||||
// Pool is an interface providing connection artifacts on request.
|
// Pool is an interface providing connection artifacts on request.
|
||||||
type Pool interface {
|
type Pool interface {
|
||||||
Connection() (client.Client, *token.SessionToken, error)
|
Connection() (client.Client, *session.Token, error)
|
||||||
OwnerID() *owner.ID
|
OwnerID() *owner.ID
|
||||||
}
|
}
|
||||||
|
|
||||||
type clientPack struct {
|
type clientPack struct {
|
||||||
client client.Client
|
client client.Client
|
||||||
sessionToken *token.SessionToken
|
sessionToken *session.Token
|
||||||
healthy bool
|
healthy bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ func newPool(ctx context.Context, options *BuilderOptions) (Pool, error) {
|
||||||
return pool, nil
|
return pool, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *pool) Connection() (client.Client, *token.SessionToken, error) {
|
func (p *pool) Connection() (client.Client, *session.Token, error) {
|
||||||
p.lock.RLock()
|
p.lock.RLock()
|
||||||
defer p.lock.RUnlock()
|
defer p.lock.RUnlock()
|
||||||
if len(p.clientPacks) == 1 {
|
if len(p.clientPacks) == 1 {
|
||||||
|
|
Loading…
Reference in a new issue