Add PutSingle request/response #45

Merged
fyrchik merged 1 commit from dstepanov-yadro/frostfs-api-go:feat/put_single into master 2023-07-26 21:08:03 +00:00
Showing only changes of commit 285516a94e - Show all commits

View file

@ -10,13 +10,14 @@ import (
const serviceObject = serviceNamePrefix + "object.ObjectService" const serviceObject = serviceNamePrefix + "object.ObjectService"
const ( const (
rpcObjectPut = "Put" rpcObjectPut = "Put"
rpcObjectGet = "Get" rpcObjectGet = "Get"
rpcObjectSearch = "Search" rpcObjectSearch = "Search"
rpcObjectRange = "GetRange" rpcObjectRange = "GetRange"
rpcObjectHash = "GetRangeHash" rpcObjectHash = "GetRangeHash"
rpcObjectHead = "Head" rpcObjectHead = "Head"
rpcObjectDelete = "Delete" rpcObjectDelete = "Delete"
rpcObjectPutSingle = "PutSingle"
) )
// PutRequestWriter is an object.PutRequest // PutRequestWriter is an object.PutRequest
@ -188,3 +189,19 @@ func HashObjectRange(
return resp, nil 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
}