View Source K8s.Client.Provider behaviour (k8s v1.1.5)

HTTP Request / Response provider behaviour

Link to this section Summary

Callbacks

Handle HTTP Responses

Generate headers for HTTP Requests

Deprecated! Use headers/1 instead

Link to this section Types

@type error_t() ::
  {:error,
   K8s.Client.APIError.t() | HTTPoison.Response.t() | HTTPoison.Error.t()}
@type response_t() :: success_t() | error_t()
@type success_t() :: {:ok, [map()] | map() | reference() | binary() | [binary()]}

Link to this section Callbacks

@callback handle_response(
  {:ok, HTTPoison.Response.t() | HTTPoison.AsyncResponse.t()}
  | {:error, HTTPoison.Error.t()}
) :: response_t()

Handle HTTP Responses

@callback headers(K8s.Conn.RequestOptions.t()) :: keyword()

Generate headers for HTTP Requests

@callback headers(atom(), K8s.Conn.RequestOptions.t()) :: [{binary(), binary()}]

Deprecated! Use headers/1 instead

Link to this callback

request(atom, binary, binary, keyword, keyword)

View Source
@callback request(atom(), binary(), binary(), keyword(), keyword()) :: response_t()

Perform HTTP Requests