View Source K8s.Client.DynamicHTTPProvider (k8s v1.1.1)

Allows for registration of K8s.Client.Provider handlers per-process.

Used internally by the test suite for testing/mocking Kubernetes responses.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

List all registered handlers

Locate the handler module for this process

Register the handler mdoule for this process

Dispatch request/5 to the module registered in the current process.

Starts this provider.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

handle_response(
  {:error, HTTPoison.Error.t()}
  | {:ok,
     %{
       :__struct__ => HTTPoison.AsyncResponse | HTTPoison.Response,
       optional(any()) => any()
     }}
) ::
  {:error,
   %{
     :__struct__ => HTTPoison.Error | HTTPoison.Response | K8s.Client.APIError,
     optional(any()) => any()
   }}
  | {:ok, any()}

See K8s.Client.HTTPProvider.handle_response/1

Link to this function

headers(request_options)

View Source

See K8s.Client.HTTPProvider.headers/1

Link to this function

headers(method, request_options)

View Source
This function is deprecated. Use headers/1 insead..

See K8s.Client.HTTPProvider.headers/2

Specs

list() :: map()

List all registered handlers

Specs

locate(pid()) :: module() | function() | nil

Locate the handler module for this process

Link to this function

register(this_pid, module_or_function)

View Source

Specs

register(pid(), module() | function()) :: map()

Register the handler mdoule for this process

Link to this function

request(method, url, body, headers, opts)

View Source

Dispatch request/5 to the module registered in the current process.

If the current process is not register, check its parent. This is useful when requests are made from child processes e.g.: (Task.async/1)

Specs

start_link(any()) :: GenServer.on_start()

Starts this provider.