summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2020-05-30 04:41:11 +0300
committerMichael Klishin <michael@clojurewerkz.org>2020-05-30 17:29:45 +0300
commitbc75a7bb524aa708cd2242e066fb7da5f8886efc (patch)
treefa80c2c91c426f8d37d98a5b6f90fa015c81df34 /src
parentefed9b0a6c13847778689851b5c2a079187ba9a1 (diff)
downloadrabbitmq-server-git-bc75a7bb524aa708cd2242e066fb7da5f8886efc.tar.gz
New policy validators test suite
Part of #2356.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_policies.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rabbit_policies.erl b/src/rabbit_policies.erl
index b0457a5b6a..bf5fc3cc47 100644
--- a/src/rabbit_policies.erl
+++ b/src/rabbit_policies.erl
@@ -33,6 +33,8 @@
{enables, recovery}]}).
register() ->
+ %% Note: there are more validators registered from other modules,
+ %% such as rabbit_mirror_queue_misc
[rabbit_registry:register(Class, Name, ?MODULE) ||
{Class, Name} <- [{policy_validator, <<"alternate-exchange">>},
{policy_validator, <<"dead-letter-exchange">>},
@@ -62,6 +64,8 @@ register() ->
{policy_merge_strategy, <<"delivery-limit">>}]],
ok.
+-spec validate_policy([{binary(), term()}]) -> rabbit_policy_validator:validate_results().
+
validate_policy(Terms) ->
lists:foldl(fun ({Key, Value}, ok) -> validate_policy0(Key, Value);
(_, Error) -> Error