Class: CacheService
Implements
CacheServiceInterface
Constructors
new CacheService()
new CacheService(
allCacheRepos
,settings
):CacheService
Parameters
Parameter | Type |
---|---|
allCacheRepos | Record <string , Repository <CacheInterface >> |
settings | CacheSettingsInterface |
Returns
Defined in
.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:28 (opens in a new tab)
Properties
Property | Modifier | Type |
---|---|---|
settings | readonly | CacheSettingsInterface |
Methods
clear()
clear(
assignment
,cache
,queryOptions
?):Promise
<void
>
Clear all caches for a given assignee.
Parameters
Parameter | Type | Description |
---|---|---|
assignment | string | The assignment of the repository |
cache | Pick <CacheInterface , "assignee" > | The cache to clear |
queryOptions ? | QueryOptionsInterface | - |
Returns
Promise
<void
>
Implementation of
CacheServiceInterface.clear
Defined in
.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:196 (opens in a new tab)
create()
create(
assignment
,cache
,queryOptions
?):Promise
<CacheInterface
>
Create a cache with a for the given assignee.
Parameters
Parameter | Type | Description |
---|---|---|
assignment | string | The cache assignment |
cache | CacheCreateDto | The data to create |
queryOptions ? | QueryOptionsInterface | - |
Returns
Promise
<CacheInterface
>
Implementation of
CacheServiceInterface.create
Defined in
.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:41 (opens in a new tab)
delete()
delete(
assignment
,cache
,queryOptions
?):Promise
<void
>
Delete a cache based on params
Parameters
Parameter | Type | Description |
---|---|---|
assignment | string | The cache assignment |
cache | Pick <CacheInterface , "key" | "type" | "assignee" > | The cache to delete |
queryOptions ? | QueryOptionsInterface | - |
Returns
Promise
<void
>
Implementation of
CacheServiceInterface.delete
Defined in
.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:126 (opens in a new tab)
deleteCache()
protected
deleteCache(assignment
,id
,queryOptions
?):Promise
<void
>
Internal
Delete CACHE based on assignment
Parameters
Parameter | Type | Description |
---|---|---|
assignment | string | The assignment to delete id from |
id | string | string [] | The id or ids to delete |
queryOptions ? | QueryOptionsInterface | - |
Returns
Promise
<void
>
Defined in
.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:224 (opens in a new tab)
findCache()
protected
findCache(repoProxy
,cache
,queryOptions
?):Promise
<null
|CacheInterface
>
Parameters
Parameter | Type |
---|---|
repoProxy | RepositoryProxy <CacheInterface > |
cache | Pick <CacheInterface , "key" | "type" | "assignee" > |
queryOptions ? | QueryOptionsInterface |
Returns
Promise
<null
| CacheInterface
>
Defined in
.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:278 (opens in a new tab)
get()
get(
assignment
,cache
,queryOptions
?):Promise
<null
|CacheInterface
>
Parameters
Parameter | Type |
---|---|
assignment | string |
cache | Pick <CacheInterface , "key" | "type" | "assignee" > |
queryOptions ? | QueryOptionsInterface |
Returns
Promise
<null
| CacheInterface
>
Implementation of
CacheServiceInterface.get
Defined in
.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:176 (opens in a new tab)
getAssignedCaches()
getAssignedCaches(
assignment
,cache
,queryOptions
?):Promise
<CacheInterface
[]>
Get all CACHEs for assignee.
Parameters
Parameter | Type | Description |
---|---|---|
assignment | string | The assignment of the check |
cache | Pick <CacheInterface , "assignee" > | The cache to get assignments |
queryOptions ? | QueryOptionsInterface | - |
Returns
Promise
<CacheInterface
[]>
Implementation of
CacheServiceInterface.getAssignedCaches
Defined in
.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:145 (opens in a new tab)
getAssignmentRepo()
protected
getAssignmentRepo(assignment
):Repository
<CacheInterface
>
Internal
Get the assignment repo for the given assignment.
Parameters
Parameter | Type | Description |
---|---|---|
assignment | string | The cache assignment |
Returns
Repository
<CacheInterface
>
Defined in
.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:312 (opens in a new tab)
update()
update(
assignment
,cache
,queryOptions
?):Promise
<CacheInterface
>
Parameters
Parameter | Type |
---|---|
assignment | string |
cache | CacheUpdatableInterface |
queryOptions ? | QueryOptionsInterface |
Returns
Promise
<CacheInterface
>
Implementation of
CacheServiceInterface.update
Defined in
.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:78 (opens in a new tab)
updateOrCreate()
updateOrCreate(
assignment
,cache
,queryOptions
?):Promise
<CacheInterface
>
Parameters
Parameter | Type |
---|---|
assignment | string |
cache | CacheCreateDto |
queryOptions ? | QueryOptionsInterface |
Returns
Promise
<CacheInterface
>
Implementation of
CacheServiceInterface.updateOrCreate
Defined in
.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:242 (opens in a new tab)
validateDto()
protected
validateDto<T
>(type
,data
):Promise
<T
>
Type Parameters
Type Parameter |
---|
T extends DeepPartial <CacheInterface > |
Parameters
Parameter | Type |
---|---|
type | Type <T > |
data | T |
Returns
Promise
<T
>
Defined in
.tmp/repos/rockets/packages/nestjs-cache/src/services/cache.service.ts:256 (opens in a new tab)