test.proto 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // Copyright 2018 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. syntax = "proto3";
  5. package goproto.proto.test3;
  6. import "test3/test_import.proto";
  7. option go_package = "google.golang.org/protobuf/internal/testprotos/test3";
  8. message TestAllTypes {
  9. message NestedMessage {
  10. int32 a = 1;
  11. TestAllTypes corecursive = 2;
  12. }
  13. enum NestedEnum {
  14. FOO = 0;
  15. BAR = 1;
  16. BAZ = 2;
  17. NEG = -1; // Intentionally negative.
  18. }
  19. int32 optional_int32 = 1;
  20. int64 optional_int64 = 2;
  21. uint32 optional_uint32 = 3;
  22. uint64 optional_uint64 = 4;
  23. sint32 optional_sint32 = 5;
  24. sint64 optional_sint64 = 6;
  25. fixed32 optional_fixed32 = 7;
  26. fixed64 optional_fixed64 = 8;
  27. sfixed32 optional_sfixed32 = 9;
  28. sfixed64 optional_sfixed64 = 10;
  29. float optional_float = 11;
  30. double optional_double = 12;
  31. bool optional_bool = 13;
  32. string optional_string = 14;
  33. bytes optional_bytes = 15;
  34. NestedMessage optional_nested_message = 18;
  35. ForeignMessage optional_foreign_message = 19;
  36. ImportMessage optional_import_message = 20;
  37. NestedEnum optional_nested_enum = 21;
  38. ForeignEnum optional_foreign_enum = 22;
  39. ImportEnum optional_import_enum = 23;
  40. repeated int32 repeated_int32 = 31;
  41. repeated int64 repeated_int64 = 32;
  42. repeated uint32 repeated_uint32 = 33;
  43. repeated uint64 repeated_uint64 = 34;
  44. repeated sint32 repeated_sint32 = 35;
  45. repeated sint64 repeated_sint64 = 36;
  46. repeated fixed32 repeated_fixed32 = 37;
  47. repeated fixed64 repeated_fixed64 = 38;
  48. repeated sfixed32 repeated_sfixed32 = 39;
  49. repeated sfixed64 repeated_sfixed64 = 40;
  50. repeated float repeated_float = 41;
  51. repeated double repeated_double = 42;
  52. repeated bool repeated_bool = 43;
  53. repeated string repeated_string = 44;
  54. repeated bytes repeated_bytes = 45;
  55. repeated NestedMessage repeated_nested_message = 48;
  56. repeated ForeignMessage repeated_foreign_message = 49;
  57. repeated ImportMessage repeated_importmessage = 50;
  58. repeated NestedEnum repeated_nested_enum = 51;
  59. repeated ForeignEnum repeated_foreign_enum = 52;
  60. repeated ImportEnum repeated_importenum = 53;
  61. map < int32, int32> map_int32_int32 = 56;
  62. map < int64, int64> map_int64_int64 = 57;
  63. map < uint32, uint32> map_uint32_uint32 = 58;
  64. map < uint64, uint64> map_uint64_uint64 = 59;
  65. map < sint32, sint32> map_sint32_sint32 = 60;
  66. map < sint64, sint64> map_sint64_sint64 = 61;
  67. map < fixed32, fixed32> map_fixed32_fixed32 = 62;
  68. map < fixed64, fixed64> map_fixed64_fixed64 = 63;
  69. map <sfixed32, sfixed32> map_sfixed32_sfixed32 = 64;
  70. map <sfixed64, sfixed64> map_sfixed64_sfixed64 = 65;
  71. map < int32, float> map_int32_float = 66;
  72. map < int32, double> map_int32_double = 67;
  73. map < bool, bool> map_bool_bool = 68;
  74. map < string, string> map_string_string = 69;
  75. map < string, bytes> map_string_bytes = 70;
  76. map < string, NestedMessage> map_string_nested_message = 71;
  77. map < string, NestedEnum> map_string_nested_enum = 73;
  78. oneof oneof_field {
  79. uint32 oneof_uint32 = 111;
  80. NestedMessage oneof_nested_message = 112;
  81. string oneof_string = 113;
  82. bytes oneof_bytes = 114;
  83. bool oneof_bool = 115;
  84. uint64 oneof_uint64 = 116;
  85. float oneof_float = 117;
  86. double oneof_double = 118;
  87. NestedEnum oneof_enum = 119;
  88. }
  89. }
  90. message ForeignMessage {
  91. int32 c = 1;
  92. int32 d = 2;
  93. }
  94. enum ForeignEnum {
  95. FOREIGN_ZERO = 0;
  96. FOREIGN_FOO = 4;
  97. FOREIGN_BAR = 5;
  98. FOREIGN_BAZ = 6;
  99. }