Rocksky.Client (Rocksky v0.1.0)

Copy Markdown View Source

Client struct holding base URL, token and request options.

Build one with Rocksky.new/1.

Summary

Functions

Return a new client with the given Bearer token. Useful when you want to derive authenticated clients from a shared base.

Types

t()

@type t() :: %Rocksky.Client{
  base_url: String.t(),
  headers: [{String.t(), String.t()}],
  req_options: keyword(),
  token: String.t() | nil
}

Functions

new(opts \\ [])

@spec new(keyword()) :: t()

with_token(client, token)

@spec with_token(t(), String.t() | nil) :: t()

Return a new client with the given Bearer token. Useful when you want to derive authenticated clients from a shared base.

client |> Rocksky.Client.with_token(token)