Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Bucket

import { Bucket } from "https://raw.githubusercontent.com/nats-io/nats.deno/v1.28.2/nats-base-client/internal_mod.ts";
class Bucket implements KV, KvRemove {
constructor(
bucket: string,
js: JetStreamClient,
jsm: JetStreamManager,
);
_prefixLen: number;
bucket: string;
codec: KvCodecs;
direct: boolean;
editPrefix: string;
hasWildcards;
js: JetStreamClient;
jsm: JetStreamManager;
prefix: string;
get prefixLen(): number;
stream: string;
useJsPrefix: boolean;
validateKey;
validateSearchKey;
 
_buildCC(
k: string | string[],
content: KvWatchInclude,
opts?: Partial<ConsumerConfig>,
): Partial<ConsumerConfig>;
async _deleteOrPurge(
k: string,
op: "DEL" | "PURGE",
opts?: Partial<KvDeleteOptions>,
): Promise<void>;
async _doDeleteOrPurge(
k: string,
op: "DEL" | "PURGE",
opts?: Partial<KvDeleteOptions>,
): Promise<void>;
bucketName(): string;
canSetWatcherName(): boolean;
close(): Promise<void>;
async 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;
async get(k: string, opts?: {
revision: number;
}
): Promise<KvEntry | null>;
async history(opts?: {
key?: string | string[];
headers_only?: boolean;
}
): Promise<QueuedIterator<KvEntry>>;
async init(opts?: Partial<KvOptions>): Promise<void>;
initializePrefixes(info: StreamInfo);
jmToEntry(jm: JsMsg): KvEntry;
async keys(k?: string | string[]): Promise<QueuedIterator<string>>;
purge(k: string, opts?: Partial<KvDeleteOptions>): Promise<void>;
purgeBucket(opts?: PurgeOpts): Promise<PurgeResponse>;
async purgeDeletes(olderMillis?: number): Promise<PurgeResponse>;
async put(
k: string,
data: Payload,
opts?: Partial<KvPutOptions>,
): Promise<number>;
remove(k: string): Promise<void>;
smToEntry(sm: StoredMsg): KvEntry;
async status(): Promise<KvStatus>;
subjectForBucket(): string;
subjectForKey(k: string, edit?): string;
update(
k: string,
data: Payload,
version: number,
): Promise<number>;
async watch(opts?: KvWatchOptions): Promise<QueuedIterator<KvEntry>>;
 
static async bind(
js: JetStreamClient,
name: string,
opts?: Partial<KvOptions>,
): Promise<KV>;
static async create(
js: JetStreamClient,
name: string,
opts?: Partial<KvOptions>,
): Promise<KV>;
}

§Implements

§
KvRemove
[src]

§Constructors

§
new Bucket(bucket: string, js: JetStreamClient, jsm: JetStreamManager)
[src]

§Properties

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

§Methods

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

§Static Methods

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