github.com/cloudwego/kitex@v0.9.0/pkg/generic/reflect_test/idl/example.thrift (about) 1 include "base.thrift" 2 include "self_ref.thrift" 3 namespace go kitex.test.server 4 5 enum FOO { 6 A = 1; 7 } 8 9 struct InnerBase { 10 255: base.Base Base, 11 } 12 13 struct MockElem { 14 1: string Bar 15 } 16 17 struct ExampleReq { 18 1: required string Msg = "Hello", 19 2: FOO Foo, 20 3: list<MockElem> TestList, 21 4: optional map<string, MockElem> TestMap, 22 5: list<string> StrList, 23 6: list<i64> I64List = [1, 2, 3], 24 7: bool B, 25 255: base.Base Base, 26 } 27 struct ExampleResp { 28 1: required string Msg, 29 2: string required_field 30 255: base.BaseResp BaseResp, 31 } 32 exception Exception { 33 1: i32 code 34 2: string msg 35 } 36 37 struct A { 38 1: A self 39 2: self_ref.A a 40 } 41 42 service ExampleService { 43 ExampleReq ExampleMethod(1: ExampleReq req)throws(1: Exception err), 44 ExampleResp ExampleMethod2(1: ExampleReq req)throws(1: Exception err), 45 A Foo(1: A req) 46 string Ping(1: string msg) 47 oneway void Oneway(1: string msg) 48 void Void(1: string msg) 49 }