[#45] api-go: Add PutSingle RPC call
All checks were successful
Tests and linters / Tests (1.19) (pull_request) Successful in 52s
Tests and linters / Lint (pull_request) Successful in 1m56s
Tests and linters / Tests with -race (pull_request) Successful in 3m4s
Tests and linters / Tests (1.20) (pull_request) Successful in 4m35s

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-06-30 16:07:57 +03:00
parent d5b55d0926
commit 285516a94e

View file

@ -17,6 +17,7 @@ const (
rpcObjectHash = "GetRangeHash"
rpcObjectHead = "Head"
rpcObjectDelete = "Delete"
rpcObjectPutSingle = "PutSingle"
)
// PutRequestWriter is an object.PutRequest
@ -188,3 +189,19 @@ func HashObjectRange(
return resp, nil
}
// PutSingleObject executes ObjectService.PutSingle RPC.
func PutSingleObject(
cli *client.Client,
req *object.PutSingleRequest,
opts ...client.CallOption,
) (*object.PutSingleResponse, error) {
resp := new(object.PutSingleResponse)
err := client.SendUnary(cli, common.CallMethodInfoUnary(serviceObject, rpcObjectPutSingle), req, resp, opts...)
if err != nil {
return nil, err
}
return resp, nil
}