View Source Crow.Config (crow v0.2.0)

Plugin discovery, functions and types for working with plugins.

Link to this section Summary

Types

A plugin as appearing in crow's configuration.

A plugin along with its options.

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

Link to this type

configured_plugin()

View Source (since 0.2.0)
@type configured_plugin() :: module() | plugin_with_options()

A plugin as appearing in crow's configuration.

Link to this type

plugin_with_options()

View Source (since 0.2.0)
@type plugin_with_options() :: {module(), Crow.Plugin.options()}

A plugin along with its options.

Link to this section Functions

Link to this function

find(name)

View Source (since 0.2.0)
@spec find(nonempty_charlist()) :: plugin_with_options() | nil

Find the given plugin under all configured plugins.

Link to this function

find(plugins, name)

View Source (since 0.2.0)
@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.

Link to this function

list(plugins)

View Source (since 0.2.0)
@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]}]