Mux v1.6.0 Mux View Source

Core module for Mux. You can use the client method to create authenticated Tesla client, which is passed to each request from then on.

Link to this section Summary

Functions

Same as Mux.client/3, but will attempt to pull your access token ID and secret from the application configuration.

Creates a new connection struct that takes an access token ID and secret, as well as params.

Link to this section Functions

Same as Mux.client/3, but will attempt to pull your access token ID and secret from the application configuration.

Returns %Tesla.Client{}.

Examples

iex> Application.put_env(:mux, :access_token_id, "my_token_id")
iex> Application.put_env(:mux, :access_token_secret, "my_token_secret")
iex> Mux.client()
%Tesla.Client{
  fun: nil,
  post: [],
  pre: [
    {Tesla.Middleware.BaseUrl, :call, ["https://api.mux.com"]},
    {Tesla.Middleware.BasicAuth, :call,
    [%{password: "my_token_secret", username: "my_token_id"}]}
  ]
}
Link to this function

client(id, secret, options \\ []) View Source

Creates a new connection struct that takes an access token ID and secret, as well as params.

Returns %Tesla.Client{}.

Examples

iex> Mux.client("my_token_id", "my_token_secret")
%Tesla.Client{
  fun: nil,
  post: [],
  pre: [
    {Tesla.Middleware.BaseUrl, :call, ["https://api.mux.com"]},
    {Tesla.Middleware.BasicAuth, :call,
    [%{password: "my_token_secret", username: "my_token_id"}]}
  ]
}