Interface: CacheImplementation<E>
Type parameters
Name | Type |
---|---|
E | unknown |
Properties
get
• get: (key
: string
, call
: ProtoCatCall
<E
, Message
, Message
, Unary
>) => undefined
| Buffer
| Promise
<undefined
| Buffer
>
Type declaration
▸ (key
, call
): undefined
| Buffer
| Promise
<undefined
| Buffer
>
Return buffer from cache. Returning falsy value is considered a cache miss.
Parameters
Name | Type |
---|---|
key | string |
call | ProtoCatCall <E , Message , Message , Unary > |
Returns
undefined
| Buffer
| Promise
<undefined
| Buffer
>
Defined in
lib/server/middleware/cache.ts:15
hash
• hash: (call
: ProtoCatCall
<E
, Message
, Message
, Unary
>) => undefined
| string
| Promise
<undefined
| string
>
Type declaration
▸ (call
): undefined
| string
| Promise
<undefined
| string
>
Create a unique cache key that will be used for response save and lookup.
Return falsy key if caching should be skipped
Parameters
Name | Type |
---|---|
call | ProtoCatCall <E , Message , Message , Unary > |
Returns
undefined
| string
| Promise
<undefined
| string
>
Defined in
lib/server/middleware/cache.ts:11
set
• set: (key
: string
, value
: Buffer
, call
: ProtoCatCall
<E
, Message
, Message
, Unary
>) => void
Type declaration
▸ (key
, value
, call
): void
Set cache result. Result is not awaited and does not block the response nor subsequent requests
Parameters
Name | Type |
---|---|
key | string |
value | Buffer |
call | ProtoCatCall <E , Message , Message , Unary > |
Returns
void