Methods
# async static addUser(user) → {Promise.<void>}
Add user to Redis cache.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
ICurrentUserResponse
|
The user to add to the cache. |
Resolves when the cache entry is stored.
Promise.<void>
# async static deleteUser(userId) → {Promise.<void>}
Delete user from Redis cache
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string
|
The user ID to delete from the cache |
Resolves when the user is deleted from the cache.
Promise.<void>
# static generateKey(userId) → {string}
Generate key for Redis cache.
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string
|
The user ID. |
Redis key namespace.
string
# static toUserResponse(user) → {ICurrentUserResponse}
Transform User document to ICurrentUserResponse format.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
IUserDocument
|
The user to transform. |
Serialized user response.
ICurrentUserResponse
# async static updateUser(user) → {Promise.<void>}
Update user in Redis cache.
Parameters:
| Name | Type | Description |
|---|---|---|
user |
ICurrentUserResponse
|
The user to update in the cache. |
Resolves when potential cache updates finish.
Promise.<void>