Setu-TS
    Preparing search index...

    The HTTP surface the Consul and Kubernetes providers need.

    One seam with two methods rather than two seams: both providers need both a buffered read and a streaming one. Injecting it is also the documented escape hatch for a caller-supplied TLS configuration — an in-cluster Kubernetes API server presents a CA that plain fetch rejects.

    0.2.0

    interface IDiscoveryHttp {
        request(url: string, init?: RequestInit): Promise<DiscoveryHttpResponse>;
        stream(url: string, init?: RequestInit): Promise<DiscoveryHttpStream>;
    }
    Index
    • Performs a request and reads the whole body.

      A non-2xx response is returned with ok: false, never thrown — callers decide what a 404 or a 410 means. An implementation must honour init.signal: the reachability probe aborts after 2 s, and a transport that ignores the signal leaves a hung request open.

      Parameters

      • url: string

        Absolute URL

      • Optionalinit: RequestInit

        Standard fetch init

      Returns Promise<DiscoveryHttpResponse>

      The buffered response