Skip to content

@sourceloop/cache / Exports / ICacheStrategy

Interface: ICacheStrategy<M>

Interface defining the component's options object

Type parameters

Name
M

Hierarchy

Implemented by

Table of contents

Properties

Methods

Properties

cacheProvider

cacheProvider: Redis

Inherited from

CachePluginComponentOptions.cacheProvider

Defined in

types.ts:21


getCacheDataSource

getCacheDataSource: () => Promise<DataSource | SequelizeDataSource>

Type declaration

▸ (): Promise<DataSource | SequelizeDataSource>

Returns

Promise<DataSource | SequelizeDataSource>

Defined in

strategies/cache-strategy.ts:10


prefix

prefix: string

Inherited from

CachePluginComponentOptions.prefix

Defined in

types.ts:22


ttl

ttl: number

Inherited from

CachePluginComponentOptions.ttl

Defined in

types.ts:23

Methods

clearCache

clearCache(): Promise<void>

Returns

Promise<void>

Defined in

strategies/cache-strategy.ts:13


saveInCache

saveInCache(key, value): Promise<void>

Parameters

Name Type
key string
value null | M | M[]

Returns

Promise<void>

Defined in

strategies/cache-strategy.ts:12


searchInCache

searchInCache(key): Promise<undefined | null | M | M[]>

Parameters

Name Type
key string

Returns

Promise<undefined | null | M | M[]>

Defined in

strategies/cache-strategy.ts:11