UNPKG

adonis5-cache

Version:
19 lines (18 loc) 1.01 kB
import Redis from '@ioc:Adonis/Addons/Redis'; import { CacheContextContract, CacheStorageContract, TaggableStorageContract } from '@ioc:Adonis/Addons/Adonis5-Cache'; export default class RedisStorage implements CacheStorageContract, TaggableStorageContract { protected redisConnection: typeof Redis; constructor(redisConnection: typeof Redis); get<T = any>(context: CacheContextContract, key: string): Promise<T | null>; getMany<T = any>(context: CacheContextContract, keys: string[]): Promise<(T | null)[]>; put<T = any>(context: CacheContextContract, key: string, value: T, ttl: number): Promise<void>; putMany<T = any>(context: CacheContextContract, cacheDictionary: { [p: string]: T; }, ttl: number): Promise<void>; flush(): Promise<void>; forget(key: string): Promise<boolean>; addTag(tag: string, tagData: string): Promise<void>; readTag(tag: string): Promise<string[]>; removeTag(tag: string): Promise<void>; resolveTtl(ttlInMl: number): number; }