github.com/cloudwego/kitex@v0.9.0/pkg/generic/json_test/idl/example.thrift (about)

     1  include "base.thrift"
     2  include "self_ref.thrift"
     3  include "extend.thrift"
     4  namespace go kitex.test.server
     5  
     6  enum FOO {
     7      A = 1;
     8  }
     9  
    10  struct InnerBase {
    11      255: base.Base Base,
    12  }
    13  
    14  struct ExampleReq {
    15      1: required string Msg,
    16      2: FOO Foo,
    17      3: InnerBase InnerBase,
    18      4: optional i8 I8,
    19      5: optional i16 I16,
    20      6: optional i32 I32,
    21      7: optional i64 I64,
    22      8: optional double Double,
    23      255: base.Base Base,
    24  }
    25  struct ExampleResp {
    26      1: required string Msg,
    27      2: string required_field,
    28      3: optional i64 num (api.js_conv="true"),
    29      4: optional i8 I8,
    30      5: optional i16 I16,
    31      6: optional i32 I32,
    32      7: optional i64 I64,
    33      8: optional double Double,
    34      255: base.BaseResp BaseResp,
    35  }
    36  exception Exception {
    37      1: i32 code
    38      2: string msg
    39  }
    40  
    41  struct A {
    42      1: A self
    43      2: self_ref.A a
    44  }
    45  
    46  service ExampleService extends extend.ExtendService {
    47      ExampleResp ExampleMethod(1: ExampleReq req)throws(1: Exception err),
    48      A Foo(1: A req)
    49      string Ping(1: string msg)
    50      oneway void Oneway(1: string msg)
    51      void Void(1: string msg)
    52  }