Members
config :BajoCache.TConfig
Configuration object.
fnCache :Array
Array container for cached functions
- Array
Methods
(async) clear(optsopt) → {Promise.<void>}
Clear cached items.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
opts | Object | <optional> | {} | Options for clearing cache |
- Type:
- Promise.<void>
(async) get(optsopt) → {Promise.<any>}
Get cached items.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
opts | Object | <optional> | {} | Options for getting cache |
- Returns the cached item or undefined if not found
- Type:
- Promise.<any>
(async) remove(optsopt) → {Promise.<void>}
Remove cached items.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
opts | Object | <optional> | {} | Options for removing cache |
- Type:
- Promise.<void>
(async) set(optsopt) → {Promise.<void>}
Set cached items.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
opts | Object | <optional> | {} | Options for setting cache |
- Type:
- Promise.<void>
(async) start() → {Promise.<void>}
Start the plugin.
- Type:
- Promise.<void>
(async) sync(optsopt) → {Promise.<any>}
Sync cached items.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
opts | Object | <optional> | {} | Options for syncing cache |
- Returns the cached item or the value set
- Type:
- Promise.<any>
Type Definitions
TConfig
Configuration object.
To override the default configuration, you can create a bajo-cache.json file in your {dataDir}/config/bajoCache.json and set your custom configuration values there.
- Object
| Name | Type | Attributes | Default | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
connection | string | <optional> | 'memory' | Dobo connection to use. Default is 'memory' | |||||||||||||||
default | Object | <optional> | {} | Default configuration for cache items Properties
| |||||||||||||||
removeExpiredDur | string | <optional> | '1s' | Duration for removing expired cache items. Default is '1s' | |||||||||||||||
dobo | Object | <optional> | {} | Configuration for the dobo store | |||||||||||||||
exportPrefix | string | <optional> | '~' | Prefix for exported cache keys. Default is '~' | |||||||||||||||
waibuAdmin | Object | <optional> | {} | Configuration for waibu admin Properties
|
- Source