forked from TrueCloudLab/frostfs-api-go
[#295] pkg: Remove usage of deprecated elements
Remove usage of deprecated of `container.ID` and `token.SessionToken` code elements. Replace using of custom message generators with the ones provided by packages. Replace string comparison with `Equal` method call. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
89be8d3f5a
commit
65080c8b69
22 changed files with 97 additions and 209 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
|
||||
"github.com/google/uuid"
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg"
|
||||
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/owner"
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/session"
|
||||
|
@ -63,13 +64,13 @@ func NewContainerFromV2(c *container.Container) *Container {
|
|||
|
||||
// CalculateID calculates container identifier
|
||||
// based on its structure.
|
||||
func CalculateID(c *Container) *ID {
|
||||
func CalculateID(c *Container) *cid.ID {
|
||||
data, err := c.ToV2().StableMarshal(nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
id := NewID()
|
||||
id := cid.New()
|
||||
id.SetSHA256(sha256.Sum256(data))
|
||||
|
||||
return id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue