View Source Crow.Config (crow v0.2.0)
Plugin discovery, functions and types for working with plugins.
Link to this section Summary
Functions
Find the given plugin under all configured plugins.
Find a plugin with the given name under the given plugin list.
List all plugins that are configured via crow's :plugin app setting.
List the given plugins along with their options.
Link to this section Types
@type configured_plugin() :: module() | plugin_with_options()
A plugin as appearing in crow's configuration.
@type plugin_with_options() :: {module(), Crow.Plugin.options()}
A plugin along with its options.
Link to this section Functions
@spec find(nonempty_charlist()) :: plugin_with_options() | nil
Find the given plugin under all configured plugins.
@spec find( [configured_plugin(), ...], nonempty_charlist() ) :: plugin_with_options() | nil
Find a plugin with the given name under the given plugin list.
Options that were configured with the plugin will be returned with it.
List all plugins that are configured via crow's :plugin app setting.
@spec list([configured_plugin(), ...]) :: [plugin_with_options()]
List the given plugins along with their options.
example
Example
iex> Crow.Config.list([])
[]
iex> Crow.Config.list([MyPlugin])
[{MyPlugin, []}]
iex> Crow.Config.list([{MyPlugin, mode: :auto}])
[{MyPlugin, [mode: :auto]}]