Skip to main content

MemoryContentStorage

@webda/utils


Class: MemoryContentStorage

Defined in: packages/utils/src/content.ts:524

In-memory ContentStorage implementation (useful for tests)

Implements​

Constructors​

Constructor​

new MemoryContentStorage(): MemoryContentStorage

Returns​

MemoryContentStorage

Properties​

schemes​

readonly schemes: string[]

Defined in: packages/utils/src/content.ts:525

Schemes handled, without ':' e.g. ["s3"], ["gs", "gcs"], ["file"]

Implementation of​

ContentStorage.schemes

Methods​

clear()​

clear(): void

Defined in: packages/utils/src/content.ts:637

Clear all stored items

Returns​

void


deleteContent()​

deleteContent(url): Promise<void>

Defined in: packages/utils/src/content.ts:629

Delete content

Parameters​

url​

string

memory URL

Returns​

Promise<void>

Implementation of​

ContentStorage.deleteContent


getContent()​

getContent(url, options?): Promise<Readable>

Defined in: packages/utils/src/content.ts:554

Get content from memory

Parameters​

url​

string

memory URL

options?​

ContentGetOptions

range options

Returns​

Promise<Readable>

Readable stream

Implementation of​

ContentStorage.getContent


headContent()​

headContent(url): Promise<ContentInfo | undefined>

Defined in: packages/utils/src/content.ts:609

Head content metadata

Parameters​

url​

string

memory URL

Returns​

Promise<ContentInfo | undefined>

ContentInfo or undefined if not found

Implementation of​

ContentStorage.headContent


putContent()​

putContent(url, body, options?): Promise<ContentInfo>

Defined in: packages/utils/src/content.ts:576

Put content into memory

Parameters​

url​

string

memory URL

body​

ContentBody

content to store

options?​

ContentPutOptions

write options

Returns​

Promise<ContentInfo>

ContentInfo

Implementation of​

ContentStorage.putContent