ISponsorkitStorage
A storage backend for the per-target-set state (session token, cache, nag counters).
On this page
A storage backend for the per-target-set state (session token, cache, nag counters). The content is the JSON document; keys are targets_hash strings.
namespace Sponsorkit;
public interface ISponsorkitStorageImplementations must make Write atomic: a concurrent Read sees the old or the new content, never a mix.
Methods#
| Member | Description |
|---|---|
Read(string) | Returns the stored JSON for key, or null if there is none. |
Write(string, string) | Atomically replaces the stored JSON for key. |
Read(string)#
string? Read(string key);Returns the stored JSON for key, or null if there is none.
Parameters
keystring: Thetargets_hash.
Returns string?
Write(string, string)#
void Write(string key, string json);Atomically replaces the stored JSON for key.
Parameters
keystring: Thetargets_hash.jsonstring: The document.