Skip to main content

Class: ExternalStorage

common.ExternalStorage

Configuration for external storage. Holds the registered drivers, an optional selector, and the size threshold above which payloads are eligible for offloading to external storage. A selector function is required when more than one driver is registered.

Constructors

constructor

new ExternalStorage(«destructured»): ExternalStorage

Parameters

NameTypeDescription
«destructured»Object-
› driverSelector?StorageDriverSelector-
› driversStorageDriver[]-
› payloadSizeThreshold?numberOmit for default (256 KiB). Set 0 to consider all payloads regardless of size.

Returns

ExternalStorage

Properties

driverSelector

Readonly driverSelector: StorageDriverSelector

Selects the destination driver for each payload, or returns null to keep the payload inline.


drivers

Readonly drivers: StorageDriver[]


payloadSizeThreshold

Readonly payloadSizeThreshold: number

Methods

getDriver

getDriver(name): null | StorageDriver

Look up a registered driver by name. Returns null if no driver with that name is registered.

Parameters

NameType
namestring

Returns

null | StorageDriver