Upgrading dependency to Thrift 0.12.0
This commit is contained in:
parent
3e4590dcc0
commit
356978cb42
1302 changed files with 101701 additions and 26784 deletions
6
vendor/git.apache.org/thrift.git/tutorial/erl/client.erl
generated
vendored
6
vendor/git.apache.org/thrift.git/tutorial/erl/client.erl
generated
vendored
|
@ -28,7 +28,7 @@ p(X) ->
|
|||
ok.
|
||||
|
||||
t() ->
|
||||
Port = 9999,
|
||||
Port = 9090,
|
||||
|
||||
{ok, Client0} = thrift_client_util:new("127.0.0.1",
|
||||
Port,
|
||||
|
@ -44,7 +44,7 @@ t() ->
|
|||
{Client3, {ok, Sum1}} = thrift_client:call(Client2, add, [1, 4]),
|
||||
io:format("1+4=~p~n", [Sum1]),
|
||||
|
||||
Work = #work{op=?tutorial_Operation_SUBTRACT,
|
||||
Work = #'Work'{op=?TUTORIAL_OPERATION_SUBTRACT,
|
||||
num1=15,
|
||||
num2=10},
|
||||
{Client4, {ok, Diff}} = thrift_client:call(Client3, calculate, [1, Work]),
|
||||
|
@ -55,7 +55,7 @@ t() ->
|
|||
|
||||
Client6 =
|
||||
try
|
||||
Work1 = #work{op=?tutorial_Operation_DIVIDE,
|
||||
Work1 = #'Work'{op=?TUTORIAL_OPERATION_DIVIDE,
|
||||
num1=1,
|
||||
num2=0},
|
||||
{ClientS1, {ok, _Quot}} = thrift_client:call(Client5, calculate, [2, Work1]),
|
||||
|
|
1
vendor/git.apache.org/thrift.git/tutorial/erl/client.sh
generated
vendored
1
vendor/git.apache.org/thrift.git/tutorial/erl/client.sh
generated
vendored
|
@ -1 +0,0 @@
|
|||
server.sh
|
37
vendor/git.apache.org/thrift.git/tutorial/erl/client.sh
generated
vendored
Executable file
37
vendor/git.apache.org/thrift.git/tutorial/erl/client.sh
generated
vendored
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
ERL_THRIFT=../../lib/erl
|
||||
|
||||
if ! [ -d ${ERL_THRIFT}/ebin ]; then
|
||||
echo "Please build the Thrift library by running \`make' in ${ERL_THRIFT}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -d gen-erl ]; then
|
||||
../../compiler/cpp/thrift -r --gen erl ../tutorial.thrift
|
||||
fi
|
||||
|
||||
|
||||
erlc -I ${ERL_THRIFT}/include -I ${ERL_THRIFT}/ebin \
|
||||
-I gen-erl -o gen-erl gen-erl/*.erl &&
|
||||
erlc -I ${ERL_THRIFT}/include -I gen-erl *.erl &&
|
||||
erl +K true -pa ${ERL_THRIFT}/ebin -pa gen-erl
|
4
vendor/git.apache.org/thrift.git/tutorial/erl/json_client.erl
generated
vendored
4
vendor/git.apache.org/thrift.git/tutorial/erl/json_client.erl
generated
vendored
|
@ -55,7 +55,7 @@ t() ->
|
|||
{Client3, {ok, Sum1}} = thrift_client:call(Client2, add, [1, 4]),
|
||||
io:format("1+4=~p~n", [Sum1]),
|
||||
|
||||
Work = #work{op=?tutorial_Operation_SUBTRACT,
|
||||
Work = #'Work'{op=?TUTORIAL_OPERATION_SUBTRACT,
|
||||
num1=15,
|
||||
num2=10},
|
||||
{Client4, {ok, Diff}} = thrift_client:call(Client3, calculate, [1, Work]),
|
||||
|
@ -66,7 +66,7 @@ t() ->
|
|||
|
||||
Client6 =
|
||||
try
|
||||
Work1 = #work{op=?tutorial_Operation_DIVIDE,
|
||||
Work1 = #'Work'{op=?TUTORIAL_OPERATION_DIVIDE,
|
||||
num1=1,
|
||||
num2=0},
|
||||
{ClientS1, {ok, _Quot}} = thrift_client:call(Client5, calculate, [2, Work1]),
|
||||
|
|
20
vendor/git.apache.org/thrift.git/tutorial/erl/server.erl
generated
vendored
20
vendor/git.apache.org/thrift.git/tutorial/erl/server.erl
generated
vendored
|
@ -36,25 +36,25 @@ add(N1, N2) ->
|
|||
N1+N2.
|
||||
|
||||
calculate(Logid, Work) ->
|
||||
{ Op, Num1, Num2 } = { Work#work.op, Work#work.num1, Work#work.num2 },
|
||||
{ Op, Num1, Num2 } = { Work#'Work'.op, Work#'Work'.num1, Work#'Work'.num2 },
|
||||
debug("calculate(~p, {~p,~p,~p})", [Logid, Op, Num1, Num2]),
|
||||
case Op of
|
||||
?tutorial_Operation_ADD -> Num1 + Num2;
|
||||
?tutorial_Operation_SUBTRACT -> Num1 - Num2;
|
||||
?tutorial_Operation_MULTIPLY -> Num1 * Num2;
|
||||
?TUTORIAL_OPERATION_ADD -> Num1 + Num2;
|
||||
?TUTORIAL_OPERATION_SUBTRACT -> Num1 - Num2;
|
||||
?TUTORIAL_OPERATION_MULTIPLY -> Num1 * Num2;
|
||||
|
||||
?tutorial_Operation_DIVIDE when Num2 == 0 ->
|
||||
throw(#invalidOperation{whatOp=Op, why="Cannot divide by 0"});
|
||||
?tutorial_Operation_DIVIDE ->
|
||||
?TUTORIAL_OPERATION_DIVIDE when Num2 == 0 ->
|
||||
throw(#'InvalidOperation'{whatOp=Op, why="Cannot divide by 0"});
|
||||
?TUTORIAL_OPERATION_DIVIDE ->
|
||||
Num1 div Num2;
|
||||
|
||||
_Else ->
|
||||
throw(#invalidOperation{whatOp=Op, why="Invalid operation"})
|
||||
throw(#'InvalidOperation'{whatOp=Op, why="Invalid operation"})
|
||||
end.
|
||||
|
||||
getStruct(Key) ->
|
||||
debug("getStruct(~p)", [Key]),
|
||||
#sharedStruct{key=Key, value="RARG"}.
|
||||
#'SharedStruct'{key=Key, value="RARG"}.
|
||||
|
||||
zip() ->
|
||||
debug("zip", []),
|
||||
|
@ -63,7 +63,7 @@ zip() ->
|
|||
%%
|
||||
|
||||
start() ->
|
||||
start(9999).
|
||||
start(9090).
|
||||
|
||||
start(Port) ->
|
||||
Handler = ?MODULE,
|
||||
|
|
37
vendor/git.apache.org/thrift.git/tutorial/erl/server.sh
generated
vendored
37
vendor/git.apache.org/thrift.git/tutorial/erl/server.sh
generated
vendored
|
@ -1,37 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
ERL_THRIFT=../../lib/erl
|
||||
|
||||
if ! [ -d ${ERL_THRIFT}/ebin ]; then
|
||||
echo "Please build the Thrift library by running \`make' in ${ERL_THRIFT}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [ -d gen-erl ]; then
|
||||
../../compiler/cpp/thrift -r --gen erl ../tutorial.thrift
|
||||
fi
|
||||
|
||||
|
||||
erlc -I ${ERL_THRIFT}/include -I ${ERL_THRIFT}/ebin \
|
||||
-I gen-erl -o gen-erl gen-erl/*.erl &&
|
||||
erlc -I ${ERL_THRIFT}/include -I gen-erl *.erl &&
|
||||
erl +K true -pa ${ERL_THRIFT}/ebin -pa gen-erl
|
1
vendor/git.apache.org/thrift.git/tutorial/erl/server.sh
generated
vendored
Symbolic link
1
vendor/git.apache.org/thrift.git/tutorial/erl/server.sh
generated
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
client.sh
|
Loading…
Add table
Add a link
Reference in a new issue