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 ISponsorkitStorage

Implementations must make Write atomic: a concurrent Read sees the old or the new content, never a mix.

Methods#

MemberDescription
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

  • key string: The targets_hash.

Returns string?

Write(string, string)#

void Write(string key, string json);

Atomically replaces the stored JSON for key.

Parameters

  • key string: The targets_hash.
  • json string: The document.