pinxs v2.1.0 PINXS View Source

Convenience functions for building config structs

Link to this section Summary

Functions

Default usage is to just provide the api key

If you want to use test mode

Link to this section Types

Specs

t() :: %PINXS{api_key: String.t(), url: String.t()}

Link to this section Functions

Default usage is to just provide the api key

iex> PINXS.config("ABC123")
%PINXS{api_key: "ABC123", url: "https://api.pin.net.au/1"}

If you want to use test mode

iex> PINXS.config("ABC123", :test)
%PINXS{api_key: "ABC123", url: "https://test-api.pin.net.au/1"}

Or you can have an arbitrary URL

iex> PINXS.config("ABC123", "https://my-fake-pin")
%PINXS{api_key: "ABC123", url: "https://my-fake-pin"}