Simpified platform-neutral transport layer for communication with InfluxDB.

interface Transport {
    iterate(
        path: string,
        requestBody: any,
        options: SendOptions,
    ): AsyncIterableIterator<Uint8Array>;
    request(
        path: string,
        requestBody: any,
        options: SendOptions,
        responseStarted?: ResponseStartedFn,
    ): Promise<any>;
    send(
        path: string,
        requestBody: string,
        options: SendOptions,
        callbacks?: Partial<CommunicationObserver<Uint8Array>>,
    ): void;
}

Implemented by

Methods

  • Sends requestBody and returns response chunks in an async iterable that can be easily consumed in an for-await loop.

    Parameters

    • path: string

      HTTP request path

    • requestBody: any

      request body

    • options: SendOptions

      send options

    Returns AsyncIterableIterator<Uint8Array>

    async iterable

  • Sends data to the server and receives decoded result. The type of the result depends on response's content-type (deserialized json, text).

    Parameters

    Returns Promise<any>

    response data

  • Send data to the server and receive communication events via callbacks.

    Parameters

    • path: string

      HTTP request path

    • requestBody: string

      HTTP request body

    • options: SendOptions

      send options

    • Optionalcallbacks: Partial<CommunicationObserver<Uint8Array>>

      communication callbacks to received data in Uint8Array

    Returns void