Compare commits

...

1 commit

Author SHA1 Message Date
fa3ab6094d [#675] client: Refactor PrmObjectDelete usage
Some checks failed
DCO action / DCO (pull_request) Successful in 4m30s
Vulncheck / Vulncheck (pull_request) Successful in 5m45s
Build / Build Components (1.21) (pull_request) Successful in 9m18s
Build / Build Components (1.20) (pull_request) Successful in 9m23s
Tests and linters / Tests with -race (pull_request) Failing after 10m18s
Tests and linters / Tests (1.21) (pull_request) Successful in 11m47s
Tests and linters / Staticcheck (pull_request) Successful in 11m41s
Tests and linters / Lint (pull_request) Successful in 12m5s
Tests and linters / Tests (1.20) (pull_request) Successful in 12m14s
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2023-09-04 18:42:51 +03:00
3 changed files with 9 additions and 12 deletions

View file

@ -507,20 +507,17 @@ func (x DeleteObjectRes) Tombstone() oid.ID {
//
// Returns any error which prevented the operation from completing correctly in error return.
func DeleteObject(ctx context.Context, prm DeleteObjectPrm) (*DeleteObjectRes, error) {
var delPrm client.PrmObjectDelete
delPrm.FromContainer(prm.objAddr.Container())
delPrm.ByID(prm.objAddr.Object())
cnr := prm.objAddr.Container()
obj := prm.objAddr.Object()
if prm.sessionToken != nil {
delPrm.WithinSession(*prm.sessionToken)
delPrm := client.PrmObjectDelete{
XHeaders: prm.xHeaders,
ContainerID: &cnr,
ObjectID: &obj,
Session: prm.sessionToken,
BearerToken: prm.bearerToken,
}
if prm.bearerToken != nil {
delPrm.WithBearerToken(*prm.bearerToken)
}
delPrm.WithXHeaders(prm.xHeaders...)
cliRes, err := prm.cli.ObjectDelete(ctx, delPrm)
if err != nil {
return nil, fmt.Errorf("remove object via client: %w", err)

2
go.mod
View file

@ -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-20230828082657-84e7e69f98ac
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230904141422-5a471e5002a7
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

Binary file not shown.