amoc_config_scenario (amoc v4.1.1)

View Source

Summary

Types

error/0

-type error() :: {error, error_type(), reason()}.

error_type/0

-type error_type() :: atom().

maybe_update_fun/0

-type maybe_update_fun() :: update_fun() | fun((_, _) -> any()).

maybe_verification_fun/0

-type maybe_verification_fun() :: verification_fun() | fun((_) -> any()).

module_configuration/0

-type module_configuration() :: [module_parameter()].

module_configuration_map/0

-type module_configuration_map() :: #{name() => #{value := any(), any() => any()}}.

module_parameter/0

-type module_parameter() ::
          #module_parameter{name :: name(),
                            mod :: module(),
                            value :: value(),
                            description :: unicode:chardata(),
                            scope :: scope(),
                            verification_fn :: maybe_verification_fun(),
                            update_fn :: maybe_update_fun() | read_only}.

name/0

-type name() :: atom().

reason/0

-type reason() :: any().

scope/0

-type scope() :: local | global.

settings/0

-type settings() :: [{name(), value()}].

update_fun/0

-type update_fun() :: fun((ParamName :: name(), NewValue :: value()) -> any()).

value/0

-type value() :: any().

verification_fun/0

-type verification_fun() ::
          fun((Value :: value()) -> boolean() | {true, NewValue :: value()} | {false, reason()}).

Functions

get_current_configuration()

-spec get_current_configuration() -> {ok, module_configuration_map()}.

get_default_configuration(Module)

-spec get_default_configuration(module()) -> {ok, module_configuration_map()} | error().

parse_scenario_settings(Module, Settings)

-spec parse_scenario_settings(module(), settings()) -> ok | error().

update_settings(Settings)

-spec update_settings(settings()) -> ok | error().