package kube

  1. Overview
  2. Docs
Native OCaml Kubernetes client and controller runtime

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1.3.tar.gz
md5=3c6916dea849fb2842c4a2e8a92b6cdd
sha512=b57daa3bb4879e1f33efc157cf5c648f88455e0f7c87484d572096d46345d6a8081cc7cefb4887aa95507af8daf73b3b8570b8583106953a5ba96a874159ff00

doc/kube.test/Kube_test/Transport/index.html

Module Kube_test.TransportSource

Sourcetype request = {
  1. meth : Kube.Http.meth;
  2. target : string;
  3. headers : (string * string) list;
  4. body : string option;
  5. streaming : bool;
  6. max_body_bytes : int option;
}

A captured request after authentication and before HTTP framing.

Sourcetype outcome
Sourceval respond : ?status:int -> ?reason:string -> ?headers:(string * string) list -> string -> outcome

Return one buffered response body. When the client requested streaming, a successful body is delivered as one callback chunk.

Sourceval respond_json : ?status:int -> ?reason:string -> ?headers:(string * string) list -> Yojson.Safe.t -> outcome
Sourceval stream : ?status:int -> ?reason:string -> ?headers:(string * string) list -> ?wait_for_cancel:bool -> string list -> outcome

Deliver distinct chunks in order. wait_for_cancel keeps the request open after the chunks and is useful for reflectors and controller tests. It requires the client request to carry a cancellation token.

Sourceval fail : string -> outcome

Return a transport failure rather than an HTTP response.

Sourcetype t
Sourceval create : (request -> outcome) -> t

Create a concurrent handler transport. The handler may be called from several threads and is responsible for synchronizing its own mutable state. Requests are captured safely by the testkit.

Sourceval scripted : outcome list -> t

Create a FIFO transport. An extra request becomes a transport failure and is reported by verify_complete.

Sourceval client_transport : t -> Kube.Client.Transport.t
Sourceval requests : t -> request list
Sourceval request_count : t -> int
Sourceval remaining : t -> int option
Sourceval is_closed : t -> bool
Sourceval verify_complete : t -> (unit, string) result

Check that a scripted transport consumed every outcome and received no extra requests. Handler transports are always complete.

Sourceval header : request -> string -> string option

Perform a case-insensitive lookup in captured request headers.