forked from TrueCloudLab/frostfs-api-go
[#45] api-go: Add PutSingle RPC call
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
d5b55d0926
commit
285516a94e
1 changed files with 24 additions and 7 deletions
|
@ -17,6 +17,7 @@ const (
|
||||||
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
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue