Merge pull request #23 from cthulhu-rider/upd-apigo-v1.28.2

Update NeoFS API Go library to v1.28.2
This commit is contained in:
Alex Vanin 2021-07-06 14:53:13 +03:00 committed by GitHub
commit 3904339f2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

2
go.mod
View file

@ -4,7 +4,7 @@ go 1.16
require (
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210521073959-f0d4d129b7f1
github.com/nspcc-dev/neofs-api-go v1.27.0
github.com/nspcc-dev/neofs-api-go v1.28.2
github.com/stretchr/testify v1.6.1
go.uber.org/zap v1.10.0
google.golang.org/grpc v1.29.1

BIN
go.sum

Binary file not shown.

View file

@ -13,6 +13,7 @@ import (
"github.com/nspcc-dev/neofs-api-go/pkg/client"
"github.com/nspcc-dev/neofs-api-go/pkg/container"
cid "github.com/nspcc-dev/neofs-api-go/pkg/container/id"
"github.com/nspcc-dev/neofs-api-go/pkg/netmap"
"github.com/nspcc-dev/neofs-api-go/pkg/object"
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
"github.com/nspcc-dev/neofs-api-go/pkg/session"
@ -103,11 +104,21 @@ func newPool(ctx context.Context, options *BuilderOptions) (Pool, error) {
}
st, err := c.CreateSession(ctx, options.SessionExpirationEpoch)
if err != nil {
address := "unknown"
var address interface{} = "unknown"
if epi, err := c.EndpointInfo(ctx); err == nil {
address = epi.NodeInfo().Address()
ni := epi.NodeInfo()
addresses := make([]string, 0, ni.NumberOfAddresses())
netmap.IterateAllAddresses(ni, func(addr string) {
addresses = append(addresses, addr)
})
address = addresses
}
return nil, fmt.Errorf("failed to create neofs session token for client %s: %w", address, err)
return nil, fmt.Errorf("failed to create neofs session token for client %v: %w", address, err)
}
clientPacks[i] = &clientPack{client: c, sessionToken: st, healthy: true}
}