UNPKG

cnpmcore

Version:
14 lines (13 loc) 584 B
/// <reference types="node" /> export declare class CacheAdapter { private readonly redis; setBytes(key: string, bytes: Buffer): Promise<void>; getBytes(key: string): Promise<Buffer | null>; set(key: string, text: string): Promise<void>; get(key: string): Promise<string | null>; delete(key: string): Promise<void>; lock(key: string, seconds: number): Promise<string | null>; unlock(key: string, lockTimestamp: string): Promise<void>; usingLock(key: string, seconds: number, func: () => Promise<void>): Promise<boolean>; private getLockName; }