Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
class Bucket
implements KV, KvRemove
import { Bucket } from "https://deno.land/x/natsws@v1.28.0/src/nats-base-client.ts";

Constructors

new
Bucket(
bucket: string,
js: JetStreamClient,
jsm: JetStreamManager,
)

Properties

_prefixLen: number
bucket: string
codec: KvCodecs
direct: boolean
editPrefix: string
hasWildcards
js: JetStreamClient
jsm: JetStreamManager
prefix: string
readonly
prefixLen: number
stream: string
useJsPrefix: boolean
validateKey
validateSearchKey

Methods

_buildCC(
k: string | string[],
content: KvWatchInclude,
opts?: Partial<ConsumerConfig>,
): Partial<ConsumerConfig>
_deleteOrPurge(
k: string,
op: "DEL" | "PURGE",
opts?: Partial<KvDeleteOptions>,
): Promise<void>
_doDeleteOrPurge(
k: string,
op: "DEL" | "PURGE",
opts?: Partial<KvDeleteOptions>,
): Promise<void>
bucketName(): string
close(): Promise<void>
create(k: string, data: Payload): Promise<number>
dataLen(data: Uint8Array, h?: MsgHdrs): number
decodeKey(ekey: string): string
delete(k: string, opts?: Partial<KvDeleteOptions>): Promise<void>
destroy(): Promise<boolean>
encodeKey(key: string): string
fullKeyName(k: string): string
get(k: string, opts?: { revision: number; }): Promise<KvEntry | null>
history(opts?: { key?: string | string[]; headers_only?: boolean; }): Promise<QueuedIterator<KvEntry>>
init(opts?: Partial<KvOptions>): Promise<void>
initializePrefixes(info: StreamInfo)
jmToEntry(jm: JsMsg): KvEntry
keys(k?: string | string[]): Promise<QueuedIterator<string>>
purge(k: string, opts?: Partial<KvDeleteOptions>): Promise<void>
purgeBucket(opts?: PurgeOpts): Promise<PurgeResponse>
purgeDeletes(olderMillis?: number): Promise<PurgeResponse>
put(
k: string,
data: Payload,
opts?: Partial<KvPutOptions>,
): Promise<number>
remove(k: string): Promise<void>
smToEntry(sm: StoredMsg): KvEntry
status(): Promise<KvStatus>
subjectForKey(k: string, edit?): string
update(
k: string,
data: Payload,
version: number,
): Promise<number>
watch(opts?: KvWatchOptions): Promise<QueuedIterator<KvEntry>>

Static Methods

bind(
js: JetStreamClient,
name: string,
opts?: Partial<KvOptions>,
): Promise<KV>
create(
js: JetStreamClient,
name: string,
opts?: Partial<KvOptions>,
): Promise<KV>