2006-10-25 19:03:32 +00:00
|
|
|
java_package thrift.test
|
|
|
|
cpp_namespace thrift.test
|
2007-07-06 02:45:25 +00:00
|
|
|
ruby_namespace Thrift.Test
|
2007-08-16 01:26:31 +00:00
|
|
|
perl_package ThriftTest
|
2008-01-11 20:59:12 +00:00
|
|
|
csharp_namespace Thrift.Test
|
2006-08-15 00:21:31 +00:00
|
|
|
|
2006-05-30 09:24:40 +00:00
|
|
|
enum Numberz
|
|
|
|
{
|
|
|
|
ONE = 1,
|
|
|
|
TWO,
|
|
|
|
THREE,
|
|
|
|
FIVE = 5,
|
|
|
|
SIX,
|
|
|
|
EIGHT = 8
|
|
|
|
}
|
|
|
|
|
2006-06-30 18:28:50 +00:00
|
|
|
typedef i64 UserId
|
2006-05-30 09:24:40 +00:00
|
|
|
|
2007-02-21 05:17:48 +00:00
|
|
|
struct Bonk
|
|
|
|
{
|
|
|
|
1: string message,
|
|
|
|
2: i32 type
|
|
|
|
}
|
|
|
|
|
2006-05-30 09:24:40 +00:00
|
|
|
struct Xtruct
|
|
|
|
{
|
2006-10-25 19:03:32 +00:00
|
|
|
1: string string_thing,
|
|
|
|
4: byte byte_thing,
|
|
|
|
9: i32 i32_thing,
|
|
|
|
11: i64 i64_thing
|
2006-05-30 09:24:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Xtruct2
|
|
|
|
{
|
2006-10-25 19:03:32 +00:00
|
|
|
1: byte byte_thing,
|
|
|
|
2: Xtruct struct_thing,
|
|
|
|
3: i32 i32_thing
|
2006-05-30 09:24:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Insanity
|
|
|
|
{
|
2006-10-25 19:03:32 +00:00
|
|
|
1: map<Numberz, UserId> userMap,
|
|
|
|
2: list<Xtruct> xtructs
|
2006-05-30 09:24:40 +00:00
|
|
|
}
|
|
|
|
|
2006-08-15 21:29:39 +00:00
|
|
|
exception Xception {
|
2006-10-25 19:03:32 +00:00
|
|
|
1: i32 errorCode,
|
|
|
|
2: string message
|
2006-08-14 23:30:37 +00:00
|
|
|
}
|
|
|
|
|
2006-08-15 21:29:39 +00:00
|
|
|
exception Xception2 {
|
2006-10-25 19:03:32 +00:00
|
|
|
1: i32 errorCode,
|
|
|
|
2: Xtruct struct_thing
|
2006-08-14 23:30:37 +00:00
|
|
|
}
|
2007-08-16 01:26:31 +00:00
|
|
|
|
2006-09-01 22:19:06 +00:00
|
|
|
struct EmptyStruct {}
|
|
|
|
|
2006-08-14 23:30:37 +00:00
|
|
|
struct OneField {
|
2006-10-25 19:03:32 +00:00
|
|
|
1: EmptyStruct field
|
2006-08-14 23:30:37 +00:00
|
|
|
}
|
2006-08-11 23:03:42 +00:00
|
|
|
|
2006-05-30 09:24:40 +00:00
|
|
|
service ThriftTest
|
|
|
|
{
|
2006-08-14 23:30:37 +00:00
|
|
|
void testVoid(),
|
2006-10-25 19:03:32 +00:00
|
|
|
string testString(1: string thing),
|
|
|
|
byte testByte(1: byte thing),
|
|
|
|
i32 testI32(1: i32 thing),
|
|
|
|
i64 testI64(1: i64 thing),
|
|
|
|
double testDouble(1: double thing),
|
|
|
|
Xtruct testStruct(1: Xtruct thing),
|
|
|
|
Xtruct2 testNest(1: Xtruct2 thing),
|
|
|
|
map<i32,i32> testMap(1: map<i32,i32> thing),
|
|
|
|
set<i32> testSet(1: set<i32> thing),
|
|
|
|
list<i32> testList(1: list<i32> thing),
|
|
|
|
Numberz testEnum(1: Numberz thing),
|
|
|
|
UserId testTypedef(1: UserId thing),
|
|
|
|
|
|
|
|
map<i32,map<i32,i32>> testMapMap(1: i32 hello),
|
2006-05-30 09:24:40 +00:00
|
|
|
|
|
|
|
/* So you think you've got this all worked, out eh? */
|
2006-10-25 19:03:32 +00:00
|
|
|
map<UserId, map<Numberz,Insanity>> testInsanity(1: Insanity argument),
|
2006-08-14 23:30:37 +00:00
|
|
|
|
|
|
|
/* Multiple parameters */
|
2007-08-16 01:26:31 +00:00
|
|
|
Xtruct testMulti(byte arg0, i32 arg1, i64 arg2, map<i16, string> arg3, Numberz arg4, UserId arg5),
|
2006-08-14 23:30:37 +00:00
|
|
|
|
|
|
|
/* Exception specifier */
|
|
|
|
|
2006-08-15 21:29:39 +00:00
|
|
|
void testException(string arg) throws(Xception err1),
|
2006-08-14 23:30:37 +00:00
|
|
|
|
|
|
|
/* Multiple exceptions specifier */
|
|
|
|
|
2006-10-25 19:03:32 +00:00
|
|
|
Xtruct testMultiException(string arg0, string arg1) throws(Xception err1, Xception2 err2)
|
2006-05-30 09:24:40 +00:00
|
|
|
}
|
2006-09-02 23:56:49 +00:00
|
|
|
|
|
|
|
service SecondService
|
|
|
|
{
|
|
|
|
void blahBlah()
|
|
|
|
}
|