[#25] Client: Implement Patch and Range methods

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2024-11-08 10:38:50 +03:00
parent bff8d67867
commit 003b7fdfdd
51 changed files with 1338 additions and 137 deletions

View file

@ -0,0 +1,43 @@
using System.Security.Cryptography;
using FrostFS.Object;
using FrostFS.SDK.ClientV2;
using FrostFS.SDK.ClientV2.Mappers.GRPC;
using FrostFS.SDK.Cryptography;
using FrostFS.Session;
using Google.Protobuf;
using Grpc.Core;
namespace FrostFS.SDK.Tests;
public class AsyncStreamRangeReaderMock(string key, byte[] response) : ServiceBase(key), IAsyncStreamReader<GetRangeResponse>
{
private readonly byte[] _response = response;
public GetRangeResponse Current
{
get
{
var response = new GetRangeResponse
{
Body = new GetRangeResponse.Types.Body
{
Chunk = ByteString.CopyFrom(_response)
},
MetaHeader = new ResponseMetaHeader()
};
response.VerifyHeader = GetResponseVerificationHeader(response);
return response;
}
}
public Task<bool> MoveNext(CancellationToken cancellationToken)
{
return Task.FromResult(true);
}
}