hocon v0.1.8 Hocon.Resolver behaviour View Source
This module is responsible for loading file configuration. The configuration is specified by a path (filepath, url).
By implementing this behaviour you can pass the module by the :resolver
keyword as an option.
Example
iex> conf = ~s({ a : { include required("./test/data/include-3") } }
iex> Hocon.decode(conf), resolver: Hocon.FileResolver)
{:ok, %{"a" => %{"x" => 10, "y" => 10}}}
Link to this section Summary
Callbacks
Returns true
if the given path exists.
Returns {:ok, binary}
, where binary
is a binary data object that contains the contents
of path
, or {:error, reason}
if an error occurs.
Link to this section Callbacks
Returns true
if the given path exists.
Link to this callback
load(arg1)
View Sourceload(Path.t()) :: {:ok, binary()} | {:error, File.posix()}
Returns {:ok, binary}
, where binary
is a binary data object that contains the contents
of path
, or {:error, reason}
if an error occurs.