Skip to content

etcd/client

Documentation

Overview

Classes

getRevision()

The revision of the key-value store when the request was processed.

ts
getRevision(): string;

Returns

  • Type: string
  • Description:

getClusterId()

The ID of the cluster which the request was sent to.

ts
getClusterId(): string;

Returns

  • Type: string
  • Description:

getMemberId()

The ID of the member which the request was handled by.

ts
getMemberId(): string;

Returns

  • Type: string
  • Description:

getRaftTerm()

The Raft term.

ts
getRaftTerm(): string;

Returns

  • Type: string
  • Description:

GetResponse

getHeader()

Retrieves the response header containing cluster metadata.

ts
getHeader(): Header;

Returns

  • Type: Header
  • Description:

getKvsString()

Retrieves the Key-Value pairs with values converted to strings.

ts
getKvsString(): void;

Returns

  • Type: void
  • Description:

getKvsByteArray()

Retrieves the Key-Value pairs with values converted to Int8Array (byte arrays).

ts
getKvsByteArray(): void;

Returns

  • Type: void
  • Description:

getCount()

Retrieves the number of Key-Value pairs returned.

ts
getCount(): number;

Returns

  • Type: number
  • Description:

Client

putStringValue()

Puts (writes) a string value to the specified key.

ts
putStringValue(key: string, value: string): void;
ParameterTypeDescription
keystringThe key to write to.
valuestringThe string value.

Returns

  • Type: void
  • Description:

putByteArrayValue()

Puts (writes) a byte array value to the specified key.

ts
putByteArrayValue(key: string, value: Int8Array): void;
ParameterTypeDescription
keystringThe key to write to.
valueInt8ArrayThe Int8Array (byte array) value.

Returns

  • Type: void
  • Description:

getHeader()

Retrieves the response header metadata for a key.

ts
getHeader(key: string): Header;
ParameterTypeDescription
keystringThe key to query.

Returns

  • Type: Header
  • Description: The Header object.

getKvsStringValue()

Retrieves the Key-Value pairs as a JavaScript object with string values.

ts
getKvsStringValue(key: string): void;
ParameterTypeDescription
keystringThe key (or key prefix) to query.

Returns

  • Type: void
  • Description: An object mapping keys to string values.

getKvsByteArrayValue()

Retrieves the Key-Value pairs as a JavaScript object with Int8Array values.

ts
getKvsByteArrayValue(key: string): void;
ParameterTypeDescription
keystringThe key (or key prefix) to query.

Returns

  • Type: void
  • Description: An object mapping keys to Int8Array values.

getCount()

Retrieves the count of Key-Value pairs matching the key (or key prefix).

ts
getCount(key: string): number;
ParameterTypeDescription
keystringThe key (or key prefix) to query.

Returns

  • Type: number
  • Description: The count of matching entries.

delete()

Deletes the specified key.

ts
delete(key: string): void;
ParameterTypeDescription
keystringThe key to delete.

Returns

  • Type: void
  • Description: