GhEx.Client (gh_ex v0.3.3)

Copy Markdown View Source

The client struct: credentials, endpoints, and per-request Req options.

Build one with GhEx.new/1 rather than constructing the struct by hand. The same client is used for both REST (GhEx.REST) and, later, GraphQL.

Credentials are redacted from inspect output

The :auth field holds a secret (a bearer token, or a GitHub App's RSA private key) and is excluded from Inspect, so it never appears in inspect/1, IEx echoes, or a crash report that captures the call args. Do not defeat this by logging client.auth or interpolating the raw credential yourself.

Summary

Functions

Builds a client from options. See GhEx.new/1 for the option list.

Types

t()

@type t() :: %GhEx.Client{
  auth: GhEx.Auth.t() | nil,
  graphql_url: String.t(),
  req_options: keyword(),
  rest_url: String.t()
}

Functions

new(opts \\ [])

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

Builds a client from options. See GhEx.new/1 for the option list.