github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/golang/protobuf/jsonpb/jsonpb_test_proto/test_objects.proto (about)

     1  // Go support for Protocol Buffers - Google's data interchange format
     2  //
     3  // Copyright 2015 The Go Authors.  All rights reserved.
     4  // https://github.com/golang/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  //     * Neither the name of Google Inc. nor the names of its
    17  // contributors may be used to endorse or promote products derived from
    18  // this software without specific prior written permission.
    19  //
    20  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    21  // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    22  // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    23  // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    24  // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    25  // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    26  // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    27  // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    28  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    29  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    30  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    31  
    32  syntax = "proto2";
    33  
    34  import "google/protobuf/duration.proto";
    35  import "google/protobuf/struct.proto";
    36  import "google/protobuf/timestamp.proto";
    37  import "google/protobuf/wrappers.proto";
    38  
    39  package jsonpb;
    40  
    41  // Test message for holding primitive types.
    42  message Simple {
    43    optional bool o_bool = 1;
    44    optional int32 o_int32 = 2;
    45    optional int64 o_int64 = 3;
    46    optional uint32 o_uint32 = 4;
    47    optional uint64 o_uint64 = 5;
    48    optional sint32 o_sint32 = 6;
    49    optional sint64 o_sint64 = 7;
    50    optional float o_float = 8;
    51    optional double o_double = 9;
    52    optional string o_string = 10;
    53    optional bytes o_bytes = 11;
    54  }
    55  
    56  // Test message for holding repeated primitives.
    57  message Repeats {
    58    repeated bool r_bool = 1;
    59    repeated int32 r_int32 = 2;
    60    repeated int64 r_int64 = 3;
    61    repeated uint32 r_uint32 = 4;
    62    repeated uint64 r_uint64 = 5;
    63    repeated sint32 r_sint32 = 6;
    64    repeated sint64 r_sint64 = 7;
    65    repeated float r_float = 8;
    66    repeated double r_double = 9;
    67    repeated string r_string = 10;
    68    repeated bytes r_bytes = 11;
    69  }
    70  
    71  // Test message for holding enums and nested messages.
    72  message Widget {
    73    enum Color {
    74      RED = 0;
    75      GREEN = 1;
    76      BLUE = 2;
    77    };
    78    optional Color color = 1;
    79    repeated Color r_color = 2;
    80  
    81    optional Simple simple = 10;
    82    repeated Simple r_simple = 11;
    83  
    84    optional Repeats repeats = 20;
    85    repeated Repeats r_repeats = 21;
    86  }
    87  
    88  message Maps {
    89    map<int64, string> m_int64_str = 1;
    90    map<bool, Simple> m_bool_simple = 2;
    91  }
    92  
    93  message MsgWithOneof {
    94    oneof union {
    95      string title = 1;
    96      int64 salary = 2;
    97      string Country = 3;
    98    }
    99  }
   100  
   101  message Real {
   102    optional double value = 1;
   103    extensions 100 to max;
   104  }
   105  
   106  extend Real {
   107    optional string name = 124;
   108  }
   109  
   110  message Complex {
   111    extend Real {
   112      optional Complex real_extension = 123;
   113    }
   114    optional double imaginary = 1;
   115    extensions 100 to max;
   116  }
   117  
   118  message KnownTypes {
   119    optional google.protobuf.Duration dur = 1;
   120    optional google.protobuf.Struct st = 12;
   121    optional google.protobuf.Timestamp ts = 2;
   122  
   123    optional google.protobuf.DoubleValue dbl = 3;
   124    optional google.protobuf.FloatValue flt = 4;
   125    optional google.protobuf.Int64Value i64 = 5;
   126    optional google.protobuf.UInt64Value u64 = 6;
   127    optional google.protobuf.Int32Value i32 = 7;
   128    optional google.protobuf.UInt32Value u32 = 8;
   129    optional google.protobuf.BoolValue bool = 9;
   130    optional google.protobuf.StringValue str = 10;
   131    optional google.protobuf.BytesValue bytes = 11;
   132  }