View Source Hush.Provider behaviour (hush v1.0.0-rc.0)

Hush 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 value from a provider

Is the provider a valid one?

Link to this section Types

@type child_spec() :: Supervisor.child_spec()

Link to this section Callbacks

@callback fetch(key :: String.t()) ::
  {:ok, String.t()} | {:error, :not_found} | {:error, any()}
@callback load(config :: Keyword.t()) :: :ok | {:ok, [child_spec()]} | {:error, any()}

Link to this section Functions

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

Fetch a value from a provider

@spec valid?(module()) :: :ok | {:error, String.t()}

Is the provider a valid one?