Skip to content

Instantly share code, notes, and snippets.

@dantswain
Created October 16, 2016 17:22
Show Gist options
  • Save dantswain/623215759d3413a1a6b7e68b37b039f8 to your computer and use it in GitHub Desktop.
Save dantswain/623215759d3413a1a6b7e68b37b039f8 to your computer and use it in GitHub Desktop.
Example thrift file with enum and typedef
namespace erl thrash
typedef i64 UgeInt
const i32 MAX_THINGS = 42
enum TacoType {
BARBACOA = 123,
CARNITAS = 124,
STEAK = 125,
CHICKEN = 126,
PASTOR = 127
}
struct SubStruct {
1: i32 sub_id
2: string sub_name
}
struct SimpleStruct {
1: i32 id
2: string name
3: list<i32> list_of_ints
4: UgeInt bigint
5: SubStruct sub_struct
6: bool flag
7: double floatval
8: TacoType taco_pref
9: list<SubStruct> list_of_structs
10: byte chew
11: i16 mediumint
12: map<i32, string> map_int_to_string
13: map<string, SubStruct> map_string_to_struct
14: set<string> set_of_strings
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment