Options
All
  • Public
  • Public/Protected
  • All
Menu

NSApplicator is used internally to apply a namespace to a given request. It can only be used for a single application.

Hierarchy

  • NSApplicator

Index

Constructors

constructor

Properties

Static Readonly default

default: NSApplicator = new NSApplicator(emptyKey)

Creates a new no-op namespace applicator.

Methods

applyKey

  • applyKey(buf?: Buffer): undefined | Buffer
  • Applies the namespace prefix to the buffer, if it exists.

    Parameters

    • Optional buf: Buffer

    Returns undefined | Buffer

applyRangeEnd

  • applyRangeEnd(buf?: Buffer): undefined | Buffer
  • Applies the namespace prefix to a range end. Due to how etcd handle 'zero' ranges, we need special logic here.

    Parameters

    • Optional buf: Buffer

    Returns undefined | Buffer

applyToRequest

  • applyToRequest<T>(req: T): T
  • Shortcut function to apply the namespace to a GRPC CRUD request. It returns a new request, it does not modify the original.

    Type parameters

    • T: { key?: Buffer; range_end?: Buffer }

    Parameters

    • req: T

    Returns T

unprefix

  • unprefix(buf: Buffer): Buffer
  • Removes a namespace prefix from the provided buffer. Throws if the buffer doesn't have the prefix.

    Parameters

    • buf: Buffer

    Returns Buffer

Legend

  • Constructor
  • Method
  • Inherited method

Generated using TypeDoc