github.com/cloudwego/kitex@v0.9.0/pkg/protocol/bthrift/test/test.thrift (about)

     1  /*
     2   * Copyright 2023 CloudWeGo Authors
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *     http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  namespace go test
    18  
    19  enum AEnum {
    20    A = 1,
    21    B = 2,
    22  }
    23  
    24  struct Inner {
    25    1: optional i32 Num = 5,
    26    2: optional string desc,
    27    3: optional map<i64, list<i64>> MapOfList,
    28    4: optional map<AEnum, i64> MapOfEnumKey,
    29    5: optional byte Byte1,
    30    6: optional double Double1,
    31  }
    32  
    33  enum HTTPStatus {
    34    OK = 200,
    35    NOT_FOUND = 404
    36  }
    37  
    38  struct Local {
    39    1: i32 l,
    40  }
    41  
    42  struct FullStruct {
    43    1: required i32 Left,
    44    2: optional i32 Right = 3,
    45    3: binary Dummy,
    46    4: Inner InnerReq,
    47    5: HTTPStatus status,
    48    6: string Str,
    49    7: list<HTTPStatus> enum_list,
    50    8: optional map<i32, string> Strmap,
    51    9: i64 Int64,
    52    10: optional list<i32> IntList,
    53    11: list<Local> localList,
    54    12: map<string, Local> StrLocalMap,
    55    13: list<list<i32>> nestList,
    56    14: required Local required_ins,
    57    16: map<string, list<string>> nestMap,
    58    17: list<map<string, HTTPStatus>> nestMap2,
    59    18: map<i32, HTTPStatus> enum_map,
    60    19: list<string> Strlist,
    61    20: optional Local optional_ins,
    62    21: Inner AnotherInner,
    63    22: optional list<string> opt_nil_list,
    64    23: list<string> nil_list,
    65    24: optional list<Inner> opt_nil_ins_list,
    66    25: list<Inner> nil_ins_list,
    67    26: optional HTTPStatus opt_status,
    68    27: map<HTTPStatus, Local> enum_key_map,
    69    28: map<HTTPStatus, list<map<string, Local>>> complex,
    70    29: set<i64> i64Set,
    71    30: i16 Int16,
    72    31: bool isSet,
    73  }
    74  
    75  struct MixedStruct {
    76    1: required i32 Left,
    77    3: binary Dummy,
    78    6: string Str,
    79    7: list<HTTPStatus> enum_list,
    80    9: i64 Int64,
    81    10: optional list<i32> IntList,
    82    11: list<Local> localList,
    83    12: map<string, Local> StrLocalMap,
    84    13: list<list<i32>> nestList,
    85    14: required Local required_ins,
    86    20: optional Local optional_ins,
    87    21: Inner AnotherInner,
    88    27: map<HTTPStatus, Local> enum_key_map,
    89  }
    90  
    91  struct EmptyStruct {
    92  }
    93