-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from moheladwy/AddCachingUsingRedis
Interducing Caching Using Redis 👍🏿
- Loading branch information
Showing
17 changed files
with
219 additions
and
94 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Jenkinsfile | ||
LICENSE | ||
README.md | ||
.github | ||
.gitignore | ||
.idea | ||
.vscode | ||
Dockerfile | ||
docker-compose.yml | ||
.dockerignore |
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
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
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,66 @@ | ||
namespace Todo.Core.Interfaces; | ||
|
||
/// <summary> | ||
/// Interface for Redis Cache Service | ||
/// </summary> | ||
public interface IRedisCacheService | ||
{ | ||
/// <summary> | ||
/// Get data from Redis Cache | ||
/// </summary> | ||
/// <param name="key"> | ||
/// Key to get data from Redis Cache | ||
/// </param> | ||
/// <typeparam name="T"> | ||
/// Type of data to get from Redis Cache | ||
/// </typeparam> | ||
/// <returns> | ||
/// Data from Redis Cache with the given key if exists, otherwise default value of the type | ||
/// </returns> | ||
Task<T?> GetData<T>(string key); | ||
|
||
/// <summary> | ||
/// Set data in Redis Cache | ||
/// </summary> | ||
/// <param name="key"> | ||
/// Key to set data in Redis Cache | ||
/// </param> | ||
/// <param name="data"> | ||
/// Data to set in Redis Cache | ||
/// </param> | ||
/// <typeparam name="T"> | ||
/// Type of data to set in Redis Cache | ||
/// </typeparam> | ||
/// <returns> | ||
/// A task that represents the asynchronous operation | ||
/// </returns> | ||
Task SetData<T>(string key, T data); | ||
|
||
/// <summary> | ||
/// Update data in Redis Cache | ||
/// </summary> | ||
/// <param name="key"> | ||
/// Key to update data in Redis Cache | ||
/// </param> | ||
/// <param name="data"> | ||
/// Data to update in Redis Cache | ||
/// </param> | ||
/// <typeparam name="T"> | ||
/// Type of data to update in Redis Cache | ||
/// </typeparam> | ||
/// <returns> | ||
/// A task that represents the asynchronous operation, containing the updated data | ||
/// </returns> | ||
Task<T> UpdateData<T>(string key, T data); | ||
|
||
/// <summary> | ||
/// Remove data from Redis Cache | ||
/// </summary> | ||
/// <param name="key"> | ||
/// Key to remove data from Redis Cache | ||
/// </param> | ||
/// <returns> | ||
/// A task that represents the asynchronous operation | ||
/// </returns> | ||
Task RemoveData(string key); | ||
} |
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
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
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
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
Oops, something went wrong.