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"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/accounting"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client"
|
||||
containerSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container"
|
||||
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 an error if number of received hashes differs with the number of requested ranges.
|
||||
func HashPayloadRanges(ctx context.Context, prm HashPayloadRangesPrm) (*HashPayloadRangesRes, error) {
|
||||
var cliPrm client.PrmObjectHash
|
||||
cliPrm.FromContainer(prm.objAddr.Container())
|
||||
cliPrm.ByID(prm.objAddr.Object())
|
||||
rngs := make([]objectSDK.Range, len(prm.rngs))
|
||||
|
||||
if prm.local {
|
||||
cliPrm.MarkLocal()
|
||||
for i, r := range prm.rngs {
|
||||
if r != nil {
|
||||
rngs[i] = *r
|
||||
}
|
||||
}
|
||||
|
||||
cliPrm.UseSalt(prm.salt)
|
||||
|
||||
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...)
|
||||
|
||||
cs := checksum.SHA256
|
||||
if prm.tz {
|
||||
cliPrm.TillichZemorAlgo()
|
||||
cs = checksum.TZ
|
||||
}
|
||||
|
||||
if prm.sessionToken != nil {
|
||||
cliPrm.WithinSession(*prm.sessionToken)
|
||||
cnr := prm.objAddr.Container()
|
||||
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)
|
||||
if err != nil {
|
||||
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
|
||||
sessionPrm.SetClient(c)
|
||||
sessionPrm.SetExp(exp)
|
||||
sessionPrm.Expiration = exp
|
||||
|
||||
sessionRes, err := internalclient.CreateSession(ctx, sessionPrm)
|
||||
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-contract v0.0.0-20230627134746-36f3d39c406a
|
||||
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/tzhash v1.8.0
|
||||
github.com/cheggaaa/pb v1.0.29
|
||||
|
|
BIN
go.sum
BIN
go.sum
Binary file not shown.
Loading…
Reference in a new issue