LogHog.API.Client behaviour (log_hog v0.2.0)

View Source

Behaviour and the default implementation of a PostHog API Client. Uses Req.

Summary

Types

client()

@type client() :: any()

response()

@type response() ::
  {:ok, %{status: non_neg_integer(), body: any()}} | {:error, Exception.t()}

t()

@type t() :: %LogHog.API.Client{client: client(), module: atom()}

Callbacks

client(api_key, cloud)

@callback client(api_key :: String.t(), cloud :: String.t()) :: t()

request(client, method, url, opts)

@callback request(
  client :: client(),
  method :: atom(),
  url :: String.t(),
  opts :: keyword()
) :: response()