vendor protobuf & grpc
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
14
vendor/github.com/gogo/protobuf/Readme.md
generated
vendored
14
vendor/github.com/gogo/protobuf/Readme.md
generated
vendored
@@ -17,6 +17,18 @@ This code generation is used to achieve:
|
||||
Keeping track of how up to date gogoprotobuf is relative to golang/protobuf is done in this
|
||||
<a href="https://github.com/gogo/protobuf/issues/191">issue</a>
|
||||
|
||||
## Release v1.3.0
|
||||
|
||||
The project has updated to release v1.3.0. Check out the release notes <a href="https://github.com/gogo/protobuf/releases/tag/v1.3.0">here</a>.
|
||||
|
||||
With this new release comes a new internal library version. This means any newly generated *pb.go files generated with the v1.3.0 library will not be compatible with the old library version (v1.2.1). However, current *pb.go files (generated with v1.2.1) should still work with the new library.
|
||||
|
||||
Please make sure you manage your dependencies correctly when upgrading your project. If you are still using v1.2.1 and you update your dependencies, one of which could include a new *pb.go (generated with v1.3.0), you could get a compile time error.
|
||||
|
||||
Our upstream repo, golang/protobuf, also had to go through this process in order to update their library version.
|
||||
Here is a link explaining <a href="https://github.com/golang/protobuf/issues/763#issuecomment-442434870">hermetic builds</a>.
|
||||
|
||||
|
||||
## Users
|
||||
|
||||
These projects use gogoprotobuf:
|
||||
@@ -49,6 +61,8 @@ These projects use gogoprotobuf:
|
||||
- <a href="https://github.com/spacemeshos/go-spacemesh">go-spacemesh</a>
|
||||
- <a href="https://github.com/weaveworks/cortex">cortex</a> - <a href="https://github.com/weaveworks/cortex/blob/fee02a59729d3771ef888f7bf0fd050e1197c56e/pkg/ingester/client/cortex.proto">sample proto file</a>
|
||||
- <a href="http://skywalking.apache.org/">Apache SkyWalking APM</a> - Istio telemetry receiver based on Mixer bypass protocol
|
||||
- <a href="https://github.com/hyperledger/burrow">Hyperledger Burrow</a> - a permissioned DLT framework
|
||||
- <a href="https://github.com/iov-one/weave">IOV Weave</a> - a blockchain framework - <a href="https://github.com/iov-one/weave/tree/23f9856f1e316f93cb3d45d92c4c6a0c4810f6bf/spec/gogo">sample proto files</a>
|
||||
|
||||
Please let us know if you are using gogoprotobuf by posting on our <a href="https://groups.google.com/forum/#!topic/gogoprotobuf/Brw76BxmFpQ">GoogleGroup</a>.
|
||||
|
||||
|
||||
5
vendor/github.com/gogo/protobuf/go.mod
generated
vendored
5
vendor/github.com/gogo/protobuf/go.mod
generated
vendored
@@ -1,3 +1,6 @@
|
||||
module github.com/gogo/protobuf
|
||||
|
||||
require github.com/kisielk/errcheck v1.1.0 // indirect
|
||||
require (
|
||||
github.com/kisielk/errcheck v1.2.0 // indirect
|
||||
github.com/kisielk/gotool v1.0.0 // indirect
|
||||
)
|
||||
|
||||
2
vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go
generated
vendored
2
vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go
generated
vendored
@@ -19,7 +19,7 @@ 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 _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
var E_GoprotoEnumPrefix = &proto.ExtensionDesc{
|
||||
ExtendedType: (*descriptor.EnumOptions)(nil),
|
||||
|
||||
56
vendor/github.com/gogo/protobuf/plugin/compare/compare.go
generated
vendored
56
vendor/github.com/gogo/protobuf/plugin/compare/compare.go
generated
vendored
@@ -425,11 +425,65 @@ func (p *plugin) generateMessage(file *generator.FileDescriptor, message *genera
|
||||
p.In()
|
||||
p.P(`return -1`)
|
||||
p.Out()
|
||||
p.P(`} else if c := this.`, fieldname, `.Compare(that1.`, fieldname, `); c != 0 {`)
|
||||
p.P(`} else {`)
|
||||
p.In()
|
||||
|
||||
// Generate two type switches in order to compare the
|
||||
// types of the oneofs. If they are of the same type
|
||||
// call Compare, otherwise return 1 or -1.
|
||||
p.P(`thisType := -1`)
|
||||
p.P(`switch this.`, fieldname, `.(type) {`)
|
||||
for i, subfield := range message.Field {
|
||||
if *subfield.OneofIndex == *field.OneofIndex {
|
||||
ccTypeName := p.OneOfTypeName(message, subfield)
|
||||
p.P(`case *`, ccTypeName, `:`)
|
||||
p.In()
|
||||
p.P(`thisType = `, i)
|
||||
p.Out()
|
||||
}
|
||||
}
|
||||
p.P(`default:`)
|
||||
p.In()
|
||||
p.P(`panic(fmt.Sprintf("compare: unexpected type %T in oneof", this.`, fieldname, `))`)
|
||||
p.Out()
|
||||
p.P(`}`)
|
||||
|
||||
p.P(`that1Type := -1`)
|
||||
p.P(`switch that1.`, fieldname, `.(type) {`)
|
||||
for i, subfield := range message.Field {
|
||||
if *subfield.OneofIndex == *field.OneofIndex {
|
||||
ccTypeName := p.OneOfTypeName(message, subfield)
|
||||
p.P(`case *`, ccTypeName, `:`)
|
||||
p.In()
|
||||
p.P(`that1Type = `, i)
|
||||
p.Out()
|
||||
}
|
||||
}
|
||||
p.P(`default:`)
|
||||
p.In()
|
||||
p.P(`panic(fmt.Sprintf("compare: unexpected type %T in oneof", that1.`, fieldname, `))`)
|
||||
p.Out()
|
||||
p.P(`}`)
|
||||
|
||||
p.P(`if thisType == that1Type {`)
|
||||
p.In()
|
||||
p.P(`if c := this.`, fieldname, `.Compare(that1.`, fieldname, `); c != 0 {`)
|
||||
p.In()
|
||||
p.P(`return c`)
|
||||
p.Out()
|
||||
p.P(`}`)
|
||||
p.Out()
|
||||
p.P(`} else if thisType < that1Type {`)
|
||||
p.In()
|
||||
p.P(`return -1`)
|
||||
p.Out()
|
||||
p.P(`} else if thisType > that1Type {`)
|
||||
p.In()
|
||||
p.P(`return 1`)
|
||||
p.Out()
|
||||
p.P(`}`)
|
||||
p.Out()
|
||||
p.P(`}`)
|
||||
} else {
|
||||
p.generateField(file, message, field)
|
||||
}
|
||||
|
||||
4
vendor/github.com/gogo/protobuf/plugin/gostring/gostring.go
generated
vendored
4
vendor/github.com/gogo/protobuf/plugin/gostring/gostring.go
generated
vendored
@@ -238,10 +238,10 @@ func (p *gostring) Generate(file *generator.FileDescriptor) {
|
||||
} else {
|
||||
goTyp, _ := p.GoType(message, field)
|
||||
goTyp = strings.Replace(goTyp, "[]", "", 1)
|
||||
p.P("vs := make([]*", goTyp, ", len(this.", fieldname, "))")
|
||||
p.P("vs := make([]", goTyp, ", len(this.", fieldname, "))")
|
||||
p.P("for i := range vs {")
|
||||
p.In()
|
||||
p.P("vs[i] = &this.", fieldname, "[i]")
|
||||
p.P("vs[i] = this.", fieldname, "[i]")
|
||||
p.Out()
|
||||
p.P("}")
|
||||
p.P(`s = append(s, "`, fieldname, `: " + `, fmtPkg.Use(), `.Sprintf("%#v", vs) + ",\n")`)
|
||||
|
||||
959
vendor/github.com/gogo/protobuf/plugin/marshalto/marshalto.go
generated
vendored
959
vendor/github.com/gogo/protobuf/plugin/marshalto/marshalto.go
generated
vendored
File diff suppressed because it is too large
Load Diff
4
vendor/github.com/gogo/protobuf/plugin/populate/populate.go
generated
vendored
4
vendor/github.com/gogo/protobuf/plugin/populate/populate.go
generated
vendored
@@ -584,9 +584,9 @@ func (p *plugin) Generate(file *generator.FileDescriptor) {
|
||||
p.GenerateField(file, message, field)
|
||||
} else {
|
||||
if loopLevels[fieldIndex] > 0 {
|
||||
p.P(`if r.Intn(10) == 0 {`)
|
||||
p.P(`if r.Intn(5) == 0 {`)
|
||||
} else {
|
||||
p.P(`if r.Intn(10) != 0 {`)
|
||||
p.P(`if r.Intn(5) != 0 {`)
|
||||
}
|
||||
p.In()
|
||||
p.GenerateField(file, message, field)
|
||||
|
||||
11
vendor/github.com/gogo/protobuf/plugin/size/size.go
generated
vendored
11
vendor/github.com/gogo/protobuf/plugin/size/size.go
generated
vendored
@@ -141,6 +141,7 @@ type size struct {
|
||||
atleastOne bool
|
||||
localName string
|
||||
typesPkg generator.Single
|
||||
bitsPkg generator.Single
|
||||
}
|
||||
|
||||
func NewSize() *size {
|
||||
@@ -188,14 +189,7 @@ func keySize(fieldNumber int32, wireType int) int {
|
||||
func (p *size) sizeVarint() {
|
||||
p.P(`
|
||||
func sov`, p.localName, `(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
return (`, p.bitsPkg.Use(), `.Len64(x | 1) + 6)/ 7
|
||||
}`)
|
||||
}
|
||||
|
||||
@@ -589,6 +583,7 @@ func (p *size) Generate(file *generator.FileDescriptor) {
|
||||
p.localName = generator.FileName(file)
|
||||
p.typesPkg = p.NewImport("github.com/gogo/protobuf/types")
|
||||
protoPkg := p.NewImport("github.com/gogo/protobuf/proto")
|
||||
p.bitsPkg = p.NewImport("math/bits")
|
||||
if !gogoproto.ImportsGoGoProto(file.FileDescriptorProto) {
|
||||
protoPkg = p.NewImport("github.com/golang/protobuf/proto")
|
||||
}
|
||||
|
||||
59
vendor/github.com/gogo/protobuf/plugin/stringer/stringer.go
generated
vendored
59
vendor/github.com/gogo/protobuf/plugin/stringer/stringer.go
generated
vendored
@@ -148,6 +148,47 @@ func (p *stringer) Generate(file *generator.FileDescriptor) {
|
||||
p.P(`return "nil"`)
|
||||
p.Out()
|
||||
p.P(`}`)
|
||||
for _, field := range message.Field {
|
||||
if p.IsMap(field) || !field.IsRepeated() {
|
||||
continue
|
||||
}
|
||||
if (field.IsMessage() && !gogoproto.IsCustomType(field)) || p.IsGroup(field) {
|
||||
nullable := gogoproto.IsNullable(field)
|
||||
desc := p.ObjectNamed(field.GetTypeName())
|
||||
msgname := p.TypeName(desc)
|
||||
msgnames := strings.Split(msgname, ".")
|
||||
typeName := msgnames[len(msgnames)-1]
|
||||
fieldMessageDesc := file.GetMessage(msgname)
|
||||
gogoStringer := false
|
||||
if fieldMessageDesc != nil {
|
||||
gogoStringer = gogoproto.IsStringer(file.FileDescriptorProto, fieldMessageDesc)
|
||||
}
|
||||
fieldname := p.GetFieldName(message, field)
|
||||
stringfunc := fmtPkg.Use() + `.Sprintf("%v", f)`
|
||||
if gogoStringer {
|
||||
stringfunc = `f.String()`
|
||||
}
|
||||
repeatedName := `repeatedStringFor` + fieldname
|
||||
if nullable {
|
||||
p.P(repeatedName, ` := "[]*`, typeName, `{"`)
|
||||
} else {
|
||||
p.P(repeatedName, ` := "[]`, typeName, `{"`)
|
||||
}
|
||||
|
||||
p.P(`for _, f := range `, `this.`, fieldname, ` {`)
|
||||
p.In()
|
||||
if nullable {
|
||||
p.P(repeatedName, " += ", stringsPkg.Use(), `.Replace(`, stringfunc, `, "`, typeName, `","`, msgname, `"`, ", 1)", ` + ","`)
|
||||
} else if gogoStringer {
|
||||
p.P(repeatedName, " += ", stringsPkg.Use(), `.Replace(`, stringsPkg.Use(), `.Replace(`, stringfunc, `, "`, typeName, `","`, msgname, `"`, ", 1),`&`,``,1)", ` + ","`)
|
||||
} else {
|
||||
p.P(repeatedName, " += ", stringfunc, ` + ","`)
|
||||
}
|
||||
p.Out()
|
||||
p.P(`}`)
|
||||
p.P(repeatedName, ` += "}"`)
|
||||
}
|
||||
}
|
||||
for _, field := range message.Field {
|
||||
if !p.IsMap(field) {
|
||||
continue
|
||||
@@ -208,12 +249,22 @@ func (p *stringer) Generate(file *generator.FileDescriptor) {
|
||||
msgname := p.TypeName(desc)
|
||||
msgnames := strings.Split(msgname, ".")
|
||||
typeName := msgnames[len(msgnames)-1]
|
||||
if nullable {
|
||||
p.P("`", fieldname, ":`", ` + `, stringsPkg.Use(), `.Replace(`, fmtPkg.Use(), `.Sprintf("%v", this.`, fieldname, `), "`, typeName, `","`, msgname, `"`, ", 1) + `,", "`,")
|
||||
fieldMessageDesc := file.GetMessage(msgname)
|
||||
gogoStringer := false
|
||||
if fieldMessageDesc != nil {
|
||||
gogoStringer = gogoproto.IsStringer(file.FileDescriptorProto, fieldMessageDesc)
|
||||
}
|
||||
stringfunc := fmtPkg.Use() + `.Sprintf("%v", this.` + fieldname + `)`
|
||||
if gogoStringer {
|
||||
stringfunc = `this.` + fieldname + `.String()`
|
||||
}
|
||||
if nullable && !repeated {
|
||||
p.P("`", fieldname, ":`", ` + `, stringsPkg.Use(), `.Replace(`, stringfunc, `, "`, typeName, `","`, msgname, `"`, ", 1) + `,", "`,")
|
||||
} else if repeated {
|
||||
p.P("`", fieldname, ":`", ` + `, stringsPkg.Use(), `.Replace(`, stringsPkg.Use(), `.Replace(`, fmtPkg.Use(), `.Sprintf("%v", this.`, fieldname, `), "`, typeName, `","`, msgname, `"`, ", 1),`&`,``,1) + `,", "`,")
|
||||
repeatedName := `repeatedStringFor` + fieldname
|
||||
p.P("`", fieldname, ":`", ` + `, repeatedName, " + `,", "`,")
|
||||
} else {
|
||||
p.P("`", fieldname, ":`", ` + `, stringsPkg.Use(), `.Replace(`, stringsPkg.Use(), `.Replace(this.`, fieldname, `.String(), "`, typeName, `","`, msgname, `"`, ", 1),`&`,``,1) + `,", "`,")
|
||||
p.P("`", fieldname, ":`", ` + `, stringsPkg.Use(), `.Replace(`, stringsPkg.Use(), `.Replace(`, stringfunc, `, "`, typeName, `","`, msgname, `"`, ", 1),`&`,``,1) + `,", "`,")
|
||||
}
|
||||
} else {
|
||||
if nullable && !repeated && !proto3 {
|
||||
|
||||
54
vendor/github.com/gogo/protobuf/plugin/unmarshal/unmarshal.go
generated
vendored
54
vendor/github.com/gogo/protobuf/plugin/unmarshal/unmarshal.go
generated
vendored
@@ -1578,6 +1578,7 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) {
|
||||
p.P(`func skip` + p.localName + `(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -1609,10 +1610,8 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -1633,57 +1632,32 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) {
|
||||
return 0, ErrInvalidLength` + p.localName + `
|
||||
}
|
||||
iNdEx += length
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLength` + p.localName + `
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflow` + p.localName + `
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return 0, ` + p.ioPkg.Use() + `.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
innerWire |= (uint64(b) & 0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
innerWireType := int(innerWire & 0x7)
|
||||
if innerWireType == 4 {
|
||||
break
|
||||
}
|
||||
next, err := skip` + p.localName + `(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLength` + p.localName + `
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
depth++
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroup` + p.localName + `
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, ` + fmtPkg.Use() + `.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLength` + p.localName + `
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
return 0, ` + p.ioPkg.Use() + `.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLength` + p.localName + ` = ` + fmtPkg.Use() + `.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflow` + p.localName + ` = ` + fmtPkg.Use() + `.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroup` + p.localName + ` = ` + fmtPkg.Use() + `.Errorf("proto: unexpected end of group")
|
||||
)
|
||||
`)
|
||||
}
|
||||
|
||||
2
vendor/github.com/gogo/protobuf/proto/encode.go
generated
vendored
2
vendor/github.com/gogo/protobuf/proto/encode.go
generated
vendored
@@ -189,6 +189,8 @@ type Marshaler interface {
|
||||
// prefixed by a varint-encoded length.
|
||||
func (p *Buffer) EncodeMessage(pb Message) error {
|
||||
siz := Size(pb)
|
||||
sizVar := SizeVarint(uint64(siz))
|
||||
p.grow(siz + sizVar)
|
||||
p.EncodeVarint(uint64(siz))
|
||||
return p.Marshal(pb)
|
||||
}
|
||||
|
||||
1
vendor/github.com/gogo/protobuf/proto/extensions.go
generated
vendored
1
vendor/github.com/gogo/protobuf/proto/extensions.go
generated
vendored
@@ -527,6 +527,7 @@ func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) {
|
||||
// SetExtension sets the specified extension of pb to the specified value.
|
||||
func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error {
|
||||
if epb, ok := pb.(extensionsBytes); ok {
|
||||
ClearExtension(pb, extension)
|
||||
newb, err := encodeExtension(extension, value)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
21
vendor/github.com/gogo/protobuf/proto/extensions_gogo.go
generated
vendored
21
vendor/github.com/gogo/protobuf/proto/extensions_gogo.go
generated
vendored
@@ -154,6 +154,10 @@ func EncodeInternalExtension(m extendableProto, data []byte) (n int, err error)
|
||||
return EncodeExtensionMap(m.extensionsWrite(), data)
|
||||
}
|
||||
|
||||
func EncodeInternalExtensionBackwards(m extendableProto, data []byte) (n int, err error) {
|
||||
return EncodeExtensionMapBackwards(m.extensionsWrite(), data)
|
||||
}
|
||||
|
||||
func EncodeExtensionMap(m map[int32]Extension, data []byte) (n int, err error) {
|
||||
o := 0
|
||||
for _, e := range m {
|
||||
@@ -169,6 +173,23 @@ func EncodeExtensionMap(m map[int32]Extension, data []byte) (n int, err error) {
|
||||
return o, nil
|
||||
}
|
||||
|
||||
func EncodeExtensionMapBackwards(m map[int32]Extension, data []byte) (n int, err error) {
|
||||
o := 0
|
||||
end := len(data)
|
||||
for _, e := range m {
|
||||
if err := e.Encode(); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
n := copy(data[end-len(e.enc):], e.enc)
|
||||
if n != len(e.enc) {
|
||||
return 0, io.ErrShortBuffer
|
||||
}
|
||||
end -= n
|
||||
o += n
|
||||
}
|
||||
return o, nil
|
||||
}
|
||||
|
||||
func GetRawExtension(m map[int32]Extension, id int32) ([]byte, error) {
|
||||
e := m[id]
|
||||
if err := e.Encode(); err != nil {
|
||||
|
||||
18
vendor/github.com/gogo/protobuf/proto/lib.go
generated
vendored
18
vendor/github.com/gogo/protobuf/proto/lib.go
generated
vendored
@@ -948,13 +948,19 @@ func isProto3Zero(v reflect.Value) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// ProtoPackageIsVersion2 is referenced from generated protocol buffer files
|
||||
// to assert that that code is compatible with this version of the proto package.
|
||||
const GoGoProtoPackageIsVersion2 = true
|
||||
const (
|
||||
// ProtoPackageIsVersion3 is referenced from generated protocol buffer files
|
||||
// to assert that that code is compatible with this version of the proto package.
|
||||
GoGoProtoPackageIsVersion3 = true
|
||||
|
||||
// ProtoPackageIsVersion1 is referenced from generated protocol buffer files
|
||||
// to assert that that code is compatible with this version of the proto package.
|
||||
const GoGoProtoPackageIsVersion1 = true
|
||||
// ProtoPackageIsVersion2 is referenced from generated protocol buffer files
|
||||
// to assert that that code is compatible with this version of the proto package.
|
||||
GoGoProtoPackageIsVersion2 = true
|
||||
|
||||
// ProtoPackageIsVersion1 is referenced from generated protocol buffer files
|
||||
// to assert that that code is compatible with this version of the proto package.
|
||||
GoGoProtoPackageIsVersion1 = true
|
||||
)
|
||||
|
||||
// InternalMessageInfo is a type used internally by generated .pb.go files.
|
||||
// This type is not intended to be used by non-generated code.
|
||||
|
||||
71
vendor/github.com/gogo/protobuf/proto/properties.go
generated
vendored
71
vendor/github.com/gogo/protobuf/proto/properties.go
generated
vendored
@@ -43,7 +43,6 @@ package proto
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"reflect"
|
||||
"sort"
|
||||
"strconv"
|
||||
@@ -205,7 +204,7 @@ func (p *Properties) Parse(s string) {
|
||||
// "bytes,49,opt,name=foo,def=hello!"
|
||||
fields := strings.Split(s, ",") // breaks def=, but handled below.
|
||||
if len(fields) < 2 {
|
||||
fmt.Fprintf(os.Stderr, "proto: tag has too few fields: %q\n", s)
|
||||
log.Printf("proto: tag has too few fields: %q", s)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -225,7 +224,7 @@ func (p *Properties) Parse(s string) {
|
||||
p.WireType = WireBytes
|
||||
// no numeric converter for non-numeric types
|
||||
default:
|
||||
fmt.Fprintf(os.Stderr, "proto: tag has unknown wire type: %q\n", s)
|
||||
log.Printf("proto: tag has unknown wire type: %q", s)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -400,6 +399,15 @@ func GetProperties(t reflect.Type) *StructProperties {
|
||||
return sprop
|
||||
}
|
||||
|
||||
type (
|
||||
oneofFuncsIface interface {
|
||||
XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})
|
||||
}
|
||||
oneofWrappersIface interface {
|
||||
XXX_OneofWrappers() []interface{}
|
||||
}
|
||||
)
|
||||
|
||||
// getPropertiesLocked requires that propertiesMu is held.
|
||||
func getPropertiesLocked(t reflect.Type) *StructProperties {
|
||||
if prop, ok := propertiesMap[t]; ok {
|
||||
@@ -441,37 +449,40 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
|
||||
// Re-order prop.order.
|
||||
sort.Sort(prop)
|
||||
|
||||
type oneofMessage interface {
|
||||
XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})
|
||||
}
|
||||
if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); isOneofMessage && ok {
|
||||
if isOneofMessage {
|
||||
var oots []interface{}
|
||||
_, _, _, oots = om.XXX_OneofFuncs()
|
||||
|
||||
// Interpret oneof metadata.
|
||||
prop.OneofTypes = make(map[string]*OneofProperties)
|
||||
for _, oot := range oots {
|
||||
oop := &OneofProperties{
|
||||
Type: reflect.ValueOf(oot).Type(), // *T
|
||||
Prop: new(Properties),
|
||||
}
|
||||
sft := oop.Type.Elem().Field(0)
|
||||
oop.Prop.Name = sft.Name
|
||||
oop.Prop.Parse(sft.Tag.Get("protobuf"))
|
||||
// There will be exactly one interface field that
|
||||
// this new value is assignable to.
|
||||
for i := 0; i < t.NumField(); i++ {
|
||||
f := t.Field(i)
|
||||
if f.Type.Kind() != reflect.Interface {
|
||||
continue
|
||||
switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
|
||||
case oneofFuncsIface:
|
||||
_, _, _, oots = m.XXX_OneofFuncs()
|
||||
case oneofWrappersIface:
|
||||
oots = m.XXX_OneofWrappers()
|
||||
}
|
||||
if len(oots) > 0 {
|
||||
// Interpret oneof metadata.
|
||||
prop.OneofTypes = make(map[string]*OneofProperties)
|
||||
for _, oot := range oots {
|
||||
oop := &OneofProperties{
|
||||
Type: reflect.ValueOf(oot).Type(), // *T
|
||||
Prop: new(Properties),
|
||||
}
|
||||
if !oop.Type.AssignableTo(f.Type) {
|
||||
continue
|
||||
sft := oop.Type.Elem().Field(0)
|
||||
oop.Prop.Name = sft.Name
|
||||
oop.Prop.Parse(sft.Tag.Get("protobuf"))
|
||||
// There will be exactly one interface field that
|
||||
// this new value is assignable to.
|
||||
for i := 0; i < t.NumField(); i++ {
|
||||
f := t.Field(i)
|
||||
if f.Type.Kind() != reflect.Interface {
|
||||
continue
|
||||
}
|
||||
if !oop.Type.AssignableTo(f.Type) {
|
||||
continue
|
||||
}
|
||||
oop.Field = i
|
||||
break
|
||||
}
|
||||
oop.Field = i
|
||||
break
|
||||
prop.OneofTypes[oop.Prop.OrigName] = oop
|
||||
}
|
||||
prop.OneofTypes[oop.Prop.OrigName] = oop
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
17
vendor/github.com/gogo/protobuf/proto/table_marshal.go
generated
vendored
17
vendor/github.com/gogo/protobuf/proto/table_marshal.go
generated
vendored
@@ -389,8 +389,13 @@ func (u *marshalInfo) computeMarshalInfo() {
|
||||
// get oneof implementers
|
||||
var oneofImplementers []interface{}
|
||||
// gogo: isOneofMessage is needed for embedded oneof messages, without a marshaler and unmarshaler
|
||||
if m, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok && isOneofMessage {
|
||||
_, _, _, oneofImplementers = m.XXX_OneofFuncs()
|
||||
if isOneofMessage {
|
||||
switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
|
||||
case oneofFuncsIface:
|
||||
_, _, _, oneofImplementers = m.XXX_OneofFuncs()
|
||||
case oneofWrappersIface:
|
||||
oneofImplementers = m.XXX_OneofWrappers()
|
||||
}
|
||||
}
|
||||
|
||||
// normal fields
|
||||
@@ -519,10 +524,6 @@ func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofI
|
||||
}
|
||||
}
|
||||
|
||||
type oneofMessage interface {
|
||||
XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})
|
||||
}
|
||||
|
||||
// wiretype returns the wire encoding of the type.
|
||||
func wiretype(encoding string) uint64 {
|
||||
switch encoding {
|
||||
@@ -2968,7 +2969,9 @@ func (p *Buffer) Marshal(pb Message) error {
|
||||
if m, ok := pb.(newMarshaler); ok {
|
||||
siz := m.XXX_Size()
|
||||
p.grow(siz) // make sure buf has enough capacity
|
||||
p.buf, err = m.XXX_Marshal(p.buf, p.deterministic)
|
||||
pp := p.buf[len(p.buf) : len(p.buf) : len(p.buf)+siz]
|
||||
pp, err = m.XXX_Marshal(pp, p.deterministic)
|
||||
p.buf = append(p.buf, pp...)
|
||||
return err
|
||||
}
|
||||
if m, ok := pb.(Marshaler); ok {
|
||||
|
||||
19
vendor/github.com/gogo/protobuf/proto/table_merge.go
generated
vendored
19
vendor/github.com/gogo/protobuf/proto/table_merge.go
generated
vendored
@@ -530,6 +530,25 @@ func (mi *mergeInfo) computeMergeInfo() {
|
||||
}
|
||||
case reflect.Struct:
|
||||
switch {
|
||||
case isSlice && !isPointer: // E.g. []pb.T
|
||||
mergeInfo := getMergeInfo(tf)
|
||||
zero := reflect.Zero(tf)
|
||||
mfi.merge = func(dst, src pointer) {
|
||||
// TODO: Make this faster?
|
||||
dstsp := dst.asPointerTo(f.Type)
|
||||
dsts := dstsp.Elem()
|
||||
srcs := src.asPointerTo(f.Type).Elem()
|
||||
for i := 0; i < srcs.Len(); i++ {
|
||||
dsts = reflect.Append(dsts, zero)
|
||||
srcElement := srcs.Index(i).Addr()
|
||||
dstElement := dsts.Index(dsts.Len() - 1).Addr()
|
||||
mergeInfo.merge(valToPointer(dstElement), valToPointer(srcElement))
|
||||
}
|
||||
if dsts.IsNil() {
|
||||
dsts = reflect.MakeSlice(f.Type, 0, 0)
|
||||
}
|
||||
dstsp.Elem().Set(dsts)
|
||||
}
|
||||
case !isPointer:
|
||||
mergeInfo := getMergeInfo(tf)
|
||||
mfi.merge = func(dst, src pointer) {
|
||||
|
||||
22
vendor/github.com/gogo/protobuf/proto/table_unmarshal.go
generated
vendored
22
vendor/github.com/gogo/protobuf/proto/table_unmarshal.go
generated
vendored
@@ -371,15 +371,18 @@ func (u *unmarshalInfo) computeUnmarshalInfo() {
|
||||
}
|
||||
|
||||
// Find any types associated with oneof fields.
|
||||
// TODO: XXX_OneofFuncs returns more info than we need. Get rid of some of it?
|
||||
fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("XXX_OneofFuncs")
|
||||
// gogo: len(oneofFields) > 0 is needed for embedded oneof messages, without a marshaler and unmarshaler
|
||||
if fn.IsValid() && len(oneofFields) > 0 {
|
||||
res := fn.Call(nil)[3] // last return value from XXX_OneofFuncs: []interface{}
|
||||
for i := res.Len() - 1; i >= 0; i-- {
|
||||
v := res.Index(i) // interface{}
|
||||
tptr := reflect.ValueOf(v.Interface()).Type() // *Msg_X
|
||||
typ := tptr.Elem() // Msg_X
|
||||
if len(oneofFields) > 0 {
|
||||
var oneofImplementers []interface{}
|
||||
switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
|
||||
case oneofFuncsIface:
|
||||
_, _, _, oneofImplementers = m.XXX_OneofFuncs()
|
||||
case oneofWrappersIface:
|
||||
oneofImplementers = m.XXX_OneofWrappers()
|
||||
}
|
||||
for _, v := range oneofImplementers {
|
||||
tptr := reflect.TypeOf(v) // *Msg_X
|
||||
typ := tptr.Elem() // Msg_X
|
||||
|
||||
f := typ.Field(0) // oneof implementers have one field
|
||||
baseUnmarshal := fieldUnmarshaler(&f)
|
||||
@@ -407,11 +410,12 @@ func (u *unmarshalInfo) computeUnmarshalInfo() {
|
||||
u.setTag(fieldNum, of.field, unmarshal, 0, name)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Get extension ranges, if any.
|
||||
fn = reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray")
|
||||
fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray")
|
||||
if fn.IsValid() {
|
||||
if !u.extensions.IsValid() && !u.oldExtensions.IsValid() && !u.bytesExtensions.IsValid() {
|
||||
panic("a message with extensions, but no extensions field in " + t.Name())
|
||||
|
||||
6
vendor/github.com/gogo/protobuf/proto/text.go
generated
vendored
6
vendor/github.com/gogo/protobuf/proto/text.go
generated
vendored
@@ -476,6 +476,8 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
var textMarshalerType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem()
|
||||
|
||||
// writeAny writes an arbitrary field.
|
||||
func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error {
|
||||
v = reflect.Indirect(v)
|
||||
@@ -589,8 +591,8 @@ func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Propert
|
||||
// mutating this value.
|
||||
v = v.Addr()
|
||||
}
|
||||
if etm, ok := v.Interface().(encoding.TextMarshaler); ok {
|
||||
text, err := etm.MarshalText()
|
||||
if v.Type().Implements(textMarshalerType) {
|
||||
text, err := v.Interface().(encoding.TextMarshaler).MarshalText()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
1
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/compiler/plugin.proto
generated
vendored
1
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/compiler/plugin.proto
generated
vendored
@@ -45,6 +45,7 @@
|
||||
// flag "--${NAME}_out" is passed to protoc.
|
||||
|
||||
syntax = "proto2";
|
||||
|
||||
package google.protobuf.compiler;
|
||||
option java_package = "com.google.protobuf.compiler";
|
||||
option java_outer_classname = "PluginProtos";
|
||||
|
||||
140
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/descriptor.proto
generated
vendored
140
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/descriptor.proto
generated
vendored
@@ -40,6 +40,7 @@
|
||||
syntax = "proto2";
|
||||
|
||||
package google.protobuf;
|
||||
|
||||
option go_package = "descriptor";
|
||||
option java_package = "com.google.protobuf";
|
||||
option java_outer_classname = "DescriptorProtos";
|
||||
@@ -59,8 +60,8 @@ message FileDescriptorSet {
|
||||
|
||||
// Describes a complete .proto file.
|
||||
message FileDescriptorProto {
|
||||
optional string name = 1; // file name, relative to root of source tree
|
||||
optional string package = 2; // e.g. "foo", "foo.bar", etc.
|
||||
optional string name = 1; // file name, relative to root of source tree
|
||||
optional string package = 2; // e.g. "foo", "foo.bar", etc.
|
||||
|
||||
// Names of files imported by this file.
|
||||
repeated string dependency = 3;
|
||||
@@ -100,8 +101,8 @@ message DescriptorProto {
|
||||
repeated EnumDescriptorProto enum_type = 4;
|
||||
|
||||
message ExtensionRange {
|
||||
optional int32 start = 1;
|
||||
optional int32 end = 2;
|
||||
optional int32 start = 1; // Inclusive.
|
||||
optional int32 end = 2; // Exclusive.
|
||||
|
||||
optional ExtensionRangeOptions options = 3;
|
||||
}
|
||||
@@ -115,8 +116,8 @@ message DescriptorProto {
|
||||
// fields or extension ranges in the same message. Reserved ranges may
|
||||
// not overlap.
|
||||
message ReservedRange {
|
||||
optional int32 start = 1; // Inclusive.
|
||||
optional int32 end = 2; // Exclusive.
|
||||
optional int32 start = 1; // Inclusive.
|
||||
optional int32 end = 2; // Exclusive.
|
||||
}
|
||||
repeated ReservedRange reserved_range = 9;
|
||||
// Reserved field names, which may not be used by fields in the same message.
|
||||
@@ -137,42 +138,42 @@ message FieldDescriptorProto {
|
||||
enum Type {
|
||||
// 0 is reserved for errors.
|
||||
// Order is weird for historical reasons.
|
||||
TYPE_DOUBLE = 1;
|
||||
TYPE_FLOAT = 2;
|
||||
TYPE_DOUBLE = 1;
|
||||
TYPE_FLOAT = 2;
|
||||
// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
|
||||
// negative values are likely.
|
||||
TYPE_INT64 = 3;
|
||||
TYPE_UINT64 = 4;
|
||||
TYPE_INT64 = 3;
|
||||
TYPE_UINT64 = 4;
|
||||
// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
|
||||
// negative values are likely.
|
||||
TYPE_INT32 = 5;
|
||||
TYPE_FIXED64 = 6;
|
||||
TYPE_FIXED32 = 7;
|
||||
TYPE_BOOL = 8;
|
||||
TYPE_STRING = 9;
|
||||
TYPE_INT32 = 5;
|
||||
TYPE_FIXED64 = 6;
|
||||
TYPE_FIXED32 = 7;
|
||||
TYPE_BOOL = 8;
|
||||
TYPE_STRING = 9;
|
||||
// Tag-delimited aggregate.
|
||||
// Group type is deprecated and not supported in proto3. However, Proto3
|
||||
// implementations should still be able to parse the group wire format and
|
||||
// treat group fields as unknown fields.
|
||||
TYPE_GROUP = 10;
|
||||
TYPE_MESSAGE = 11; // Length-delimited aggregate.
|
||||
TYPE_GROUP = 10;
|
||||
TYPE_MESSAGE = 11; // Length-delimited aggregate.
|
||||
|
||||
// New in version 2.
|
||||
TYPE_BYTES = 12;
|
||||
TYPE_UINT32 = 13;
|
||||
TYPE_ENUM = 14;
|
||||
TYPE_SFIXED32 = 15;
|
||||
TYPE_SFIXED64 = 16;
|
||||
TYPE_SINT32 = 17; // Uses ZigZag encoding.
|
||||
TYPE_SINT64 = 18; // Uses ZigZag encoding.
|
||||
};
|
||||
TYPE_BYTES = 12;
|
||||
TYPE_UINT32 = 13;
|
||||
TYPE_ENUM = 14;
|
||||
TYPE_SFIXED32 = 15;
|
||||
TYPE_SFIXED64 = 16;
|
||||
TYPE_SINT32 = 17; // Uses ZigZag encoding.
|
||||
TYPE_SINT64 = 18; // Uses ZigZag encoding.
|
||||
}
|
||||
|
||||
enum Label {
|
||||
// 0 is reserved for errors
|
||||
LABEL_OPTIONAL = 1;
|
||||
LABEL_REQUIRED = 2;
|
||||
LABEL_REPEATED = 3;
|
||||
};
|
||||
LABEL_OPTIONAL = 1;
|
||||
LABEL_REQUIRED = 2;
|
||||
LABEL_REPEATED = 3;
|
||||
}
|
||||
|
||||
optional string name = 1;
|
||||
optional int32 number = 3;
|
||||
@@ -234,8 +235,8 @@ message EnumDescriptorProto {
|
||||
// is inclusive such that it can appropriately represent the entire int32
|
||||
// domain.
|
||||
message EnumReservedRange {
|
||||
optional int32 start = 1; // Inclusive.
|
||||
optional int32 end = 2; // Inclusive.
|
||||
optional int32 start = 1; // Inclusive.
|
||||
optional int32 end = 2; // Inclusive.
|
||||
}
|
||||
|
||||
// Range of reserved numeric values. Reserved numeric values may not be used
|
||||
@@ -276,9 +277,9 @@ message MethodDescriptorProto {
|
||||
optional MethodOptions options = 4;
|
||||
|
||||
// Identifies if client streams multiple client messages
|
||||
optional bool client_streaming = 5 [default=false];
|
||||
optional bool client_streaming = 5 [default = false];
|
||||
// Identifies if server streams multiple server messages
|
||||
optional bool server_streaming = 6 [default=false];
|
||||
optional bool server_streaming = 6 [default = false];
|
||||
}
|
||||
|
||||
|
||||
@@ -314,7 +315,6 @@ message MethodDescriptorProto {
|
||||
// If this turns out to be popular, a web service will be set up
|
||||
// to automatically assign option numbers.
|
||||
|
||||
|
||||
message FileOptions {
|
||||
|
||||
// Sets the Java package where classes generated from this .proto will be
|
||||
@@ -337,7 +337,7 @@ message FileOptions {
|
||||
// named by java_outer_classname. However, the outer class will still be
|
||||
// generated to contain the file's getDescriptor() method as well as any
|
||||
// top-level extensions defined in the file.
|
||||
optional bool java_multiple_files = 10 [default=false];
|
||||
optional bool java_multiple_files = 10 [default = false];
|
||||
|
||||
// This option does nothing.
|
||||
optional bool java_generate_equals_and_hash = 20 [deprecated=true];
|
||||
@@ -348,17 +348,17 @@ message FileOptions {
|
||||
// Message reflection will do the same.
|
||||
// However, an extension field still accepts non-UTF-8 byte sequences.
|
||||
// This option has no effect on when used with the lite runtime.
|
||||
optional bool java_string_check_utf8 = 27 [default=false];
|
||||
optional bool java_string_check_utf8 = 27 [default = false];
|
||||
|
||||
|
||||
// Generated classes can be optimized for speed or code size.
|
||||
enum OptimizeMode {
|
||||
SPEED = 1; // Generate complete code for parsing, serialization,
|
||||
// etc.
|
||||
CODE_SIZE = 2; // Use ReflectionOps to implement these methods.
|
||||
LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.
|
||||
SPEED = 1; // Generate complete code for parsing, serialization,
|
||||
// etc.
|
||||
CODE_SIZE = 2; // Use ReflectionOps to implement these methods.
|
||||
LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.
|
||||
}
|
||||
optional OptimizeMode optimize_for = 9 [default=SPEED];
|
||||
optional OptimizeMode optimize_for = 9 [default = SPEED];
|
||||
|
||||
// Sets the Go package where structs generated from this .proto will be
|
||||
// placed. If omitted, the Go package will be derived from the following:
|
||||
@@ -369,6 +369,7 @@ message FileOptions {
|
||||
|
||||
|
||||
|
||||
|
||||
// Should generic services be generated in each language? "Generic" services
|
||||
// are not specific to any particular RPC system. They are generated by the
|
||||
// main code generators in each language (without additional plugins).
|
||||
@@ -379,20 +380,20 @@ message FileOptions {
|
||||
// that generate code specific to your particular RPC system. Therefore,
|
||||
// these default to false. Old code which depends on generic services should
|
||||
// explicitly set them to true.
|
||||
optional bool cc_generic_services = 16 [default=false];
|
||||
optional bool java_generic_services = 17 [default=false];
|
||||
optional bool py_generic_services = 18 [default=false];
|
||||
optional bool php_generic_services = 42 [default=false];
|
||||
optional bool cc_generic_services = 16 [default = false];
|
||||
optional bool java_generic_services = 17 [default = false];
|
||||
optional bool py_generic_services = 18 [default = false];
|
||||
optional bool php_generic_services = 42 [default = false];
|
||||
|
||||
// Is this file deprecated?
|
||||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for everything in the file, or it will be completely ignored; in the very
|
||||
// least, this is a formalization for deprecating files.
|
||||
optional bool deprecated = 23 [default=false];
|
||||
optional bool deprecated = 23 [default = false];
|
||||
|
||||
// Enables the use of arenas for the proto messages in this file. This applies
|
||||
// only to generated classes for C++.
|
||||
optional bool cc_enable_arenas = 31 [default=false];
|
||||
optional bool cc_enable_arenas = 31 [default = false];
|
||||
|
||||
|
||||
// Sets the objective c class prefix which is prepended to all objective c
|
||||
@@ -417,10 +418,9 @@ message FileOptions {
|
||||
// determining the namespace.
|
||||
optional string php_namespace = 41;
|
||||
|
||||
|
||||
// Use this option to change the namespace of php generated metadata classes.
|
||||
// Default is empty. When this option is empty, the proto file name will be used
|
||||
// for determining the namespace.
|
||||
// Default is empty. When this option is empty, the proto file name will be
|
||||
// used for determining the namespace.
|
||||
optional string php_metadata_namespace = 44;
|
||||
|
||||
// Use this option to change the package of ruby generated classes. Default
|
||||
@@ -428,6 +428,7 @@ message FileOptions {
|
||||
// determining the ruby package.
|
||||
optional string ruby_package = 45;
|
||||
|
||||
|
||||
// The parser stores options it doesn't recognize here.
|
||||
// See the documentation for the "Options" section above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
@@ -458,18 +459,18 @@ message MessageOptions {
|
||||
//
|
||||
// Because this is an option, the above two restrictions are not enforced by
|
||||
// the protocol compiler.
|
||||
optional bool message_set_wire_format = 1 [default=false];
|
||||
optional bool message_set_wire_format = 1 [default = false];
|
||||
|
||||
// Disables the generation of the standard "descriptor()" accessor, which can
|
||||
// conflict with a field of the same name. This is meant to make migration
|
||||
// from proto1 easier; new code should avoid fields named "descriptor".
|
||||
optional bool no_standard_descriptor_accessor = 2 [default=false];
|
||||
optional bool no_standard_descriptor_accessor = 2 [default = false];
|
||||
|
||||
// Is this message deprecated?
|
||||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for the message, or it will be completely ignored; in the very least,
|
||||
// this is a formalization for deprecating messages.
|
||||
optional bool deprecated = 3 [default=false];
|
||||
optional bool deprecated = 3 [default = false];
|
||||
|
||||
// Whether the message is an automatically generated map entry type for the
|
||||
// maps field.
|
||||
@@ -486,7 +487,7 @@ message MessageOptions {
|
||||
//
|
||||
// Implementations may choose not to generate the map_entry=true message, but
|
||||
// use a native map in the target language to hold the keys and values.
|
||||
// The reflection APIs in such implementions still need to work as
|
||||
// The reflection APIs in such implementations still need to work as
|
||||
// if the field is a repeated message field.
|
||||
//
|
||||
// NOTE: Do not set the option in .proto files. Always use the maps syntax
|
||||
@@ -497,6 +498,7 @@ message MessageOptions {
|
||||
//reserved 8; // javalite_serializable
|
||||
//reserved 9; // javanano_as_lite
|
||||
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
|
||||
@@ -576,16 +578,16 @@ message FieldOptions {
|
||||
// implementation must either *always* check its required fields, or *never*
|
||||
// check its required fields, regardless of whether or not the message has
|
||||
// been parsed.
|
||||
optional bool lazy = 5 [default=false];
|
||||
optional bool lazy = 5 [default = false];
|
||||
|
||||
// Is this field deprecated?
|
||||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for accessors, or it will be completely ignored; in the very least, this
|
||||
// is a formalization for deprecating fields.
|
||||
optional bool deprecated = 3 [default=false];
|
||||
optional bool deprecated = 3 [default = false];
|
||||
|
||||
// For Google-internal migration only. Do not use.
|
||||
optional bool weak = 10 [default=false];
|
||||
optional bool weak = 10 [default = false];
|
||||
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
@@ -615,7 +617,7 @@ message EnumOptions {
|
||||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for the enum, or it will be completely ignored; in the very least, this
|
||||
// is a formalization for deprecating enums.
|
||||
optional bool deprecated = 3 [default=false];
|
||||
optional bool deprecated = 3 [default = false];
|
||||
|
||||
//reserved 5; // javanano_as_lite
|
||||
|
||||
@@ -631,7 +633,7 @@ message EnumValueOptions {
|
||||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for the enum value, or it will be completely ignored; in the very least,
|
||||
// this is a formalization for deprecating enum values.
|
||||
optional bool deprecated = 1 [default=false];
|
||||
optional bool deprecated = 1 [default = false];
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
@@ -651,7 +653,7 @@ message ServiceOptions {
|
||||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for the service, or it will be completely ignored; in the very least,
|
||||
// this is a formalization for deprecating services.
|
||||
optional bool deprecated = 33 [default=false];
|
||||
optional bool deprecated = 33 [default = false];
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
@@ -671,18 +673,18 @@ message MethodOptions {
|
||||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for the method, or it will be completely ignored; in the very least,
|
||||
// this is a formalization for deprecating methods.
|
||||
optional bool deprecated = 33 [default=false];
|
||||
optional bool deprecated = 33 [default = false];
|
||||
|
||||
// Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
|
||||
// or neither? HTTP based RPC implementation may choose GET verb for safe
|
||||
// methods, and PUT verb for idempotent methods instead of the default POST.
|
||||
enum IdempotencyLevel {
|
||||
IDEMPOTENCY_UNKNOWN = 0;
|
||||
NO_SIDE_EFFECTS = 1; // implies idempotent
|
||||
IDEMPOTENT = 2; // idempotent, but may have side effects
|
||||
NO_SIDE_EFFECTS = 1; // implies idempotent
|
||||
IDEMPOTENT = 2; // idempotent, but may have side effects
|
||||
}
|
||||
optional IdempotencyLevel idempotency_level =
|
||||
34 [default=IDEMPOTENCY_UNKNOWN];
|
||||
optional IdempotencyLevel idempotency_level = 34
|
||||
[default = IDEMPOTENCY_UNKNOWN];
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
@@ -763,7 +765,7 @@ message SourceCodeInfo {
|
||||
// beginning of the "extend" block and is shared by all extensions within
|
||||
// the block.
|
||||
// - Just because a location's span is a subset of some other location's span
|
||||
// does not mean that it is a descendent. For example, a "group" defines
|
||||
// does not mean that it is a descendant. For example, a "group" defines
|
||||
// both a type and a field in a single declaration. Thus, the locations
|
||||
// corresponding to the type and field and their components will overlap.
|
||||
// - Code which tries to interpret locations should probably be designed to
|
||||
@@ -794,14 +796,14 @@ message SourceCodeInfo {
|
||||
// [ 4, 3, 2, 7 ]
|
||||
// this path refers to the whole field declaration (from the beginning
|
||||
// of the label to the terminating semicolon).
|
||||
repeated int32 path = 1 [packed=true];
|
||||
repeated int32 path = 1 [packed = true];
|
||||
|
||||
// Always has exactly three or four elements: start line, start column,
|
||||
// end line (optional, otherwise assumed same as start line), end column.
|
||||
// These are packed into a single field for efficiency. Note that line
|
||||
// and column numbers are zero-based -- typically you will want to add
|
||||
// 1 to each before displaying to a user.
|
||||
repeated int32 span = 2 [packed=true];
|
||||
repeated int32 span = 2 [packed = true];
|
||||
|
||||
// If this SourceCodeInfo represents a complete declaration, these are any
|
||||
// comments appearing before and after the declaration which appear to be
|
||||
@@ -866,7 +868,7 @@ message GeneratedCodeInfo {
|
||||
message Annotation {
|
||||
// Identifies the element in the original source .proto file. This field
|
||||
// is formatted the same as SourceCodeInfo.Location.path.
|
||||
repeated int32 path = 1 [packed=true];
|
||||
repeated int32 path = 1 [packed = true];
|
||||
|
||||
// Identifies the filesystem path to the original source .proto.
|
||||
optional string source_file = 2;
|
||||
|
||||
1
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/duration.proto
generated
vendored
1
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/duration.proto
generated
vendored
@@ -101,7 +101,6 @@ option objc_class_prefix = "GPB";
|
||||
//
|
||||
//
|
||||
message Duration {
|
||||
|
||||
// Signed seconds of the span of time. Must be from -315,576,000,000
|
||||
// to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
||||
// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
||||
|
||||
1
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/struct.proto
generated
vendored
1
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/struct.proto
generated
vendored
@@ -40,7 +40,6 @@ option java_outer_classname = "StructProto";
|
||||
option java_multiple_files = true;
|
||||
option objc_class_prefix = "GPB";
|
||||
|
||||
|
||||
// `Struct` represents a structured data value, consisting of fields
|
||||
// which map to dynamically typed values. In some languages, `Struct`
|
||||
// might be supported by a native representation. For example, in
|
||||
|
||||
11
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/timestamp.proto
generated
vendored
11
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/timestamp.proto
generated
vendored
@@ -113,17 +113,18 @@ option objc_class_prefix = "GPB";
|
||||
// 01:30 UTC on January 15, 2017.
|
||||
//
|
||||
// In JavaScript, one can convert a Date object to this format using the
|
||||
// standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
||||
// standard
|
||||
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
||||
// method. In Python, a standard `datetime.datetime` object can be converted
|
||||
// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
|
||||
// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
||||
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
// to this format using
|
||||
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
||||
// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
||||
// the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
||||
// ) to obtain a formatter capable of generating timestamps in this format.
|
||||
//
|
||||
//
|
||||
message Timestamp {
|
||||
|
||||
// Represents seconds of UTC time since Unix epoch
|
||||
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
||||
// 9999-12-31T23:59:59Z inclusive.
|
||||
|
||||
40
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/type.proto
generated
vendored
40
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/type.proto
generated
vendored
@@ -64,44 +64,44 @@ message Field {
|
||||
// Basic field types.
|
||||
enum Kind {
|
||||
// Field type unknown.
|
||||
TYPE_UNKNOWN = 0;
|
||||
TYPE_UNKNOWN = 0;
|
||||
// Field type double.
|
||||
TYPE_DOUBLE = 1;
|
||||
TYPE_DOUBLE = 1;
|
||||
// Field type float.
|
||||
TYPE_FLOAT = 2;
|
||||
TYPE_FLOAT = 2;
|
||||
// Field type int64.
|
||||
TYPE_INT64 = 3;
|
||||
TYPE_INT64 = 3;
|
||||
// Field type uint64.
|
||||
TYPE_UINT64 = 4;
|
||||
TYPE_UINT64 = 4;
|
||||
// Field type int32.
|
||||
TYPE_INT32 = 5;
|
||||
TYPE_INT32 = 5;
|
||||
// Field type fixed64.
|
||||
TYPE_FIXED64 = 6;
|
||||
TYPE_FIXED64 = 6;
|
||||
// Field type fixed32.
|
||||
TYPE_FIXED32 = 7;
|
||||
TYPE_FIXED32 = 7;
|
||||
// Field type bool.
|
||||
TYPE_BOOL = 8;
|
||||
TYPE_BOOL = 8;
|
||||
// Field type string.
|
||||
TYPE_STRING = 9;
|
||||
TYPE_STRING = 9;
|
||||
// Field type group. Proto2 syntax only, and deprecated.
|
||||
TYPE_GROUP = 10;
|
||||
TYPE_GROUP = 10;
|
||||
// Field type message.
|
||||
TYPE_MESSAGE = 11;
|
||||
TYPE_MESSAGE = 11;
|
||||
// Field type bytes.
|
||||
TYPE_BYTES = 12;
|
||||
TYPE_BYTES = 12;
|
||||
// Field type uint32.
|
||||
TYPE_UINT32 = 13;
|
||||
TYPE_UINT32 = 13;
|
||||
// Field type enum.
|
||||
TYPE_ENUM = 14;
|
||||
TYPE_ENUM = 14;
|
||||
// Field type sfixed32.
|
||||
TYPE_SFIXED32 = 15;
|
||||
TYPE_SFIXED32 = 15;
|
||||
// Field type sfixed64.
|
||||
TYPE_SFIXED64 = 16;
|
||||
TYPE_SFIXED64 = 16;
|
||||
// Field type sint32.
|
||||
TYPE_SINT32 = 17;
|
||||
TYPE_SINT32 = 17;
|
||||
// Field type sint64.
|
||||
TYPE_SINT64 = 18;
|
||||
};
|
||||
TYPE_SINT64 = 18;
|
||||
}
|
||||
|
||||
// Whether a field is optional, required, or repeated.
|
||||
enum Cardinality {
|
||||
|
||||
10
vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go
generated
vendored
10
vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go
generated
vendored
@@ -18,7 +18,7 @@ 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 _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
type FieldDescriptorProto_Type int32
|
||||
|
||||
@@ -1364,8 +1364,8 @@ type FileOptions struct {
|
||||
// determining the namespace.
|
||||
PhpNamespace *string `protobuf:"bytes,41,opt,name=php_namespace,json=phpNamespace" json:"php_namespace,omitempty"`
|
||||
// Use this option to change the namespace of php generated metadata classes.
|
||||
// Default is empty. When this option is empty, the proto file name will be used
|
||||
// for determining the namespace.
|
||||
// Default is empty. When this option is empty, the proto file name will be
|
||||
// used for determining the namespace.
|
||||
PhpMetadataNamespace *string `protobuf:"bytes,44,opt,name=php_metadata_namespace,json=phpMetadataNamespace" json:"php_metadata_namespace,omitempty"`
|
||||
// Use this option to change the package of ruby generated classes. Default
|
||||
// is empty. When this option is not set, the package name will be used for
|
||||
@@ -1615,7 +1615,7 @@ type MessageOptions struct {
|
||||
//
|
||||
// Implementations may choose not to generate the map_entry=true message, but
|
||||
// use a native map in the target language to hold the keys and values.
|
||||
// The reflection APIs in such implementions still need to work as
|
||||
// The reflection APIs in such implementations still need to work as
|
||||
// if the field is a repeated message field.
|
||||
//
|
||||
// NOTE: Do not set the option in .proto files. Always use the maps syntax
|
||||
@@ -2363,7 +2363,7 @@ type SourceCodeInfo struct {
|
||||
// beginning of the "extend" block and is shared by all extensions within
|
||||
// the block.
|
||||
// - Just because a location's span is a subset of some other location's span
|
||||
// does not mean that it is a descendent. For example, a "group" defines
|
||||
// does not mean that it is a descendant. For example, a "group" defines
|
||||
// both a type and a field in a single declaration. Thus, the locations
|
||||
// corresponding to the type and field and their components will overlap.
|
||||
// - Code which tries to interpret locations should probably be designed to
|
||||
|
||||
499
vendor/github.com/gogo/protobuf/protoc-gen-gogo/generator/generator.go
generated
vendored
499
vendor/github.com/gogo/protobuf/protoc-gen-gogo/generator/generator.go
generated
vendored
@@ -73,7 +73,7 @@ import (
|
||||
// It is incremented whenever an incompatibility between the generated code and
|
||||
// proto package is introduced; the generated code references
|
||||
// a constant, proto.ProtoPackageIsVersionN (where N is generatedCodeVersion).
|
||||
const generatedCodeVersion = 2
|
||||
const generatedCodeVersion = 3
|
||||
|
||||
// A Plugin provides functionality to add to the output during Go code generation,
|
||||
// such as to produce RPC stubs.
|
||||
@@ -482,6 +482,7 @@ func New() *Generator {
|
||||
g.Request = new(plugin.CodeGeneratorRequest)
|
||||
g.Response = new(plugin.CodeGeneratorResponse)
|
||||
g.writtenImports = make(map[string]bool)
|
||||
g.addedImports = make(map[GoImportPath]bool)
|
||||
return g
|
||||
}
|
||||
|
||||
@@ -2232,391 +2233,14 @@ type oneofSubField struct {
|
||||
getterDef string // Default for getters, e.g. "nil", `""` or "Default_MessageType_FieldName"
|
||||
protoDef string // Default value as defined in the proto file, e.g "yoshi" or "5"
|
||||
deprecated string // Deprecation comment, if any.
|
||||
wireType string // gogo. We can set this on creation, instead of using a function
|
||||
}
|
||||
|
||||
// wireTypeName returns a textual wire type, needed for oneof sub fields in generated code.
|
||||
func (f *oneofSubField) wireTypeName() string {
|
||||
return f.wireType
|
||||
}
|
||||
|
||||
// typedNil prints a nil casted to the pointer to this field.
|
||||
// - for XXX_OneofFuncs
|
||||
// - for XXX_OneofWrappers
|
||||
func (f *oneofSubField) typedNil(g *Generator) {
|
||||
g.P("(*", f.oneofTypeName, ")(nil),")
|
||||
}
|
||||
|
||||
// marshalCase prints the case matching this oneof subfield in the marshalling code.
|
||||
func (f *oneofSubField) marshalCase(g *Generator, mc *msgCtx) {
|
||||
// if field.OneofIndex == nil || int(*field.OneofIndex) != oi {
|
||||
// continue
|
||||
// }
|
||||
g.P("case *", f.oneofTypeName, ":")
|
||||
var pre, post string
|
||||
val := "x." + f.goName // overridden for TYPE_BOOL
|
||||
canFail := false // only TYPE_MESSAGE and TYPE_GROUP can fail
|
||||
switch f.protoType {
|
||||
case descriptor.FieldDescriptorProto_TYPE_DOUBLE:
|
||||
pre = "b.EncodeFixed64(" + g.Pkg["math"] + ".Float64bits("
|
||||
post = "))"
|
||||
case descriptor.FieldDescriptorProto_TYPE_FLOAT:
|
||||
pre = "b.EncodeFixed32(uint64(" + g.Pkg["math"] + ".Float32bits("
|
||||
post = ")))"
|
||||
case descriptor.FieldDescriptorProto_TYPE_INT64,
|
||||
descriptor.FieldDescriptorProto_TYPE_UINT64:
|
||||
pre, post = "b.EncodeVarint(uint64(", "))"
|
||||
case descriptor.FieldDescriptorProto_TYPE_INT32,
|
||||
descriptor.FieldDescriptorProto_TYPE_UINT32,
|
||||
descriptor.FieldDescriptorProto_TYPE_ENUM:
|
||||
pre, post = "b.EncodeVarint(uint64(", "))"
|
||||
case descriptor.FieldDescriptorProto_TYPE_FIXED64,
|
||||
descriptor.FieldDescriptorProto_TYPE_SFIXED64:
|
||||
pre, post = "b.EncodeFixed64(uint64(", "))"
|
||||
case descriptor.FieldDescriptorProto_TYPE_FIXED32,
|
||||
descriptor.FieldDescriptorProto_TYPE_SFIXED32:
|
||||
pre, post = "b.EncodeFixed32(uint64(", "))"
|
||||
case descriptor.FieldDescriptorProto_TYPE_BOOL:
|
||||
// bool needs special handling.
|
||||
g.P("t := uint64(0)")
|
||||
g.P("if ", val, " { t = 1 }")
|
||||
val = "t"
|
||||
pre, post = "b.EncodeVarint(", ")"
|
||||
case descriptor.FieldDescriptorProto_TYPE_STRING:
|
||||
pre, post = "b.EncodeStringBytes(", ")"
|
||||
case descriptor.FieldDescriptorProto_TYPE_GROUP:
|
||||
pre, post = "b.Marshal(", ")"
|
||||
canFail = true
|
||||
case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
|
||||
pre, post = "b.EncodeMessage(", ")"
|
||||
canFail = true
|
||||
case descriptor.FieldDescriptorProto_TYPE_BYTES:
|
||||
pre, post = "b.EncodeRawBytes(", ")"
|
||||
case descriptor.FieldDescriptorProto_TYPE_SINT32:
|
||||
pre, post = "b.EncodeZigzag32(uint64(", "))"
|
||||
case descriptor.FieldDescriptorProto_TYPE_SINT64:
|
||||
pre, post = "b.EncodeZigzag64(uint64(", "))"
|
||||
default:
|
||||
g.Fail("unhandled oneof field type ", f.protoType.String())
|
||||
}
|
||||
g.P("_ = b.EncodeVarint(", f.fieldNumber, "<<3|", g.Pkg["proto"], ".", f.wireTypeName(), ")")
|
||||
if f.protoType == descriptor.FieldDescriptorProto_TYPE_BYTES && gogoproto.IsCustomType(f.protoField) {
|
||||
g.P(`dAtA, err := `, val, `.Marshal()`)
|
||||
g.P(`if err != nil {`)
|
||||
g.In()
|
||||
g.P(`return err`)
|
||||
g.Out()
|
||||
g.P(`}`)
|
||||
val = "dAtA"
|
||||
} else if gogoproto.IsStdType(f.protoField) {
|
||||
pkg := g.useTypes()
|
||||
ptr := ""
|
||||
fnname := ""
|
||||
if gogoproto.IsNullable(f.protoField) {
|
||||
ptr = "*"
|
||||
}
|
||||
if gogoproto.IsStdTime(f.protoField) {
|
||||
fnname = "Time"
|
||||
} else if gogoproto.IsStdDuration(f.protoField) {
|
||||
fnname = "Duration"
|
||||
} else if gogoproto.IsStdDouble(f.protoField) {
|
||||
fnname = "Double"
|
||||
} else if gogoproto.IsStdFloat(f.protoField) {
|
||||
fnname = "Float"
|
||||
} else if gogoproto.IsStdInt64(f.protoField) {
|
||||
fnname = "Int64"
|
||||
} else if gogoproto.IsStdUInt64(f.protoField) {
|
||||
fnname = "UInt64"
|
||||
} else if gogoproto.IsStdInt32(f.protoField) {
|
||||
fnname = "Int32"
|
||||
} else if gogoproto.IsStdUInt32(f.protoField) {
|
||||
fnname = "UInt32"
|
||||
} else if gogoproto.IsStdBool(f.protoField) {
|
||||
fnname = "Bool"
|
||||
} else if gogoproto.IsStdString(f.protoField) {
|
||||
fnname = "String"
|
||||
} else if gogoproto.IsStdBytes(f.protoField) {
|
||||
fnname = "Bytes"
|
||||
} else {
|
||||
panic("internal error")
|
||||
}
|
||||
g.P(`dAtA, err := `, pkg, `.Std`, fnname, `Marshal(`, ptr, val, `)`)
|
||||
g.P(`if err != nil {`)
|
||||
g.In()
|
||||
g.P(`return err`)
|
||||
g.Out()
|
||||
g.P(`}`)
|
||||
val = "dAtA"
|
||||
pre, post = "b.EncodeRawBytes(", ")"
|
||||
}
|
||||
if !canFail {
|
||||
g.P("_ = ", pre, val, post)
|
||||
} else {
|
||||
g.P("if err := ", pre, val, post, "; err != nil {")
|
||||
g.In()
|
||||
g.P("return err")
|
||||
g.Out()
|
||||
g.P("}")
|
||||
}
|
||||
if f.protoType == descriptor.FieldDescriptorProto_TYPE_GROUP {
|
||||
g.P("_ = b.EncodeVarint(", f.fieldNumber, "<<3|", g.Pkg["proto"], ".WireEndGroup)")
|
||||
}
|
||||
}
|
||||
|
||||
// unmarshalCase prints the case matching this oneof subfield in the unmarshalling code.
|
||||
func (f *oneofSubField) unmarshalCase(g *Generator, origOneofName string, oneofName string, mc *msgCtx) {
|
||||
// if field.OneofIndex == nil {
|
||||
// continue
|
||||
// }
|
||||
g.P("case ", f.fieldNumber, ": // ", origOneofName, ".", f.getProtoName())
|
||||
g.P("if wire != ", g.Pkg["proto"], ".", f.wireTypeName(), " {")
|
||||
g.P("return true, ", g.Pkg["proto"], ".ErrInternalBadWireType")
|
||||
g.P("}")
|
||||
lhs := "x, err" // overridden for TYPE_MESSAGE and TYPE_GROUP
|
||||
var dec, cast, cast2 string
|
||||
switch f.protoType {
|
||||
case descriptor.FieldDescriptorProto_TYPE_DOUBLE:
|
||||
dec, cast = "b.DecodeFixed64()", g.Pkg["math"]+".Float64frombits"
|
||||
case descriptor.FieldDescriptorProto_TYPE_FLOAT:
|
||||
dec, cast, cast2 = "b.DecodeFixed32()", "uint32", g.Pkg["math"]+".Float32frombits"
|
||||
case descriptor.FieldDescriptorProto_TYPE_INT64:
|
||||
dec, cast = "b.DecodeVarint()", "int64"
|
||||
case descriptor.FieldDescriptorProto_TYPE_UINT64:
|
||||
dec = "b.DecodeVarint()"
|
||||
case descriptor.FieldDescriptorProto_TYPE_INT32:
|
||||
dec, cast = "b.DecodeVarint()", "int32"
|
||||
case descriptor.FieldDescriptorProto_TYPE_FIXED64:
|
||||
dec = "b.DecodeFixed64()"
|
||||
case descriptor.FieldDescriptorProto_TYPE_FIXED32:
|
||||
dec, cast = "b.DecodeFixed32()", "uint32"
|
||||
case descriptor.FieldDescriptorProto_TYPE_BOOL:
|
||||
dec = "b.DecodeVarint()"
|
||||
// handled specially below
|
||||
case descriptor.FieldDescriptorProto_TYPE_STRING:
|
||||
dec = "b.DecodeStringBytes()"
|
||||
case descriptor.FieldDescriptorProto_TYPE_GROUP:
|
||||
g.P("msg := new(", f.goType[1:], ")") // drop star
|
||||
lhs = "err"
|
||||
dec = "b.DecodeGroup(msg)"
|
||||
// handled specially below
|
||||
case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
|
||||
if gogoproto.IsStdType(f.protoField) {
|
||||
dec = "b.DecodeRawBytes(true)"
|
||||
} else {
|
||||
g.P("msg := new(", f.goType[1:], ")") // drop star
|
||||
lhs = "err"
|
||||
dec = "b.DecodeMessage(msg)"
|
||||
}
|
||||
// handled specially below
|
||||
case descriptor.FieldDescriptorProto_TYPE_BYTES:
|
||||
dec = "b.DecodeRawBytes(true)"
|
||||
case descriptor.FieldDescriptorProto_TYPE_UINT32:
|
||||
dec, cast = "b.DecodeVarint()", "uint32"
|
||||
case descriptor.FieldDescriptorProto_TYPE_ENUM:
|
||||
dec, cast = "b.DecodeVarint()", f.goType
|
||||
case descriptor.FieldDescriptorProto_TYPE_SFIXED32:
|
||||
dec, cast = "b.DecodeFixed32()", "int32"
|
||||
case descriptor.FieldDescriptorProto_TYPE_SFIXED64:
|
||||
dec, cast = "b.DecodeFixed64()", "int64"
|
||||
case descriptor.FieldDescriptorProto_TYPE_SINT32:
|
||||
dec, cast = "b.DecodeZigzag32()", "int32"
|
||||
case descriptor.FieldDescriptorProto_TYPE_SINT64:
|
||||
dec, cast = "b.DecodeZigzag64()", "int64"
|
||||
default:
|
||||
g.Fail("unhandled oneof field type ", f.protoType.String())
|
||||
}
|
||||
g.P(lhs, " := ", dec)
|
||||
val := "x"
|
||||
if f.protoType == descriptor.FieldDescriptorProto_TYPE_BYTES && gogoproto.IsCustomType(f.protoField) {
|
||||
g.P(`if err != nil {`)
|
||||
g.In()
|
||||
g.P(`return true, err`)
|
||||
g.Out()
|
||||
g.P(`}`)
|
||||
_, ctyp, err := GetCustomType(f.protoField)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
g.P(`var cc `, ctyp)
|
||||
g.P(`c := &cc`)
|
||||
g.P(`err = c.Unmarshal(`, val, `)`)
|
||||
val = "*c"
|
||||
} else if gogoproto.IsStdType(f.protoField) {
|
||||
var stdtype string
|
||||
var fnname string
|
||||
if gogoproto.IsStdTime(f.protoField) {
|
||||
stdtype = "time.Time"
|
||||
fnname = "Time"
|
||||
} else if gogoproto.IsStdDuration(f.protoField) {
|
||||
stdtype = "time.Duration"
|
||||
fnname = "Duration"
|
||||
} else if gogoproto.IsStdDouble(f.protoField) {
|
||||
stdtype = "float64"
|
||||
fnname = "Double"
|
||||
} else if gogoproto.IsStdFloat(f.protoField) {
|
||||
stdtype = "float32"
|
||||
fnname = "Float"
|
||||
} else if gogoproto.IsStdInt64(f.protoField) {
|
||||
stdtype = "int64"
|
||||
fnname = "Int64"
|
||||
} else if gogoproto.IsStdUInt64(f.protoField) {
|
||||
stdtype = "uint64"
|
||||
fnname = "UInt64"
|
||||
} else if gogoproto.IsStdInt32(f.protoField) {
|
||||
stdtype = "int32"
|
||||
fnname = "Int32"
|
||||
} else if gogoproto.IsStdUInt32(f.protoField) {
|
||||
stdtype = "uint32"
|
||||
fnname = "UInt32"
|
||||
} else if gogoproto.IsStdBool(f.protoField) {
|
||||
stdtype = "bool"
|
||||
fnname = "Bool"
|
||||
} else if gogoproto.IsStdString(f.protoField) {
|
||||
stdtype = "string"
|
||||
fnname = "String"
|
||||
} else if gogoproto.IsStdBytes(f.protoField) {
|
||||
stdtype = "[]byte"
|
||||
fnname = "Bytes"
|
||||
} else {
|
||||
panic("internal error")
|
||||
}
|
||||
|
||||
pkg := g.useTypes()
|
||||
g.P(`if err != nil {`)
|
||||
g.In()
|
||||
g.P(`return true, err`)
|
||||
g.Out()
|
||||
g.P(`}`)
|
||||
g.P(`c := new(`, stdtype, `)`)
|
||||
g.P(`if err2 := `, pkg, `.Std`, fnname, `Unmarshal(c, `, val, `); err2 != nil {`)
|
||||
g.In()
|
||||
g.P(`return true, err`)
|
||||
g.Out()
|
||||
g.P(`}`)
|
||||
val = "c"
|
||||
}
|
||||
if cast != "" {
|
||||
val = cast + "(" + val + ")"
|
||||
}
|
||||
if cast2 != "" {
|
||||
val = cast2 + "(" + val + ")"
|
||||
}
|
||||
switch f.protoType {
|
||||
case descriptor.FieldDescriptorProto_TYPE_BOOL:
|
||||
val += " != 0"
|
||||
case descriptor.FieldDescriptorProto_TYPE_GROUP,
|
||||
descriptor.FieldDescriptorProto_TYPE_MESSAGE:
|
||||
if !gogoproto.IsStdType(f.protoField) {
|
||||
val = "msg"
|
||||
}
|
||||
}
|
||||
if gogoproto.IsCastType(f.protoField) {
|
||||
_, typ, err := getCastType(f.protoField)
|
||||
if err != nil {
|
||||
g.Fail(err.Error())
|
||||
}
|
||||
val = typ + "(" + val + ")"
|
||||
}
|
||||
g.P("m.", oneofName, " = &", f.oneofTypeName, "{", val, "}")
|
||||
g.P("return true, err")
|
||||
}
|
||||
|
||||
// sizerCase prints the case matching this oneof subfield in the sizer code.
|
||||
func (f *oneofSubField) sizerCase(g *Generator) {
|
||||
// if field.OneofIndex == nil || int(*field.OneofIndex) != oi {
|
||||
// continue
|
||||
// }
|
||||
g.P("case *", f.oneofTypeName, ":")
|
||||
val := "x." + f.goName
|
||||
var varint, fixed string
|
||||
switch f.protoType {
|
||||
case descriptor.FieldDescriptorProto_TYPE_DOUBLE:
|
||||
fixed = "8"
|
||||
case descriptor.FieldDescriptorProto_TYPE_FLOAT:
|
||||
fixed = "4"
|
||||
case descriptor.FieldDescriptorProto_TYPE_INT64,
|
||||
descriptor.FieldDescriptorProto_TYPE_UINT64,
|
||||
descriptor.FieldDescriptorProto_TYPE_INT32,
|
||||
descriptor.FieldDescriptorProto_TYPE_UINT32,
|
||||
descriptor.FieldDescriptorProto_TYPE_ENUM:
|
||||
varint = val
|
||||
case descriptor.FieldDescriptorProto_TYPE_FIXED64,
|
||||
descriptor.FieldDescriptorProto_TYPE_SFIXED64:
|
||||
fixed = "8"
|
||||
case descriptor.FieldDescriptorProto_TYPE_FIXED32,
|
||||
descriptor.FieldDescriptorProto_TYPE_SFIXED32:
|
||||
fixed = "4"
|
||||
case descriptor.FieldDescriptorProto_TYPE_BOOL:
|
||||
fixed = "1"
|
||||
case descriptor.FieldDescriptorProto_TYPE_STRING:
|
||||
fixed = "len(" + val + ")"
|
||||
varint = fixed
|
||||
case descriptor.FieldDescriptorProto_TYPE_GROUP:
|
||||
fixed = g.Pkg["proto"] + ".Size(" + val + ")"
|
||||
case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
|
||||
if gogoproto.IsStdType(f.protoField) {
|
||||
pkg := g.useTypes()
|
||||
if gogoproto.IsNullable(f.protoField) {
|
||||
val = "*" + val
|
||||
}
|
||||
if gogoproto.IsStdTime(f.protoField) {
|
||||
g.P("s := ", pkg, ".SizeOfStdTime(", val, ")")
|
||||
} else if gogoproto.IsStdDuration(f.protoField) {
|
||||
g.P("s := ", pkg, ".SizeOfStdDuration(", val, ")")
|
||||
} else if gogoproto.IsStdDouble(f.protoField) {
|
||||
g.P("s := ", pkg, ".SizeOfStdDouble(", val, ")")
|
||||
} else if gogoproto.IsStdFloat(f.protoField) {
|
||||
g.P("s := ", pkg, ".SizeOfStdFloat(", val, ")")
|
||||
} else if gogoproto.IsStdInt64(f.protoField) {
|
||||
g.P("s := ", pkg, ".SizeOfStdInt64(", val, ")")
|
||||
} else if gogoproto.IsStdUInt64(f.protoField) {
|
||||
g.P("s := ", pkg, ".SizeOfStdUInt64(", val, ")")
|
||||
} else if gogoproto.IsStdInt32(f.protoField) {
|
||||
g.P("s := ", pkg, ".SizeOfStdInt32(", val, ")")
|
||||
} else if gogoproto.IsStdUInt32(f.protoField) {
|
||||
g.P("s := ", pkg, ".SizeOfStdUInt32(", val, ")")
|
||||
} else if gogoproto.IsStdBool(f.protoField) {
|
||||
g.P("s := ", pkg, ".SizeOfStdBool(", val, ")")
|
||||
} else if gogoproto.IsStdString(f.protoField) {
|
||||
g.P("s := ", pkg, ".SizeOfStdString(", val, ")")
|
||||
} else if gogoproto.IsStdBytes(f.protoField) {
|
||||
g.P("s := ", pkg, ".SizeOfStdBytes(", val, ")")
|
||||
} else {
|
||||
panic("internal error")
|
||||
}
|
||||
} else {
|
||||
g.P("s := ", g.Pkg["proto"], ".Size(", val, ")")
|
||||
}
|
||||
fixed = "s"
|
||||
varint = fixed
|
||||
case descriptor.FieldDescriptorProto_TYPE_BYTES:
|
||||
if gogoproto.IsCustomType(f.protoField) {
|
||||
fixed = val + ".Size()"
|
||||
} else {
|
||||
fixed = "len(" + val + ")"
|
||||
}
|
||||
varint = fixed
|
||||
case descriptor.FieldDescriptorProto_TYPE_SINT32:
|
||||
varint = "(uint32(" + val + ") << 1) ^ uint32((int32(" + val + ") >> 31))"
|
||||
case descriptor.FieldDescriptorProto_TYPE_SINT64:
|
||||
varint = "uint64(" + val + " << 1) ^ uint64((int64(" + val + ") >> 63))"
|
||||
default:
|
||||
g.Fail("unhandled oneof field type ", f.protoType.String())
|
||||
}
|
||||
// Tag and wire varint is known statically,
|
||||
// so don't generate code for that part of the size computation.
|
||||
tagAndWireSize := proto.SizeVarint(uint64(f.fieldNumber << 3)) // wire doesn't affect varint size
|
||||
g.P("n += ", tagAndWireSize, " // tag and wire")
|
||||
if varint != "" {
|
||||
g.P("n += ", g.Pkg["proto"], ".SizeVarint(uint64(", varint, "))")
|
||||
}
|
||||
if fixed != "" {
|
||||
g.P("n += ", fixed)
|
||||
}
|
||||
if f.protoType == descriptor.FieldDescriptorProto_TYPE_GROUP {
|
||||
g.P("n += ", tagAndWireSize, " // tag and wire")
|
||||
}
|
||||
}
|
||||
|
||||
// getProtoDef returns the default value explicitly stated in the proto file, e.g "yoshi" or "5".
|
||||
func (f *oneofSubField) getProtoDef() string {
|
||||
return f.protoDef
|
||||
@@ -2895,17 +2519,11 @@ func (g *Generator) generateOneofFuncs(mc *msgCtx, topLevelFields []topLevelFiel
|
||||
if len(ofields) == 0 {
|
||||
return
|
||||
}
|
||||
enc := "_" + mc.goName + "_OneofMarshaler"
|
||||
dec := "_" + mc.goName + "_OneofUnmarshaler"
|
||||
size := "_" + mc.goName + "_OneofSizer"
|
||||
encSig := "(msg " + g.Pkg["proto"] + ".Message, b *" + g.Pkg["proto"] + ".Buffer) error"
|
||||
decSig := "(msg " + g.Pkg["proto"] + ".Message, tag, wire int, b *" + g.Pkg["proto"] + ".Buffer) (bool, error)"
|
||||
sizeSig := "(msg " + g.Pkg["proto"] + ".Message) (n int)"
|
||||
|
||||
// OneofFuncs
|
||||
g.P("// XXX_OneofFuncs is for the internal use of the proto package.")
|
||||
g.P("func (*", mc.goName, ") XXX_OneofFuncs() (func", encSig, ", func", decSig, ", func", sizeSig, ", []interface{}) {")
|
||||
g.P("return ", enc, ", ", dec, ", ", size, ", []interface{}{")
|
||||
g.P("// XXX_OneofWrappers is for the internal use of the proto package.")
|
||||
g.P("func (*", mc.goName, ") XXX_OneofWrappers() []interface{} {")
|
||||
g.P("return []interface{}{")
|
||||
for _, of := range ofields {
|
||||
for _, sf := range of.subFields {
|
||||
sf.typedNil(g)
|
||||
@@ -2914,56 +2532,6 @@ func (g *Generator) generateOneofFuncs(mc *msgCtx, topLevelFields []topLevelFiel
|
||||
g.P("}")
|
||||
g.P("}")
|
||||
g.P()
|
||||
|
||||
// marshaler
|
||||
g.P("func ", enc, encSig, " {")
|
||||
g.P("m := msg.(*", mc.goName, ")")
|
||||
for _, of := range ofields {
|
||||
g.P("// ", of.getProtoName())
|
||||
g.P("switch x := m.", of.goName, ".(type) {")
|
||||
for _, sf := range of.subFields {
|
||||
sf.marshalCase(g, mc)
|
||||
}
|
||||
g.P("case nil:")
|
||||
g.P("default: return ", g.Pkg["fmt"], `.Errorf("`, mc.goName, ".", of.goName, ` has unexpected type %T", x)`)
|
||||
g.P("}")
|
||||
}
|
||||
g.P("return nil")
|
||||
g.P("}")
|
||||
g.P()
|
||||
|
||||
// unmarshaler
|
||||
g.P("func ", dec, decSig, " {")
|
||||
g.P("m := msg.(*", mc.goName, ")")
|
||||
g.P("switch tag {")
|
||||
for _, of := range ofields {
|
||||
for _, sf := range of.subFields {
|
||||
sf.unmarshalCase(g, of.getProtoName(), of.goName, mc)
|
||||
}
|
||||
}
|
||||
g.P("default: return false, nil")
|
||||
g.P("}")
|
||||
g.P("}")
|
||||
g.P()
|
||||
|
||||
// sizer
|
||||
g.P("func ", size, sizeSig, " {")
|
||||
g.P("m := msg.(*", mc.goName, ")")
|
||||
for _, of := range ofields {
|
||||
g.P("// ", of.getProtoName())
|
||||
g.P("switch x := m.", of.goName, ".(type) {")
|
||||
for _, sf := range of.subFields {
|
||||
// also fills in field.wire
|
||||
sf.sizerCase(g)
|
||||
}
|
||||
g.P("case nil:")
|
||||
g.P("default:")
|
||||
g.P("panic(", g.Pkg["fmt"], ".Sprintf(\"proto: unexpected type %T in oneof\", x))")
|
||||
g.P("}")
|
||||
}
|
||||
g.P("return n")
|
||||
g.P("}")
|
||||
g.P()
|
||||
}
|
||||
|
||||
func (g *Generator) generateOneofDecls(mc *msgCtx, topLevelFields []topLevelField) {
|
||||
@@ -3004,16 +2572,17 @@ func (g *Generator) generateOneofDecls(mc *msgCtx, topLevelFields []topLevelFiel
|
||||
if gogoproto.IsProtoSizer(g.file.FileDescriptorProto, mc.message.DescriptorProto) {
|
||||
g.P(`ProtoSize() int`)
|
||||
}
|
||||
if gogoproto.HasCompare(g.file.FileDescriptorProto, mc.message.DescriptorProto) {
|
||||
g.P(`Compare(interface{}) int`)
|
||||
}
|
||||
g.Out()
|
||||
g.P("}")
|
||||
}
|
||||
g.P()
|
||||
for _, of := range ofields {
|
||||
for i, sf := range of.subFields {
|
||||
_, wiretype := g.GoType(mc.message, sf.protoField)
|
||||
tag := "protobuf:" + g.goTag(mc.message, sf.protoField, wiretype)
|
||||
fieldFullPath := fmt.Sprintf("%s,%d,%d", mc.message.path, messageFieldPath, i)
|
||||
g.P("type ", Annotate(mc.message.file, fieldFullPath, sf.oneofTypeName), " struct{ ", Annotate(mc.message.file, fieldFullPath, sf.goName), " ", sf.goType, " `", tag, "` }")
|
||||
g.P("type ", Annotate(mc.message.file, fieldFullPath, sf.oneofTypeName), " struct{ ", Annotate(mc.message.file, fieldFullPath, sf.goName), " ", sf.goType, " `", sf.tags, "` }")
|
||||
if !gogoproto.IsStdType(sf.protoField) && !gogoproto.IsCustomType(sf.protoField) && !gogoproto.IsCastType(sf.protoField) {
|
||||
g.RecordTypeUse(sf.protoField.GetTypeName())
|
||||
}
|
||||
@@ -3147,7 +2716,7 @@ func (g *Generator) generateCommonMethods(mc *msgCtx) {
|
||||
gogoproto.IsUnsafeMarshaler(g.file.FileDescriptorProto, mc.message.DescriptorProto) {
|
||||
if gogoproto.IsStableMarshaler(g.file.FileDescriptorProto, mc.message.DescriptorProto) {
|
||||
g.P("b = b[:cap(b)]")
|
||||
g.P("n, err := m.MarshalTo(b)")
|
||||
g.P("n, err := m.MarshalToSizedBuffer(b)")
|
||||
g.P("if err != nil {")
|
||||
g.In()
|
||||
g.P("return nil, err")
|
||||
@@ -3161,7 +2730,7 @@ func (g *Generator) generateCommonMethods(mc *msgCtx) {
|
||||
g.P("} else {")
|
||||
g.In()
|
||||
g.P("b = b[:cap(b)]")
|
||||
g.P("n, err := m.MarshalTo(b)")
|
||||
g.P("n, err := m.MarshalToSizedBuffer(b)")
|
||||
g.P("if err != nil {")
|
||||
g.In()
|
||||
g.P("return nil, err")
|
||||
@@ -3302,13 +2871,13 @@ func (g *Generator) generateMessage(message *Descriptor) {
|
||||
// when we've computed any disambiguation.
|
||||
|
||||
dname := "is" + goTypeName + "_" + fname
|
||||
tag := `protobuf_oneof:"` + odp.GetName() + `"`
|
||||
oneOftag := `protobuf_oneof:"` + odp.GetName() + `"`
|
||||
of := oneofField{
|
||||
fieldCommon: fieldCommon{
|
||||
goName: fname,
|
||||
getterName: gname,
|
||||
goType: dname,
|
||||
tags: tag,
|
||||
tags: oneOftag,
|
||||
protoName: odp.GetName(),
|
||||
fullPath: oneofFullPath,
|
||||
protoField: field,
|
||||
@@ -3361,7 +2930,6 @@ func (g *Generator) generateMessage(message *Descriptor) {
|
||||
}
|
||||
|
||||
oneofField := oFields[*field.OneofIndex]
|
||||
tag = "protobuf:" + g.goTag(message, field, wiretype)
|
||||
sf := oneofSubField{
|
||||
fieldCommon: fieldCommon{
|
||||
goName: fieldName,
|
||||
@@ -3379,7 +2947,6 @@ func (g *Generator) generateMessage(message *Descriptor) {
|
||||
protoDef: field.GetDefaultValue(),
|
||||
oneofTypeName: tname,
|
||||
deprecated: fieldDeprecated,
|
||||
wireType: wireTypeName(field),
|
||||
}
|
||||
|
||||
oneofField.subFields = append(oneofField.subFields, &sf)
|
||||
@@ -3820,44 +3387,6 @@ func IsScalar(field *descriptor.FieldDescriptorProto) bool {
|
||||
}
|
||||
}
|
||||
|
||||
func wireTypeName(field *descriptor.FieldDescriptorProto) string {
|
||||
switch *field.Type {
|
||||
case descriptor.FieldDescriptorProto_TYPE_DOUBLE:
|
||||
return "WireFixed64"
|
||||
case descriptor.FieldDescriptorProto_TYPE_FLOAT:
|
||||
return "WireFixed32"
|
||||
case descriptor.FieldDescriptorProto_TYPE_INT64,
|
||||
descriptor.FieldDescriptorProto_TYPE_UINT64:
|
||||
return "WireVarint"
|
||||
case descriptor.FieldDescriptorProto_TYPE_INT32,
|
||||
descriptor.FieldDescriptorProto_TYPE_UINT32,
|
||||
descriptor.FieldDescriptorProto_TYPE_ENUM:
|
||||
return "WireVarint"
|
||||
case descriptor.FieldDescriptorProto_TYPE_FIXED64,
|
||||
descriptor.FieldDescriptorProto_TYPE_SFIXED64:
|
||||
return "WireFixed64"
|
||||
case descriptor.FieldDescriptorProto_TYPE_FIXED32,
|
||||
descriptor.FieldDescriptorProto_TYPE_SFIXED32:
|
||||
return "WireFixed32"
|
||||
case descriptor.FieldDescriptorProto_TYPE_BOOL:
|
||||
return "WireVarint"
|
||||
case descriptor.FieldDescriptorProto_TYPE_STRING:
|
||||
return "WireBytes"
|
||||
case descriptor.FieldDescriptorProto_TYPE_GROUP:
|
||||
return "WireStartGroup"
|
||||
case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
|
||||
return "WireBytes"
|
||||
case descriptor.FieldDescriptorProto_TYPE_BYTES:
|
||||
return "WireBytes"
|
||||
case descriptor.FieldDescriptorProto_TYPE_SINT32:
|
||||
return "WireVarint"
|
||||
case descriptor.FieldDescriptorProto_TYPE_SINT64:
|
||||
return "WireVarint"
|
||||
default:
|
||||
return "WireVarint"
|
||||
}
|
||||
}
|
||||
|
||||
// badToUnderscore is the mapping function used to generate Go names from package names,
|
||||
// which can be dotted in the input .proto file. It replaces non-identifier characters such as
|
||||
// dot or dash with underscore.
|
||||
|
||||
1
vendor/github.com/gogo/protobuf/protoc-gen-gogo/generator/helper.go
generated
vendored
1
vendor/github.com/gogo/protobuf/protoc-gen-gogo/generator/helper.go
generated
vendored
@@ -355,6 +355,7 @@ func (g *Generator) generatePlugin(file *FileDescriptor, p Plugin) {
|
||||
g.usedPackages = make(map[GoImportPath]bool)
|
||||
g.packageNames = make(map[GoImportPath]GoPackageName)
|
||||
g.usedPackageNames = make(map[GoPackageName]bool)
|
||||
g.addedImports = make(map[GoImportPath]bool)
|
||||
g.file = file
|
||||
|
||||
// Run the plugins before the imports so we know which imports are necessary.
|
||||
|
||||
61
vendor/github.com/gogo/protobuf/protoc-gen-gogo/grpc/grpc.go
generated
vendored
Normal file → Executable file
61
vendor/github.com/gogo/protobuf/protoc-gen-gogo/grpc/grpc.go
generated
vendored
Normal file → Executable file
@@ -54,6 +54,8 @@ const generatedCodeVersion = 4
|
||||
const (
|
||||
contextPkgPath = "context"
|
||||
grpcPkgPath = "google.golang.org/grpc"
|
||||
codePkgPath = "google.golang.org/grpc/codes"
|
||||
statusPkgPath = "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -215,6 +217,12 @@ func (g *grpc) generateService(file *generator.FileDescriptor, service *pb.Servi
|
||||
g.P("}")
|
||||
g.P()
|
||||
|
||||
// Server Unimplemented struct for forward compatability.
|
||||
if deprecated {
|
||||
g.P(deprecationComment)
|
||||
}
|
||||
g.generateUnimplementedServer(servName, service)
|
||||
|
||||
// Server registration.
|
||||
if deprecated {
|
||||
g.P(deprecationComment)
|
||||
@@ -268,6 +276,35 @@ func (g *grpc) generateService(file *generator.FileDescriptor, service *pb.Servi
|
||||
g.P()
|
||||
}
|
||||
|
||||
// generateUnimplementedServer creates the unimplemented server struct
|
||||
func (g *grpc) generateUnimplementedServer(servName string, service *pb.ServiceDescriptorProto) {
|
||||
serverType := servName + "Server"
|
||||
g.P("// Unimplemented", serverType, " can be embedded to have forward compatible implementations.")
|
||||
g.P("type Unimplemented", serverType, " struct {")
|
||||
g.P("}")
|
||||
g.P()
|
||||
// Unimplemented<service_name>Server's concrete methods
|
||||
for _, method := range service.Method {
|
||||
g.generateServerMethodConcrete(servName, method)
|
||||
}
|
||||
g.P()
|
||||
}
|
||||
|
||||
// generateServerMethodConcrete returns unimplemented methods which ensure forward compatibility
|
||||
func (g *grpc) generateServerMethodConcrete(servName string, method *pb.MethodDescriptorProto) {
|
||||
header := g.generateServerSignatureWithParamNames(servName, method)
|
||||
g.P("func (*Unimplemented", servName, "Server) ", header, " {")
|
||||
var nilArg string
|
||||
if !method.GetServerStreaming() && !method.GetClientStreaming() {
|
||||
nilArg = "nil, "
|
||||
}
|
||||
methName := generator.CamelCase(method.GetName())
|
||||
statusPkg := string(g.gen.AddImport(statusPkgPath))
|
||||
codePkg := string(g.gen.AddImport(codePkgPath))
|
||||
g.P("return ", nilArg, statusPkg, `.Errorf(`, codePkg, `.Unimplemented, "method `, methName, ` not implemented")`)
|
||||
g.P("}")
|
||||
}
|
||||
|
||||
// generateClientSignature returns the client-side signature for a method.
|
||||
func (g *grpc) generateClientSignature(servName string, method *pb.MethodDescriptorProto) string {
|
||||
origMethName := method.GetName()
|
||||
@@ -367,6 +404,30 @@ func (g *grpc) generateClientMethod(servName, fullServName, serviceDescVar strin
|
||||
}
|
||||
}
|
||||
|
||||
// generateServerSignatureWithParamNames returns the server-side signature for a method with parameter names.
|
||||
func (g *grpc) generateServerSignatureWithParamNames(servName string, method *pb.MethodDescriptorProto) string {
|
||||
origMethName := method.GetName()
|
||||
methName := generator.CamelCase(origMethName)
|
||||
if reservedClientName[methName] {
|
||||
methName += "_"
|
||||
}
|
||||
|
||||
var reqArgs []string
|
||||
ret := "error"
|
||||
if !method.GetServerStreaming() && !method.GetClientStreaming() {
|
||||
reqArgs = append(reqArgs, "ctx "+contextPkg+".Context")
|
||||
ret = "(*" + g.typeName(method.GetOutputType()) + ", error)"
|
||||
}
|
||||
if !method.GetClientStreaming() {
|
||||
reqArgs = append(reqArgs, "req *"+g.typeName(method.GetInputType()))
|
||||
}
|
||||
if method.GetServerStreaming() || method.GetClientStreaming() {
|
||||
reqArgs = append(reqArgs, "srv "+servName+"_"+generator.CamelCase(origMethName)+"Server")
|
||||
}
|
||||
|
||||
return methName + "(" + strings.Join(reqArgs, ", ") + ") " + ret
|
||||
}
|
||||
|
||||
// generateServerSignature returns the server-side signature for a method.
|
||||
func (g *grpc) generateServerSignature(servName string, method *pb.MethodDescriptorProto) string {
|
||||
origMethName := method.GetName()
|
||||
|
||||
2
vendor/github.com/gogo/protobuf/protoc-gen-gogo/plugin/plugin.pb.go
generated
vendored
2
vendor/github.com/gogo/protobuf/protoc-gen-gogo/plugin/plugin.pb.go
generated
vendored
@@ -19,7 +19,7 @@ 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 _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// The version number of protocol compiler.
|
||||
type Version struct {
|
||||
|
||||
110
vendor/github.com/gogo/protobuf/types/any.pb.go
generated
vendored
110
vendor/github.com/gogo/protobuf/types/any.pb.go
generated
vendored
@@ -9,6 +9,7 @@ import (
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
reflect "reflect"
|
||||
strings "strings"
|
||||
)
|
||||
@@ -22,7 +23,7 @@ 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 _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// `Any` contains an arbitrary serialized protocol buffer message along with a
|
||||
// URL that describes the type of the serialized message.
|
||||
@@ -155,7 +156,7 @@ func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Any.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -309,7 +310,7 @@ func valueToGoStringAny(v interface{}, typ string) string {
|
||||
func (m *Any) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -317,36 +318,46 @@ func (m *Any) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *Any) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Any) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.TypeUrl) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintAny(dAtA, i, uint64(len(m.TypeUrl)))
|
||||
i += copy(dAtA[i:], m.TypeUrl)
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if len(m.Value) > 0 {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
i -= len(m.Value)
|
||||
copy(dAtA[i:], m.Value)
|
||||
i = encodeVarintAny(dAtA, i, uint64(len(m.Value)))
|
||||
i += copy(dAtA[i:], m.Value)
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
if len(m.TypeUrl) > 0 {
|
||||
i -= len(m.TypeUrl)
|
||||
copy(dAtA[i:], m.TypeUrl)
|
||||
i = encodeVarintAny(dAtA, i, uint64(len(m.TypeUrl)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return i, nil
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintAny(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovAny(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return offset + 1
|
||||
return base
|
||||
}
|
||||
func NewPopulatedAny(r randyAny, easy bool) *Any {
|
||||
this := &Any{}
|
||||
@@ -455,14 +466,7 @@ func (m *Any) Size() (n int) {
|
||||
}
|
||||
|
||||
func sovAny(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozAny(x uint64) (n int) {
|
||||
return sovAny(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
@@ -610,6 +614,7 @@ func (m *Any) Unmarshal(dAtA []byte) error {
|
||||
func skipAny(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -641,10 +646,8 @@ func skipAny(dAtA []byte) (n int, err error) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -665,55 +668,30 @@ func skipAny(dAtA []byte) (n int, err error) {
|
||||
return 0, ErrInvalidLengthAny
|
||||
}
|
||||
iNdEx += length
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthAny
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowAny
|
||||
}
|
||||
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 := skipAny(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthAny
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
depth++
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupAny
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthAny
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthAny = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowAny = fmt.Errorf("proto: integer overflow")
|
||||
ErrInvalidLengthAny = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowAny = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupAny = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
||||
|
||||
399
vendor/github.com/gogo/protobuf/types/api.pb.go
generated
vendored
399
vendor/github.com/gogo/protobuf/types/api.pb.go
generated
vendored
@@ -9,6 +9,7 @@ import (
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
reflect "reflect"
|
||||
strings "strings"
|
||||
)
|
||||
@@ -22,7 +23,7 @@ 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 _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// Api is a light-weight descriptor for an API Interface.
|
||||
//
|
||||
@@ -88,7 +89,7 @@ func (m *Api) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Api.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -194,7 +195,7 @@ func (m *Method) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Method.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -368,7 +369,7 @@ func (m *Mixin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Mixin.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -862,7 +863,7 @@ func valueToGoStringApi(v interface{}, typ string) string {
|
||||
func (m *Api) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -870,83 +871,99 @@ func (m *Api) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *Api) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Api) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Name) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
|
||||
i += copy(dAtA[i:], m.Name)
|
||||
}
|
||||
if len(m.Methods) > 0 {
|
||||
for _, msg := range m.Methods {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
i = encodeVarintApi(dAtA, i, uint64(msg.Size()))
|
||||
n, err := msg.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i += n
|
||||
}
|
||||
}
|
||||
if len(m.Options) > 0 {
|
||||
for _, msg := range m.Options {
|
||||
dAtA[i] = 0x1a
|
||||
i++
|
||||
i = encodeVarintApi(dAtA, i, uint64(msg.Size()))
|
||||
n, err := msg.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i += n
|
||||
}
|
||||
}
|
||||
if len(m.Version) > 0 {
|
||||
dAtA[i] = 0x22
|
||||
i++
|
||||
i = encodeVarintApi(dAtA, i, uint64(len(m.Version)))
|
||||
i += copy(dAtA[i:], m.Version)
|
||||
}
|
||||
if m.SourceContext != nil {
|
||||
dAtA[i] = 0x2a
|
||||
i++
|
||||
i = encodeVarintApi(dAtA, i, uint64(m.SourceContext.Size()))
|
||||
n1, err := m.SourceContext.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i += n1
|
||||
}
|
||||
if len(m.Mixins) > 0 {
|
||||
for _, msg := range m.Mixins {
|
||||
dAtA[i] = 0x32
|
||||
i++
|
||||
i = encodeVarintApi(dAtA, i, uint64(msg.Size()))
|
||||
n, err := msg.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i += n
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if m.Syntax != 0 {
|
||||
dAtA[i] = 0x38
|
||||
i++
|
||||
i = encodeVarintApi(dAtA, i, uint64(m.Syntax))
|
||||
i--
|
||||
dAtA[i] = 0x38
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
if len(m.Mixins) > 0 {
|
||||
for iNdEx := len(m.Mixins) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Mixins[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintApi(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x32
|
||||
}
|
||||
}
|
||||
return i, nil
|
||||
if m.SourceContext != nil {
|
||||
{
|
||||
size, err := m.SourceContext.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintApi(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x2a
|
||||
}
|
||||
if len(m.Version) > 0 {
|
||||
i -= len(m.Version)
|
||||
copy(dAtA[i:], m.Version)
|
||||
i = encodeVarintApi(dAtA, i, uint64(len(m.Version)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(m.Options) > 0 {
|
||||
for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintApi(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
}
|
||||
if len(m.Methods) > 0 {
|
||||
for iNdEx := len(m.Methods) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Methods[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintApi(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
}
|
||||
if len(m.Name) > 0 {
|
||||
i -= len(m.Name)
|
||||
copy(dAtA[i:], m.Name)
|
||||
i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Method) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -954,75 +971,86 @@ func (m *Method) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *Method) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Method) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Name) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
|
||||
i += copy(dAtA[i:], m.Name)
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if len(m.RequestTypeUrl) > 0 {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
i = encodeVarintApi(dAtA, i, uint64(len(m.RequestTypeUrl)))
|
||||
i += copy(dAtA[i:], m.RequestTypeUrl)
|
||||
if m.Syntax != 0 {
|
||||
i = encodeVarintApi(dAtA, i, uint64(m.Syntax))
|
||||
i--
|
||||
dAtA[i] = 0x38
|
||||
}
|
||||
if m.RequestStreaming {
|
||||
dAtA[i] = 0x18
|
||||
i++
|
||||
if m.RequestStreaming {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
if len(m.Options) > 0 {
|
||||
for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintApi(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x32
|
||||
}
|
||||
i++
|
||||
}
|
||||
if len(m.ResponseTypeUrl) > 0 {
|
||||
dAtA[i] = 0x22
|
||||
i++
|
||||
i = encodeVarintApi(dAtA, i, uint64(len(m.ResponseTypeUrl)))
|
||||
i += copy(dAtA[i:], m.ResponseTypeUrl)
|
||||
}
|
||||
if m.ResponseStreaming {
|
||||
dAtA[i] = 0x28
|
||||
i++
|
||||
i--
|
||||
if m.ResponseStreaming {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
}
|
||||
i++
|
||||
i--
|
||||
dAtA[i] = 0x28
|
||||
}
|
||||
if len(m.Options) > 0 {
|
||||
for _, msg := range m.Options {
|
||||
dAtA[i] = 0x32
|
||||
i++
|
||||
i = encodeVarintApi(dAtA, i, uint64(msg.Size()))
|
||||
n, err := msg.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i += n
|
||||
if len(m.ResponseTypeUrl) > 0 {
|
||||
i -= len(m.ResponseTypeUrl)
|
||||
copy(dAtA[i:], m.ResponseTypeUrl)
|
||||
i = encodeVarintApi(dAtA, i, uint64(len(m.ResponseTypeUrl)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if m.RequestStreaming {
|
||||
i--
|
||||
if m.RequestStreaming {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x18
|
||||
}
|
||||
if m.Syntax != 0 {
|
||||
dAtA[i] = 0x38
|
||||
i++
|
||||
i = encodeVarintApi(dAtA, i, uint64(m.Syntax))
|
||||
if len(m.RequestTypeUrl) > 0 {
|
||||
i -= len(m.RequestTypeUrl)
|
||||
copy(dAtA[i:], m.RequestTypeUrl)
|
||||
i = encodeVarintApi(dAtA, i, uint64(len(m.RequestTypeUrl)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
if len(m.Name) > 0 {
|
||||
i -= len(m.Name)
|
||||
copy(dAtA[i:], m.Name)
|
||||
i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return i, nil
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Mixin) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1030,48 +1058,58 @@ func (m *Mixin) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *Mixin) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Mixin) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Name) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
|
||||
i += copy(dAtA[i:], m.Name)
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if len(m.Root) > 0 {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
i -= len(m.Root)
|
||||
copy(dAtA[i:], m.Root)
|
||||
i = encodeVarintApi(dAtA, i, uint64(len(m.Root)))
|
||||
i += copy(dAtA[i:], m.Root)
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
if len(m.Name) > 0 {
|
||||
i -= len(m.Name)
|
||||
copy(dAtA[i:], m.Name)
|
||||
i = encodeVarintApi(dAtA, i, uint64(len(m.Name)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return i, nil
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovApi(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return offset + 1
|
||||
return base
|
||||
}
|
||||
func NewPopulatedApi(r randyApi, easy bool) *Api {
|
||||
this := &Api{}
|
||||
this.Name = string(randStringApi(r))
|
||||
if r.Intn(10) != 0 {
|
||||
if r.Intn(5) != 0 {
|
||||
v1 := r.Intn(5)
|
||||
this.Methods = make([]*Method, v1)
|
||||
for i := 0; i < v1; i++ {
|
||||
this.Methods[i] = NewPopulatedMethod(r, easy)
|
||||
}
|
||||
}
|
||||
if r.Intn(10) != 0 {
|
||||
if r.Intn(5) != 0 {
|
||||
v2 := r.Intn(5)
|
||||
this.Options = make([]*Option, v2)
|
||||
for i := 0; i < v2; i++ {
|
||||
@@ -1079,10 +1117,10 @@ func NewPopulatedApi(r randyApi, easy bool) *Api {
|
||||
}
|
||||
}
|
||||
this.Version = string(randStringApi(r))
|
||||
if r.Intn(10) != 0 {
|
||||
if r.Intn(5) != 0 {
|
||||
this.SourceContext = NewPopulatedSourceContext(r, easy)
|
||||
}
|
||||
if r.Intn(10) != 0 {
|
||||
if r.Intn(5) != 0 {
|
||||
v3 := r.Intn(5)
|
||||
this.Mixins = make([]*Mixin, v3)
|
||||
for i := 0; i < v3; i++ {
|
||||
@@ -1103,7 +1141,7 @@ func NewPopulatedMethod(r randyApi, easy bool) *Method {
|
||||
this.RequestStreaming = bool(bool(r.Intn(2) == 0))
|
||||
this.ResponseTypeUrl = string(randStringApi(r))
|
||||
this.ResponseStreaming = bool(bool(r.Intn(2) == 0))
|
||||
if r.Intn(10) != 0 {
|
||||
if r.Intn(5) != 0 {
|
||||
v4 := r.Intn(5)
|
||||
this.Options = make([]*Option, v4)
|
||||
for i := 0; i < v4; i++ {
|
||||
@@ -1304,14 +1342,7 @@ func (m *Mixin) Size() (n int) {
|
||||
}
|
||||
|
||||
func sovApi(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozApi(x uint64) (n int) {
|
||||
return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
@@ -1320,13 +1351,28 @@ func (this *Api) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
repeatedStringForMethods := "[]*Method{"
|
||||
for _, f := range this.Methods {
|
||||
repeatedStringForMethods += strings.Replace(f.String(), "Method", "Method", 1) + ","
|
||||
}
|
||||
repeatedStringForMethods += "}"
|
||||
repeatedStringForOptions := "[]*Option{"
|
||||
for _, f := range this.Options {
|
||||
repeatedStringForOptions += strings.Replace(fmt.Sprintf("%v", f), "Option", "Option", 1) + ","
|
||||
}
|
||||
repeatedStringForOptions += "}"
|
||||
repeatedStringForMixins := "[]*Mixin{"
|
||||
for _, f := range this.Mixins {
|
||||
repeatedStringForMixins += strings.Replace(f.String(), "Mixin", "Mixin", 1) + ","
|
||||
}
|
||||
repeatedStringForMixins += "}"
|
||||
s := strings.Join([]string{`&Api{`,
|
||||
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
||||
`Methods:` + strings.Replace(fmt.Sprintf("%v", this.Methods), "Method", "Method", 1) + `,`,
|
||||
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Option", "Option", 1) + `,`,
|
||||
`Methods:` + repeatedStringForMethods + `,`,
|
||||
`Options:` + repeatedStringForOptions + `,`,
|
||||
`Version:` + fmt.Sprintf("%v", this.Version) + `,`,
|
||||
`SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`,
|
||||
`Mixins:` + strings.Replace(fmt.Sprintf("%v", this.Mixins), "Mixin", "Mixin", 1) + `,`,
|
||||
`Mixins:` + repeatedStringForMixins + `,`,
|
||||
`Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`,
|
||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||
`}`,
|
||||
@@ -1337,13 +1383,18 @@ func (this *Method) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
repeatedStringForOptions := "[]*Option{"
|
||||
for _, f := range this.Options {
|
||||
repeatedStringForOptions += strings.Replace(fmt.Sprintf("%v", f), "Option", "Option", 1) + ","
|
||||
}
|
||||
repeatedStringForOptions += "}"
|
||||
s := strings.Join([]string{`&Method{`,
|
||||
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
||||
`RequestTypeUrl:` + fmt.Sprintf("%v", this.RequestTypeUrl) + `,`,
|
||||
`RequestStreaming:` + fmt.Sprintf("%v", this.RequestStreaming) + `,`,
|
||||
`ResponseTypeUrl:` + fmt.Sprintf("%v", this.ResponseTypeUrl) + `,`,
|
||||
`ResponseStreaming:` + fmt.Sprintf("%v", this.ResponseStreaming) + `,`,
|
||||
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Option", "Option", 1) + `,`,
|
||||
`Options:` + repeatedStringForOptions + `,`,
|
||||
`Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`,
|
||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||
`}`,
|
||||
@@ -2009,6 +2060,7 @@ func (m *Mixin) Unmarshal(dAtA []byte) error {
|
||||
func skipApi(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -2040,10 +2092,8 @@ func skipApi(dAtA []byte) (n int, err error) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -2064,55 +2114,30 @@ func skipApi(dAtA []byte) (n int, err error) {
|
||||
return 0, ErrInvalidLengthApi
|
||||
}
|
||||
iNdEx += length
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthApi
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowApi
|
||||
}
|
||||
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 := skipApi(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthApi
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
depth++
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupApi
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthApi
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
|
||||
ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
||||
|
||||
104
vendor/github.com/gogo/protobuf/types/duration.pb.go
generated
vendored
104
vendor/github.com/gogo/protobuf/types/duration.pb.go
generated
vendored
@@ -9,6 +9,7 @@ import (
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
reflect "reflect"
|
||||
strings "strings"
|
||||
)
|
||||
@@ -22,7 +23,7 @@ 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 _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// A Duration represents a signed, fixed-length span of time represented
|
||||
// as a count of seconds and fractions of seconds at nanosecond
|
||||
@@ -115,7 +116,7 @@ func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Duration.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -272,7 +273,7 @@ func valueToGoStringDuration(v interface{}, typ string) string {
|
||||
func (m *Duration) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -280,34 +281,42 @@ func (m *Duration) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *Duration) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Duration) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Seconds != 0 {
|
||||
dAtA[i] = 0x8
|
||||
i++
|
||||
i = encodeVarintDuration(dAtA, i, uint64(m.Seconds))
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if m.Nanos != 0 {
|
||||
dAtA[i] = 0x10
|
||||
i++
|
||||
i = encodeVarintDuration(dAtA, i, uint64(m.Nanos))
|
||||
i--
|
||||
dAtA[i] = 0x10
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
if m.Seconds != 0 {
|
||||
i = encodeVarintDuration(dAtA, i, uint64(m.Seconds))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return i, nil
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintDuration(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovDuration(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return offset + 1
|
||||
return base
|
||||
}
|
||||
func (m *Duration) Size() (n int) {
|
||||
if m == nil {
|
||||
@@ -328,14 +337,7 @@ func (m *Duration) Size() (n int) {
|
||||
}
|
||||
|
||||
func sovDuration(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozDuration(x uint64) (n int) {
|
||||
return sovDuration(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
@@ -435,6 +437,7 @@ func (m *Duration) Unmarshal(dAtA []byte) error {
|
||||
func skipDuration(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -466,10 +469,8 @@ func skipDuration(dAtA []byte) (n int, err error) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -490,55 +491,30 @@ func skipDuration(dAtA []byte) (n int, err error) {
|
||||
return 0, ErrInvalidLengthDuration
|
||||
}
|
||||
iNdEx += length
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthDuration
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowDuration
|
||||
}
|
||||
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 := skipDuration(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthDuration
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
depth++
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupDuration
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthDuration
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthDuration = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowDuration = fmt.Errorf("proto: integer overflow")
|
||||
ErrInvalidLengthDuration = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowDuration = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupDuration = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
||||
|
||||
90
vendor/github.com/gogo/protobuf/types/empty.pb.go
generated
vendored
90
vendor/github.com/gogo/protobuf/types/empty.pb.go
generated
vendored
@@ -9,6 +9,7 @@ import (
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
reflect "reflect"
|
||||
strings "strings"
|
||||
)
|
||||
@@ -22,7 +23,7 @@ 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 _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// A generic empty message that you can re-use to avoid defining duplicated
|
||||
// empty messages in your APIs. A typical example is to use it as the request
|
||||
@@ -53,7 +54,7 @@ func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Empty.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -173,7 +174,7 @@ func valueToGoStringEmpty(v interface{}, typ string) string {
|
||||
func (m *Empty) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -181,24 +182,32 @@ func (m *Empty) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *Empty) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Empty) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintEmpty(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovEmpty(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return offset + 1
|
||||
return base
|
||||
}
|
||||
func NewPopulatedEmpty(r randyEmpty, easy bool) *Empty {
|
||||
this := &Empty{}
|
||||
@@ -293,14 +302,7 @@ func (m *Empty) Size() (n int) {
|
||||
}
|
||||
|
||||
func sovEmpty(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozEmpty(x uint64) (n int) {
|
||||
return sovEmpty(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
@@ -380,6 +382,7 @@ func (m *Empty) Unmarshal(dAtA []byte) error {
|
||||
func skipEmpty(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -411,10 +414,8 @@ func skipEmpty(dAtA []byte) (n int, err error) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -435,55 +436,30 @@ func skipEmpty(dAtA []byte) (n int, err error) {
|
||||
return 0, ErrInvalidLengthEmpty
|
||||
}
|
||||
iNdEx += length
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthEmpty
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowEmpty
|
||||
}
|
||||
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 := skipEmpty(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthEmpty
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
depth++
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupEmpty
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthEmpty
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthEmpty = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowEmpty = fmt.Errorf("proto: integer overflow")
|
||||
ErrInvalidLengthEmpty = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowEmpty = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupEmpty = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
||||
|
||||
110
vendor/github.com/gogo/protobuf/types/field_mask.pb.go
generated
vendored
110
vendor/github.com/gogo/protobuf/types/field_mask.pb.go
generated
vendored
@@ -9,6 +9,7 @@ import (
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
reflect "reflect"
|
||||
strings "strings"
|
||||
)
|
||||
@@ -22,7 +23,7 @@ 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 _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// `FieldMask` represents a set of symbolic field paths, for example:
|
||||
//
|
||||
@@ -244,7 +245,7 @@ func (m *FieldMask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_FieldMask.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -396,7 +397,7 @@ func valueToGoStringFieldMask(v interface{}, typ string) string {
|
||||
func (m *FieldMask) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -404,39 +405,41 @@ func (m *FieldMask) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *FieldMask) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *FieldMask) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if len(m.Paths) > 0 {
|
||||
for _, s := range m.Paths {
|
||||
for iNdEx := len(m.Paths) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.Paths[iNdEx])
|
||||
copy(dAtA[i:], m.Paths[iNdEx])
|
||||
i = encodeVarintFieldMask(dAtA, i, uint64(len(m.Paths[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
l = len(s)
|
||||
for l >= 1<<7 {
|
||||
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
|
||||
l >>= 7
|
||||
i++
|
||||
}
|
||||
dAtA[i] = uint8(l)
|
||||
i++
|
||||
i += copy(dAtA[i:], s)
|
||||
}
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintFieldMask(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovFieldMask(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return offset + 1
|
||||
return base
|
||||
}
|
||||
func NewPopulatedFieldMask(r randyFieldMask, easy bool) *FieldMask {
|
||||
this := &FieldMask{}
|
||||
@@ -542,14 +545,7 @@ func (m *FieldMask) Size() (n int) {
|
||||
}
|
||||
|
||||
func sovFieldMask(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozFieldMask(x uint64) (n int) {
|
||||
return sovFieldMask(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
@@ -662,6 +658,7 @@ func (m *FieldMask) Unmarshal(dAtA []byte) error {
|
||||
func skipFieldMask(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -693,10 +690,8 @@ func skipFieldMask(dAtA []byte) (n int, err error) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -717,55 +712,30 @@ func skipFieldMask(dAtA []byte) (n int, err error) {
|
||||
return 0, ErrInvalidLengthFieldMask
|
||||
}
|
||||
iNdEx += length
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthFieldMask
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowFieldMask
|
||||
}
|
||||
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 := skipFieldMask(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthFieldMask
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
depth++
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupFieldMask
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthFieldMask
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthFieldMask = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowFieldMask = fmt.Errorf("proto: integer overflow")
|
||||
ErrInvalidLengthFieldMask = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowFieldMask = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupFieldMask = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
||||
|
||||
103
vendor/github.com/gogo/protobuf/types/source_context.pb.go
generated
vendored
103
vendor/github.com/gogo/protobuf/types/source_context.pb.go
generated
vendored
@@ -9,6 +9,7 @@ import (
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
reflect "reflect"
|
||||
strings "strings"
|
||||
)
|
||||
@@ -22,7 +23,7 @@ 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 _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// `SourceContext` represents information about the source of a
|
||||
// protobuf element, like the file in which it is defined.
|
||||
@@ -48,7 +49,7 @@ func (m *SourceContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
|
||||
return xxx_messageInfo_SourceContext.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -190,7 +191,7 @@ func valueToGoStringSourceContext(v interface{}, typ string) string {
|
||||
func (m *SourceContext) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -198,30 +199,39 @@ func (m *SourceContext) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *SourceContext) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *SourceContext) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.FileName) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintSourceContext(dAtA, i, uint64(len(m.FileName)))
|
||||
i += copy(dAtA[i:], m.FileName)
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
if len(m.FileName) > 0 {
|
||||
i -= len(m.FileName)
|
||||
copy(dAtA[i:], m.FileName)
|
||||
i = encodeVarintSourceContext(dAtA, i, uint64(len(m.FileName)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintSourceContext(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovSourceContext(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return offset + 1
|
||||
return base
|
||||
}
|
||||
func NewPopulatedSourceContext(r randySourceContext, easy bool) *SourceContext {
|
||||
this := &SourceContext{}
|
||||
@@ -321,14 +331,7 @@ func (m *SourceContext) Size() (n int) {
|
||||
}
|
||||
|
||||
func sovSourceContext(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozSourceContext(x uint64) (n int) {
|
||||
return sovSourceContext(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
@@ -441,6 +444,7 @@ func (m *SourceContext) Unmarshal(dAtA []byte) error {
|
||||
func skipSourceContext(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -472,10 +476,8 @@ func skipSourceContext(dAtA []byte) (n int, err error) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -496,55 +498,30 @@ func skipSourceContext(dAtA []byte) (n int, err error) {
|
||||
return 0, ErrInvalidLengthSourceContext
|
||||
}
|
||||
iNdEx += length
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthSourceContext
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowSourceContext
|
||||
}
|
||||
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 := skipSourceContext(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthSourceContext
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
depth++
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupSourceContext
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthSourceContext
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthSourceContext = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowSourceContext = fmt.Errorf("proto: integer overflow")
|
||||
ErrInvalidLengthSourceContext = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowSourceContext = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupSourceContext = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
||||
|
||||
877
vendor/github.com/gogo/protobuf/types/struct.pb.go
generated
vendored
877
vendor/github.com/gogo/protobuf/types/struct.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
114
vendor/github.com/gogo/protobuf/types/timestamp.pb.go
generated
vendored
114
vendor/github.com/gogo/protobuf/types/timestamp.pb.go
generated
vendored
@@ -9,6 +9,7 @@ import (
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
reflect "reflect"
|
||||
strings "strings"
|
||||
)
|
||||
@@ -22,7 +23,7 @@ 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 _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// A Timestamp represents a point in time independent of any time zone or local
|
||||
// calendar, encoded as a count of seconds and fractions of seconds at
|
||||
@@ -97,11 +98,13 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
// 01:30 UTC on January 15, 2017.
|
||||
//
|
||||
// In JavaScript, one can convert a Date object to this format using the
|
||||
// standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
||||
// standard
|
||||
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
||||
// method. In Python, a standard `datetime.datetime` object can be converted
|
||||
// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
|
||||
// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
||||
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
// to this format using
|
||||
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
||||
// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
||||
// the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
||||
// ) to obtain a formatter capable of generating timestamps in this format.
|
||||
//
|
||||
@@ -135,7 +138,7 @@ func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -292,7 +295,7 @@ func valueToGoStringTimestamp(v interface{}, typ string) string {
|
||||
func (m *Timestamp) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -300,34 +303,42 @@ func (m *Timestamp) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *Timestamp) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Timestamp) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Seconds != 0 {
|
||||
dAtA[i] = 0x8
|
||||
i++
|
||||
i = encodeVarintTimestamp(dAtA, i, uint64(m.Seconds))
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if m.Nanos != 0 {
|
||||
dAtA[i] = 0x10
|
||||
i++
|
||||
i = encodeVarintTimestamp(dAtA, i, uint64(m.Nanos))
|
||||
i--
|
||||
dAtA[i] = 0x10
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
if m.Seconds != 0 {
|
||||
i = encodeVarintTimestamp(dAtA, i, uint64(m.Seconds))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return i, nil
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintTimestamp(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovTimestamp(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return offset + 1
|
||||
return base
|
||||
}
|
||||
func (m *Timestamp) Size() (n int) {
|
||||
if m == nil {
|
||||
@@ -348,14 +359,7 @@ func (m *Timestamp) Size() (n int) {
|
||||
}
|
||||
|
||||
func sovTimestamp(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozTimestamp(x uint64) (n int) {
|
||||
return sovTimestamp(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
@@ -455,6 +459,7 @@ func (m *Timestamp) Unmarshal(dAtA []byte) error {
|
||||
func skipTimestamp(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -486,10 +491,8 @@ func skipTimestamp(dAtA []byte) (n int, err error) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -510,55 +513,30 @@ func skipTimestamp(dAtA []byte) (n int, err error) {
|
||||
return 0, ErrInvalidLengthTimestamp
|
||||
}
|
||||
iNdEx += length
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthTimestamp
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowTimestamp
|
||||
}
|
||||
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 := skipTimestamp(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthTimestamp
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
depth++
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupTimestamp
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthTimestamp
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthTimestamp = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowTimestamp = fmt.Errorf("proto: integer overflow")
|
||||
ErrInvalidLengthTimestamp = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowTimestamp = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupTimestamp = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
||||
|
||||
588
vendor/github.com/gogo/protobuf/types/type.pb.go
generated
vendored
588
vendor/github.com/gogo/protobuf/types/type.pb.go
generated
vendored
@@ -9,6 +9,7 @@ import (
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
reflect "reflect"
|
||||
strconv "strconv"
|
||||
strings "strings"
|
||||
@@ -23,7 +24,7 @@ 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 _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// The syntax in which a protocol buffer element is defined.
|
||||
type Syntax int32
|
||||
@@ -205,7 +206,7 @@ func (m *Type) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Type.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -312,7 +313,7 @@ func (m *Field) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Field.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -435,7 +436,7 @@ func (m *Enum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Enum.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -519,7 +520,7 @@ func (m *EnumValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_EnumValue.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -594,7 +595,7 @@ func (m *Option) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Option.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1404,7 +1405,7 @@ func valueToGoStringType(v interface{}, typ string) string {
|
||||
func (m *Type) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1412,80 +1413,87 @@ func (m *Type) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *Type) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Type) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Name) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||
i += copy(dAtA[i:], m.Name)
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if len(m.Fields) > 0 {
|
||||
for _, msg := range m.Fields {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(msg.Size()))
|
||||
n, err := msg.MarshalTo(dAtA[i:])
|
||||
if m.Syntax != 0 {
|
||||
i = encodeVarintType(dAtA, i, uint64(m.Syntax))
|
||||
i--
|
||||
dAtA[i] = 0x30
|
||||
}
|
||||
if m.SourceContext != nil {
|
||||
{
|
||||
size, err := m.SourceContext.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i += n
|
||||
i -= size
|
||||
i = encodeVarintType(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x2a
|
||||
}
|
||||
if len(m.Options) > 0 {
|
||||
for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintType(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
}
|
||||
if len(m.Oneofs) > 0 {
|
||||
for _, s := range m.Oneofs {
|
||||
for iNdEx := len(m.Oneofs) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.Oneofs[iNdEx])
|
||||
copy(dAtA[i:], m.Oneofs[iNdEx])
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.Oneofs[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
i++
|
||||
l = len(s)
|
||||
for l >= 1<<7 {
|
||||
dAtA[i] = uint8(uint64(l)&0x7f | 0x80)
|
||||
l >>= 7
|
||||
i++
|
||||
}
|
||||
}
|
||||
if len(m.Fields) > 0 {
|
||||
for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Fields[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintType(dAtA, i, uint64(size))
|
||||
}
|
||||
dAtA[i] = uint8(l)
|
||||
i++
|
||||
i += copy(dAtA[i:], s)
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
}
|
||||
if len(m.Options) > 0 {
|
||||
for _, msg := range m.Options {
|
||||
dAtA[i] = 0x22
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(msg.Size()))
|
||||
n, err := msg.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i += n
|
||||
}
|
||||
if len(m.Name) > 0 {
|
||||
i -= len(m.Name)
|
||||
copy(dAtA[i:], m.Name)
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
if m.SourceContext != nil {
|
||||
dAtA[i] = 0x2a
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(m.SourceContext.Size()))
|
||||
n1, err := m.SourceContext.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i += n1
|
||||
}
|
||||
if m.Syntax != 0 {
|
||||
dAtA[i] = 0x30
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(m.Syntax))
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Field) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1493,86 +1501,98 @@ func (m *Field) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *Field) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Field) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Kind != 0 {
|
||||
dAtA[i] = 0x8
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(m.Kind))
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if m.Cardinality != 0 {
|
||||
dAtA[i] = 0x10
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(m.Cardinality))
|
||||
if len(m.DefaultValue) > 0 {
|
||||
i -= len(m.DefaultValue)
|
||||
copy(dAtA[i:], m.DefaultValue)
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.DefaultValue)))
|
||||
i--
|
||||
dAtA[i] = 0x5a
|
||||
}
|
||||
if m.Number != 0 {
|
||||
dAtA[i] = 0x18
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(m.Number))
|
||||
if len(m.JsonName) > 0 {
|
||||
i -= len(m.JsonName)
|
||||
copy(dAtA[i:], m.JsonName)
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.JsonName)))
|
||||
i--
|
||||
dAtA[i] = 0x52
|
||||
}
|
||||
if len(m.Name) > 0 {
|
||||
dAtA[i] = 0x22
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||
i += copy(dAtA[i:], m.Name)
|
||||
}
|
||||
if len(m.TypeUrl) > 0 {
|
||||
dAtA[i] = 0x32
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.TypeUrl)))
|
||||
i += copy(dAtA[i:], m.TypeUrl)
|
||||
}
|
||||
if m.OneofIndex != 0 {
|
||||
dAtA[i] = 0x38
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(m.OneofIndex))
|
||||
if len(m.Options) > 0 {
|
||||
for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintType(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x4a
|
||||
}
|
||||
}
|
||||
if m.Packed {
|
||||
dAtA[i] = 0x40
|
||||
i++
|
||||
i--
|
||||
if m.Packed {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
}
|
||||
i++
|
||||
i--
|
||||
dAtA[i] = 0x40
|
||||
}
|
||||
if len(m.Options) > 0 {
|
||||
for _, msg := range m.Options {
|
||||
dAtA[i] = 0x4a
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(msg.Size()))
|
||||
n, err := msg.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i += n
|
||||
}
|
||||
if m.OneofIndex != 0 {
|
||||
i = encodeVarintType(dAtA, i, uint64(m.OneofIndex))
|
||||
i--
|
||||
dAtA[i] = 0x38
|
||||
}
|
||||
if len(m.JsonName) > 0 {
|
||||
dAtA[i] = 0x52
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.JsonName)))
|
||||
i += copy(dAtA[i:], m.JsonName)
|
||||
if len(m.TypeUrl) > 0 {
|
||||
i -= len(m.TypeUrl)
|
||||
copy(dAtA[i:], m.TypeUrl)
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.TypeUrl)))
|
||||
i--
|
||||
dAtA[i] = 0x32
|
||||
}
|
||||
if len(m.DefaultValue) > 0 {
|
||||
dAtA[i] = 0x5a
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.DefaultValue)))
|
||||
i += copy(dAtA[i:], m.DefaultValue)
|
||||
if len(m.Name) > 0 {
|
||||
i -= len(m.Name)
|
||||
copy(dAtA[i:], m.Name)
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
if m.Number != 0 {
|
||||
i = encodeVarintType(dAtA, i, uint64(m.Number))
|
||||
i--
|
||||
dAtA[i] = 0x18
|
||||
}
|
||||
return i, nil
|
||||
if m.Cardinality != 0 {
|
||||
i = encodeVarintType(dAtA, i, uint64(m.Cardinality))
|
||||
i--
|
||||
dAtA[i] = 0x10
|
||||
}
|
||||
if m.Kind != 0 {
|
||||
i = encodeVarintType(dAtA, i, uint64(m.Kind))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Enum) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1580,65 +1600,78 @@ func (m *Enum) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *Enum) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Enum) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Name) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||
i += copy(dAtA[i:], m.Name)
|
||||
}
|
||||
if len(m.Enumvalue) > 0 {
|
||||
for _, msg := range m.Enumvalue {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(msg.Size()))
|
||||
n, err := msg.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i += n
|
||||
}
|
||||
}
|
||||
if len(m.Options) > 0 {
|
||||
for _, msg := range m.Options {
|
||||
dAtA[i] = 0x1a
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(msg.Size()))
|
||||
n, err := msg.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i += n
|
||||
}
|
||||
}
|
||||
if m.SourceContext != nil {
|
||||
dAtA[i] = 0x22
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(m.SourceContext.Size()))
|
||||
n2, err := m.SourceContext.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i += n2
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if m.Syntax != 0 {
|
||||
dAtA[i] = 0x28
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(m.Syntax))
|
||||
i--
|
||||
dAtA[i] = 0x28
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
if m.SourceContext != nil {
|
||||
{
|
||||
size, err := m.SourceContext.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintType(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
return i, nil
|
||||
if len(m.Options) > 0 {
|
||||
for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintType(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
}
|
||||
if len(m.Enumvalue) > 0 {
|
||||
for iNdEx := len(m.Enumvalue) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Enumvalue[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintType(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
}
|
||||
if len(m.Name) > 0 {
|
||||
i -= len(m.Name)
|
||||
copy(dAtA[i:], m.Name)
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *EnumValue) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1646,43 +1679,52 @@ func (m *EnumValue) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *EnumValue) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *EnumValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Name) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||
i += copy(dAtA[i:], m.Name)
|
||||
}
|
||||
if m.Number != 0 {
|
||||
dAtA[i] = 0x10
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(m.Number))
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if len(m.Options) > 0 {
|
||||
for _, msg := range m.Options {
|
||||
dAtA[i] = 0x1a
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(msg.Size()))
|
||||
n, err := msg.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintType(dAtA, i, uint64(size))
|
||||
}
|
||||
i += n
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
if m.Number != 0 {
|
||||
i = encodeVarintType(dAtA, i, uint64(m.Number))
|
||||
i--
|
||||
dAtA[i] = 0x10
|
||||
}
|
||||
return i, nil
|
||||
if len(m.Name) > 0 {
|
||||
i -= len(m.Name)
|
||||
copy(dAtA[i:], m.Name)
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Option) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1690,45 +1732,56 @@ func (m *Option) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *Option) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Option) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Name) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||
i += copy(dAtA[i:], m.Name)
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if m.Value != nil {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
i = encodeVarintType(dAtA, i, uint64(m.Value.Size()))
|
||||
n3, err := m.Value.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
{
|
||||
size, err := m.Value.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintType(dAtA, i, uint64(size))
|
||||
}
|
||||
i += n3
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
if len(m.Name) > 0 {
|
||||
i -= len(m.Name)
|
||||
copy(dAtA[i:], m.Name)
|
||||
i = encodeVarintType(dAtA, i, uint64(len(m.Name)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return i, nil
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintType(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovType(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return offset + 1
|
||||
return base
|
||||
}
|
||||
func NewPopulatedType(r randyType, easy bool) *Type {
|
||||
this := &Type{}
|
||||
this.Name = string(randStringType(r))
|
||||
if r.Intn(10) != 0 {
|
||||
if r.Intn(5) != 0 {
|
||||
v1 := r.Intn(5)
|
||||
this.Fields = make([]*Field, v1)
|
||||
for i := 0; i < v1; i++ {
|
||||
@@ -1740,14 +1793,14 @@ func NewPopulatedType(r randyType, easy bool) *Type {
|
||||
for i := 0; i < v2; i++ {
|
||||
this.Oneofs[i] = string(randStringType(r))
|
||||
}
|
||||
if r.Intn(10) != 0 {
|
||||
if r.Intn(5) != 0 {
|
||||
v3 := r.Intn(5)
|
||||
this.Options = make([]*Option, v3)
|
||||
for i := 0; i < v3; i++ {
|
||||
this.Options[i] = NewPopulatedOption(r, easy)
|
||||
}
|
||||
}
|
||||
if r.Intn(10) != 0 {
|
||||
if r.Intn(5) != 0 {
|
||||
this.SourceContext = NewPopulatedSourceContext(r, easy)
|
||||
}
|
||||
this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)])
|
||||
@@ -1772,7 +1825,7 @@ func NewPopulatedField(r randyType, easy bool) *Field {
|
||||
this.OneofIndex *= -1
|
||||
}
|
||||
this.Packed = bool(bool(r.Intn(2) == 0))
|
||||
if r.Intn(10) != 0 {
|
||||
if r.Intn(5) != 0 {
|
||||
v4 := r.Intn(5)
|
||||
this.Options = make([]*Option, v4)
|
||||
for i := 0; i < v4; i++ {
|
||||
@@ -1790,21 +1843,21 @@ func NewPopulatedField(r randyType, easy bool) *Field {
|
||||
func NewPopulatedEnum(r randyType, easy bool) *Enum {
|
||||
this := &Enum{}
|
||||
this.Name = string(randStringType(r))
|
||||
if r.Intn(10) != 0 {
|
||||
if r.Intn(5) != 0 {
|
||||
v5 := r.Intn(5)
|
||||
this.Enumvalue = make([]*EnumValue, v5)
|
||||
for i := 0; i < v5; i++ {
|
||||
this.Enumvalue[i] = NewPopulatedEnumValue(r, easy)
|
||||
}
|
||||
}
|
||||
if r.Intn(10) != 0 {
|
||||
if r.Intn(5) != 0 {
|
||||
v6 := r.Intn(5)
|
||||
this.Options = make([]*Option, v6)
|
||||
for i := 0; i < v6; i++ {
|
||||
this.Options[i] = NewPopulatedOption(r, easy)
|
||||
}
|
||||
}
|
||||
if r.Intn(10) != 0 {
|
||||
if r.Intn(5) != 0 {
|
||||
this.SourceContext = NewPopulatedSourceContext(r, easy)
|
||||
}
|
||||
this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)])
|
||||
@@ -1821,7 +1874,7 @@ func NewPopulatedEnumValue(r randyType, easy bool) *EnumValue {
|
||||
if r.Intn(2) == 0 {
|
||||
this.Number *= -1
|
||||
}
|
||||
if r.Intn(10) != 0 {
|
||||
if r.Intn(5) != 0 {
|
||||
v7 := r.Intn(5)
|
||||
this.Options = make([]*Option, v7)
|
||||
for i := 0; i < v7; i++ {
|
||||
@@ -1837,7 +1890,7 @@ func NewPopulatedEnumValue(r randyType, easy bool) *EnumValue {
|
||||
func NewPopulatedOption(r randyType, easy bool) *Option {
|
||||
this := &Option{}
|
||||
this.Name = string(randStringType(r))
|
||||
if r.Intn(10) != 0 {
|
||||
if r.Intn(5) != 0 {
|
||||
this.Value = NewPopulatedAny(r, easy)
|
||||
}
|
||||
if !easy && r.Intn(10) != 0 {
|
||||
@@ -2089,14 +2142,7 @@ func (m *Option) Size() (n int) {
|
||||
}
|
||||
|
||||
func sovType(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozType(x uint64) (n int) {
|
||||
return sovType(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
@@ -2105,11 +2151,21 @@ func (this *Type) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
repeatedStringForFields := "[]*Field{"
|
||||
for _, f := range this.Fields {
|
||||
repeatedStringForFields += strings.Replace(f.String(), "Field", "Field", 1) + ","
|
||||
}
|
||||
repeatedStringForFields += "}"
|
||||
repeatedStringForOptions := "[]*Option{"
|
||||
for _, f := range this.Options {
|
||||
repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + ","
|
||||
}
|
||||
repeatedStringForOptions += "}"
|
||||
s := strings.Join([]string{`&Type{`,
|
||||
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
||||
`Fields:` + strings.Replace(fmt.Sprintf("%v", this.Fields), "Field", "Field", 1) + `,`,
|
||||
`Fields:` + repeatedStringForFields + `,`,
|
||||
`Oneofs:` + fmt.Sprintf("%v", this.Oneofs) + `,`,
|
||||
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Option", "Option", 1) + `,`,
|
||||
`Options:` + repeatedStringForOptions + `,`,
|
||||
`SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`,
|
||||
`Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`,
|
||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||
@@ -2121,6 +2177,11 @@ func (this *Field) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
repeatedStringForOptions := "[]*Option{"
|
||||
for _, f := range this.Options {
|
||||
repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + ","
|
||||
}
|
||||
repeatedStringForOptions += "}"
|
||||
s := strings.Join([]string{`&Field{`,
|
||||
`Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
|
||||
`Cardinality:` + fmt.Sprintf("%v", this.Cardinality) + `,`,
|
||||
@@ -2129,7 +2190,7 @@ func (this *Field) String() string {
|
||||
`TypeUrl:` + fmt.Sprintf("%v", this.TypeUrl) + `,`,
|
||||
`OneofIndex:` + fmt.Sprintf("%v", this.OneofIndex) + `,`,
|
||||
`Packed:` + fmt.Sprintf("%v", this.Packed) + `,`,
|
||||
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Option", "Option", 1) + `,`,
|
||||
`Options:` + repeatedStringForOptions + `,`,
|
||||
`JsonName:` + fmt.Sprintf("%v", this.JsonName) + `,`,
|
||||
`DefaultValue:` + fmt.Sprintf("%v", this.DefaultValue) + `,`,
|
||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||
@@ -2141,10 +2202,20 @@ func (this *Enum) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
repeatedStringForEnumvalue := "[]*EnumValue{"
|
||||
for _, f := range this.Enumvalue {
|
||||
repeatedStringForEnumvalue += strings.Replace(f.String(), "EnumValue", "EnumValue", 1) + ","
|
||||
}
|
||||
repeatedStringForEnumvalue += "}"
|
||||
repeatedStringForOptions := "[]*Option{"
|
||||
for _, f := range this.Options {
|
||||
repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + ","
|
||||
}
|
||||
repeatedStringForOptions += "}"
|
||||
s := strings.Join([]string{`&Enum{`,
|
||||
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
||||
`Enumvalue:` + strings.Replace(fmt.Sprintf("%v", this.Enumvalue), "EnumValue", "EnumValue", 1) + `,`,
|
||||
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Option", "Option", 1) + `,`,
|
||||
`Enumvalue:` + repeatedStringForEnumvalue + `,`,
|
||||
`Options:` + repeatedStringForOptions + `,`,
|
||||
`SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`,
|
||||
`Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`,
|
||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||
@@ -2156,10 +2227,15 @@ func (this *EnumValue) String() string {
|
||||
if this == nil {
|
||||
return "nil"
|
||||
}
|
||||
repeatedStringForOptions := "[]*Option{"
|
||||
for _, f := range this.Options {
|
||||
repeatedStringForOptions += strings.Replace(f.String(), "Option", "Option", 1) + ","
|
||||
}
|
||||
repeatedStringForOptions += "}"
|
||||
s := strings.Join([]string{`&EnumValue{`,
|
||||
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
|
||||
`Number:` + fmt.Sprintf("%v", this.Number) + `,`,
|
||||
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Option", "Option", 1) + `,`,
|
||||
`Options:` + repeatedStringForOptions + `,`,
|
||||
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||
`}`,
|
||||
}, "")
|
||||
@@ -3211,6 +3287,7 @@ func (m *Option) Unmarshal(dAtA []byte) error {
|
||||
func skipType(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -3242,10 +3319,8 @@ func skipType(dAtA []byte) (n int, err error) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -3266,55 +3341,30 @@ func skipType(dAtA []byte) (n int, err error) {
|
||||
return 0, ErrInvalidLengthType
|
||||
}
|
||||
iNdEx += length
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthType
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowType
|
||||
}
|
||||
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 := skipType(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthType
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
depth++
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupType
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthType
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthType = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowType = fmt.Errorf("proto: integer overflow")
|
||||
ErrInvalidLengthType = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowType = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupType = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
||||
|
||||
318
vendor/github.com/gogo/protobuf/types/wrappers.pb.go
generated
vendored
318
vendor/github.com/gogo/protobuf/types/wrappers.pb.go
generated
vendored
@@ -10,6 +10,7 @@ import (
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
io "io"
|
||||
math "math"
|
||||
math_bits "math/bits"
|
||||
reflect "reflect"
|
||||
strings "strings"
|
||||
)
|
||||
@@ -23,7 +24,7 @@ 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 _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// Wrapper message for `double`.
|
||||
//
|
||||
@@ -50,7 +51,7 @@ func (m *DoubleValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
|
||||
return xxx_messageInfo_DoubleValue.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -105,7 +106,7 @@ func (m *FloatValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_FloatValue.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -160,7 +161,7 @@ func (m *Int64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Int64Value.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -215,7 +216,7 @@ func (m *UInt64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
|
||||
return xxx_messageInfo_UInt64Value.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -270,7 +271,7 @@ func (m *Int32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Int32Value.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -325,7 +326,7 @@ func (m *UInt32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
|
||||
return xxx_messageInfo_UInt32Value.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -380,7 +381,7 @@ func (m *BoolValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_BoolValue.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -435,7 +436,7 @@ func (m *StringValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
|
||||
return xxx_messageInfo_StringValue.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -490,7 +491,7 @@ func (m *BytesValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_BytesValue.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalTo(b)
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1247,7 +1248,7 @@ func valueToGoStringWrappers(v interface{}, typ string) string {
|
||||
func (m *DoubleValue) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1255,26 +1256,32 @@ func (m *DoubleValue) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *DoubleValue) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *DoubleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Value != 0 {
|
||||
dAtA[i] = 0x9
|
||||
i++
|
||||
encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value))))
|
||||
i += 8
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
if m.Value != 0 {
|
||||
i -= 8
|
||||
encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value))))
|
||||
i--
|
||||
dAtA[i] = 0x9
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *FloatValue) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1282,26 +1289,32 @@ func (m *FloatValue) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *FloatValue) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *FloatValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Value != 0 {
|
||||
dAtA[i] = 0xd
|
||||
i++
|
||||
encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Value))))
|
||||
i += 4
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
if m.Value != 0 {
|
||||
i -= 4
|
||||
encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Value))))
|
||||
i--
|
||||
dAtA[i] = 0xd
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Int64Value) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1309,25 +1322,31 @@ func (m *Int64Value) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *Int64Value) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Int64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Value != 0 {
|
||||
dAtA[i] = 0x8
|
||||
i++
|
||||
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
if m.Value != 0 {
|
||||
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *UInt64Value) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1335,25 +1354,31 @@ func (m *UInt64Value) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *UInt64Value) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *UInt64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Value != 0 {
|
||||
dAtA[i] = 0x8
|
||||
i++
|
||||
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
if m.Value != 0 {
|
||||
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Int32Value) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1361,25 +1386,31 @@ func (m *Int32Value) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *Int32Value) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Int32Value) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Value != 0 {
|
||||
dAtA[i] = 0x8
|
||||
i++
|
||||
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
if m.Value != 0 {
|
||||
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *UInt32Value) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1387,25 +1418,31 @@ func (m *UInt32Value) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *UInt32Value) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *UInt32Value) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Value != 0 {
|
||||
dAtA[i] = 0x8
|
||||
i++
|
||||
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
if m.Value != 0 {
|
||||
i = encodeVarintWrappers(dAtA, i, uint64(m.Value))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *BoolValue) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1413,30 +1450,36 @@ func (m *BoolValue) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *BoolValue) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *BoolValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.XXX_unrecognized != nil {
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
if m.Value {
|
||||
dAtA[i] = 0x8
|
||||
i++
|
||||
i--
|
||||
if m.Value {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
}
|
||||
i++
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *StringValue) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1444,26 +1487,33 @@ func (m *StringValue) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *StringValue) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *StringValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Value) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintWrappers(dAtA, i, uint64(len(m.Value)))
|
||||
i += copy(dAtA[i:], m.Value)
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
if len(m.Value) > 0 {
|
||||
i -= len(m.Value)
|
||||
copy(dAtA[i:], m.Value)
|
||||
i = encodeVarintWrappers(dAtA, i, uint64(len(m.Value)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *BytesValue) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1471,30 +1521,39 @@ func (m *BytesValue) Marshal() (dAtA []byte, err error) {
|
||||
}
|
||||
|
||||
func (m *BytesValue) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *BytesValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Value) > 0 {
|
||||
dAtA[i] = 0xa
|
||||
i++
|
||||
i = encodeVarintWrappers(dAtA, i, uint64(len(m.Value)))
|
||||
i += copy(dAtA[i:], m.Value)
|
||||
}
|
||||
if m.XXX_unrecognized != nil {
|
||||
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||
i -= len(m.XXX_unrecognized)
|
||||
copy(dAtA[i:], m.XXX_unrecognized)
|
||||
}
|
||||
return i, nil
|
||||
if len(m.Value) > 0 {
|
||||
i -= len(m.Value)
|
||||
copy(dAtA[i:], m.Value)
|
||||
i = encodeVarintWrappers(dAtA, i, uint64(len(m.Value)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintWrappers(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovWrappers(v)
|
||||
base := offset
|
||||
for v >= 1<<7 {
|
||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||
v >>= 7
|
||||
offset++
|
||||
}
|
||||
dAtA[offset] = uint8(v)
|
||||
return offset + 1
|
||||
return base
|
||||
}
|
||||
func NewPopulatedDoubleValue(r randyWrappers, easy bool) *DoubleValue {
|
||||
this := &DoubleValue{}
|
||||
@@ -1803,14 +1862,7 @@ func (m *BytesValue) Size() (n int) {
|
||||
}
|
||||
|
||||
func sovWrappers(x uint64) (n int) {
|
||||
for {
|
||||
n++
|
||||
x >>= 7
|
||||
if x == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
return n
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
func sozWrappers(x uint64) (n int) {
|
||||
return sovWrappers(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||
@@ -2595,6 +2647,7 @@ func (m *BytesValue) Unmarshal(dAtA []byte) error {
|
||||
func skipWrappers(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
depth := 0
|
||||
for iNdEx < l {
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -2626,10 +2679,8 @@ func skipWrappers(dAtA []byte) (n int, err error) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 1:
|
||||
iNdEx += 8
|
||||
return iNdEx, nil
|
||||
case 2:
|
||||
var length int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -2650,55 +2701,30 @@ func skipWrappers(dAtA []byte) (n int, err error) {
|
||||
return 0, ErrInvalidLengthWrappers
|
||||
}
|
||||
iNdEx += length
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthWrappers
|
||||
}
|
||||
return iNdEx, nil
|
||||
case 3:
|
||||
for {
|
||||
var innerWire uint64
|
||||
var start int = iNdEx
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return 0, ErrIntOverflowWrappers
|
||||
}
|
||||
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 := skipWrappers(dAtA[start:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
iNdEx = start + next
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthWrappers
|
||||
}
|
||||
}
|
||||
return iNdEx, nil
|
||||
depth++
|
||||
case 4:
|
||||
return iNdEx, nil
|
||||
if depth == 0 {
|
||||
return 0, ErrUnexpectedEndOfGroupWrappers
|
||||
}
|
||||
depth--
|
||||
case 5:
|
||||
iNdEx += 4
|
||||
return iNdEx, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||
}
|
||||
if iNdEx < 0 {
|
||||
return 0, ErrInvalidLengthWrappers
|
||||
}
|
||||
if depth == 0 {
|
||||
return iNdEx, nil
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
|
||||
var (
|
||||
ErrInvalidLengthWrappers = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowWrappers = fmt.Errorf("proto: integer overflow")
|
||||
ErrInvalidLengthWrappers = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||
ErrIntOverflowWrappers = fmt.Errorf("proto: integer overflow")
|
||||
ErrUnexpectedEndOfGroupWrappers = fmt.Errorf("proto: unexpected end of group")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user