@sourceloop/cache / Exports / ICacheStrategy
Interface: ICacheStrategy<M>¶
Interface defining the component's options object
Type parameters¶
Name |
---|
M |
Hierarchy¶
-
↳
ICacheStrategy
Implemented by¶
Table of contents¶
Properties¶
Methods¶
Properties¶
cacheProvider¶
• cacheProvider: Redis
Inherited from¶
CachePluginComponentOptions.cacheProvider
Defined in¶
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¶
ttl¶
• ttl: number
Inherited from¶
CachePluginComponentOptions.ttl
Defined in¶
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
[]>