Permalink
Browse files

Initial commit

  • Loading branch information...
jbrisbin committed Jan 19, 2011
0 parents commit c8f08c20652e4a9f4250bc0f6d97ddcc5c7f6e0b
@@ -0,0 +1,18 @@
= Rebar-friendly fork of Erlang AMQP client
This is a fork of the [official RabbitMQ/AMQP Erlang client](https://github.com/rabbitmq/rabbitmq-erlang-client).
It's meant to be included in your rebar projects in your rebar.config file:
{deps, [
{rabbit_common, ".*", {git, "git://github.com/jbrisbin/rabbit_common.git", "HEAD"}},
{amqp_client, ".*", {git, "git://github.com/jbrisbin/amqp_client.git", "HEAD"}}
]}.
This is simply a re-packaging of the AMQP client, which is licensed under the MPL:
This package, the RabbitMQ server is licensed under the MPL. For the
MPL, please see LICENSE-MPL-RabbitMQ.
If you have any questions regarding licensing, please contact us at
info@rabbitmq.com.
@@ -0,0 +1,44 @@
%% 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-2010 VMware, Inc. All rights reserved.
%%
-include_lib("rabbit_common/include/rabbit.hrl").
-include_lib("rabbit_common/include/rabbit_framing.hrl").
-define(PROTOCOL_VERSION_MAJOR, 0).
-define(PROTOCOL_VERSION_MINOR, 9).
-define(PROTOCOL_HEADER, <<"AMQP", 0, 0, 9, 1>>).
-define(PROTOCOL, rabbit_framing_amqp_0_9_1).
-define(MAX_CHANNEL_NUMBER, 65535).
-record(amqp_msg, {props = #'P_basic'{}, payload = <<>>}).
-record(amqp_params, {username = <<"guest">>,
password = <<"guest">>,
virtual_host = <<"/">>,
host = "localhost",
port = ?PROTOCOL_PORT,
channel_max = 0,
frame_max = 0,
heartbeat = 0,
ssl_options = none,
auth_mechanisms = [fun amqp_auth_mechanisms:plain/3,
fun amqp_auth_mechanisms:amqplain/3],
client_properties = []}).
-define(LOG_DEBUG(Format), error_logger:info_msg(Format)).
-define(LOG_INFO(Format, Args), error_logger:info_msg(Format, Args)).
-define(LOG_WARN(Format, Args), error_logger:warning_msg(Format, Args)).
@@ -0,0 +1,3 @@
{deps, [
{rabbit_common, ".*", {git, "git://github.com/jbrisbin/rabbit_common.git", "HEAD"}},
]}.
@@ -0,0 +1,42 @@
%% 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-2010 VMware, Inc. All rights reserved.
%%
-module(amqp_auth_mechanisms).
-include("amqp_client.hrl").
-export([plain/3, amqplain/3, external/3]).
%%---------------------------------------------------------------------------
plain(none, _, init) ->
{<<"PLAIN">>, []};
plain(none, #amqp_params{username = Username,
password = Password}, _State) ->
{<<0, Username/binary, 0, Password/binary>>, _State}.
amqplain(none, _, init) ->
{<<"AMQPLAIN">>, []};
amqplain(none, #amqp_params{username = Username,
password = Password}, _State) ->
LoginTable = [{<<"LOGIN">>, longstr, Username},
{<<"PASSWORD">>, longstr, Password}],
{rabbit_binary_generator:generate_table(LoginTable), _State}.
external(none, _, init) ->
{<<"EXTERNAL">>, []};
external(none, _, _State) ->
{<<"">>, _State}.
Oops, something went wrong.

0 comments on commit c8f08c2

Please sign in to comment.