From ce7be6bbdf0edf069cb50aee64df187609893b92 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sat, 17 Jun 2023 20:58:51 +0200 Subject: Start refactor --- MatrixRoomUtils.Core/Interfaces/IHomeServer.cs | 2 +- MatrixRoomUtils.Core/Interfaces/IStorageProvider.cs | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 MatrixRoomUtils.Core/Interfaces/IStorageProvider.cs (limited to 'MatrixRoomUtils.Core/Interfaces') diff --git a/MatrixRoomUtils.Core/Interfaces/IHomeServer.cs b/MatrixRoomUtils.Core/Interfaces/IHomeServer.cs index 9a9ba7a..a808c3d 100644 --- a/MatrixRoomUtils.Core/Interfaces/IHomeServer.cs +++ b/MatrixRoomUtils.Core/Interfaces/IHomeServer.cs @@ -21,7 +21,7 @@ public class IHomeServer { private async Task _resolveHomeserverFromWellKnown(string homeserver) { if (RuntimeCache.HomeserverResolutionCache.Count == 0) { - Console.WriteLine("No cached homeservers, resolving..."); + // Console.WriteLine("No cached homeservers, resolving..."); await Task.Delay(Random.Shared.Next(1000, 5000)); } diff --git a/MatrixRoomUtils.Core/Interfaces/IStorageProvider.cs b/MatrixRoomUtils.Core/Interfaces/IStorageProvider.cs new file mode 100644 index 0000000..e1a066e --- /dev/null +++ b/MatrixRoomUtils.Core/Interfaces/IStorageProvider.cs @@ -0,0 +1,15 @@ +public interface IStorageProvider { + // save + public async Task SaveAll() { + Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement Save()!"); + } + + public async Task SaveObject(string key, T value) { + Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement SaveObject(key, value)!"); + } + + // delete + public async Task DeleteObject(string key) { + Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement DeleteObject(key)!"); + } +} \ No newline at end of file -- cgit 1.5.1