Controller specification used by Solve init and dependency validation.
Summary
Types
@type collect_fun() :: (collect_context() -> collect_result())
@type collect_result() :: [{Solve.Collection.id(), collected_item_opts()}]
@type collected_item_opts() :: keyword()
@type dependency_binding() :: %{ key: atom(), source: atom(), kind: :single | :collection, filter: nil | (Solve.Collection.id(), map() -> boolean()) }
@type dependency_spec() :: atom() | {atom(), atom() | collection_binding()}
@type name() :: atom()
@type t() :: %Solve.ControllerSpec{ callbacks: map(), collect: collect_fun() | nil, dependencies: [name()], dependency_bindings: [dependency_binding()], module: module(), name: name(), params: term(), variant: variant() }
@type variant() :: :singleton | :collection
Functions
@spec collection(atom()) :: collection_binding()
@spec collection(atom(), (Solve.Collection.id(), map() -> boolean())) :: collection_binding()
@spec default_params(term()) :: true