all: Update protobuf package 1.0.0 -> 1.2.0 (#5452)
Also adds a few file global options to keep the generated code similar to what we already had.
This commit is contained in:
4
vendor/github.com/gogo/protobuf/test/Makefile
generated
vendored
4
vendor/github.com/gogo/protobuf/test/Makefile
generated
vendored
@@ -29,8 +29,8 @@
|
||||
regenerate:
|
||||
go install github.com/gogo/protobuf/protoc-gen-gogo
|
||||
go install github.com/gogo/protobuf/protoc-gen-combo
|
||||
protoc --gogo_out=. --proto_path=../:../../../../:../protobuf/:. thetest.proto
|
||||
protoc-gen-combo --default=false --gogo_out=. --proto_path=../:../../../../:../protobuf/:. thetest.proto
|
||||
protoc --gogo_out=. --proto_path=../protobuf/:../:../../../../:. thetest.proto
|
||||
protoc-gen-combo --default=false --gogo_out=. --proto_path=../protobuf/:../:../../../../:. thetest.proto
|
||||
cp uuid.go ./combos/both/
|
||||
cp uuid.go ./combos/marshaler/
|
||||
cp uuid.go ./combos/unmarshaler/
|
||||
|
||||
2
vendor/github.com/gogo/protobuf/test/casttype/Makefile
generated
vendored
2
vendor/github.com/gogo/protobuf/test/casttype/Makefile
generated
vendored
@@ -29,4 +29,4 @@
|
||||
regenerate:
|
||||
go install github.com/gogo/protobuf/protoc-gen-combo
|
||||
go install github.com/gogo/protobuf/protoc-gen-gogo
|
||||
protoc-gen-combo --gogo_out=. --version="3.0.0" --proto_path=../../../../../:../../protobuf/:. casttype.proto
|
||||
protoc-gen-combo --gogo_out=. --version="3.0.0" --proto_path=../../protobuf/:../../../../../:. casttype.proto
|
||||
|
||||
5879
vendor/github.com/gogo/protobuf/test/combos/both/thetest.pb.go
generated
vendored
5879
vendor/github.com/gogo/protobuf/test/combos/both/thetest.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
4
vendor/github.com/gogo/protobuf/test/combos/both/uuid.go
generated
vendored
4
vendor/github.com/gogo/protobuf/test/combos/both/uuid.go
generated
vendored
@@ -47,6 +47,10 @@ func PutLittleEndianUint64(b []byte, offset int, v uint64) {
|
||||
|
||||
type Uuid []byte
|
||||
|
||||
func (uuid Uuid) Bytes() []byte {
|
||||
return uuid
|
||||
}
|
||||
|
||||
func (uuid Uuid) Marshal() ([]byte, error) {
|
||||
if len(uuid) == 0 {
|
||||
return nil, nil
|
||||
|
||||
2
vendor/github.com/gogo/protobuf/test/example/Makefile
generated
vendored
2
vendor/github.com/gogo/protobuf/test/example/Makefile
generated
vendored
@@ -27,4 +27,4 @@
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
regenerate:
|
||||
(protoc -I=. -I=$(GOPATH)/src -I=$(GOPATH)/src/github.com/gogo/protobuf/protobuf --gogo_out=. example.proto)
|
||||
(protoc -I=. -I=$(GOPATH)/src/github.com/gogo/protobuf/protobuf -I=$(GOPATH)/src --gogo_out=. example.proto)
|
||||
|
||||
866
vendor/github.com/gogo/protobuf/test/example/example.pb.go
generated
vendored
866
vendor/github.com/gogo/protobuf/test/example/example.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
4
vendor/github.com/gogo/protobuf/test/importcustom-issue389/imported/Makefile
generated
vendored
Normal file
4
vendor/github.com/gogo/protobuf/test/importcustom-issue389/imported/Makefile
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
regenerate:
|
||||
go install github.com/gogo/protobuf/protoc-gen-gogo
|
||||
go install github.com/gogo/protobuf/protoc-min-version
|
||||
protoc-min-version --version="3.0.0" --proto_path=../../../../../../:../../../protobuf/:. --gogo_out=. a.proto
|
||||
446
vendor/github.com/gogo/protobuf/test/importcustom-issue389/imported/a.pb.go
generated
vendored
Normal file
446
vendor/github.com/gogo/protobuf/test/importcustom-issue389/imported/a.pb.go
generated
vendored
Normal file
@@ -0,0 +1,446 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: a.proto
|
||||
|
||||
package imported
|
||||
|
||||
import proto "github.com/gogo/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import _ "github.com/gogo/protobuf/gogoproto"
|
||||
|
||||
import bytes "bytes"
|
||||
|
||||
import io "io"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
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.
|
||||
// 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 A struct {
|
||||
F1 string `protobuf:"bytes,1,opt,name=f1,proto3" json:"f1,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *A) Reset() { *m = A{} }
|
||||
func (m *A) String() string { return proto.CompactTextString(m) }
|
||||
func (*A) ProtoMessage() {}
|
||||
func (*A) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_a_b3350f4009dfb5d2, []int{0}
|
||||
}
|
||||
func (m *A) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_A.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (dst *A) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_A.Merge(dst, src)
|
||||
}
|
||||
func (m *A) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *A) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_A.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_A proto.InternalMessageInfo
|
||||
|
||||
func (m *A) GetF1() string {
|
||||
if m != nil {
|
||||
return m.F1
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*A)(nil), "imported.A")
|
||||
}
|
||||
func (this *A) Equal(that interface{}) bool {
|
||||
if that == nil {
|
||||
return this == nil
|
||||
}
|
||||
|
||||
that1, ok := that.(*A)
|
||||
if !ok {
|
||||
that2, ok := that.(A)
|
||||
if ok {
|
||||
that1 = &that2
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if that1 == nil {
|
||||
return this == nil
|
||||
} else if this == nil {
|
||||
return false
|
||||
}
|
||||
if this.F1 != that1.F1 {
|
||||
return false
|
||||
}
|
||||
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
func (m *A) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *A) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.F1) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintA(dAtA, i, uint64(len(m.F1)))
|
||||
i += copy(dAtA[i:], m.F1)
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
}
|
||||
|
||||
func encodeVarintA(dAtA []byte, offset int, v uint64) int {
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return offset + 1
|
||||
}
|
||||
func NewPopulatedA(r randyA, easy bool) *A {
|
||||
this := &A{}
|
||||
this.F1 = string(randStringA(r))
|
||||
if !easy && r.Intn(10) != 0 {
|
||||
this.XXX_unrecognized = randUnrecognizedA(r, 2)
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
type randyA interface {
|
||||
Float32() float32
|
||||
Float64() float64
|
||||
Int63() int64
|
||||
Int31() int32
|
||||
Uint32() uint32
|
||||
Intn(n int) int
|
||||
}
|
||||
|
||||
func randUTF8RuneA(r randyA) rune {
|
||||
ru := r.Intn(62)
|
||||
if ru < 10 {
|
||||
return rune(ru + 48)
|
||||
} else if ru < 36 {
|
||||
return rune(ru + 55)
|
||||
}
|
||||
return rune(ru + 61)
|
||||
}
|
||||
func randStringA(r randyA) string {
|
||||
v1 := r.Intn(100)
|
||||
tmps := make([]rune, v1)
|
||||
for i := 0; i < v1; i++ {
|
||||
tmps[i] = randUTF8RuneA(r)
|
||||
}
|
||||
return string(tmps)
|
||||
}
|
||||
func randUnrecognizedA(r randyA, maxFieldNumber int) (dAtA []byte) {
|
||||
l := r.Intn(5)
|
||||
for i := 0; i < l; i++ {
|
||||
wire := r.Intn(4)
|
||||
if wire == 3 {
|
||||
wire = 5
|
||||
}
|
||||
fieldNumber := maxFieldNumber + r.Intn(100)
|
||||
dAtA = randFieldA(dAtA, r, fieldNumber, wire)
|
||||
}
|
||||
return dAtA
|
||||
}
|
||||
func randFieldA(dAtA []byte, r randyA, fieldNumber int, wire int) []byte {
|
||||
key := uint32(fieldNumber)<<3 | uint32(wire)
|
||||
switch wire {
|
||||
case 0:
|
||||
dAtA = encodeVarintPopulateA(dAtA, uint64(key))
|
||||
v2 := r.Int63()
|
||||
if r.Intn(2) == 0 {
|
||||
v2 *= -1
|
||||
}
|
||||
dAtA = encodeVarintPopulateA(dAtA, uint64(v2))
|
||||
case 1:
|
||||
dAtA = encodeVarintPopulateA(dAtA, uint64(key))
|
||||
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
|
||||
case 2:
|
||||
dAtA = encodeVarintPopulateA(dAtA, uint64(key))
|
||||
ll := r.Intn(100)
|
||||
dAtA = encodeVarintPopulateA(dAtA, uint64(ll))
|
||||
for j := 0; j < ll; j++ {
|
||||
dAtA = append(dAtA, byte(r.Intn(256)))
|
||||
}
|
||||
default:
|
||||
dAtA = encodeVarintPopulateA(dAtA, uint64(key))
|
||||
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
|
||||
}
|
||||
return dAtA
|
||||
}
|
||||
func encodeVarintPopulateA(dAtA []byte, v uint64) []byte {
|
||||
for v >= 1<<7 {
|
||||
dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
|
||||
v >>= 7
|
||||
}
|
||||
dAtA = append(dAtA, uint8(v))
|
||||
return dAtA
|
||||
}
|
||||
func (m *A) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.F1)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovA(uint64(l))
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
n += len(m.XXX_unrecognized)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovA(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
func sozA(x uint64) (n int) {
|
||||
return sovA(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
}
|
||||
func (m *A) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowA
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: A: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: A: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field F1", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowA
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthA
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.F1 = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipA(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthA
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipA(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowA
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
wireType := int(wire & 0x7)
|
||||
switch wireType {
|
||||
case 0:
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowA
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx++
|
||||
if dAtA[iNdEx-1] < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowA
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
length |= (int(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
iNdEx += length
|
||||
if length < 0 {
|
||||
return 0, ErrInvalidLengthA
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowA
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
innerWire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
innerWireType := int(innerWire & 0x7)
|
||||
if innerWireType == 4 {
|
||||
break
|
||||
}
|
||||
next, err := skipA(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthA = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowA = fmt.Errorf("proto: integer overflow")
|
||||
)
|
||||
|
||||
func init() { proto.RegisterFile("a.proto", fileDescriptor_a_b3350f4009dfb5d2) }
|
||||
|
||||
var fileDescriptor_a_b3350f4009dfb5d2 = []byte{
|
||||
// 127 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x62, 0x4f, 0xd4, 0x2b, 0x28,
|
||||
0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xc8, 0xcc, 0x2d, 0xc8, 0x2f, 0x2a, 0x49, 0x4d, 0x91, 0xd2, 0x4d,
|
||||
0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x07,
|
||||
0x2b, 0x48, 0x2a, 0x4d, 0x03, 0xf3, 0xc0, 0x1c, 0x30, 0x0b, 0xa2, 0x51, 0x49, 0x98, 0x8b, 0xd1,
|
||||
0x51, 0x88, 0x8f, 0x8b, 0x29, 0xcd, 0x50, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x88, 0x29, 0xcd,
|
||||
0xd0, 0x49, 0xe2, 0xc7, 0x43, 0x39, 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x77, 0x3c, 0x92, 0x63, 0x3c,
|
||||
0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x93, 0xd8, 0xc0, 0xba,
|
||||
0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x70, 0x12, 0x2a, 0xca, 0x79, 0x00, 0x00, 0x00,
|
||||
}
|
||||
15
vendor/github.com/gogo/protobuf/test/importcustom-issue389/imported/a.proto
generated
vendored
Normal file
15
vendor/github.com/gogo/protobuf/test/importcustom-issue389/imported/a.proto
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
syntax = "proto3";
|
||||
package imported;
|
||||
|
||||
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
||||
|
||||
option (gogoproto.sizer_all) = true;
|
||||
option (gogoproto.marshaler_all) = true;
|
||||
option (gogoproto.unmarshaler_all) = true;
|
||||
option (gogoproto.testgen_all) = true;
|
||||
option (gogoproto.populate_all) = true;
|
||||
option (gogoproto.equal_all) = true;
|
||||
|
||||
message A {
|
||||
string f1 = 1;
|
||||
}
|
||||
55
vendor/github.com/gogo/protobuf/test/importcustom-issue389/imported/b.go
generated
vendored
Normal file
55
vendor/github.com/gogo/protobuf/test/importcustom-issue389/imported/b.go
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
package imported
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/gogo/protobuf/proto"
|
||||
)
|
||||
|
||||
type B struct {
|
||||
A
|
||||
}
|
||||
|
||||
func (b B) Equal(other B) bool {
|
||||
return b.A.Equal(other.A)
|
||||
}
|
||||
|
||||
func (b B) Size() int {
|
||||
return b.A.Size()
|
||||
}
|
||||
|
||||
func NewPopulatedB(r randyA) *B {
|
||||
a := NewPopulatedA(r, true)
|
||||
if a == nil {
|
||||
return nil
|
||||
}
|
||||
return &B{*a}
|
||||
}
|
||||
|
||||
func (b B) Marshal() ([]byte, error) {
|
||||
return proto.Marshal(&b.A)
|
||||
}
|
||||
|
||||
func (b *B) Unmarshal(data []byte) error {
|
||||
a := &A{}
|
||||
err := proto.Unmarshal(data, a)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
b.A = *a
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b B) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(b.A)
|
||||
}
|
||||
|
||||
func (b *B) UnmarshalJSON(data []byte) error {
|
||||
a := &A{}
|
||||
err := json.Unmarshal(data, a)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*b = B{A: *a}
|
||||
return nil
|
||||
}
|
||||
44
vendor/github.com/gogo/protobuf/test/importdedup/subpkg/subproto.pb.go
generated
vendored
44
vendor/github.com/gogo/protobuf/test/importdedup/subpkg/subproto.pb.go
generated
vendored
@@ -1,15 +1,6 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: subpkg/subproto.proto
|
||||
|
||||
/*
|
||||
Package subpkg is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
subpkg/subproto.proto
|
||||
|
||||
It has these top-level messages:
|
||||
SubObject
|
||||
*/
|
||||
package subpkg
|
||||
|
||||
import proto "github.com/gogo/protobuf/proto"
|
||||
@@ -29,21 +20,42 @@ var _ = math.Inf
|
||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
type SubObject struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SubObject) Reset() { *m = SubObject{} }
|
||||
func (m *SubObject) String() string { return proto.CompactTextString(m) }
|
||||
func (*SubObject) ProtoMessage() {}
|
||||
func (*SubObject) Descriptor() ([]byte, []int) { return fileDescriptorSubproto, []int{0} }
|
||||
func (m *SubObject) Reset() { *m = SubObject{} }
|
||||
func (m *SubObject) String() string { return proto.CompactTextString(m) }
|
||||
func (*SubObject) ProtoMessage() {}
|
||||
func (*SubObject) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_subproto_094c5f22e1aecb1e, []int{0}
|
||||
}
|
||||
func (m *SubObject) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SubObject.Unmarshal(m, b)
|
||||
}
|
||||
func (m *SubObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_SubObject.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (dst *SubObject) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_SubObject.Merge(dst, src)
|
||||
}
|
||||
func (m *SubObject) XXX_Size() int {
|
||||
return xxx_messageInfo_SubObject.Size(m)
|
||||
}
|
||||
func (m *SubObject) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_SubObject.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_SubObject proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*SubObject)(nil), "subpkg.SubObject")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("subpkg/subproto.proto", fileDescriptorSubproto) }
|
||||
func init() { proto.RegisterFile("subpkg/subproto.proto", fileDescriptor_subproto_094c5f22e1aecb1e) }
|
||||
|
||||
var fileDescriptorSubproto = []byte{
|
||||
var fileDescriptor_subproto_094c5f22e1aecb1e = []byte{
|
||||
// 88 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2d, 0x2e, 0x4d, 0x2a,
|
||||
0xc8, 0x4e, 0xd7, 0x07, 0x51, 0x45, 0xf9, 0x25, 0xf9, 0x7a, 0x60, 0x52, 0x88, 0x0d, 0x22, 0x2c,
|
||||
|
||||
60
vendor/github.com/gogo/protobuf/test/importduplicate/proto/proto.pb.go
generated
vendored
60
vendor/github.com/gogo/protobuf/test/importduplicate/proto/proto.pb.go
generated
vendored
@@ -1,27 +1,20 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: proto/proto.proto
|
||||
|
||||
/*
|
||||
Package proto is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
proto/proto.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Subject
|
||||
*/
|
||||
package proto
|
||||
|
||||
import proto1 "github.com/gogo/protobuf/proto"
|
||||
import proto "github.com/gogo/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import _ "github.com/gogo/protobuf/gogoproto"
|
||||
|
||||
import bytes "bytes"
|
||||
|
||||
import strings "strings"
|
||||
import reflect "reflect"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto1.Marshal
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
@@ -29,18 +22,40 @@ var _ = math.Inf
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto1.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
type Subject struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Subject) Reset() { *m = Subject{} }
|
||||
func (m *Subject) String() string { return proto1.CompactTextString(m) }
|
||||
func (*Subject) ProtoMessage() {}
|
||||
func (*Subject) Descriptor() ([]byte, []int) { return fileDescriptorProto, []int{0} }
|
||||
func (m *Subject) Reset() { *m = Subject{} }
|
||||
func (m *Subject) String() string { return proto.CompactTextString(m) }
|
||||
func (*Subject) ProtoMessage() {}
|
||||
func (*Subject) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_proto_2eb405ba8c57e5a9, []int{0}
|
||||
}
|
||||
func (m *Subject) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Subject.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Subject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Subject.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (dst *Subject) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Subject.Merge(dst, src)
|
||||
}
|
||||
func (m *Subject) XXX_Size() int {
|
||||
return xxx_messageInfo_Subject.Size(m)
|
||||
}
|
||||
func (m *Subject) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Subject.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Subject proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto1.RegisterType((*Subject)(nil), "proto.Subject")
|
||||
proto.RegisterType((*Subject)(nil), "proto.Subject")
|
||||
}
|
||||
func (this *Subject) Equal(that interface{}) bool {
|
||||
if that == nil {
|
||||
@@ -61,6 +76,9 @@ func (this *Subject) Equal(that interface{}) bool {
|
||||
} else if this == nil {
|
||||
return false
|
||||
}
|
||||
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
func (this *Subject) GoString() string {
|
||||
@@ -69,6 +87,9 @@ func (this *Subject) GoString() string {
|
||||
}
|
||||
s := make([]string, 0, 4)
|
||||
s = append(s, "&proto.Subject{")
|
||||
if this.XXX_unrecognized != nil {
|
||||
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
||||
}
|
||||
s = append(s, "}")
|
||||
return strings.Join(s, "")
|
||||
}
|
||||
@@ -83,6 +104,7 @@ func valueToGoStringProto(v interface{}, typ string) string {
|
||||
func NewPopulatedSubject(r randyProto, easy bool) *Subject {
|
||||
this := &Subject{}
|
||||
if !easy && r.Intn(10) != 0 {
|
||||
this.XXX_unrecognized = randUnrecognizedProto(r, 1)
|
||||
}
|
||||
return this
|
||||
}
|
||||
@@ -160,9 +182,9 @@ func encodeVarintPopulateProto(dAtA []byte, v uint64) []byte {
|
||||
return dAtA
|
||||
}
|
||||
|
||||
func init() { proto1.RegisterFile("proto/proto.proto", fileDescriptorProto) }
|
||||
func init() { proto.RegisterFile("proto/proto.proto", fileDescriptor_proto_2eb405ba8c57e5a9) }
|
||||
|
||||
var fileDescriptorProto = []byte{
|
||||
var fileDescriptor_proto_2eb405ba8c57e5a9 = []byte{
|
||||
// 103 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2c, 0x28, 0xca, 0x2f,
|
||||
0xc9, 0xd7, 0x07, 0x93, 0x7a, 0x60, 0x52, 0x88, 0x15, 0x4c, 0x49, 0xe9, 0xa6, 0x67, 0x96, 0x64,
|
||||
|
||||
52
vendor/github.com/gogo/protobuf/test/importduplicate/sortkeys/sortable.pb.go
generated
vendored
52
vendor/github.com/gogo/protobuf/test/importduplicate/sortkeys/sortable.pb.go
generated
vendored
@@ -1,15 +1,6 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: sortkeys/sortable.proto
|
||||
|
||||
/*
|
||||
Package sortkeys is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
sortkeys/sortable.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Object
|
||||
*/
|
||||
package sortkeys
|
||||
|
||||
import proto "github.com/gogo/protobuf/proto"
|
||||
@@ -17,6 +8,8 @@ import fmt "fmt"
|
||||
import math "math"
|
||||
import _ "github.com/gogo/protobuf/gogoproto"
|
||||
|
||||
import bytes "bytes"
|
||||
|
||||
import strings "strings"
|
||||
import reflect "reflect"
|
||||
|
||||
@@ -32,12 +25,34 @@ var _ = math.Inf
|
||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
type Object struct {
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Object) Reset() { *m = Object{} }
|
||||
func (m *Object) String() string { return proto.CompactTextString(m) }
|
||||
func (*Object) ProtoMessage() {}
|
||||
func (*Object) Descriptor() ([]byte, []int) { return fileDescriptorSortable, []int{0} }
|
||||
func (m *Object) Reset() { *m = Object{} }
|
||||
func (m *Object) String() string { return proto.CompactTextString(m) }
|
||||
func (*Object) ProtoMessage() {}
|
||||
func (*Object) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_sortable_d1adc3e2593f24f3, []int{0}
|
||||
}
|
||||
func (m *Object) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Object.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Object.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (dst *Object) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Object.Merge(dst, src)
|
||||
}
|
||||
func (m *Object) XXX_Size() int {
|
||||
return xxx_messageInfo_Object.Size(m)
|
||||
}
|
||||
func (m *Object) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Object.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Object proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Object)(nil), "sortkeys.Object")
|
||||
@@ -61,6 +76,9 @@ func (this *Object) Equal(that interface{}) bool {
|
||||
} else if this == nil {
|
||||
return false
|
||||
}
|
||||
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
func (this *Object) GoString() string {
|
||||
@@ -69,6 +87,9 @@ func (this *Object) GoString() string {
|
||||
}
|
||||
s := make([]string, 0, 4)
|
||||
s = append(s, "&sortkeys.Object{")
|
||||
if this.XXX_unrecognized != nil {
|
||||
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
||||
}
|
||||
s = append(s, "}")
|
||||
return strings.Join(s, "")
|
||||
}
|
||||
@@ -83,6 +104,7 @@ func valueToGoStringSortable(v interface{}, typ string) string {
|
||||
func NewPopulatedObject(r randySortable, easy bool) *Object {
|
||||
this := &Object{}
|
||||
if !easy && r.Intn(10) != 0 {
|
||||
this.XXX_unrecognized = randUnrecognizedSortable(r, 1)
|
||||
}
|
||||
return this
|
||||
}
|
||||
@@ -160,9 +182,9 @@ func encodeVarintPopulateSortable(dAtA []byte, v uint64) []byte {
|
||||
return dAtA
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("sortkeys/sortable.proto", fileDescriptorSortable) }
|
||||
func init() { proto.RegisterFile("sortkeys/sortable.proto", fileDescriptor_sortable_d1adc3e2593f24f3) }
|
||||
|
||||
var fileDescriptorSortable = []byte{
|
||||
var fileDescriptor_sortable_d1adc3e2593f24f3 = []byte{
|
||||
// 115 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2f, 0xce, 0x2f, 0x2a,
|
||||
0xc9, 0x4e, 0xad, 0x2c, 0xd6, 0x07, 0x31, 0x12, 0x93, 0x72, 0x52, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b,
|
||||
|
||||
60
vendor/github.com/gogo/protobuf/test/indeximport-issue72/index/index.pb.go
generated
vendored
60
vendor/github.com/gogo/protobuf/test/indeximport-issue72/index/index.pb.go
generated
vendored
@@ -1,15 +1,6 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: index.proto
|
||||
|
||||
/*
|
||||
Package index is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
index.proto
|
||||
|
||||
It has these top-level messages:
|
||||
IndexQuery
|
||||
*/
|
||||
package index
|
||||
|
||||
import proto "github.com/gogo/protobuf/proto"
|
||||
@@ -33,15 +24,45 @@ var _ = math.Inf
|
||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
type IndexQuery struct {
|
||||
Key *string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"`
|
||||
Value *string `protobuf:"bytes,2,opt,name=Value" json:"Value,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
Key *string `protobuf:"bytes,1,opt,name=Key" json:"Key,omitempty"`
|
||||
Value *string `protobuf:"bytes,2,opt,name=Value" json:"Value,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *IndexQuery) Reset() { *m = IndexQuery{} }
|
||||
func (m *IndexQuery) String() string { return proto.CompactTextString(m) }
|
||||
func (*IndexQuery) ProtoMessage() {}
|
||||
func (*IndexQuery) Descriptor() ([]byte, []int) { return fileDescriptorIndex, []int{0} }
|
||||
func (m *IndexQuery) Reset() { *m = IndexQuery{} }
|
||||
func (m *IndexQuery) String() string { return proto.CompactTextString(m) }
|
||||
func (*IndexQuery) ProtoMessage() {}
|
||||
func (*IndexQuery) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_index_5bc64712555c00b6, []int{0}
|
||||
}
|
||||
func (m *IndexQuery) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *IndexQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_IndexQuery.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (dst *IndexQuery) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_IndexQuery.Merge(dst, src)
|
||||
}
|
||||
func (m *IndexQuery) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *IndexQuery) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_IndexQuery.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_IndexQuery proto.InternalMessageInfo
|
||||
|
||||
func (m *IndexQuery) GetKey() string {
|
||||
if m != nil && m.Key != nil {
|
||||
@@ -233,6 +254,9 @@ func encodeVarintPopulateIndex(dAtA []byte, v uint64) []byte {
|
||||
return dAtA
|
||||
}
|
||||
func (m *IndexQuery) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Key != nil {
|
||||
@@ -478,9 +502,9 @@ var (
|
||||
ErrIntOverflowIndex = fmt.Errorf("proto: integer overflow")
|
||||
)
|
||||
|
||||
func init() { proto.RegisterFile("index.proto", fileDescriptorIndex) }
|
||||
func init() { proto.RegisterFile("index.proto", fileDescriptor_index_5bc64712555c00b6) }
|
||||
|
||||
var fileDescriptorIndex = []byte{
|
||||
var fileDescriptor_index_5bc64712555c00b6 = []byte{
|
||||
// 141 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xce, 0xcc, 0x4b, 0x49,
|
||||
0xad, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x73, 0xa4, 0x74, 0xd3, 0x33, 0x4b,
|
||||
|
||||
16
vendor/github.com/gogo/protobuf/test/issue312/issue312.pb.go
generated
vendored
16
vendor/github.com/gogo/protobuf/test/issue312/issue312.pb.go
generated
vendored
@@ -1,14 +1,6 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: issue312.proto
|
||||
|
||||
/*
|
||||
Package issue312 is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
issue312.proto
|
||||
|
||||
It has these top-level messages:
|
||||
*/
|
||||
package issue312
|
||||
|
||||
import proto "github.com/gogo/protobuf/proto"
|
||||
@@ -62,15 +54,17 @@ func (x *TaskState) UnmarshalJSON(data []byte) error {
|
||||
*x = TaskState(value)
|
||||
return nil
|
||||
}
|
||||
func (TaskState) EnumDescriptor() ([]byte, []int) { return fileDescriptorIssue312, []int{0} }
|
||||
func (TaskState) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_issue312_ffe23d3d41bbbf36, []int{0}
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterEnum("issue312.TaskState", TaskState_name, TaskState_value)
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("issue312.proto", fileDescriptorIssue312) }
|
||||
func init() { proto.RegisterFile("issue312.proto", fileDescriptor_issue312_ffe23d3d41bbbf36) }
|
||||
|
||||
var fileDescriptorIssue312 = []byte{
|
||||
var fileDescriptor_issue312_ffe23d3d41bbbf36 = []byte{
|
||||
// 147 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcb, 0x2c, 0x2e, 0x2e,
|
||||
0x4d, 0x35, 0x36, 0x34, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x80, 0xf1, 0xa5, 0x74,
|
||||
|
||||
3
vendor/github.com/gogo/protobuf/test/issue411/Makefile
generated
vendored
Normal file
3
vendor/github.com/gogo/protobuf/test/issue411/Makefile
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
regenerate:
|
||||
go install github.com/gogo/protobuf/protoc-gen-gogo
|
||||
protoc-min-version --version="3.0.0" --gogo_out=Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types:. --proto_path=../../../../../:../../protobuf/:. issue411.proto
|
||||
222
vendor/github.com/gogo/protobuf/test/issue411/ids.go
generated
vendored
Normal file
222
vendor/github.com/gogo/protobuf/test/issue411/ids.go
generated
vendored
Normal file
@@ -0,0 +1,222 @@
|
||||
package issue411
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// TraceID is a random 128bit identifier for a trace
|
||||
type TraceID struct {
|
||||
Low uint64 `json:"lo"`
|
||||
High uint64 `json:"hi"`
|
||||
}
|
||||
|
||||
// SpanID is a random 64bit identifier for a span
|
||||
type SpanID uint64
|
||||
|
||||
// ------- TraceID -------
|
||||
|
||||
// NewTraceID creates a new TraceID from two 64bit unsigned ints.
|
||||
func NewTraceID(high, low uint64) TraceID {
|
||||
return TraceID{High: high, Low: low}
|
||||
}
|
||||
|
||||
func (t TraceID) String() string {
|
||||
if t.High == 0 {
|
||||
return fmt.Sprintf("%x", t.Low)
|
||||
}
|
||||
return fmt.Sprintf("%x%016x", t.High, t.Low)
|
||||
}
|
||||
|
||||
// TraceIDFromString creates a TraceID from a hexadecimal string
|
||||
func TraceIDFromString(s string) (TraceID, error) {
|
||||
var hi, lo uint64
|
||||
var err error
|
||||
if len(s) > 32 {
|
||||
return TraceID{}, fmt.Errorf("TraceID cannot be longer than 32 hex characters: %s", s)
|
||||
} else if len(s) > 16 {
|
||||
hiLen := len(s) - 16
|
||||
if hi, err = strconv.ParseUint(s[0:hiLen], 16, 64); err != nil {
|
||||
return TraceID{}, err
|
||||
}
|
||||
if lo, err = strconv.ParseUint(s[hiLen:], 16, 64); err != nil {
|
||||
return TraceID{}, err
|
||||
}
|
||||
} else {
|
||||
if lo, err = strconv.ParseUint(s, 16, 64); err != nil {
|
||||
return TraceID{}, err
|
||||
}
|
||||
}
|
||||
return TraceID{High: hi, Low: lo}, nil
|
||||
}
|
||||
|
||||
// MarshalText is called by encoding/json, which we do not want people to use.
|
||||
func (t TraceID) MarshalText() ([]byte, error) {
|
||||
return nil, fmt.Errorf("unsupported method TraceID.MarshalText; please use github.com/gogo/protobuf/jsonpb for marshalling")
|
||||
}
|
||||
|
||||
// UnmarshalText is called by encoding/json, which we do not want people to use.
|
||||
func (t *TraceID) UnmarshalText(text []byte) error {
|
||||
return fmt.Errorf("unsupported method TraceID.UnmarshalText; please use github.com/gogo/protobuf/jsonpb for marshalling")
|
||||
}
|
||||
|
||||
// Size returns the size of this datum in protobuf. It is always 16 bytes.
|
||||
func (t *TraceID) Size() int {
|
||||
return 16
|
||||
}
|
||||
|
||||
// Marshal converts trace ID into a binary representation. Called by protobuf serialization.
|
||||
func (t TraceID) Marshal() ([]byte, error) {
|
||||
b := make([]byte, t.Size())
|
||||
_, err := t.MarshalTo(b)
|
||||
return b, err
|
||||
}
|
||||
|
||||
// MarshalTo converts trace ID into a binary representation. Called by protobuf serialization.
|
||||
func (t *TraceID) MarshalTo(data []byte) (n int, err error) {
|
||||
var b [16]byte
|
||||
binary.BigEndian.PutUint64(b[:8], uint64(t.High))
|
||||
binary.BigEndian.PutUint64(b[8:], uint64(t.Low))
|
||||
return marshalBytes(data, b[:])
|
||||
}
|
||||
|
||||
// Unmarshal inflates this trace ID from binary representation. Called by protobuf serialization.
|
||||
func (t *TraceID) Unmarshal(data []byte) error {
|
||||
if len(data) < 16 {
|
||||
return fmt.Errorf("buffer is too short")
|
||||
}
|
||||
t.High = binary.BigEndian.Uint64(data[:8])
|
||||
t.Low = binary.BigEndian.Uint64(data[8:])
|
||||
return nil
|
||||
}
|
||||
|
||||
func marshalBytes(dst []byte, src []byte) (n int, err error) {
|
||||
if len(dst) < len(src) {
|
||||
return 0, fmt.Errorf("buffer is too short")
|
||||
}
|
||||
return copy(dst, src), nil
|
||||
}
|
||||
|
||||
// MarshalJSON converts trace id into a base64 string enclosed in quotes.
|
||||
// Used by protobuf JSON serialization.
|
||||
// Example: {high:2, low:1} => "AAAAAAAAAAIAAAAAAAAAAQ==".
|
||||
func (t TraceID) MarshalJSON() ([]byte, error) {
|
||||
var b [16]byte
|
||||
_, err := t.MarshalTo(b[:]) // can only error on incorrect buffer size
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
s := make([]byte, 24+2)
|
||||
base64.StdEncoding.Encode(s[1:25], b[:])
|
||||
s[0], s[25] = '"', '"'
|
||||
return s, nil
|
||||
}
|
||||
|
||||
// UnmarshalJSON inflates trace id from base64 string, possibly enclosed in quotes.
|
||||
// User by protobuf JSON serialization.
|
||||
func (t *TraceID) UnmarshalJSON(data []byte) error {
|
||||
s := string(data)
|
||||
if l := len(s); l > 2 && s[0] == '"' && s[l-1] == '"' {
|
||||
s = s[1 : l-1]
|
||||
}
|
||||
b, err := base64.StdEncoding.DecodeString(s)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot unmarshal TraceID from string '%s': %v", string(data), err)
|
||||
}
|
||||
return t.Unmarshal(b)
|
||||
}
|
||||
|
||||
// ------- SpanID -------
|
||||
|
||||
// NewSpanID creates a new SpanID from a 64bit unsigned int.
|
||||
func NewSpanID(v uint64) SpanID {
|
||||
return SpanID(v)
|
||||
}
|
||||
|
||||
func (s SpanID) String() string {
|
||||
return fmt.Sprintf("%x", uint64(s))
|
||||
}
|
||||
|
||||
// SpanIDFromString creates a SpanID from a hexadecimal string
|
||||
func SpanIDFromString(s string) (SpanID, error) {
|
||||
if len(s) > 16 {
|
||||
return SpanID(0), fmt.Errorf("SpanID cannot be longer than 16 hex characters: %s", s)
|
||||
}
|
||||
id, err := strconv.ParseUint(s, 16, 64)
|
||||
if err != nil {
|
||||
return SpanID(0), err
|
||||
}
|
||||
return SpanID(id), nil
|
||||
}
|
||||
|
||||
// MarshalText is called by encoding/json, which we do not want people to use.
|
||||
func (s SpanID) MarshalText() ([]byte, error) {
|
||||
return nil, fmt.Errorf("unsupported method SpanID.MarshalText; please use github.com/gogo/protobuf/jsonpb for marshalling")
|
||||
}
|
||||
|
||||
// UnmarshalText is called by encoding/json, which we do not want people to use.
|
||||
func (s *SpanID) UnmarshalText(text []byte) error {
|
||||
return fmt.Errorf("unsupported method SpanID.UnmarshalText; please use github.com/gogo/protobuf/jsonpb for marshalling")
|
||||
}
|
||||
|
||||
// Size returns the size of this datum in protobuf. It is always 8 bytes.
|
||||
func (s *SpanID) Size() int {
|
||||
return 8
|
||||
}
|
||||
|
||||
// Marshal converts span ID into a binary representation. Called by protobuf serialization.
|
||||
func (s SpanID) Marshal() ([]byte, error) {
|
||||
b := make([]byte, s.Size())
|
||||
_, err := s.MarshalTo(b)
|
||||
return b, err
|
||||
}
|
||||
|
||||
// MarshalTo converts span ID into a binary representation. Called by protobuf serialization.
|
||||
func (s *SpanID) MarshalTo(data []byte) (n int, err error) {
|
||||
var b [8]byte
|
||||
binary.BigEndian.PutUint64(b[:], uint64(*s))
|
||||
return marshalBytes(data, b[:])
|
||||
}
|
||||
|
||||
// Unmarshal inflates span ID from a binary representation. Called by protobuf serialization.
|
||||
func (s *SpanID) Unmarshal(data []byte) error {
|
||||
if len(data) < 8 {
|
||||
return fmt.Errorf("buffer is too short")
|
||||
}
|
||||
*s = NewSpanID(binary.BigEndian.Uint64(data))
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON converts span id into a base64 string enclosed in quotes.
|
||||
// Used by protobuf JSON serialization.
|
||||
// Example: {1} => "AAAAAAAAAAE=".
|
||||
func (s SpanID) MarshalJSON() ([]byte, error) {
|
||||
var b [8]byte
|
||||
_, err := s.MarshalTo(b[:]) // can only error on incorrect buffer size
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
v := make([]byte, 12+2)
|
||||
base64.StdEncoding.Encode(v[1:13], b[:])
|
||||
v[0], v[13] = '"', '"'
|
||||
return v, nil
|
||||
}
|
||||
|
||||
// UnmarshalJSON inflates span id from base64 string, possibly enclosed in quotes.
|
||||
// User by protobuf JSON serialization.
|
||||
//
|
||||
// There appears to be a bug in gogoproto, as this function is only called for numeric values.
|
||||
// https://github.com/gogo/protobuf/issues/411#issuecomment-393856837
|
||||
func (s *SpanID) UnmarshalJSON(data []byte) error {
|
||||
str := string(data)
|
||||
if l := len(str); l > 2 && str[0] == '"' && str[l-1] == '"' {
|
||||
str = str[1 : l-1]
|
||||
}
|
||||
b, err := base64.StdEncoding.DecodeString(str)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot unmarshal SpanID from string '%s': %v", string(data), err)
|
||||
}
|
||||
return s.Unmarshal(b)
|
||||
}
|
||||
72
vendor/github.com/gogo/protobuf/test/issue411/issue411.pb.go
generated
vendored
Normal file
72
vendor/github.com/gogo/protobuf/test/issue411/issue411.pb.go
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: issue411.proto
|
||||
|
||||
package issue411
|
||||
|
||||
import proto "github.com/gogo/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import _ "github.com/gogo/protobuf/gogoproto"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
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.
|
||||
// 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 Span struct {
|
||||
TraceID TraceID `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,customtype=TraceID" json:"trace_id"`
|
||||
SpanID SpanID `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3,customtype=SpanID" json:"span_id"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Span) Reset() { *m = Span{} }
|
||||
func (m *Span) String() string { return proto.CompactTextString(m) }
|
||||
func (*Span) ProtoMessage() {}
|
||||
func (*Span) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_issue411_3de9ea40a93d370b, []int{0}
|
||||
}
|
||||
func (m *Span) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Span.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Span) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Span.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (dst *Span) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Span.Merge(dst, src)
|
||||
}
|
||||
func (m *Span) XXX_Size() int {
|
||||
return xxx_messageInfo_Span.Size(m)
|
||||
}
|
||||
func (m *Span) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Span.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Span proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Span)(nil), "issue411.Span")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("issue411.proto", fileDescriptor_issue411_3de9ea40a93d370b) }
|
||||
|
||||
var fileDescriptor_issue411_3de9ea40a93d370b = []byte{
|
||||
// 158 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcb, 0x2c, 0x2e, 0x2e,
|
||||
0x4d, 0x35, 0x31, 0x34, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x80, 0xf1, 0xa5, 0x74,
|
||||
0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xd3, 0xf3, 0xd3, 0xf3, 0xf5,
|
||||
0xc1, 0x0a, 0x92, 0x4a, 0xd3, 0xc0, 0x3c, 0x30, 0x07, 0xcc, 0x82, 0x68, 0x54, 0x2a, 0xe0, 0x62,
|
||||
0x09, 0x2e, 0x48, 0xcc, 0x13, 0x32, 0xe5, 0xe2, 0x28, 0x29, 0x4a, 0x4c, 0x4e, 0x8d, 0xcf, 0x4c,
|
||||
0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x71, 0x92, 0x3a, 0x71, 0x4f, 0x9e, 0xe1, 0xd6, 0x3d, 0x79,
|
||||
0xf6, 0x10, 0x90, 0xb8, 0xa7, 0xcb, 0x23, 0x04, 0x33, 0x88, 0x1d, 0xac, 0xd6, 0x33, 0x45, 0xc8,
|
||||
0x90, 0x8b, 0xbd, 0xb8, 0x20, 0x31, 0x0f, 0xa4, 0x8b, 0x09, 0xac, 0x4b, 0x02, 0xaa, 0x8b, 0x0d,
|
||||
0x64, 0x2a, 0x58, 0x13, 0x94, 0x15, 0xc4, 0x06, 0x52, 0xe8, 0x99, 0x92, 0xc4, 0x06, 0xb6, 0xd8,
|
||||
0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x68, 0x60, 0x2b, 0xc3, 0x00, 0x00, 0x00,
|
||||
}
|
||||
49
vendor/github.com/gogo/protobuf/test/issue411/issue411.proto
generated
vendored
Normal file
49
vendor/github.com/gogo/protobuf/test/issue411/issue411.proto
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
// Go support for Protocol Buffers - Google's data interchange format
|
||||
//
|
||||
// Copyright 2015 The Go Authors. All rights reserved.
|
||||
// https://github.com/golang/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.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// 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 = "proto3";
|
||||
|
||||
package issue411;
|
||||
|
||||
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
||||
|
||||
message Span {
|
||||
bytes trace_id = 1 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.customtype) = "TraceID",
|
||||
(gogoproto.customname) = "TraceID"
|
||||
];
|
||||
bytes span_id = 2 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.customtype) = "SpanID",
|
||||
(gogoproto.customname) = "SpanID"
|
||||
];
|
||||
}
|
||||
4273
vendor/github.com/gogo/protobuf/test/thetest.pb.go
generated
vendored
4273
vendor/github.com/gogo/protobuf/test/thetest.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
4
vendor/github.com/gogo/protobuf/test/uuid.go
generated
vendored
4
vendor/github.com/gogo/protobuf/test/uuid.go
generated
vendored
@@ -47,6 +47,10 @@ func PutLittleEndianUint64(b []byte, offset int, v uint64) {
|
||||
|
||||
type Uuid []byte
|
||||
|
||||
func (uuid Uuid) Bytes() []byte {
|
||||
return uuid
|
||||
}
|
||||
|
||||
func (uuid Uuid) Marshal() ([]byte, error) {
|
||||
if len(uuid) == 0 {
|
||||
return nil, nil
|
||||
|
||||
Reference in New Issue
Block a user