github.com/gogo/protobuf@v1.3.2/test/stdtypes/stdtypes.proto (about)

     1  // Protocol Buffers for Go with Gadgets
     2  //
     3  // Copyright (c) 2016, The GoGo Authors. All rights reserved.
     4  // http://github.com/gogo/protobuf
     5  //
     6  // Redistribution and use in source and binary forms, with or without
     7  // modification, are permitted provided that the following conditions are
     8  // met:
     9  //
    10  //     * Redistributions of source code must retain the above copyright
    11  // notice, this list of conditions and the following disclaimer.
    12  //     * Redistributions in binary form must reproduce the above
    13  // copyright notice, this list of conditions and the following disclaimer
    14  // in the documentation and/or other materials provided with the
    15  // distribution.
    16  //
    17  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    18  // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    19  // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    20  // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    21  // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    22  // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    23  // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    24  // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    25  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    26  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    27  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    28  
    29  syntax = "proto3";
    30  
    31  package stdtypes;
    32  
    33  import "github.com/gogo/protobuf/gogoproto/gogo.proto";
    34  
    35  import "google/protobuf/duration.proto";
    36  import "google/protobuf/timestamp.proto";
    37  import "google/protobuf/wrappers.proto";
    38  
    39  option (gogoproto.testgen_all) = true;
    40  option (gogoproto.populate_all) = true;
    41  option (gogoproto.benchgen_all) = true;
    42  option (gogoproto.unmarshaler_all) = false;
    43  option (gogoproto.marshaler_all) = false;
    44  option (gogoproto.sizer_all) = true;
    45  option (gogoproto.equal_all) = true;
    46  option (gogoproto.gostring_all) = true;
    47  option (gogoproto.verbose_equal_all) = true;
    48  option (gogoproto.unsafe_marshaler_all) = false;
    49  option (gogoproto.unsafe_unmarshaler_all) = false;
    50  
    51  message StdTypes {
    52    google.protobuf.Timestamp nullableTimestamp = 1 [(gogoproto.stdtime) = true];
    53    google.protobuf.Duration nullableDuration = 2 [(gogoproto.stdduration) = true];
    54    google.protobuf.Timestamp timestamp = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
    55    google.protobuf.Duration duration = 4 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false];
    56  
    57    google.protobuf.DoubleValue nullableDouble = 5 [(gogoproto.wktpointer) = true];
    58    google.protobuf.DoubleValue nonnullDouble = 6 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
    59  
    60    google.protobuf.FloatValue nullableFloat = 7 [(gogoproto.wktpointer) = true];
    61    google.protobuf.FloatValue nonnullFloat = 8 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
    62  
    63    google.protobuf.Int64Value nullableInt64 = 9 [(gogoproto.wktpointer) = true];
    64    google.protobuf.Int64Value nonnullInt64 = 10 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
    65  
    66    google.protobuf.UInt64Value nullableUInt64 = 11 [(gogoproto.wktpointer) = true];
    67    google.protobuf.UInt64Value nonnullUInt64 = 12 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
    68  
    69    google.protobuf.Int32Value nullableInt32 = 13 [(gogoproto.wktpointer) = true];
    70    google.protobuf.Int32Value nonnullInt32 = 14 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
    71  
    72    google.protobuf.UInt32Value nullableUInt32 = 15 [(gogoproto.wktpointer) = true];
    73    google.protobuf.UInt32Value nonnullUInt32 = 16 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
    74  
    75    google.protobuf.BoolValue nullableBool = 17 [(gogoproto.wktpointer) = true];
    76    google.protobuf.BoolValue nonnullBool = 18 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
    77  
    78    google.protobuf.StringValue nullableString = 19 [(gogoproto.wktpointer) = true];
    79    google.protobuf.StringValue nonnullString = 20 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
    80  
    81    google.protobuf.BytesValue nullableBytes = 21 [(gogoproto.wktpointer) = true];
    82    google.protobuf.BytesValue nonnullBytes = 22 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
    83  }
    84  
    85  message RepStdTypes {
    86    repeated google.protobuf.Timestamp nullableTimestamps = 1 [(gogoproto.stdtime) = true];
    87    repeated google.protobuf.Duration nullableDurations = 2 [(gogoproto.stdduration) = true];
    88    repeated google.protobuf.Timestamp timestamps = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
    89    repeated google.protobuf.Duration durations = 4 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false];
    90  
    91    repeated google.protobuf.DoubleValue nullableDouble = 5 [(gogoproto.wktpointer) = true];
    92    repeated google.protobuf.DoubleValue nonnullDouble = 6 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
    93  
    94    repeated google.protobuf.FloatValue nullableFloat = 7 [(gogoproto.wktpointer) = true];
    95    repeated google.protobuf.FloatValue nonnullFloat = 8 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
    96  
    97    repeated google.protobuf.Int64Value nullableInt64 = 9 [(gogoproto.wktpointer) = true];
    98    repeated google.protobuf.Int64Value nonnullInt64 = 10 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
    99  
   100    repeated google.protobuf.UInt64Value nullableUInt64 = 11 [(gogoproto.wktpointer) = true];
   101    repeated google.protobuf.UInt64Value nonnullUInt64 = 12 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   102  
   103    repeated google.protobuf.Int32Value nullableInt32 = 13 [(gogoproto.wktpointer) = true];
   104    repeated google.protobuf.Int32Value nonnullInt32 = 14 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   105  
   106    repeated google.protobuf.UInt32Value nullableUInt32 = 15 [(gogoproto.wktpointer) = true];
   107    repeated google.protobuf.UInt32Value nonnullUInt32 = 16 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   108  
   109    repeated google.protobuf.BoolValue nullableBool = 17 [(gogoproto.wktpointer) = true];
   110    repeated google.protobuf.BoolValue nonnullBool = 18 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   111  
   112    repeated google.protobuf.StringValue nullableString = 19 [(gogoproto.wktpointer) = true];
   113    repeated google.protobuf.StringValue nonnullString = 20 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   114  
   115    repeated google.protobuf.BytesValue nullableBytes = 21 [(gogoproto.wktpointer) = true];
   116    repeated google.protobuf.BytesValue nonnullBytes = 22 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   117  }
   118  
   119  message MapStdTypes {
   120    map<int32,google.protobuf.Timestamp> nullableTimestamp = 1 [(gogoproto.stdtime) = true];
   121    map<int32,google.protobuf.Timestamp> timestamp = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
   122  
   123    map<int32,google.protobuf.Duration> nullableDuration = 3 [(gogoproto.stdduration) = true];
   124    map<int32,google.protobuf.Duration> duration = 4 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false];
   125  
   126    map<int32, google.protobuf.DoubleValue> nullableDouble = 5 [(gogoproto.wktpointer) = true];
   127    map<int32, google.protobuf.DoubleValue> nonnullDouble = 6 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   128  
   129    map<int32, google.protobuf.FloatValue> nullableFloat = 7 [(gogoproto.wktpointer) = true];
   130    map<int32, google.protobuf.FloatValue> nonnullFloat = 8 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   131  
   132    map<int32, google.protobuf.Int64Value> nullableInt64 = 9 [(gogoproto.wktpointer) = true];
   133    map<int32, google.protobuf.Int64Value> nonnullInt64 = 10 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   134  
   135    map<int32, google.protobuf.UInt64Value> nullableUInt64 = 11 [(gogoproto.wktpointer) = true];
   136    map<int32, google.protobuf.UInt64Value> nonnullUInt64 = 12 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   137  
   138    map<int32, google.protobuf.Int32Value> nullableInt32 = 13 [(gogoproto.wktpointer) = true];
   139    map<int32, google.protobuf.Int32Value> nonnullInt32 = 14 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   140  
   141    map<int32, google.protobuf.UInt32Value> nullableUInt32 = 15 [(gogoproto.wktpointer) = true];
   142    map<int32, google.protobuf.UInt32Value> nonnullUInt32 = 16 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   143  
   144    map<int32, google.protobuf.BoolValue> nullableBool = 17 [(gogoproto.wktpointer) = true];
   145    map<int32, google.protobuf.BoolValue> nonnullBool = 18 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   146  
   147    map<int32, google.protobuf.StringValue> nullableString = 19 [(gogoproto.wktpointer) = true];
   148    map<int32, google.protobuf.StringValue> nonnullString = 20 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   149  
   150    map<int32, google.protobuf.BytesValue> nullableBytes = 21 [(gogoproto.wktpointer) = true];
   151    map<int32, google.protobuf.BytesValue> nonnullBytes = 22 [(gogoproto.wktpointer) = true, (gogoproto.nullable) = false];
   152  }
   153  
   154  message OneofStdTypes {
   155    oneof OneOfStdTimes {
   156      google.protobuf.Timestamp timestamp = 1 [(gogoproto.stdtime) = true];
   157      google.protobuf.Duration duration = 2 [(gogoproto.stdduration) = true];
   158      google.protobuf.DoubleValue repDouble = 3 [(gogoproto.wktpointer) = true];
   159      google.protobuf.FloatValue repFloat = 4 [(gogoproto.wktpointer) = true];
   160      google.protobuf.Int64Value repInt64 = 5 [(gogoproto.wktpointer) = true];
   161      google.protobuf.UInt64Value repUInt64 = 6 [(gogoproto.wktpointer) = true];
   162      google.protobuf.Int32Value repInt32 = 7 [(gogoproto.wktpointer) = true];
   163      google.protobuf.UInt32Value repUInt32 = 8 [(gogoproto.wktpointer) = true];
   164      google.protobuf.BoolValue repBool = 9 [(gogoproto.wktpointer) = true];
   165      google.protobuf.StringValue repString = 10 [(gogoproto.wktpointer) = true];
   166      google.protobuf.BytesValue repBytes = 11 [(gogoproto.wktpointer) = true];
   167    }
   168  }
   169