Skip to content

Commit

Permalink
Add delete per key
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Candeia <[email protected]>
  • Loading branch information
mcandeia committed Oct 2, 2024
1 parent 1dfa72d commit 05a8e24
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/actors/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export interface ActorStorage {
entries: [string[], T][],
options?: ActorStoragePutOptions,
): Promise<void>;
delete(key: string, options?: ActorStoragePutOptions): Promise<boolean>;
delete(key: string[], options?: ActorStoragePutOptions): Promise<boolean>;
delete(key: string[], options?: ActorStoragePutOptions): Promise<boolean>;
delete(keys: string[][], options?: ActorStoragePutOptions): Promise<number>;
Expand Down
4 changes: 4 additions & 0 deletions src/actors/storage/cached.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ export class CachedStorage implements ActorStorage {
}
}

async delete(
key: string,
options?: ActorStoragePutOptions,
): Promise<boolean>;
async delete(
key: string[],
options?: ActorStoragePutOptions,
Expand Down
1 change: 1 addition & 0 deletions src/actors/storage/denoKv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export class DenoKvActorStorage implements ActorStorage {
}

// Delete function that removes keys from Deno.Kv
async delete(key: string, options?: ActorStoragePutOptions): Promise<boolean>;
async delete(
key: string[],
options?: ActorStoragePutOptions,
Expand Down

0 comments on commit 05a8e24

Please sign in to comment.