forked from TrueCloudLab/frostfs-node
[#682] go.mod: Update sdk-go
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
aa9f8dce3d
commit
f435ab1b26
4 changed files with 22 additions and 27 deletions
|
@ -8,6 +8,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/accounting"
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/accounting"
|
||||||
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum"
|
||||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client"
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client"
|
||||||
containerSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container"
|
containerSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container"
|
||||||
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
|
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
|
||||||
|
@ -773,39 +774,33 @@ func (x HashPayloadRangesRes) HashList() [][]byte {
|
||||||
// Returns any error which prevented the operation from completing correctly in error return.
|
// Returns any error which prevented the operation from completing correctly in error return.
|
||||||
// Returns an error if number of received hashes differs with the number of requested ranges.
|
// Returns an error if number of received hashes differs with the number of requested ranges.
|
||||||
func HashPayloadRanges(ctx context.Context, prm HashPayloadRangesPrm) (*HashPayloadRangesRes, error) {
|
func HashPayloadRanges(ctx context.Context, prm HashPayloadRangesPrm) (*HashPayloadRangesRes, error) {
|
||||||
var cliPrm client.PrmObjectHash
|
rngs := make([]objectSDK.Range, len(prm.rngs))
|
||||||
cliPrm.FromContainer(prm.objAddr.Container())
|
|
||||||
cliPrm.ByID(prm.objAddr.Object())
|
|
||||||
|
|
||||||
if prm.local {
|
for i, r := range prm.rngs {
|
||||||
cliPrm.MarkLocal()
|
if r != nil {
|
||||||
|
rngs[i] = *r
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cliPrm.UseSalt(prm.salt)
|
cs := checksum.SHA256
|
||||||
|
|
||||||
rngs := make([]uint64, 2*len(prm.rngs))
|
|
||||||
|
|
||||||
for i := range prm.rngs {
|
|
||||||
rngs[2*i] = prm.rngs[i].GetOffset()
|
|
||||||
rngs[2*i+1] = prm.rngs[i].GetLength()
|
|
||||||
}
|
|
||||||
|
|
||||||
cliPrm.SetRangeList(rngs...)
|
|
||||||
|
|
||||||
if prm.tz {
|
if prm.tz {
|
||||||
cliPrm.TillichZemorAlgo()
|
cs = checksum.TZ
|
||||||
}
|
}
|
||||||
|
|
||||||
if prm.sessionToken != nil {
|
cnr := prm.objAddr.Container()
|
||||||
cliPrm.WithinSession(*prm.sessionToken)
|
obj := prm.objAddr.Object()
|
||||||
|
cliPrm := client.PrmObjectHash{
|
||||||
|
ContainerID: &cnr,
|
||||||
|
ObjectID: &obj,
|
||||||
|
Local: prm.local,
|
||||||
|
Salt: prm.salt,
|
||||||
|
Ranges: rngs,
|
||||||
|
ChecksumType: cs,
|
||||||
|
Session: prm.sessionToken,
|
||||||
|
BearerToken: prm.bearerToken,
|
||||||
|
XHeaders: prm.xHeaders,
|
||||||
}
|
}
|
||||||
|
|
||||||
if prm.bearerToken != nil {
|
|
||||||
cliPrm.WithBearerToken(*prm.bearerToken)
|
|
||||||
}
|
|
||||||
|
|
||||||
cliPrm.WithXHeaders(prm.xHeaders...)
|
|
||||||
|
|
||||||
res, err := prm.cli.ObjectHash(ctx, cliPrm)
|
res, err := prm.cli.ObjectHash(ctx, cliPrm)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("read payload hashes via client: %w", err)
|
return nil, fmt.Errorf("read payload hashes via client: %w", err)
|
||||||
|
|
|
@ -105,7 +105,7 @@ func CreateSession(ctx context.Context, dst *session.Object, c *client.Client, l
|
||||||
|
|
||||||
var sessionPrm internalclient.CreateSessionPrm
|
var sessionPrm internalclient.CreateSessionPrm
|
||||||
sessionPrm.SetClient(c)
|
sessionPrm.SetClient(c)
|
||||||
sessionPrm.SetExp(exp)
|
sessionPrm.Expiration = exp
|
||||||
|
|
||||||
sessionRes, err := internalclient.CreateSession(ctx, sessionPrm)
|
sessionRes, err := internalclient.CreateSession(ctx, sessionPrm)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -6,7 +6,7 @@ require (
|
||||||
git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.15.1-0.20230802075510-964c3edb3f44
|
git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.15.1-0.20230802075510-964c3edb3f44
|
||||||
git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230627134746-36f3d39c406a
|
git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230627134746-36f3d39c406a
|
||||||
git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20230531082742-c97d21411eb6
|
git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20230531082742-c97d21411eb6
|
||||||
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230904165523-55a1f23e7170
|
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230911122224-ac8fc6d4400c
|
||||||
git.frostfs.info/TrueCloudLab/hrw v1.2.1
|
git.frostfs.info/TrueCloudLab/hrw v1.2.1
|
||||||
git.frostfs.info/TrueCloudLab/tzhash v1.8.0
|
git.frostfs.info/TrueCloudLab/tzhash v1.8.0
|
||||||
github.com/cheggaaa/pb v1.0.29
|
github.com/cheggaaa/pb v1.0.29
|
||||||
|
|
BIN
go.sum
BIN
go.sum
Binary file not shown.
Loading…
Reference in a new issue