View Source Spark.InfoGenerator (spark v2.2.45)

Used to dynamically generate configuration functions for Spark extensions based on their DSL.

Usage

defmodule MyConfig do
  use Spark.InfoGenerator, extension: MyDslExtension, sections: [:my_section]
end

Summary

Functions

Given an extension and a list of DSL sections generate individual config functions for each option.

Given an extension and a list of DSL sections, generate an entities function which returns a list of entities.

Given an extension and a list of DSL sections, generate an options function which returns a map of all configured options for a resource (including defaults).

Types

options()

@type options() :: [extension: module(), sections: [atom()]]

Functions

generate_config_functions(extension, sections)

(macro)
@spec generate_config_functions(module(), [atom()]) :: Macro.t()

Given an extension and a list of DSL sections generate individual config functions for each option.

generate_entity_functions(extension, sections)

(macro)
@spec generate_entity_functions(module(), [atom()]) :: Macro.t()

Given an extension and a list of DSL sections, generate an entities function which returns a list of entities.

generate_options_functions(extension, sections)

(macro)
@spec generate_options_functions(module(), [atom()]) :: Macro.t()

Given an extension and a list of DSL sections, generate an options function which returns a map of all configured options for a resource (including defaults).

spec_for_type(terminal, opts)