package kube

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Client.TransportSource

Sourcetype request = {
  1. cancel : Cancel.t option;
  2. meth : Http.meth;
  3. target : string;
  4. headers : (string * string) list;
  5. body : string option;
  6. on_chunk : (string -> unit) option;
  7. max_body_bytes : int option;
}

One fully prepared wire request. Authentication headers have already been resolved, but HTTP framing headers remain the transport's responsibility. A successful streaming response should call on_chunk without retaining those bytes in the returned response body. Error bodies must always remain bounded by max_body_bytes.

Sourcetype websocket_request = {
  1. cancel : Cancel.t option;
  2. target : string;
  3. headers : (string * string) list;
  4. protocols : string list;
  5. max_message_bytes : int option;
  6. max_error_body_bytes : int option;
}
Sourcetype sensitive_request = {
  1. cancel : Cancel.t option;
  2. meth : Http.meth;
  3. target : string;
  4. headers : (string * string) list;
  5. secret_headers : (string * Secret.t) list;
  6. body : Secret.t option;
  7. max_body_bytes : int option;
  8. hardened : bool;
}

A request whose protected values are borrowed for the duration of the synchronous callback. The response body is owned by the caller.

Sourcetype t
Sourceval make : ?close:(unit -> unit) -> ?websocket: (websocket_request -> (Websocket.t, Websocket.connect_error) result) -> ?sensitive:(sensitive_request -> (Http.Sensitive.response, string) result) -> (request -> (Http.response, string) result) -> t

Build a custom transport. The callback may be invoked concurrently and must be thread-safe, honor cancellation while it is running, enforce bounds before invoking streaming callbacks, and preserve the streaming semantics described by the request. The close callback may run while requests are in flight and must also be thread-safe. The wrapper rejects requests already cancelled, validates returned buffered-body bounds, and converts callback exceptions to transport errors.

Sourceval execute : t -> request -> (Http.response, string) result

Execute a prepared request. This entry point allows transports to be decorated without exposing their implementation.

Sourceval execute_sensitive : t -> sensitive_request -> (Http.Sensitive.response, string) result

Execute a protected request. A custom transport must opt into this path; the compatibility callback is never used as a fallback because doing so would require exposing the protected values as heap strings.

Sourceval close : t -> unit

Close a transport exactly once. After closure, new requests fail without invoking the callback.