blob: e07e13637da3ded333951232ea9f9a7ede3c5d9d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
namespace LibMatrix.Interfaces.Services;
public interface IStorageProvider {
// save all children of a type with reflection
public Task SaveAllChildrenAsync<T>(string key, T value) {
Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement SaveAllChildren<T>(key, value)!");
throw new NotImplementedException();
}
// load all children of a type with reflection
public Task<T?> LoadAllChildrenAsync<T>(string key) {
Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement LoadAllChildren<T>(key)!");
throw new NotImplementedException();
}
public Task SaveObjectAsync<T>(string key, T value) {
Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement SaveObject<T>(key, value)!");
throw new NotImplementedException();
}
// load
public Task<T?> LoadObjectAsync<T>(string key) {
Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement LoadObject<T>(key)!");
throw new NotImplementedException();
}
// check if exists
public Task<bool> ObjectExistsAsync(string key) {
Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement ObjectExists(key)!");
throw new NotImplementedException();
}
// get all keys
public Task<List<string>> GetAllKeysAsync() {
Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement GetAllKeys()!");
throw new NotImplementedException();
}
// delete
public Task DeleteObjectAsync(string key) {
Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement DeleteObject(key)!");
throw new NotImplementedException();
}
// save stream
public Task SaveStreamAsync(string key, Stream stream) {
Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement SaveStream(key, stream)!");
throw new NotImplementedException();
}
// load stream
public Task<Stream?> LoadStreamAsync(string key) {
Console.WriteLine($"StorageProvider<{GetType().Name}> does not implement LoadStream(key)!");
throw new NotImplementedException();
}
}
|