Interface IKeyValueStore
An interface which abstracts methods related to reading and writing string content to a persistent file storage.
Namespace: Unity.Cloud.Common
Assembly: Unity.Cloud.Common.dll
Syntax
public interface IKeyValueStore
  Methods
DeleteCacheAsync(string)
A Task that deletes a unique filename in the current IKeyValueStore.
Declaration
Task DeleteCacheAsync(string filename)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | filename | The unique filename to delete from the current IKeyValueStore.  | 
      
Returns
| Type | Description | 
|---|---|
| Task | A Task that deletes a unique filename in the current IKeyValueStore.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| ArgumentException | Thrown if the filename is null or empty.  | 
      
ReadCacheAsync(string)
A Task that reads a cached string from the current IKeyValueStore.
Declaration
Task<string> ReadCacheAsync(string filename)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | filename | The unique filename to look for in the current IKeyValueStore.  | 
      
Returns
| Type | Description | 
|---|---|
| Task<string> | A Task that results in the cached string value.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| ArgumentException | Thrown if the filename is null or empty.  | 
      
| FileNotFoundException | Thrown if the filename does not exist.  | 
      
ValidateFilenameExistsAsync(string)
A Task that validates if a filename exists in the IKeyValueStore.
Declaration
Task<bool> ValidateFilenameExistsAsync(string filename)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | filename | The unique filename to look for in the current IKeyValueStore.  | 
      
Returns
| Type | Description | 
|---|---|
| Task<bool> | A task that has a result of true if the filename is found, false otherwise.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| ArgumentException | Thrown if the filename is null or empty.  | 
      
WriteToCacheAsync(string, string)
A Task that writes a string content value under a unique filename in the current IKeyValueStore.
Declaration
Task WriteToCacheAsync(string filename, string content)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | filename | The unique filename that will hold the content value in the current IKeyValueStore.  | 
      
| string | content | The string content to write.  | 
      
Returns
| Type | Description | 
|---|---|
| Task | A Task that writes a string content value under a unique filename in the current IKeyValueStore.  | 
      
Remarks
Overwrite any previous value.
Exceptions
| Type | Condition | 
|---|---|
| ArgumentException | Thrown if the filename is null or empty.  |