vendor: Update github.com/gogo/protobuf

Also tweaks the proto definitions:

 - [packed=false] on the block_indexes field to retain compat with
   v0.14.16 and earlier.

 - Uses the vendored protobuf package in include paths.

And, "build.go setup" will install the vendored protoc-gen-gogofast.
This should ensure that a proto rebuild isn't so dependent on whatever
version of the compiler and package the developer has installed...

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3864
This commit is contained in:
Jakob Borg
2017-01-03 00:16:21 +00:00
committed by Audrius Butkevicius
parent 4fb9c143ac
commit 987718baf8
603 changed files with 340684 additions and 62506 deletions

View File

@@ -0,0 +1,30 @@
# Protocol Buffers for Go with Gadgets
#
# Copyright (c) 2013, The GoGo Authors. All rights reserved.
# http://github.com/gogo/protobuf
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
regenerate:
(protoc --proto_path=../../../../../:../../protobuf/:. --gogo_out=. enumcustomname.proto)

View File

@@ -31,7 +31,9 @@ var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.GoGoProtoPackageIsVersion1
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type MyCustomEnum int32
@@ -269,41 +271,43 @@ func (x MyEnumWithEnumStringer) String() string {
return strconv.Itoa(int(x))
}
func init() { proto.RegisterFile("enumcustomname.proto", fileDescriptorEnumcustomname) }
var fileDescriptorEnumcustomname = []byte{
// 546 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x94, 0x4d, 0x8f, 0xd2, 0x40,
0x18, 0xc7, 0x29, 0xba, 0x2c, 0x3b, 0x22, 0xe9, 0x4e, 0x14, 0x47, 0x30, 0x0d, 0xd9, 0x18, 0x63,
0x30, 0x0b, 0x89, 0x47, 0x3c, 0x4d, 0x29, 0x9a, 0x8d, 0x01, 0x4d, 0x77, 0xf1, 0xed, 0xd2, 0xf4,
0x65, 0x60, 0x49, 0x68, 0xbb, 0x29, 0xd3, 0x68, 0xbf, 0x81, 0xf1, 0x3b, 0x78, 0x92, 0x83, 0x47,
0xcf, 0x9e, 0xfd, 0x60, 0xce, 0x4c, 0x17, 0x16, 0xda, 0x52, 0xc8, 0x9e, 0x86, 0x99, 0xfc, 0x9f,
0xdf, 0x6f, 0xe6, 0xc9, 0x53, 0xc0, 0x03, 0xe2, 0x85, 0xae, 0x1d, 0xce, 0xa9, 0xef, 0x7a, 0xa6,
0x4b, 0xda, 0x57, 0x81, 0x4f, 0x7d, 0x58, 0xdd, 0x3c, 0xad, 0x9f, 0x4e, 0xa6, 0xf4, 0x32, 0xb4,
0xda, 0xb6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, 0x4a, 0x74, 0xeb, 0xcf, 0x13, 0x36, 0xe6, 0xe7,
0x25, 0xf3, 0x27, 0xee, 0x88, 0xf8, 0xf0, 0x05, 0x00, 0x97, 0x57, 0xc6, 0x45, 0xef, 0x5d, 0xc7,
0x10, 0xf0, 0xca, 0x7c, 0xa1, 0x42, 0xae, 0xf8, 0x64, 0x4d, 0x03, 0xb2, 0x92, 0x61, 0x58, 0xde,
0xd0, 0x71, 0x6a, 0x91, 0x13, 0xff, 0x2c, 0x15, 0xe9, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbe,
0x65, 0x55, 0xe7, 0xdb, 0x05, 0x00, 0x00,
}

View File

@@ -0,0 +1,75 @@
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
// http://github.com/gogo/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto2";
// Package enumcustomname tests the behavior of enum_customname and
// enumvalue_customname extensions.
package enumcustomname;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "github.com/gogo/protobuf/test/thetest.proto";
enum MyEnum {
option (gogoproto.enum_customname) = "MyCustomEnum";
// The following field will take on the custom name and the prefix, joined
// by an underscore.
A = 0 [(gogoproto.enumvalue_customname) = "MyBetterNameA"];
B = 1; // Should be MyCustomEnum_B
}
enum MyUnprefixedEnum {
option (gogoproto.goproto_enum_prefix) = false;
option (gogoproto.goproto_enum_stringer) = false; // ensure it behaves correctly without stringer.
option (gogoproto.enum_customname) = "MyCustomUnprefixedEnum"; // no prefix added but type gets name
UNPREFIXED_A = 0 [(gogoproto.enumvalue_customname) = "MyBetterNameUnprefixedA"];
UNPREFIXED_B = 1 ; // Should not pick up prefix above
}
enum MyEnumWithEnumStringer {
option (gogoproto.goproto_enum_stringer) = false; // ensure it behaves correctly without stringer.
option (gogoproto.enum_stringer) = true; // ensure it behaves correctly without stringer.
STRINGER_A = 0 [(gogoproto.enumvalue_customname) = "EnumValueStringerA"];
STRINGER_B = 1;
}
message OnlyEnums {
optional MyEnum my_enum = 1;
optional MyEnum my_enum_default_a = 2 [default=A];
optional MyEnum my_enum_default_b = 3 [default=B];
optional MyUnprefixedEnum my_unprefixed_enum = 4;
optional MyUnprefixedEnum my_unprefixed_enum_default_a = 5 [default=UNPREFIXED_A];
optional MyUnprefixedEnum my_unprefixed_enum_default_b = 6 [default=UNPREFIXED_B];
optional test.YetAnotherTestEnum yet_another_test_enum = 7;
optional test.YetAnotherTestEnum yet_another_test_enum_default_aa = 8 [default=AA];
optional test.YetAnotherTestEnum yet_another_test_enum_default_bb = 9 [default=BB];
optional test.YetYetAnotherTestEnum yet_yet_another_test_enum = 10;
optional test.YetYetAnotherTestEnum yet_yet_another_test_enum_default_cc = 11 [default=CC];
optional test.YetYetAnotherTestEnum yet_yet_another_test_enum_default_dd = 12 [default=DD];
}