diff options
| author | Daniil Fedotov <dfedotov@pivotal.io> | 2016-04-18 14:11:59 +0100 |
|---|---|---|
| committer | Daniil Fedotov <dfedotov@pivotal.io> | 2016-05-20 12:10:49 +0100 |
| commit | 270997fd46286aa69c9da5fb30124f8e93bc7512 (patch) | |
| tree | b5407f4674b8946cfddcb50eb3ef0490306ec5f1 | |
| parent | 36365ab29fb13034e1928cecc963a50e8b915d68 (diff) | |
| download | rabbitmq-server-git-270997fd46286aa69c9da5fb30124f8e93bc7512.tar.gz | |
Select type specific info items
| -rw-r--r-- | src/rabbit_exchange.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index d85ff25834..676a6561f2 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -346,13 +346,17 @@ i(policy, X) -> case rabbit_policy:name(X) of none -> ''; Policy -> Policy end; -i(Item, _) -> throw({bad_argument, Item}). +i(Item, #exchange{type = Type} = X) -> + case (type_to_module(Type)):info(X, [Item]) of + [{Item, I}] -> I; + [] -> throw({bad_argument, Item}) + end. info(X = #exchange{type = Type}) -> infos(?INFO_KEYS, X) ++ (type_to_module(Type)):info(X). info(X = #exchange{type = Type}, Items) -> - infos(Items, X) ++ (type_to_module(Type)):info(X, Items). + infos(Items, X). info_all(VHostPath) -> map(VHostPath, fun (X) -> info(X) end). |
