pool: Fix linter error about deprecated methods #182

Merged
fyrchik merged 1 commit from aarifullin/frostfs-sdk-go:bug/linter_prm_obj_put into master 2023-10-23 15:11:33 +00:00

View file

@ -110,16 +110,11 @@ func (it *internalTarget) WriteObject(ctx context.Context, o *object.Object) err
}
func (it *internalTarget) putAsStream(ctx context.Context, o *object.Object) error {
var cliPrm sdkClient.PrmObjectPutInit
cliPrm.SetCopiesNumberByVectors(it.prm.copiesNumber)
if it.prm.stoken != nil {
cliPrm.WithinSession(*it.prm.stoken)
}
if it.prm.key != nil {
cliPrm.UseKey(*it.prm.key)
}
if it.prm.btoken != nil {
cliPrm.WithBearerToken(*it.prm.btoken)
cliPrm := sdkClient.PrmObjectPutInit{
CopiesNumber: it.prm.copiesNumber,
Session: it.prm.stoken,
Key: it.prm.key,
BearerToken: it.prm.btoken,
}
wrt, err := it.client.ObjectPutInit(ctx, cliPrm)
@ -141,16 +136,13 @@ func (it *internalTarget) tryPutSingle(ctx context.Context, o *object.Object) (b
if it.useStream {
return false, nil
}
var cliPrm sdkClient.PrmObjectPutSingle
cliPrm.SetCopiesNumber(it.prm.copiesNumber)
cliPrm.UseKey(it.prm.key)
if it.prm.stoken != nil {
cliPrm.WithinSession(*it.prm.stoken)
cliPrm := sdkClient.PrmObjectPutSingle{
CopiesNumber: it.prm.copiesNumber,
Key: it.prm.key,
Session: it.prm.stoken,
BearerToken: it.prm.btoken,
Object: o,
}
if it.prm.btoken != nil {
cliPrm.WithBearerToken(*it.prm.btoken)
}
cliPrm.SetObject(o.ToV2())
res, err := it.client.ObjectPutSingle(ctx, cliPrm)
if err != nil && status.Code(err) == codes.Unimplemented {