feat: @snort/system CacheRelay

This commit is contained in:
2024-01-23 15:35:28 +00:00
parent d6c578fafc
commit 5cea096067
29 changed files with 296 additions and 380 deletions

View File

@ -0,0 +1,17 @@
import { NostrEvent, OkResponse, ReqCommand } from "./nostr";
/**
* A cache relay is an always available local (local network / browser worker) relay
* Which should contain all of the content we're looking for and respond quickly.
*/
export interface CacheRelay {
/**
* Write event to cache relay
*/
event(ev: NostrEvent): Promise<OkResponse>;
/**
* Read event from cache relay
*/
query(req: ReqCommand): Promise<Array<NostrEvent>>;
}