View Source Sleipnir.Client protocol (sleipnir v0.1.1)

The HTTP client that makes requests on behalf of Sleipnir

Link to this section Summary

Types

Returned if the request was successfully sent. Loki will generally respond with status 204 No Content on a successful request. Headers should contain the headers from the response.

t()

Can be any type that has an implementation for the Sleipnir.Client protocol. Default implementation is provided for Tesla.Client.

Functions

Pushes the request to Loki. Implementations may define their own options.

Link to this section Types

@type reason() :: term()
@type response() :: %{status: integer(), headers: [{binary(), binary()}]}

Returned if the request was successfully sent. Loki will generally respond with status 204 No Content on a successful request. Headers should contain the headers from the response.

@type result() :: {:ok, response()} | {:error, reason()}
@type t() :: term()

Can be any type that has an implementation for the Sleipnir.Client protocol. Default implementation is provided for Tesla.Client.

Link to this section Functions

Link to this function

push(client, push_request, opts \\ [])

View Source
@spec push(t(), Sleipnir.PushRequest.t(), Keyword.t()) :: result()

Pushes the request to Loki. Implementations may define their own options.