InMemoryStoreinterface
Object that can be used for handling app definitions dynamically. The described methods operate only on in-memory app definitions.
4 Methods
clear()⚓︎
(options?: ClearAppsOptions) => Promise<void>
Clears all app definitions from the in-memory store.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| options⚓︎ | ClearAppsOptions | x | Options for clearing app definitions. |
has()⚓︎
(name: string) => Promise<boolean>
Checks if an app definition is available in the in-memory store.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| name⚓︎ | string | The name of the app for whose definition to check. |
import()⚓︎
(definitions: Definition[], mode?: "replace" | "merge") => Promise<ImportResult>
Imports the provided collection of app definitions.
Parameters (2)
| Name | Type | Required | Description |
|---|---|---|---|
| definitions⚓︎ | Definition[] | Array of app definition objects to be imported in the in-memory store. |
|
| mode⚓︎ | "replace" | "merge" | x | Mode for importing app definitions. Use |
remove()⚓︎
(options: RemoveAppOptions) => Promise<void>
Removes one or more app definitions from the in-memory store.
Parameters (1)
| Name | Type | Required | Description |
|---|---|---|---|
| options⚓︎ | RemoveAppOptions | Options for removing one or more app definitions. |
Example
// Removing a single app.
await io.apps.registry.inMemory.remove({ name: "my-app" });
// Removing multiple apps at a time.
await io.apps.registry.inMemory.remove({ name: ["my-app", "my-other-app"] });
// Removing multiple apps and stopping all their instances.
await io.apps.registry.inMemory.remove({
name: ["my-app", "my-other-app"],
stopInstances: true,
});