diff options
author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-08-03 13:06:49 +0100 |
---|---|---|
committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-08-03 13:06:49 +0100 |
commit | f59e41c9fa0c3e4e1958ca5d404f5053b12d5bb3 (patch) | |
tree | 1300902310cacf30835582ba25d071c3a53b7ab1 | |
parent | 51811f3b5e72d5c7752bb3760c0b008aa6fd0e17 (diff) | |
download | rabbitmq-server-f59e41c9fa0c3e4e1958ca5d404f5053b12d5bb3.tar.gz |
updated specs
-rw-r--r-- | src/rabbit_access_control.erl | 8 | ||||
-rw-r--r-- | src/rabbit_amqqueue.erl | 5 | ||||
-rw-r--r-- | src/rabbit_basic.erl | 10 | ||||
-rw-r--r-- | src/rabbit_exchange.erl | 20 | ||||
-rw-r--r-- | src/rabbit_misc.erl | 15 |
5 files changed, 26 insertions, 32 deletions
diff --git a/src/rabbit_access_control.erl b/src/rabbit_access_control.erl index 55d738ff..1dbda805 100644 --- a/src/rabbit_access_control.erl +++ b/src/rabbit_access_control.erl @@ -55,7 +55,9 @@ -spec(check_login/2 :: (binary(), binary()) -> rabbit_types:user() | rabbit_types:channel_exit()). --spec(user_pass_login/2 :: (username(), password()) -> rabbit_types:user()). +-spec(user_pass_login/2 :: + (username(), password()) + -> rabbit_types:user() | rabbit_types:channel_exit()). -spec(check_vhost_access/2 :: (rabbit_types:user(), rabbit_types:vhost()) -> 'ok' | rabbit_types:channel_exit()). @@ -70,9 +72,9 @@ (username()) -> rabbit_types:ok(rabbit_types:user()) | rabbit_types:error('not_found')). -spec(add_vhost/1 :: - (rabbit_types:vhost()) -> 'ok' | rabbit_types:connection_exit()). + (rabbit_types:vhost()) -> 'ok'). -spec(delete_vhost/1 :: - (rabbit_types:vhost()) -> 'ok' | rabbit_types:connection_exit()). + (rabbit_types:vhost()) -> 'ok'). -spec(list_vhosts/0 :: () -> [rabbit_types:vhost()]). -spec(set_permissions/5 ::(username(), rabbit_types:vhost(), regexp(), regexp(), regexp()) -> 'ok'). diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index f9f8e2ec..d4226331 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -150,8 +150,7 @@ -spec(flush_all/2 :: ([pid()], pid()) -> 'ok'). -spec(internal_declare/2 :: (rabbit_types:amqqueue(), boolean()) - -> rabbit_types:amqqueue() | 'not_found' | - rabbit_types:connection_exit()). + -> rabbit_types:amqqueue() | 'not_found'). -spec(internal_delete/1 :: (name()) -> rabbit_types:ok_or_error('not_found') | rabbit_types:connection_exit()). @@ -161,7 +160,7 @@ -spec(set_ram_duration_target/2 :: (pid(), number() | 'infinity') -> 'ok'). -spec(set_maximum_since_use/2 :: (pid(), non_neg_integer()) -> 'ok'). -spec(maybe_expire/1 :: (pid()) -> 'ok'). --spec(on_node_down/1 :: (node()) -> 'ok' | rabbit_types:connection_exit()). +-spec(on_node_down/1 :: (node()) -> 'ok'). -spec(pseudo_queue/2 :: (binary(), pid()) -> rabbit_types:amqqueue()). -endif. diff --git a/src/rabbit_basic.erl b/src/rabbit_basic.erl index b536fa79..c1445a0c 100644 --- a/src/rabbit_basic.erl +++ b/src/rabbit_basic.erl @@ -49,12 +49,10 @@ | rabbit_types:error('not_found'))). -spec(publish/1 :: - (rabbit_types:delivery()) -> publish_result() | - rabbit_types:connection_exit()). + (rabbit_types:delivery()) -> publish_result()). -spec(delivery/4 :: (boolean(), boolean(), rabbit_types:maybe(rabbit_types:txn()), - rabbit_types:message()) - -> rabbit_types:delivery()). + rabbit_types:message()) -> rabbit_types:delivery()). -spec(message/4 :: (rabbit_exchange:name(), rabbit_router:routing_key(), properties_input(), binary()) @@ -64,12 +62,12 @@ -spec(publish/4 :: (rabbit_exchange:name(), rabbit_router:routing_key(), properties_input(), binary()) - -> publish_result() | rabbit_types:connection_exit()). + -> publish_result()). -spec(publish/7 :: (rabbit_exchange:name(), rabbit_router:routing_key(), boolean(), boolean(), rabbit_types:maybe(rabbit_types:txn()), properties_input(), binary()) - -> publish_result() | rabbit_types:connection_exit()). + -> publish_result()). -spec(build_content/2 :: (rabbit_framing:amqp_property_record(), binary()) -> rabbit_types:content()). diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index 91a36cc7..7353f103 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -67,10 +67,10 @@ fun((rabbit_types:exchange(), queue()) -> rabbit_types:ok_or_error(rabbit_types:amqp_error()))). --spec(recover/0 :: () -> 'ok' | rabbit_types:connection_exit()). +-spec(recover/0 :: () -> 'ok'). -spec(declare/5 :: (name(), type(), boolean(), boolean(), rabbit_framing:amqp_table()) - -> rabbit_types:exchange() | rabbit_types:connection_exit()). + -> rabbit_types:exchange()). -spec(check_type/1 :: (binary()) -> atom() | rabbit_types:connection_exit()). -spec(assert_equivalence/5 :: @@ -96,32 +96,28 @@ -spec(info_all/2 ::(rabbit_types:vhost(), [rabbit_types:info_key()]) -> [[rabbit_types:info()]]). -spec(publish/2 :: (rabbit_types:exchange(), rabbit_types:delivery()) - -> {rabbit_router:routing_result(), [pid()]} | - rabbit_types:connection_exit()). + -> {rabbit_router:routing_result(), [pid()]}). -spec(add_binding/5 :: (name(), rabbit_amqqueue:name(), rabbit_router:routing_key(), - rabbit_framing:amqp_table(), inner_fun()) - -> bind_res() | rabbit_types:connection_exit()). + rabbit_framing:amqp_table(), inner_fun()) -> bind_res()). -spec(delete_binding/5 :: (name(), rabbit_amqqueue:name(), rabbit_router:routing_key(), rabbit_framing:amqp_table(), inner_fun()) - -> bind_res() | rabbit_types:error('binding_not_found') | - rabbit_types:connection_exit()). + -> bind_res() | rabbit_types:error('binding_not_found')). -spec(list_bindings/1 :: (rabbit_types:vhost()) -> [{name(), rabbit_amqqueue:name(), rabbit_router:routing_key(), rabbit_framing:amqp_table()}]). -spec(delete_queue_bindings/1 :: (rabbit_amqqueue:name()) - -> fun (() -> none()) | rabbit_types:connection_exit()). + -> fun (() -> none())). -spec(delete_transient_queue_bindings/1 :: (rabbit_amqqueue:name()) - -> fun (() -> none()) | rabbit_types:connection_exit()). + -> fun (() -> none())). -spec(delete/2 :: (name(), boolean())-> 'ok' | rabbit_types:error('not_found') | - rabbit_types:error('in_use') | - rabbit_types:connection_exit()). + rabbit_types:error('in_use')). -spec(list_queue_bindings/1 :: (rabbit_amqqueue:name()) -> [{name(), rabbit_router:routing_key(), diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 7543ae5b..3b665d38 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -79,14 +79,15 @@ -type(ok_or_error() :: rabbit_types:ok_or_error(any())). -type(thunk(T) :: fun(() -> T)). -type(resource_name() :: binary()). +-type(channel_or_connection_exit() + :: rabbit_types:channel_exit() | rabbit_types:connection_exit()). -spec(method_record_type/1 :: (rabbit_framing:amqp_method_record()) -> rabbit_framing:amqp_method_name()). -spec(polite_pause/0 :: () -> 'done'). -spec(polite_pause/1 :: (non_neg_integer()) -> 'done'). -spec(die/1 :: - (rabbit_framing:amqp_exception()) - -> rabbit_types:channel_exit() | rabbit_types:connection_exit()). + (rabbit_framing:amqp_exception()) -> channel_or_connection_exit()). -spec(frame_error/2 :: (rabbit_framing:amqp_method_name(), binary()) -> rabbit_types:connection_exit()). -spec(amqp_error/4 :: @@ -94,14 +95,12 @@ rabbit_framing:amqp_method_name()) -> rabbit_types:amqp_error()). -spec(protocol_error/3 :: (rabbit_framing:amqp_exception(), string(), [any()]) - -> rabbit_types:channel_exit() | - rabbit_types:connection_exit()). + -> channel_or_connection_exit()). -spec(protocol_error/4 :: (rabbit_framing:amqp_exception(), string(), [any()], - rabbit_framing:amqp_method_name()) - -> rabbit_types:channel_exit() | - rabbit_types:connection_exit()). --spec(protocol_error/1 :: (rabbit_types:amqp_error()) -> no_return()). + rabbit_framing:amqp_method_name()) -> channel_or_connection_exit()). +-spec(protocol_error/1 :: + (rabbit_types:amqp_error()) -> channel_or_connection_exit()). -spec(not_found/1 :: (rabbit_types:r(atom())) -> rabbit_types:channel_exit()). -spec(assert_args_equivalence/4 :: (rabbit_framing:amqp_table(), rabbit_framing:amqp_table(), |