diff options
author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-07-02 15:01:15 +0100 |
---|---|---|
committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-07-02 15:01:15 +0100 |
commit | 334d32e77e309e1e49d2f0710ff98208a4bb5c08 (patch) | |
tree | ee4dba7266763bb5abbc5a66531aea974ee2a3f4 /src | |
parent | d81c817d65ceba84c8095b0df866e068779c92f2 (diff) | |
download | rabbitmq-server-334d32e77e309e1e49d2f0710ff98208a4bb5c08.tar.gz |
better types
Diffstat (limited to 'src')
-rw-r--r-- | src/rabbit.erl | 10 | ||||
-rw-r--r-- | src/rabbit_access_control.erl | 2 | ||||
-rw-r--r-- | src/rabbit_amqqueue.erl | 2 | ||||
-rw-r--r-- | src/rabbit_basic.erl | 8 | ||||
-rw-r--r-- | src/rabbit_binary_generator.erl | 2 | ||||
-rw-r--r-- | src/rabbit_channel.erl | 2 | ||||
-rw-r--r-- | src/rabbit_exchange.erl | 2 | ||||
-rw-r--r-- | src/rabbit_misc.erl | 4 | ||||
-rw-r--r-- | src/rabbit_net.erl | 2 |
9 files changed, 19 insertions, 15 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index e276cd03..a0f0c7f2 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -41,8 +41,8 @@ -export_type([regexp/0, txn/0, thunk/1,maybe/1, info/0, info_key/0, msg_id/0, erlang_node/0, message/0, basic_message/0, - delivery/0, content/0, decoded_content/0, encoded_content/0, - unencoded_content/0, vhost/0, ctag/0]). + delivery/0, content/0, decoded_content/0, undecoded_content/0, + unencoded_content/0, encoded_content/0, vhost/0, ctag/0]). %%--------------------------------------------------------------------------- %% Boot steps. @@ -203,18 +203,18 @@ properties_bin :: binary(), payload_fragments_rev :: [binary()]} | #content{class_id :: rabbit_framing:amqp_class_id(), - properties :: rabbit_framing:amqp_properties(), + properties :: rabbit_framing:amqp_property_record(), properties_bin :: 'none', payload_fragments_rev :: [binary()]}). -type(unencoded_content() :: undecoded_content()). -type(decoded_content() :: #content{class_id :: rabbit_framing:amqp_class_id(), - properties :: rabbit_framing:amqp_properties(), + properties :: rabbit_framing:amqp_property_record(), properties_bin :: rabbit:maybe(binary()), payload_fragments_rev :: [binary()]}). -type(encoded_content() :: #content{class_id :: rabbit_framing:amqp_class_id(), - properties :: rabbit:maybe(rabbit_framing:amqp_properties()), + properties :: rabbit:maybe(rabbit_framing:amqp_property_record()), properties_bin :: binary(), payload_fragments_rev :: [binary()]}). -type(content() :: undecoded_content() | decoded_content()). diff --git a/src/rabbit_access_control.erl b/src/rabbit_access_control.erl index 082b0ac2..fec09217 100644 --- a/src/rabbit_access_control.erl +++ b/src/rabbit_access_control.erl @@ -74,7 +74,7 @@ (rabbit:vhost()) -> [{username(), rabbit:regexp(), rabbit:regexp(), rabbit:regexp()}]). -spec(list_user_permissions/1 :: - (username()) -> [{rabbit_framing:vhost(), rabbit:regexp(), + (username()) -> [{rabbit:vhost(), rabbit:regexp(), rabbit:regexp(), rabbit:regexp()}]). -endif. diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index c65913cf..96c7058d 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -46,6 +46,8 @@ -export([commit_all/3, rollback_all/3, notify_down_all/2, limit_all/3]). -export([on_node_down/1]). +-export_type([amqqueue/0, name/0, qmsg/0]). + -import(mnesia). -import(gen_server2). -import(lists). diff --git a/src/rabbit_basic.erl b/src/rabbit_basic.erl index e2c861d6..fb6f85dd 100644 --- a/src/rabbit_basic.erl +++ b/src/rabbit_basic.erl @@ -42,7 +42,7 @@ -ifdef(use_specs). --type(properties_input() :: (rabbit_framing:amqp_properties() | [{atom(), any()}])). +-type(properties_input() :: (rabbit_framing:amqp_property_record() | [{atom(), any()}])). -type(publish_result() :: ({ok, rabbit_router:routing_result(), [pid()]} | rabbit_misc:not_found())). @@ -52,16 +52,16 @@ -spec(message/4 :: (rabbit_exchange:name(), rabbit_router:routing_key(), properties_input(), binary()) -> (rabbit:message() | {'error', any()})). --spec(properties/1 :: (properties_input()) -> rabbit_framing:amqp_properties()). +-spec(properties/1 :: (properties_input()) -> rabbit_framing:amqp_property_record()). -spec(publish/4 :: (rabbit_exchange:name(), rabbit_router:routing_key(), properties_input(), binary()) -> publish_result()). -spec(publish/7 :: (rabbit_exchange:name(), rabbit_router:routing_key(), boolean(), boolean(), rabbit:maybe(rabbit:txn()), properties_input(), binary()) -> publish_result()). -spec(build_content/2 :: - (rabbit_framing:amqp_properties(), binary()) -> rabbit:content()). + (rabbit_framing:amqp_property_record(), binary()) -> rabbit:content()). -spec(from_content/1 :: (rabbit:content()) - -> {rabbit_framing:amqp_properties(), binary()}). + -> {rabbit_framing:amqp_property_record(), binary()}). -spec(is_message_persistent/1 :: (rabbit:decoded_content()) -> (boolean() | {'invalid', non_neg_integer()})). diff --git a/src/rabbit_binary_generator.erl b/src/rabbit_binary_generator.erl index 655dfe5c..a2af46c9 100644 --- a/src/rabbit_binary_generator.erl +++ b/src/rabbit_binary_generator.erl @@ -63,7 +63,7 @@ (rabbit_channel:channel_number(), rabbit:content(), non_neg_integer()) -> [frame()]). -spec(build_heartbeat_frame/0 :: () -> frame()). --spec(generate_table/1 :: (rabbit:amqp_table()) -> binary()). +-spec(generate_table/1 :: (rabbit_framing:amqp_table()) -> binary()). -spec(encode_properties/2 :: ([rabbit_framing:amqp_property_type()], [any()]) -> binary()). -spec(check_empty_content_body_frame_size/0 :: () -> 'ok'). diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index ca2e428e..a446bbab 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -84,7 +84,7 @@ rabbit:maybe(rabbit:content())) -> 'ok'). -spec(shutdown/1 :: (pid()) -> 'ok'). -spec(send_command/2 :: (pid(), rabbit_framing:amqp_method()) -> 'ok'). --spec(deliver/4 ::(pid(), rabbit:ctag(), boolean(), rabbit_queue:qmsg()) -> 'ok'). +-spec(deliver/4 ::(pid(), rabbit:ctag(), boolean(), rabbit_amqqueue:qmsg()) -> 'ok'). -spec(conserve_memory/2 :: (pid(), boolean()) -> 'ok'). -spec(flushed/2 :: (pid(), pid()) -> 'ok'). -spec(flow_timeout/2 :: (pid(), ref()) -> 'ok'). diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index 4db5a933..0e5b9baf 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -114,7 +114,7 @@ -spec(delete_transient_queue_bindings/1 :: (rabbit_amqqueue:name()) -> fun (() -> none())). -spec(delete/2 :: (name(), boolean()) -> - 'ok' | rabbit:not_found() | {'error', 'in_use'}). + 'ok' | rabbit_misc:not_found() | {'error', 'in_use'}). -spec(list_queue_bindings/1 :: (rabbit_amqqueue:name()) -> [{name(), rabbit_router:routing_key(), rabbit_framing:amqp_table()}]). diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 33c7d82e..986b1825 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -63,7 +63,7 @@ -export([version_compare/2, version_compare/3]). -export([recursive_delete/1, dict_cons/3, unlink_and_capture_exit/1]). --export_type([not_found/0, r/1]). +-export_type([not_found/0, amqp_error/0, r/1]). -import(mnesia). -import(lists). @@ -82,7 +82,7 @@ -type(not_found() :: {'error', 'not_found'}). -type(resource_name() :: binary()). -type(r(Kind) :: - #resource{virtual_host :: rabbit_framing:vhost(), + #resource{virtual_host :: rabbit:vhost(), kind :: Kind, name :: resource_name()}). diff --git a/src/rabbit_net.erl b/src/rabbit_net.erl index b04adc22..b098f37a 100644 --- a/src/rabbit_net.erl +++ b/src/rabbit_net.erl @@ -35,6 +35,8 @@ -export([async_recv/3, close/1, controlling_process/2, getstat/2, peername/1, port_command/2, send/2, sockname/1]). +-export_type([socket/0]). + %%--------------------------------------------------------------------------- -ifdef(use_specs). |