Current section

Files

Jump to
hunter lib hunter config.ex
Raw

lib/hunter/config.ex

defmodule Hunter.Config do
@moduledoc """
Hunter configuration.
"""
@doc """
Returns the API base URL
## Examples
iex> Hunter.Config.api_base_url()
"https://mastodon.social"
"""
def api_base_url do
Application.get_env(:hunter, :api_base_url, "https://mastodon.social")
end
@doc """
Returns the Hunter home directory
## Examples
iex> Path.basename(Hunter.Config.home())
".hunter"
"""
def home do
home = System.get_env("HUNTER_HOME") || Application.get_env(:hunter, :home, "~/.hunter")
Path.expand(home)
end
@doc """
Returns extra options merged into every `Req` request, e.g. for timeouts
or (in tests) the `Req.Test` plug adapter.
"""
def req_options do
Application.get_env(:hunter, :req_options, [])
end
end