hush v0.3.1 Hush.Provider behaviour View Source

Hugh relies on providers to resolve values that the consumer requests.

You can read here on how to write your own provider.

Link to this section Summary

Functions

Fetch a vlue from a provider

Is the provider a valid one?

Link to this section Functions

Link to this function

fetch(provider, name, options \\ [])

View Source

Specs

fetch(module(), String.t(), Keyword.t()) ::
  {:ok, String.t() | nil} | {:error, :required} | {:error, any()}

Fetch a vlue from a provider

Specs

is?(module()) :: :ok | {:error, String.t()}

Is the provider a valid one?

Link to this section Callbacks

Specs

fetch(key :: String.t()) ::
  {:ok, String.t()} | {:error, :not_found} | {:error, any()}

Specs

load(config :: Keyword.t()) :: :ok | {:error, any()}