[#28] Clients: Make immutable parameters

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2024-12-02 19:33:45 +03:00
parent 749000a090
commit 9bb7b5eff8
62 changed files with 2742 additions and 963 deletions

View file

@ -42,19 +42,17 @@ internal sealed class NetmapServiceProvider : ContextAccessor
return settings;
}
internal async Task<FrostFsNodeInfo> GetLocalNodeInfoAsync(PrmNodeInfo args)
internal async Task<FrostFsNodeInfo> GetLocalNodeInfoAsync(CallContext ctx)
{
var ctx = args.Context!;
var request = new LocalNodeInfoRequest
{
Body = new LocalNodeInfoRequest.Types.Body { }
};
request.AddMetaHeader(args.XHeaders);
request.AddMetaHeader([]);
request.Sign(ClientContext.Key.ECDsaKey);
var response = await netmapServiceClient.LocalNodeInfoAsync(request, null, ctx.Deadline, ctx.CancellationToken);
var response = await netmapServiceClient.LocalNodeInfoAsync(request, null, ctx.GetDeadline(), ctx.CancellationToken);
Verifier.CheckResponse(response);
@ -65,10 +63,10 @@ internal sealed class NetmapServiceProvider : ContextAccessor
{
var request = new NetworkInfoRequest();
request.AddMetaHeader(null);
request.AddMetaHeader([]);
request.Sign(ClientContext.Key.ECDsaKey);
var response = await netmapServiceClient.NetworkInfoAsync(request, null, ctx.Deadline, ctx.CancellationToken)
var response = await netmapServiceClient.NetworkInfoAsync(request, null, ctx.GetDeadline(), ctx.CancellationToken)
.ConfigureAwait(false);
Verifier.CheckResponse(response);
@ -76,16 +74,14 @@ internal sealed class NetmapServiceProvider : ContextAccessor
return response;
}
internal async Task<FrostFsNetmapSnapshot> GetNetmapSnapshotAsync(PrmNetmapSnapshot args)
internal async Task<FrostFsNetmapSnapshot> GetNetmapSnapshotAsync(CallContext ctx)
{
var ctx = args.Context!;
var request = new NetmapSnapshotRequest();
request.AddMetaHeader(args.XHeaders);
request.AddMetaHeader([]);
request.Sign(ClientContext.Key.ECDsaKey);
var response = await netmapServiceClient.NetmapSnapshotAsync(request, null, ctx.Deadline, ctx.CancellationToken);
var response = await netmapServiceClient.NetmapSnapshotAsync(request, null, ctx.GetDeadline(), ctx.CancellationToken);
Verifier.CheckResponse(response);