Skip to content

@sourceloop/cache / Exports / RedisCacheStrategy

Class: RedisCacheStrategy<M>

Interface defining the component's options object

Type parameters

Name
M

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new RedisCacheStrategy<M>(opts)

Type parameters

Name
M

Parameters

Name Type
opts CachePluginComponentOptions

Defined in

strategies/redis/redis-cache-strategy.ts:27

Properties

cacheProvider

cacheProvider: Redis = CacheStrategyTypes.Redis

Implementation of

ICacheStrategy.cacheProvider

Defined in

strategies/redis/redis-cache-strategy.ts:22


deletionKey

deletionKey: string

Defined in

strategies/redis/redis-cache-strategy.ts:25


getCacheDataSource

getCacheDataSource: () => Promise<DataSource>

Type declaration

▸ (): Promise<DataSource>

Returns

Promise<DataSource>

Implementation of

ICacheStrategy.getCacheDataSource

Defined in

strategies/redis/redis-cache-strategy.ts:21


prefix

prefix: string

Implementation of

ICacheStrategy.prefix

Defined in

strategies/redis/redis-cache-strategy.ts:23


ttl

ttl: number

Implementation of

ICacheStrategy.ttl

Defined in

strategies/redis/redis-cache-strategy.ts:24

Methods

clearCache

clearCache(): Promise<void>

Returns

Promise<void>

Implementation of

ICacheStrategy.clearCache

Defined in

strategies/redis/redis-cache-strategy.ts:78


executeRedisCommand

executeRedisCommand<T>(command, args): Promise<undefined | T>

Type parameters

Name Type
T extends RedisConnectorExecuteReturnType

Parameters

Name Type
command string
args (string | number)[]

Returns

Promise<undefined | T>

Defined in

strategies/redis/redis-cache-strategy.ts:88


saveInCache

saveInCache(key, value): Promise<void>

Parameters

Name Type
key string
value SaveInCacheValue<M>

Returns

Promise<void>

Implementation of

ICacheStrategy.saveInCache

Defined in

strategies/redis/redis-cache-strategy.ts:59


searchInCache

searchInCache(key): Promise<SearchInCacheResponse<M>>

Parameters

Name Type
key string

Returns

Promise<SearchInCacheResponse<M>>

Implementation of

ICacheStrategy.searchInCache

Defined in

strategies/redis/redis-cache-strategy.ts:33