Skip to content

MemoryPluginRecords

Class in Oadm.Sdk.Plugins · Oadm.Sdk.dll

IPluginRecords in memory (tests, hosts without a database): the same checks as the database, lost when the process ends.

public sealed class MemoryPluginRecords : IPluginRecords

Implements IPluginRecords

int WrittenRecords { get; }

Every write of MemoryPluginRecords.SetManyAsync so far (tests check that only changed records are written).

Task ClearAsync(string collection, CancellationToken ct)

Deletes every record of collection.

Task<string?> GetAsync(string collection, string key, CancellationToken ct)

One record of collection: its JSON, or null when there is none of key. Reads only that record (default for other implementations: through IPluginRecords.ListAsync).

Task<IReadOnlyDictionary<string, string>> ListAsync(string collection, CancellationToken ct)

Every record of collection: key and JSON.

Task SetManyAsync(string collection, IReadOnlyCollection<KeyValuePair<string, string?>> records, CancellationToken ct)

Writes several records of collection in one transaction; a null value deletes its key. Keys: 1 to 255 characters; values: valid JSON.