-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1533357
commit 5eb7772
Showing
7 changed files
with
321 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="Momento" /> | ||
<None Remove="Google.Protobuf" /> | ||
<None Remove="Grpc.Net.Client" /> | ||
<None Remove="Grpc.Core" /> | ||
<None Remove="JWT" /> | ||
<None Remove="Exceptions\" /> | ||
<None Remove="Responses\" /> | ||
<None Remove="Requests\" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Google.Protobuf" Version="3.19.0" /> | ||
<PackageReference Include="Grpc.Net.Client" Version="2.40.0" /> | ||
<PackageReference Include="Grpc.Core" Version="2.41.1" /> | ||
<PackageReference Include="Momento" Version="0.8.0" /> | ||
<PackageReference Include="JWT" Version="8.4.2" /> | ||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.16.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="Exceptions\" /> | ||
<Folder Include="Responses\" /> | ||
<Folder Include="Requests\" /> | ||
</ItemGroup> | ||
</Project> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<None Remove="Momento" /> | ||
<None Remove="Google.Protobuf" /> | ||
<None Remove="Grpc.Net.Client" /> | ||
<None Remove="Grpc.Core" /> | ||
<None Remove="JWT" /> | ||
<None Remove="Exceptions\" /> | ||
<None Remove="Responses\" /> | ||
<None Remove="Requests\" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Google.Protobuf" Version="3.19.0" /> | ||
<PackageReference Include="Grpc.Net.Client" Version="2.40.0" /> | ||
<PackageReference Include="Grpc.Core" Version="2.41.1" /> | ||
<PackageReference Include="Momento" Version="0.8.0" /> | ||
<PackageReference Include="JWT" Version="8.4.2" /> | ||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.16.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="Exceptions\" /> | ||
<Folder Include="Responses\" /> | ||
<Folder Include="Requests\" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
|
||
namespace MomentoSdk.Responses | ||
{ | ||
public class CacheMultiGetFailureResponse | ||
{ | ||
public byte[] Key { get; private set; } | ||
public Exception Failure { get; private set; } | ||
|
||
public CacheMultiGetFailureResponse(byte[] key, Exception failure) | ||
{ | ||
Key = key; | ||
Failure = failure; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace MomentoSdk.Responses | ||
{ | ||
public class CacheMultiGetResponse | ||
{ | ||
private readonly List<CacheGetResponse> successfulResponses; | ||
private readonly List<CacheMultiGetFailureResponse> failedResponses; | ||
|
||
private readonly CacheGetResponse successfulResponse = null; | ||
private readonly CacheMultiGetFailureResponse failedResponse = null; | ||
|
||
public CacheMultiGetResponse(List<CacheGetResponse> cacheGetResponses, List<CacheMultiGetFailureResponse> cacheMultiGetFailureResponses) | ||
{ | ||
successfulResponses = cacheGetResponses; | ||
failedResponses = cacheMultiGetFailureResponses; | ||
} | ||
|
||
public CacheMultiGetResponse(CacheGetResponse cacheGetResponse) | ||
{ | ||
successfulResponse = cacheGetResponse; | ||
} | ||
|
||
public CacheMultiGetResponse(CacheMultiGetFailureResponse cacheMultiGetFailureResponse) | ||
{ | ||
failedResponse = cacheMultiGetFailureResponse; | ||
} | ||
|
||
public CacheGetResponse SuccessfulResponse() | ||
{ | ||
return successfulResponse; | ||
} | ||
|
||
public CacheMultiGetFailureResponse FailedResponse() | ||
{ | ||
return failedResponse; | ||
} | ||
|
||
public List<CacheGetResponse> SuccessfulResponses() | ||
{ | ||
return successfulResponses; | ||
} | ||
|
||
public List<CacheMultiGetFailureResponse> FailedResponses() | ||
{ | ||
return failedResponses; | ||
} | ||
|
||
public List<string> Strings() | ||
{ | ||
List<string> values = new(); | ||
foreach (CacheGetResponse response in successfulResponses) | ||
{ | ||
values.Add(response.String()); | ||
} | ||
return values; | ||
} | ||
|
||
public List<byte[]> Bytes() | ||
{ | ||
List<byte[]> values = new(); | ||
foreach (CacheGetResponse response in successfulResponses) | ||
{ | ||
values.Add(response.Bytes()); | ||
} | ||
return values; | ||
} | ||
} | ||
} |
Oops, something went wrong.