diff options
author | Emile Joubert <emile@rabbitmq.com> | 2012-10-02 10:17:17 +0100 |
---|---|---|
committer | Emile Joubert <emile@rabbitmq.com> | 2012-10-02 10:17:17 +0100 |
commit | ce8c17a472b3480b1bafb9c1683367e998688487 (patch) | |
tree | a9ff5d9c8db97a979e07ade88ae38b9b49eb72ef /src/rabbit_policy_validator.erl | |
parent | 8494b83766c2d310e631d95fc15916fb18e60ad2 (diff) | |
download | rabbitmq-server-ce8c17a472b3480b1bafb9c1683367e998688487.tar.gz |
First draft of policy validation
Diffstat (limited to 'src/rabbit_policy_validator.erl')
-rw-r--r-- | src/rabbit_policy_validator.erl | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/rabbit_policy_validator.erl b/src/rabbit_policy_validator.erl new file mode 100644 index 00000000..3cc02ecc --- /dev/null +++ b/src/rabbit_policy_validator.erl @@ -0,0 +1,37 @@ +%% The contents of this file are subject to the Mozilla Public License +%% Version 1.1 (the "License"); you may not use this file except in +%% compliance with the License. You may obtain a copy of the License +%% at http://www.mozilla.org/MPL/ +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and +%% limitations under the License. +%% +%% The Original Code is RabbitMQ. +%% +%% The Initial Developer of the Original Code is VMware, Inc. +%% Copyright (c) 2007-2012 VMware, Inc. All rights reserved. +%% + +-module(rabbit_policy_validator). + +-ifdef(use_specs). + +-type(validate_results() :: + 'ok' | {error, string(), [term()]} | [validate_results()]). + +-callback validate_policy(binary(), term()) -> validate_results(). + +-else. + +-export([behaviour_info/1]). + +behaviour_info(callbacks) -> + [ + {validate_policy, 2}, + ]; +behaviour_info(_Other) -> + undefined. + +-endif. |