Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
interface ObjectStore
import { type ObjectStore } from "https://deno.land/x/natsws@v1.28.0/src/mod.ts";

Methods

info(name: string): Promise<ObjectInfo | null>

Returns the ObjectInfo of the named entry. Or null if the entry doesn't exist.

list(): Promise<ObjectInfo[]>

Returns a list of the entries in the ObjectStore

get(name: string): Promise<ObjectResult | null>

Returns an object you can use for reading the data from the named stored object or null if the entry doesn't exist.

getBlob(name: string): Promise<Uint8Array | null>

Returns the data stored for the named entry.

put(
rs: ReadableStream<Uint8Array>,
): Promise<ObjectInfo>

Adds an object to the store with the specified meta and using the specified ReadableStream to stream the data.

putBlob(
data: Uint8Array | null,
): Promise<ObjectInfo>

Puts the specified bytes into the store with the specified meta.

delete(name: string): Promise<PurgeResponse>

Deletes the specified entry from the object store.

linkStore(name: string, bucket: ObjectStore): Promise<ObjectInfo>

Add a link to another object store

watch(opts?: Partial<{ ignoreDeletes?: boolean; includeHistory?: boolean; }>): Promise<QueuedIterator<ObjectInfo | null>>

Watch an object store and receive updates of modifications via an iterator.

seal(): Promise<ObjectStoreStatus>

Seals the object store preventing any further modifications.

status(opts?: Partial<StreamInfoRequestOptions>): Promise<ObjectStoreStatus>

Returns the runtime status of the object store.

update(name: string, meta: Partial<ObjectStoreMeta>): Promise<PubAck>

Update the metadata for an object. If the name is modified, the object is effectively renamed and will only be accessible by its new name.

destroy(): Promise<boolean>

Destroys the object store and all its entries.