Update protobuf v1.2.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
e16368d21f
commit
830b0294cc
@ -15,10 +15,10 @@ github.com/prometheus/client_model 99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c
|
|||||||
github.com/prometheus/common 89604d197083d4781071d3c65855d24ecfb0a563
|
github.com/prometheus/common 89604d197083d4781071d3c65855d24ecfb0a563
|
||||||
github.com/prometheus/procfs cb4147076ac75738c9a7d279075a253c0cc5acbd
|
github.com/prometheus/procfs cb4147076ac75738c9a7d279075a253c0cc5acbd
|
||||||
github.com/beorn7/perks 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9
|
github.com/beorn7/perks 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.0
|
github.com/matttproud/golang_protobuf_extensions v1.0.1
|
||||||
github.com/gogo/protobuf v1.0.0
|
github.com/gogo/protobuf v1.2.1
|
||||||
github.com/gogo/googleapis 08a7655d27152912db7aaf4f983275eaf8d128ef
|
github.com/gogo/googleapis 08a7655d27152912db7aaf4f983275eaf8d128ef
|
||||||
github.com/golang/protobuf v1.1.0
|
github.com/golang/protobuf v1.2.0
|
||||||
github.com/opencontainers/runtime-spec 29686dbc5559d93fb1ef402eeda3e35c38d75af4 # v1.0.1-59-g29686db
|
github.com/opencontainers/runtime-spec 29686dbc5559d93fb1ef402eeda3e35c38d75af4 # v1.0.1-59-g29686db
|
||||||
github.com/opencontainers/runc v1.0.0-rc7
|
github.com/opencontainers/runc v1.0.0-rc7
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1
|
||||||
|
5
vendor/github.com/gogo/protobuf/LICENSE
generated
vendored
5
vendor/github.com/gogo/protobuf/LICENSE
generated
vendored
@ -1,7 +1,6 @@
|
|||||||
Protocol Buffers for Go with Gadgets
|
|
||||||
|
|
||||||
Copyright (c) 2013, The GoGo Authors. All rights reserved.
|
Copyright (c) 2013, The GoGo Authors. All rights reserved.
|
||||||
http://github.com/gogo/protobuf
|
|
||||||
|
Protocol Buffers for Go with Gadgets
|
||||||
|
|
||||||
Go support for Protocol Buffers - Google's data interchange format
|
Go support for Protocol Buffers - Google's data interchange format
|
||||||
|
|
||||||
|
90
vendor/github.com/gogo/protobuf/README
generated
vendored
90
vendor/github.com/gogo/protobuf/README
generated
vendored
@ -1,13 +1,18 @@
|
|||||||
|
Protocol Buffers for Go with Gadgets
|
||||||
|
|
||||||
GoGoProtobuf http://github.com/gogo/protobuf extends
|
GoGoProtobuf http://github.com/gogo/protobuf extends
|
||||||
GoProtobuf http://github.com/golang/protobuf
|
GoProtobuf http://github.com/golang/protobuf
|
||||||
|
|
||||||
|
Copyright (c) 2013, The GoGo Authors. All rights reserved.
|
||||||
|
|
||||||
|
|
||||||
# Go support for Protocol Buffers
|
# Go support for Protocol Buffers
|
||||||
|
|
||||||
Google's data interchange format.
|
Google's data interchange format.
|
||||||
Copyright 2010 The Go Authors.
|
Copyright 2010 The Go Authors.
|
||||||
https://github.com/golang/protobuf
|
https://github.com/golang/protobuf
|
||||||
|
|
||||||
This package and the code it generates requires at least Go 1.4.
|
This package and the code it generates requires at least Go 1.6.
|
||||||
|
|
||||||
This software implements Go bindings for protocol buffers. For
|
This software implements Go bindings for protocol buffers. For
|
||||||
information about protocol buffers themselves, see
|
information about protocol buffers themselves, see
|
||||||
@ -24,11 +29,19 @@ To use this software, you must:
|
|||||||
https://golang.org/doc/install
|
https://golang.org/doc/install
|
||||||
for details or, if you are using gccgo, follow the instructions at
|
for details or, if you are using gccgo, follow the instructions at
|
||||||
https://golang.org/doc/install/gccgo
|
https://golang.org/doc/install/gccgo
|
||||||
- Grab the code from the repository and install the proto package.
|
- Grab the code from the repository and install the `proto` package.
|
||||||
The simplest way is to run `go get -u github.com/golang/protobuf/protoc-gen-go`.
|
The simplest way is to run `go get -u github.com/golang/protobuf/protoc-gen-go`.
|
||||||
The compiler plugin, protoc-gen-go, will be installed in $GOBIN,
|
The compiler plugin, `protoc-gen-go`, will be installed in `$GOPATH/bin`
|
||||||
defaulting to $GOPATH/bin. It must be in your $PATH for the protocol
|
unless `$GOBIN` is set. It must be in your `$PATH` for the protocol
|
||||||
compiler, protoc, to find it.
|
compiler, `protoc`, to find it.
|
||||||
|
- If you need a particular version of `protoc-gen-go` (e.g., to match your
|
||||||
|
`proto` package version), one option is
|
||||||
|
```shell
|
||||||
|
GIT_TAG="v1.2.0" # change as needed
|
||||||
|
go get -d -u github.com/golang/protobuf/protoc-gen-go
|
||||||
|
git -C "$(go env GOPATH)"/src/github.com/golang/protobuf checkout $GIT_TAG
|
||||||
|
go install github.com/golang/protobuf/protoc-gen-go
|
||||||
|
```
|
||||||
|
|
||||||
This software has two parts: a 'protocol compiler plugin' that
|
This software has two parts: a 'protocol compiler plugin' that
|
||||||
generates Go source files that, once compiled, can access and manage
|
generates Go source files that, once compiled, can access and manage
|
||||||
@ -58,6 +71,45 @@ parameter set to the directory you want to output the Go code to.
|
|||||||
The generated files will be suffixed .pb.go. See the Test code below
|
The generated files will be suffixed .pb.go. See the Test code below
|
||||||
for an example using such a file.
|
for an example using such a file.
|
||||||
|
|
||||||
|
## Packages and input paths ##
|
||||||
|
|
||||||
|
The protocol buffer language has a concept of "packages" which does not
|
||||||
|
correspond well to the Go notion of packages. In generated Go code,
|
||||||
|
each source `.proto` file is associated with a single Go package. The
|
||||||
|
name and import path for this package is specified with the `go_package`
|
||||||
|
proto option:
|
||||||
|
|
||||||
|
option go_package = "github.com/gogo/protobuf/types";
|
||||||
|
|
||||||
|
The protocol buffer compiler will attempt to derive a package name and
|
||||||
|
import path if a `go_package` option is not present, but it is
|
||||||
|
best to always specify one explicitly.
|
||||||
|
|
||||||
|
There is a one-to-one relationship between source `.proto` files and
|
||||||
|
generated `.pb.go` files, but any number of `.pb.go` files may be
|
||||||
|
contained in the same Go package.
|
||||||
|
|
||||||
|
The output name of a generated file is produced by replacing the
|
||||||
|
`.proto` suffix with `.pb.go` (e.g., `foo.proto` produces `foo.pb.go`).
|
||||||
|
However, the output directory is selected in one of two ways. Let
|
||||||
|
us say we have `inputs/x.proto` with a `go_package` option of
|
||||||
|
`github.com/golang/protobuf/p`. The corresponding output file may
|
||||||
|
be:
|
||||||
|
|
||||||
|
- Relative to the import path:
|
||||||
|
|
||||||
|
protoc --gogo_out=. inputs/x.proto
|
||||||
|
# writes ./github.com/gogo/protobuf/p/x.pb.go
|
||||||
|
|
||||||
|
(This can work well with `--gogo_out=$GOPATH`.)
|
||||||
|
|
||||||
|
- Relative to the input file:
|
||||||
|
|
||||||
|
protoc --gogo_out=paths=source_relative:. inputs/x.proto
|
||||||
|
# generate ./inputs/x.pb.go
|
||||||
|
|
||||||
|
## Generated code ##
|
||||||
|
|
||||||
The package comment for the proto library contains text describing
|
The package comment for the proto library contains text describing
|
||||||
the interface provided in Go for protocol buffers. Here is an edited
|
the interface provided in Go for protocol buffers. Here is an edited
|
||||||
version.
|
version.
|
||||||
@ -132,9 +184,6 @@ Consider file test.proto, containing
|
|||||||
required string label = 1;
|
required string label = 1;
|
||||||
optional int32 type = 2 [default=77];
|
optional int32 type = 2 [default=77];
|
||||||
repeated int64 reps = 3;
|
repeated int64 reps = 3;
|
||||||
optional group OptionalGroup = 4 {
|
|
||||||
required string RequiredField = 5;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -151,13 +200,10 @@ To create and play with a Test object from the example package,
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
test := &example.Test {
|
test := &example.Test{
|
||||||
Label: proto.String("hello"),
|
Label: proto.String("hello"),
|
||||||
Type: proto.Int32(17),
|
Type: proto.Int32(17),
|
||||||
Reps: []int64{1, 2, 3},
|
Reps: []int64{1, 2, 3},
|
||||||
Optionalgroup: &example.Test_OptionalGroup {
|
|
||||||
RequiredField: proto.String("good bye"),
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
data, err := proto.Marshal(test)
|
data, err := proto.Marshal(test)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -185,19 +231,23 @@ parameter list separated from the output directory by a colon:
|
|||||||
|
|
||||||
protoc --gogo_out=plugins=grpc,import_path=mypackage:. *.proto
|
protoc --gogo_out=plugins=grpc,import_path=mypackage:. *.proto
|
||||||
|
|
||||||
|
- `paths=(import | source_relative)` - specifies how the paths of
|
||||||
- `import_prefix=xxx` - a prefix that is added onto the beginning of
|
generated files are structured. See the "Packages and imports paths"
|
||||||
all imports. Useful for things like generating protos in a
|
section above. The default is `import`.
|
||||||
subdirectory, or regenerating vendored protobufs in-place.
|
|
||||||
- `import_path=foo/bar` - used as the package if no input files
|
|
||||||
declare `go_package`. If it contains slashes, everything up to the
|
|
||||||
rightmost slash is ignored.
|
|
||||||
- `plugins=plugin1+plugin2` - specifies the list of sub-plugins to
|
- `plugins=plugin1+plugin2` - specifies the list of sub-plugins to
|
||||||
load. The only plugin in this repo is `grpc`.
|
load. The only plugin in this repo is `grpc`.
|
||||||
- `Mfoo/bar.proto=quux/shme` - declares that foo/bar.proto is
|
- `Mfoo/bar.proto=quux/shme` - declares that foo/bar.proto is
|
||||||
associated with Go package quux/shme. This is subject to the
|
associated with Go package quux/shme. This is subject to the
|
||||||
import_prefix parameter.
|
import_prefix parameter.
|
||||||
|
|
||||||
|
The following parameters are deprecated and should not be used:
|
||||||
|
|
||||||
|
- `import_prefix=xxx` - a prefix that is added onto the beginning of
|
||||||
|
all imports.
|
||||||
|
- `import_path=foo/bar` - used as the package if no input files
|
||||||
|
declare `go_package`. If it contains slashes, everything up to the
|
||||||
|
rightmost slash is ignored.
|
||||||
|
|
||||||
## gRPC Support ##
|
## gRPC Support ##
|
||||||
|
|
||||||
If a proto file specifies RPC services, protoc-gen-go can be instructed to
|
If a proto file specifies RPC services, protoc-gen-go can be instructed to
|
||||||
@ -251,8 +301,6 @@ generated code and declare a new package-level constant whose name incorporates
|
|||||||
the latest version number. Removing a compatibility constant is considered a
|
the latest version number. Removing a compatibility constant is considered a
|
||||||
breaking change and would be subject to the announcement policy stated above.
|
breaking change and would be subject to the announcement policy stated above.
|
||||||
|
|
||||||
## Plugins ##
|
|
||||||
|
|
||||||
The `protoc-gen-go/generator` package exposes a plugin interface,
|
The `protoc-gen-go/generator` package exposes a plugin interface,
|
||||||
which is used by the gRPC code generation. This interface is not
|
which is used by the gRPC code generation. This interface is not
|
||||||
supported and is subject to incompatible changes without notice.
|
supported and is subject to incompatible changes without notice.
|
||||||
|
24
vendor/github.com/gogo/protobuf/Readme.md
generated
vendored
24
vendor/github.com/gogo/protobuf/Readme.md
generated
vendored
@ -1,6 +1,7 @@
|
|||||||
# Protocol Buffers for Go with Gadgets
|
# Protocol Buffers for Go with Gadgets
|
||||||
|
|
||||||
[](https://travis-ci.org/gogo/protobuf)
|
[](https://travis-ci.org/gogo/protobuf)
|
||||||
|
[](http://godoc.org/github.com/gogo/protobuf)
|
||||||
|
|
||||||
gogoprotobuf is a fork of <a href="https://github.com/golang/protobuf">golang/protobuf</a> with extra code generation features.
|
gogoprotobuf is a fork of <a href="https://github.com/golang/protobuf">golang/protobuf</a> with extra code generation features.
|
||||||
|
|
||||||
@ -45,6 +46,9 @@ These projects use gogoprotobuf:
|
|||||||
- <a href="https://github.com/go-graphite">carbonzipper stack</a>
|
- <a href="https://github.com/go-graphite">carbonzipper stack</a>
|
||||||
- <a href="https://sendgrid.com/">sendgrid</a>
|
- <a href="https://sendgrid.com/">sendgrid</a>
|
||||||
- <a href="https://github.com/zero-os/0-stor">zero-os/0-stor</a>
|
- <a href="https://github.com/zero-os/0-stor">zero-os/0-stor</a>
|
||||||
|
- <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
|
||||||
|
|
||||||
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>.
|
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>.
|
||||||
|
|
||||||
@ -53,6 +57,12 @@ Please let us know if you are using gogoprotobuf by posting on our <a href="http
|
|||||||
- <a href="http://www.slideshare.net/albertstrasheim/serialization-in-go">Cloudflare - go serialization talk - Albert Strasheim</a>
|
- <a href="http://www.slideshare.net/albertstrasheim/serialization-in-go">Cloudflare - go serialization talk - Albert Strasheim</a>
|
||||||
- <a href="https://youtu.be/4xB46Xl9O9Q?t=557">GopherCon 2014 Writing High Performance Databases in Go by Ben Johnson</a>
|
- <a href="https://youtu.be/4xB46Xl9O9Q?t=557">GopherCon 2014 Writing High Performance Databases in Go by Ben Johnson</a>
|
||||||
- <a href="https://github.com/alecthomas/go_serialization_benchmarks">alecthomas' go serialization benchmarks</a>
|
- <a href="https://github.com/alecthomas/go_serialization_benchmarks">alecthomas' go serialization benchmarks</a>
|
||||||
|
- <a href="http://agniva.me/go/2017/11/18/gogoproto.html">Go faster with gogoproto - Agniva De Sarker</a>
|
||||||
|
- <a href="https://www.youtube.com/watch?v=CY9T020HLP8">Evolution of protobuf (Gource Visualization) - Landon Wilkins</a>
|
||||||
|
- <a href="https://fosdem.org/2018/schedule/event/gopherjs/">Creating GopherJS Apps with gRPC-Web - Johan Brandhorst</a>
|
||||||
|
- <a href="https://jbrandhorst.com/post/gogoproto/">So you want to use GoGo Protobuf - Johan Brandhorst</a>
|
||||||
|
- <a href="https://jbrandhorst.com/post/grpc-errors/">Advanced gRPC Error Usage - Johan Brandhorst</a>
|
||||||
|
- <a href="https://www.udemy.com/grpc-golang/?couponCode=GITHUB10">gRPC Golang Course on Udemy - Stephane Maarek</a>
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
@ -65,10 +75,11 @@ After that you can choose:
|
|||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
To install it, you must first have Go (at least version 1.6.3) installed (see [http://golang.org/doc/install](http://golang.org/doc/install)). Latest patch versions of Go 1.8, 1.9 and 1.10 are continuously tested.
|
To install it, you must first have Go (at least version 1.6.3 or 1.9 if you are using gRPC) installed (see [http://golang.org/doc/install](http://golang.org/doc/install)).
|
||||||
|
Latest patch versions of 1.10 and 1.11 are continuously tested.
|
||||||
|
|
||||||
Next, install the standard protocol buffer implementation from [https://github.com/google/protobuf](https://github.com/google/protobuf).
|
Next, install the standard protocol buffer implementation from [https://github.com/google/protobuf](https://github.com/google/protobuf).
|
||||||
Most versions from 2.3.1 should not give any problems, but 2.6.1, 3.0.2 and 3.5.1 are continuously tested.
|
Most versions from 2.3.1 should not give any problems, but 2.6.1, 3.0.2 and 3.6.1 are continuously tested.
|
||||||
|
|
||||||
### Speed
|
### Speed
|
||||||
|
|
||||||
@ -137,3 +148,12 @@ It works the same as golang/protobuf, simply specify the plugin.
|
|||||||
Here is an example using gofast:
|
Here is an example using gofast:
|
||||||
|
|
||||||
protoc --gofast_out=plugins=grpc:. my.proto
|
protoc --gofast_out=plugins=grpc:. my.proto
|
||||||
|
|
||||||
|
See [https://github.com/gogo/grpc-example](https://github.com/gogo/grpc-example) for an example of using gRPC with gogoprotobuf and the wider grpc-ecosystem.
|
||||||
|
|
||||||
|
|
||||||
|
## License
|
||||||
|
This software is licensed under the 3-Clause BSD License
|
||||||
|
("BSD License 2.0", "Revised BSD License", "New BSD License", or "Modified BSD License").
|
||||||
|
|
||||||
|
|
||||||
|
2
vendor/github.com/gogo/protobuf/gogoproto/doc.go
generated
vendored
2
vendor/github.com/gogo/protobuf/gogoproto/doc.go
generated
vendored
@ -162,7 +162,7 @@ The most complete way to see examples is to look at
|
|||||||
github.com/gogo/protobuf/test/thetest.proto
|
github.com/gogo/protobuf/test/thetest.proto
|
||||||
|
|
||||||
Gogoprototest is a seperate project,
|
Gogoprototest is a seperate project,
|
||||||
because we want to keep gogoprotobuf independant of goprotobuf,
|
because we want to keep gogoprotobuf independent of goprotobuf,
|
||||||
but we still want to test it thoroughly.
|
but we still want to test it thoroughly.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
476
vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go
generated
vendored
476
vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go
generated
vendored
@ -1,20 +1,14 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
// source: gogo.proto
|
// source: gogo.proto
|
||||||
|
|
||||||
/*
|
|
||||||
Package gogoproto is a generated protocol buffer package.
|
|
||||||
|
|
||||||
It is generated from these files:
|
|
||||||
gogo.proto
|
|
||||||
|
|
||||||
It has these top-level messages:
|
|
||||||
*/
|
|
||||||
package gogoproto
|
package gogoproto
|
||||||
|
|
||||||
import proto "github.com/gogo/protobuf/proto"
|
import (
|
||||||
import fmt "fmt"
|
fmt "fmt"
|
||||||
import math "math"
|
proto "github.com/gogo/protobuf/proto"
|
||||||
import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
||||||
|
math "math"
|
||||||
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -28,43 +22,43 @@ var _ = math.Inf
|
|||||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||||
|
|
||||||
var E_GoprotoEnumPrefix = &proto.ExtensionDesc{
|
var E_GoprotoEnumPrefix = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.EnumOptions)(nil),
|
ExtendedType: (*descriptor.EnumOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 62001,
|
Field: 62001,
|
||||||
Name: "gogoproto.goproto_enum_prefix",
|
Name: "gogoproto.goproto_enum_prefix",
|
||||||
Tag: "varint,62001,opt,name=goproto_enum_prefix,json=goprotoEnumPrefix",
|
Tag: "varint,62001,opt,name=goproto_enum_prefix",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_GoprotoEnumStringer = &proto.ExtensionDesc{
|
var E_GoprotoEnumStringer = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.EnumOptions)(nil),
|
ExtendedType: (*descriptor.EnumOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 62021,
|
Field: 62021,
|
||||||
Name: "gogoproto.goproto_enum_stringer",
|
Name: "gogoproto.goproto_enum_stringer",
|
||||||
Tag: "varint,62021,opt,name=goproto_enum_stringer,json=goprotoEnumStringer",
|
Tag: "varint,62021,opt,name=goproto_enum_stringer",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_EnumStringer = &proto.ExtensionDesc{
|
var E_EnumStringer = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.EnumOptions)(nil),
|
ExtendedType: (*descriptor.EnumOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 62022,
|
Field: 62022,
|
||||||
Name: "gogoproto.enum_stringer",
|
Name: "gogoproto.enum_stringer",
|
||||||
Tag: "varint,62022,opt,name=enum_stringer,json=enumStringer",
|
Tag: "varint,62022,opt,name=enum_stringer",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_EnumCustomname = &proto.ExtensionDesc{
|
var E_EnumCustomname = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.EnumOptions)(nil),
|
ExtendedType: (*descriptor.EnumOptions)(nil),
|
||||||
ExtensionType: (*string)(nil),
|
ExtensionType: (*string)(nil),
|
||||||
Field: 62023,
|
Field: 62023,
|
||||||
Name: "gogoproto.enum_customname",
|
Name: "gogoproto.enum_customname",
|
||||||
Tag: "bytes,62023,opt,name=enum_customname,json=enumCustomname",
|
Tag: "bytes,62023,opt,name=enum_customname",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_Enumdecl = &proto.ExtensionDesc{
|
var E_Enumdecl = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.EnumOptions)(nil),
|
ExtendedType: (*descriptor.EnumOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 62024,
|
Field: 62024,
|
||||||
Name: "gogoproto.enumdecl",
|
Name: "gogoproto.enumdecl",
|
||||||
@ -73,304 +67,331 @@ var E_Enumdecl = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_EnumvalueCustomname = &proto.ExtensionDesc{
|
var E_EnumvalueCustomname = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.EnumValueOptions)(nil),
|
ExtendedType: (*descriptor.EnumValueOptions)(nil),
|
||||||
ExtensionType: (*string)(nil),
|
ExtensionType: (*string)(nil),
|
||||||
Field: 66001,
|
Field: 66001,
|
||||||
Name: "gogoproto.enumvalue_customname",
|
Name: "gogoproto.enumvalue_customname",
|
||||||
Tag: "bytes,66001,opt,name=enumvalue_customname,json=enumvalueCustomname",
|
Tag: "bytes,66001,opt,name=enumvalue_customname",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_GoprotoGettersAll = &proto.ExtensionDesc{
|
var E_GoprotoGettersAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63001,
|
Field: 63001,
|
||||||
Name: "gogoproto.goproto_getters_all",
|
Name: "gogoproto.goproto_getters_all",
|
||||||
Tag: "varint,63001,opt,name=goproto_getters_all,json=goprotoGettersAll",
|
Tag: "varint,63001,opt,name=goproto_getters_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_GoprotoEnumPrefixAll = &proto.ExtensionDesc{
|
var E_GoprotoEnumPrefixAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63002,
|
Field: 63002,
|
||||||
Name: "gogoproto.goproto_enum_prefix_all",
|
Name: "gogoproto.goproto_enum_prefix_all",
|
||||||
Tag: "varint,63002,opt,name=goproto_enum_prefix_all,json=goprotoEnumPrefixAll",
|
Tag: "varint,63002,opt,name=goproto_enum_prefix_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_GoprotoStringerAll = &proto.ExtensionDesc{
|
var E_GoprotoStringerAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63003,
|
Field: 63003,
|
||||||
Name: "gogoproto.goproto_stringer_all",
|
Name: "gogoproto.goproto_stringer_all",
|
||||||
Tag: "varint,63003,opt,name=goproto_stringer_all,json=goprotoStringerAll",
|
Tag: "varint,63003,opt,name=goproto_stringer_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_VerboseEqualAll = &proto.ExtensionDesc{
|
var E_VerboseEqualAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63004,
|
Field: 63004,
|
||||||
Name: "gogoproto.verbose_equal_all",
|
Name: "gogoproto.verbose_equal_all",
|
||||||
Tag: "varint,63004,opt,name=verbose_equal_all,json=verboseEqualAll",
|
Tag: "varint,63004,opt,name=verbose_equal_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_FaceAll = &proto.ExtensionDesc{
|
var E_FaceAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63005,
|
Field: 63005,
|
||||||
Name: "gogoproto.face_all",
|
Name: "gogoproto.face_all",
|
||||||
Tag: "varint,63005,opt,name=face_all,json=faceAll",
|
Tag: "varint,63005,opt,name=face_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_GostringAll = &proto.ExtensionDesc{
|
var E_GostringAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63006,
|
Field: 63006,
|
||||||
Name: "gogoproto.gostring_all",
|
Name: "gogoproto.gostring_all",
|
||||||
Tag: "varint,63006,opt,name=gostring_all,json=gostringAll",
|
Tag: "varint,63006,opt,name=gostring_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_PopulateAll = &proto.ExtensionDesc{
|
var E_PopulateAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63007,
|
Field: 63007,
|
||||||
Name: "gogoproto.populate_all",
|
Name: "gogoproto.populate_all",
|
||||||
Tag: "varint,63007,opt,name=populate_all,json=populateAll",
|
Tag: "varint,63007,opt,name=populate_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_StringerAll = &proto.ExtensionDesc{
|
var E_StringerAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63008,
|
Field: 63008,
|
||||||
Name: "gogoproto.stringer_all",
|
Name: "gogoproto.stringer_all",
|
||||||
Tag: "varint,63008,opt,name=stringer_all,json=stringerAll",
|
Tag: "varint,63008,opt,name=stringer_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_OnlyoneAll = &proto.ExtensionDesc{
|
var E_OnlyoneAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63009,
|
Field: 63009,
|
||||||
Name: "gogoproto.onlyone_all",
|
Name: "gogoproto.onlyone_all",
|
||||||
Tag: "varint,63009,opt,name=onlyone_all,json=onlyoneAll",
|
Tag: "varint,63009,opt,name=onlyone_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_EqualAll = &proto.ExtensionDesc{
|
var E_EqualAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63013,
|
Field: 63013,
|
||||||
Name: "gogoproto.equal_all",
|
Name: "gogoproto.equal_all",
|
||||||
Tag: "varint,63013,opt,name=equal_all,json=equalAll",
|
Tag: "varint,63013,opt,name=equal_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_DescriptionAll = &proto.ExtensionDesc{
|
var E_DescriptionAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63014,
|
Field: 63014,
|
||||||
Name: "gogoproto.description_all",
|
Name: "gogoproto.description_all",
|
||||||
Tag: "varint,63014,opt,name=description_all,json=descriptionAll",
|
Tag: "varint,63014,opt,name=description_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_TestgenAll = &proto.ExtensionDesc{
|
var E_TestgenAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63015,
|
Field: 63015,
|
||||||
Name: "gogoproto.testgen_all",
|
Name: "gogoproto.testgen_all",
|
||||||
Tag: "varint,63015,opt,name=testgen_all,json=testgenAll",
|
Tag: "varint,63015,opt,name=testgen_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_BenchgenAll = &proto.ExtensionDesc{
|
var E_BenchgenAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63016,
|
Field: 63016,
|
||||||
Name: "gogoproto.benchgen_all",
|
Name: "gogoproto.benchgen_all",
|
||||||
Tag: "varint,63016,opt,name=benchgen_all,json=benchgenAll",
|
Tag: "varint,63016,opt,name=benchgen_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_MarshalerAll = &proto.ExtensionDesc{
|
var E_MarshalerAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63017,
|
Field: 63017,
|
||||||
Name: "gogoproto.marshaler_all",
|
Name: "gogoproto.marshaler_all",
|
||||||
Tag: "varint,63017,opt,name=marshaler_all,json=marshalerAll",
|
Tag: "varint,63017,opt,name=marshaler_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_UnmarshalerAll = &proto.ExtensionDesc{
|
var E_UnmarshalerAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63018,
|
Field: 63018,
|
||||||
Name: "gogoproto.unmarshaler_all",
|
Name: "gogoproto.unmarshaler_all",
|
||||||
Tag: "varint,63018,opt,name=unmarshaler_all,json=unmarshalerAll",
|
Tag: "varint,63018,opt,name=unmarshaler_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_StableMarshalerAll = &proto.ExtensionDesc{
|
var E_StableMarshalerAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63019,
|
Field: 63019,
|
||||||
Name: "gogoproto.stable_marshaler_all",
|
Name: "gogoproto.stable_marshaler_all",
|
||||||
Tag: "varint,63019,opt,name=stable_marshaler_all,json=stableMarshalerAll",
|
Tag: "varint,63019,opt,name=stable_marshaler_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_SizerAll = &proto.ExtensionDesc{
|
var E_SizerAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63020,
|
Field: 63020,
|
||||||
Name: "gogoproto.sizer_all",
|
Name: "gogoproto.sizer_all",
|
||||||
Tag: "varint,63020,opt,name=sizer_all,json=sizerAll",
|
Tag: "varint,63020,opt,name=sizer_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_GoprotoEnumStringerAll = &proto.ExtensionDesc{
|
var E_GoprotoEnumStringerAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63021,
|
Field: 63021,
|
||||||
Name: "gogoproto.goproto_enum_stringer_all",
|
Name: "gogoproto.goproto_enum_stringer_all",
|
||||||
Tag: "varint,63021,opt,name=goproto_enum_stringer_all,json=goprotoEnumStringerAll",
|
Tag: "varint,63021,opt,name=goproto_enum_stringer_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_EnumStringerAll = &proto.ExtensionDesc{
|
var E_EnumStringerAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63022,
|
Field: 63022,
|
||||||
Name: "gogoproto.enum_stringer_all",
|
Name: "gogoproto.enum_stringer_all",
|
||||||
Tag: "varint,63022,opt,name=enum_stringer_all,json=enumStringerAll",
|
Tag: "varint,63022,opt,name=enum_stringer_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_UnsafeMarshalerAll = &proto.ExtensionDesc{
|
var E_UnsafeMarshalerAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63023,
|
Field: 63023,
|
||||||
Name: "gogoproto.unsafe_marshaler_all",
|
Name: "gogoproto.unsafe_marshaler_all",
|
||||||
Tag: "varint,63023,opt,name=unsafe_marshaler_all,json=unsafeMarshalerAll",
|
Tag: "varint,63023,opt,name=unsafe_marshaler_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_UnsafeUnmarshalerAll = &proto.ExtensionDesc{
|
var E_UnsafeUnmarshalerAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63024,
|
Field: 63024,
|
||||||
Name: "gogoproto.unsafe_unmarshaler_all",
|
Name: "gogoproto.unsafe_unmarshaler_all",
|
||||||
Tag: "varint,63024,opt,name=unsafe_unmarshaler_all,json=unsafeUnmarshalerAll",
|
Tag: "varint,63024,opt,name=unsafe_unmarshaler_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_GoprotoExtensionsMapAll = &proto.ExtensionDesc{
|
var E_GoprotoExtensionsMapAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63025,
|
Field: 63025,
|
||||||
Name: "gogoproto.goproto_extensions_map_all",
|
Name: "gogoproto.goproto_extensions_map_all",
|
||||||
Tag: "varint,63025,opt,name=goproto_extensions_map_all,json=goprotoExtensionsMapAll",
|
Tag: "varint,63025,opt,name=goproto_extensions_map_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_GoprotoUnrecognizedAll = &proto.ExtensionDesc{
|
var E_GoprotoUnrecognizedAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63026,
|
Field: 63026,
|
||||||
Name: "gogoproto.goproto_unrecognized_all",
|
Name: "gogoproto.goproto_unrecognized_all",
|
||||||
Tag: "varint,63026,opt,name=goproto_unrecognized_all,json=goprotoUnrecognizedAll",
|
Tag: "varint,63026,opt,name=goproto_unrecognized_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_GogoprotoImport = &proto.ExtensionDesc{
|
var E_GogoprotoImport = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63027,
|
Field: 63027,
|
||||||
Name: "gogoproto.gogoproto_import",
|
Name: "gogoproto.gogoproto_import",
|
||||||
Tag: "varint,63027,opt,name=gogoproto_import,json=gogoprotoImport",
|
Tag: "varint,63027,opt,name=gogoproto_import",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_ProtosizerAll = &proto.ExtensionDesc{
|
var E_ProtosizerAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63028,
|
Field: 63028,
|
||||||
Name: "gogoproto.protosizer_all",
|
Name: "gogoproto.protosizer_all",
|
||||||
Tag: "varint,63028,opt,name=protosizer_all,json=protosizerAll",
|
Tag: "varint,63028,opt,name=protosizer_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_CompareAll = &proto.ExtensionDesc{
|
var E_CompareAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63029,
|
Field: 63029,
|
||||||
Name: "gogoproto.compare_all",
|
Name: "gogoproto.compare_all",
|
||||||
Tag: "varint,63029,opt,name=compare_all,json=compareAll",
|
Tag: "varint,63029,opt,name=compare_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_TypedeclAll = &proto.ExtensionDesc{
|
var E_TypedeclAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63030,
|
Field: 63030,
|
||||||
Name: "gogoproto.typedecl_all",
|
Name: "gogoproto.typedecl_all",
|
||||||
Tag: "varint,63030,opt,name=typedecl_all,json=typedeclAll",
|
Tag: "varint,63030,opt,name=typedecl_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_EnumdeclAll = &proto.ExtensionDesc{
|
var E_EnumdeclAll = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63031,
|
Field: 63031,
|
||||||
Name: "gogoproto.enumdecl_all",
|
Name: "gogoproto.enumdecl_all",
|
||||||
Tag: "varint,63031,opt,name=enumdecl_all,json=enumdeclAll",
|
Tag: "varint,63031,opt,name=enumdecl_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_GoprotoRegistration = &proto.ExtensionDesc{
|
var E_GoprotoRegistration = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 63032,
|
Field: 63032,
|
||||||
Name: "gogoproto.goproto_registration",
|
Name: "gogoproto.goproto_registration",
|
||||||
Tag: "varint,63032,opt,name=goproto_registration,json=goprotoRegistration",
|
Tag: "varint,63032,opt,name=goproto_registration",
|
||||||
|
Filename: "gogo.proto",
|
||||||
|
}
|
||||||
|
|
||||||
|
var E_MessagenameAll = &proto.ExtensionDesc{
|
||||||
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
|
ExtensionType: (*bool)(nil),
|
||||||
|
Field: 63033,
|
||||||
|
Name: "gogoproto.messagename_all",
|
||||||
|
Tag: "varint,63033,opt,name=messagename_all",
|
||||||
|
Filename: "gogo.proto",
|
||||||
|
}
|
||||||
|
|
||||||
|
var E_GoprotoSizecacheAll = &proto.ExtensionDesc{
|
||||||
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
|
ExtensionType: (*bool)(nil),
|
||||||
|
Field: 63034,
|
||||||
|
Name: "gogoproto.goproto_sizecache_all",
|
||||||
|
Tag: "varint,63034,opt,name=goproto_sizecache_all",
|
||||||
|
Filename: "gogo.proto",
|
||||||
|
}
|
||||||
|
|
||||||
|
var E_GoprotoUnkeyedAll = &proto.ExtensionDesc{
|
||||||
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
||||||
|
ExtensionType: (*bool)(nil),
|
||||||
|
Field: 63035,
|
||||||
|
Name: "gogoproto.goproto_unkeyed_all",
|
||||||
|
Tag: "varint,63035,opt,name=goproto_unkeyed_all",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_GoprotoGetters = &proto.ExtensionDesc{
|
var E_GoprotoGetters = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64001,
|
Field: 64001,
|
||||||
Name: "gogoproto.goproto_getters",
|
Name: "gogoproto.goproto_getters",
|
||||||
Tag: "varint,64001,opt,name=goproto_getters,json=goprotoGetters",
|
Tag: "varint,64001,opt,name=goproto_getters",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_GoprotoStringer = &proto.ExtensionDesc{
|
var E_GoprotoStringer = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64003,
|
Field: 64003,
|
||||||
Name: "gogoproto.goproto_stringer",
|
Name: "gogoproto.goproto_stringer",
|
||||||
Tag: "varint,64003,opt,name=goproto_stringer,json=goprotoStringer",
|
Tag: "varint,64003,opt,name=goproto_stringer",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_VerboseEqual = &proto.ExtensionDesc{
|
var E_VerboseEqual = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64004,
|
Field: 64004,
|
||||||
Name: "gogoproto.verbose_equal",
|
Name: "gogoproto.verbose_equal",
|
||||||
Tag: "varint,64004,opt,name=verbose_equal,json=verboseEqual",
|
Tag: "varint,64004,opt,name=verbose_equal",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_Face = &proto.ExtensionDesc{
|
var E_Face = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64005,
|
Field: 64005,
|
||||||
Name: "gogoproto.face",
|
Name: "gogoproto.face",
|
||||||
@ -379,7 +400,7 @@ var E_Face = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Gostring = &proto.ExtensionDesc{
|
var E_Gostring = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64006,
|
Field: 64006,
|
||||||
Name: "gogoproto.gostring",
|
Name: "gogoproto.gostring",
|
||||||
@ -388,7 +409,7 @@ var E_Gostring = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Populate = &proto.ExtensionDesc{
|
var E_Populate = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64007,
|
Field: 64007,
|
||||||
Name: "gogoproto.populate",
|
Name: "gogoproto.populate",
|
||||||
@ -397,7 +418,7 @@ var E_Populate = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Stringer = &proto.ExtensionDesc{
|
var E_Stringer = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 67008,
|
Field: 67008,
|
||||||
Name: "gogoproto.stringer",
|
Name: "gogoproto.stringer",
|
||||||
@ -406,7 +427,7 @@ var E_Stringer = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Onlyone = &proto.ExtensionDesc{
|
var E_Onlyone = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64009,
|
Field: 64009,
|
||||||
Name: "gogoproto.onlyone",
|
Name: "gogoproto.onlyone",
|
||||||
@ -415,7 +436,7 @@ var E_Onlyone = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Equal = &proto.ExtensionDesc{
|
var E_Equal = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64013,
|
Field: 64013,
|
||||||
Name: "gogoproto.equal",
|
Name: "gogoproto.equal",
|
||||||
@ -424,7 +445,7 @@ var E_Equal = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Description = &proto.ExtensionDesc{
|
var E_Description = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64014,
|
Field: 64014,
|
||||||
Name: "gogoproto.description",
|
Name: "gogoproto.description",
|
||||||
@ -433,7 +454,7 @@ var E_Description = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Testgen = &proto.ExtensionDesc{
|
var E_Testgen = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64015,
|
Field: 64015,
|
||||||
Name: "gogoproto.testgen",
|
Name: "gogoproto.testgen",
|
||||||
@ -442,7 +463,7 @@ var E_Testgen = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Benchgen = &proto.ExtensionDesc{
|
var E_Benchgen = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64016,
|
Field: 64016,
|
||||||
Name: "gogoproto.benchgen",
|
Name: "gogoproto.benchgen",
|
||||||
@ -451,7 +472,7 @@ var E_Benchgen = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Marshaler = &proto.ExtensionDesc{
|
var E_Marshaler = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64017,
|
Field: 64017,
|
||||||
Name: "gogoproto.marshaler",
|
Name: "gogoproto.marshaler",
|
||||||
@ -460,7 +481,7 @@ var E_Marshaler = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Unmarshaler = &proto.ExtensionDesc{
|
var E_Unmarshaler = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64018,
|
Field: 64018,
|
||||||
Name: "gogoproto.unmarshaler",
|
Name: "gogoproto.unmarshaler",
|
||||||
@ -469,16 +490,16 @@ var E_Unmarshaler = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_StableMarshaler = &proto.ExtensionDesc{
|
var E_StableMarshaler = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64019,
|
Field: 64019,
|
||||||
Name: "gogoproto.stable_marshaler",
|
Name: "gogoproto.stable_marshaler",
|
||||||
Tag: "varint,64019,opt,name=stable_marshaler,json=stableMarshaler",
|
Tag: "varint,64019,opt,name=stable_marshaler",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_Sizer = &proto.ExtensionDesc{
|
var E_Sizer = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64020,
|
Field: 64020,
|
||||||
Name: "gogoproto.sizer",
|
Name: "gogoproto.sizer",
|
||||||
@ -487,43 +508,43 @@ var E_Sizer = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_UnsafeMarshaler = &proto.ExtensionDesc{
|
var E_UnsafeMarshaler = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64023,
|
Field: 64023,
|
||||||
Name: "gogoproto.unsafe_marshaler",
|
Name: "gogoproto.unsafe_marshaler",
|
||||||
Tag: "varint,64023,opt,name=unsafe_marshaler,json=unsafeMarshaler",
|
Tag: "varint,64023,opt,name=unsafe_marshaler",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_UnsafeUnmarshaler = &proto.ExtensionDesc{
|
var E_UnsafeUnmarshaler = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64024,
|
Field: 64024,
|
||||||
Name: "gogoproto.unsafe_unmarshaler",
|
Name: "gogoproto.unsafe_unmarshaler",
|
||||||
Tag: "varint,64024,opt,name=unsafe_unmarshaler,json=unsafeUnmarshaler",
|
Tag: "varint,64024,opt,name=unsafe_unmarshaler",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_GoprotoExtensionsMap = &proto.ExtensionDesc{
|
var E_GoprotoExtensionsMap = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64025,
|
Field: 64025,
|
||||||
Name: "gogoproto.goproto_extensions_map",
|
Name: "gogoproto.goproto_extensions_map",
|
||||||
Tag: "varint,64025,opt,name=goproto_extensions_map,json=goprotoExtensionsMap",
|
Tag: "varint,64025,opt,name=goproto_extensions_map",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_GoprotoUnrecognized = &proto.ExtensionDesc{
|
var E_GoprotoUnrecognized = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64026,
|
Field: 64026,
|
||||||
Name: "gogoproto.goproto_unrecognized",
|
Name: "gogoproto.goproto_unrecognized",
|
||||||
Tag: "varint,64026,opt,name=goproto_unrecognized,json=goprotoUnrecognized",
|
Tag: "varint,64026,opt,name=goproto_unrecognized",
|
||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
var E_Protosizer = &proto.ExtensionDesc{
|
var E_Protosizer = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64028,
|
Field: 64028,
|
||||||
Name: "gogoproto.protosizer",
|
Name: "gogoproto.protosizer",
|
||||||
@ -532,7 +553,7 @@ var E_Protosizer = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Compare = &proto.ExtensionDesc{
|
var E_Compare = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64029,
|
Field: 64029,
|
||||||
Name: "gogoproto.compare",
|
Name: "gogoproto.compare",
|
||||||
@ -541,7 +562,7 @@ var E_Compare = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Typedecl = &proto.ExtensionDesc{
|
var E_Typedecl = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 64030,
|
Field: 64030,
|
||||||
Name: "gogoproto.typedecl",
|
Name: "gogoproto.typedecl",
|
||||||
@ -549,8 +570,35 @@ var E_Typedecl = &proto.ExtensionDesc{
|
|||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var E_Messagename = &proto.ExtensionDesc{
|
||||||
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
|
ExtensionType: (*bool)(nil),
|
||||||
|
Field: 64033,
|
||||||
|
Name: "gogoproto.messagename",
|
||||||
|
Tag: "varint,64033,opt,name=messagename",
|
||||||
|
Filename: "gogo.proto",
|
||||||
|
}
|
||||||
|
|
||||||
|
var E_GoprotoSizecache = &proto.ExtensionDesc{
|
||||||
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
|
ExtensionType: (*bool)(nil),
|
||||||
|
Field: 64034,
|
||||||
|
Name: "gogoproto.goproto_sizecache",
|
||||||
|
Tag: "varint,64034,opt,name=goproto_sizecache",
|
||||||
|
Filename: "gogo.proto",
|
||||||
|
}
|
||||||
|
|
||||||
|
var E_GoprotoUnkeyed = &proto.ExtensionDesc{
|
||||||
|
ExtendedType: (*descriptor.MessageOptions)(nil),
|
||||||
|
ExtensionType: (*bool)(nil),
|
||||||
|
Field: 64035,
|
||||||
|
Name: "gogoproto.goproto_unkeyed",
|
||||||
|
Tag: "varint,64035,opt,name=goproto_unkeyed",
|
||||||
|
Filename: "gogo.proto",
|
||||||
|
}
|
||||||
|
|
||||||
var E_Nullable = &proto.ExtensionDesc{
|
var E_Nullable = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FieldOptions)(nil),
|
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 65001,
|
Field: 65001,
|
||||||
Name: "gogoproto.nullable",
|
Name: "gogoproto.nullable",
|
||||||
@ -559,7 +607,7 @@ var E_Nullable = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Embed = &proto.ExtensionDesc{
|
var E_Embed = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FieldOptions)(nil),
|
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 65002,
|
Field: 65002,
|
||||||
Name: "gogoproto.embed",
|
Name: "gogoproto.embed",
|
||||||
@ -568,7 +616,7 @@ var E_Embed = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Customtype = &proto.ExtensionDesc{
|
var E_Customtype = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FieldOptions)(nil),
|
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||||
ExtensionType: (*string)(nil),
|
ExtensionType: (*string)(nil),
|
||||||
Field: 65003,
|
Field: 65003,
|
||||||
Name: "gogoproto.customtype",
|
Name: "gogoproto.customtype",
|
||||||
@ -577,7 +625,7 @@ var E_Customtype = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Customname = &proto.ExtensionDesc{
|
var E_Customname = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FieldOptions)(nil),
|
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||||
ExtensionType: (*string)(nil),
|
ExtensionType: (*string)(nil),
|
||||||
Field: 65004,
|
Field: 65004,
|
||||||
Name: "gogoproto.customname",
|
Name: "gogoproto.customname",
|
||||||
@ -586,7 +634,7 @@ var E_Customname = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Jsontag = &proto.ExtensionDesc{
|
var E_Jsontag = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FieldOptions)(nil),
|
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||||
ExtensionType: (*string)(nil),
|
ExtensionType: (*string)(nil),
|
||||||
Field: 65005,
|
Field: 65005,
|
||||||
Name: "gogoproto.jsontag",
|
Name: "gogoproto.jsontag",
|
||||||
@ -595,7 +643,7 @@ var E_Jsontag = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Moretags = &proto.ExtensionDesc{
|
var E_Moretags = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FieldOptions)(nil),
|
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||||
ExtensionType: (*string)(nil),
|
ExtensionType: (*string)(nil),
|
||||||
Field: 65006,
|
Field: 65006,
|
||||||
Name: "gogoproto.moretags",
|
Name: "gogoproto.moretags",
|
||||||
@ -604,7 +652,7 @@ var E_Moretags = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Casttype = &proto.ExtensionDesc{
|
var E_Casttype = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FieldOptions)(nil),
|
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||||
ExtensionType: (*string)(nil),
|
ExtensionType: (*string)(nil),
|
||||||
Field: 65007,
|
Field: 65007,
|
||||||
Name: "gogoproto.casttype",
|
Name: "gogoproto.casttype",
|
||||||
@ -613,7 +661,7 @@ var E_Casttype = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Castkey = &proto.ExtensionDesc{
|
var E_Castkey = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FieldOptions)(nil),
|
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||||
ExtensionType: (*string)(nil),
|
ExtensionType: (*string)(nil),
|
||||||
Field: 65008,
|
Field: 65008,
|
||||||
Name: "gogoproto.castkey",
|
Name: "gogoproto.castkey",
|
||||||
@ -622,7 +670,7 @@ var E_Castkey = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Castvalue = &proto.ExtensionDesc{
|
var E_Castvalue = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FieldOptions)(nil),
|
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||||
ExtensionType: (*string)(nil),
|
ExtensionType: (*string)(nil),
|
||||||
Field: 65009,
|
Field: 65009,
|
||||||
Name: "gogoproto.castvalue",
|
Name: "gogoproto.castvalue",
|
||||||
@ -631,7 +679,7 @@ var E_Castvalue = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Stdtime = &proto.ExtensionDesc{
|
var E_Stdtime = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FieldOptions)(nil),
|
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 65010,
|
Field: 65010,
|
||||||
Name: "gogoproto.stdtime",
|
Name: "gogoproto.stdtime",
|
||||||
@ -640,7 +688,7 @@ var E_Stdtime = &proto.ExtensionDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var E_Stdduration = &proto.ExtensionDesc{
|
var E_Stdduration = &proto.ExtensionDesc{
|
||||||
ExtendedType: (*google_protobuf.FieldOptions)(nil),
|
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||||
ExtensionType: (*bool)(nil),
|
ExtensionType: (*bool)(nil),
|
||||||
Field: 65011,
|
Field: 65011,
|
||||||
Name: "gogoproto.stdduration",
|
Name: "gogoproto.stdduration",
|
||||||
@ -648,6 +696,15 @@ var E_Stdduration = &proto.ExtensionDesc{
|
|||||||
Filename: "gogo.proto",
|
Filename: "gogo.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var E_Wktpointer = &proto.ExtensionDesc{
|
||||||
|
ExtendedType: (*descriptor.FieldOptions)(nil),
|
||||||
|
ExtensionType: (*bool)(nil),
|
||||||
|
Field: 65012,
|
||||||
|
Name: "gogoproto.wktpointer",
|
||||||
|
Tag: "varint,65012,opt,name=wktpointer",
|
||||||
|
Filename: "gogo.proto",
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterExtension(E_GoprotoEnumPrefix)
|
proto.RegisterExtension(E_GoprotoEnumPrefix)
|
||||||
proto.RegisterExtension(E_GoprotoEnumStringer)
|
proto.RegisterExtension(E_GoprotoEnumStringer)
|
||||||
@ -684,6 +741,9 @@ func init() {
|
|||||||
proto.RegisterExtension(E_TypedeclAll)
|
proto.RegisterExtension(E_TypedeclAll)
|
||||||
proto.RegisterExtension(E_EnumdeclAll)
|
proto.RegisterExtension(E_EnumdeclAll)
|
||||||
proto.RegisterExtension(E_GoprotoRegistration)
|
proto.RegisterExtension(E_GoprotoRegistration)
|
||||||
|
proto.RegisterExtension(E_MessagenameAll)
|
||||||
|
proto.RegisterExtension(E_GoprotoSizecacheAll)
|
||||||
|
proto.RegisterExtension(E_GoprotoUnkeyedAll)
|
||||||
proto.RegisterExtension(E_GoprotoGetters)
|
proto.RegisterExtension(E_GoprotoGetters)
|
||||||
proto.RegisterExtension(E_GoprotoStringer)
|
proto.RegisterExtension(E_GoprotoStringer)
|
||||||
proto.RegisterExtension(E_VerboseEqual)
|
proto.RegisterExtension(E_VerboseEqual)
|
||||||
@ -707,6 +767,9 @@ func init() {
|
|||||||
proto.RegisterExtension(E_Protosizer)
|
proto.RegisterExtension(E_Protosizer)
|
||||||
proto.RegisterExtension(E_Compare)
|
proto.RegisterExtension(E_Compare)
|
||||||
proto.RegisterExtension(E_Typedecl)
|
proto.RegisterExtension(E_Typedecl)
|
||||||
|
proto.RegisterExtension(E_Messagename)
|
||||||
|
proto.RegisterExtension(E_GoprotoSizecache)
|
||||||
|
proto.RegisterExtension(E_GoprotoUnkeyed)
|
||||||
proto.RegisterExtension(E_Nullable)
|
proto.RegisterExtension(E_Nullable)
|
||||||
proto.RegisterExtension(E_Embed)
|
proto.RegisterExtension(E_Embed)
|
||||||
proto.RegisterExtension(E_Customtype)
|
proto.RegisterExtension(E_Customtype)
|
||||||
@ -718,87 +781,94 @@ func init() {
|
|||||||
proto.RegisterExtension(E_Castvalue)
|
proto.RegisterExtension(E_Castvalue)
|
||||||
proto.RegisterExtension(E_Stdtime)
|
proto.RegisterExtension(E_Stdtime)
|
||||||
proto.RegisterExtension(E_Stdduration)
|
proto.RegisterExtension(E_Stdduration)
|
||||||
|
proto.RegisterExtension(E_Wktpointer)
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { proto.RegisterFile("gogo.proto", fileDescriptorGogo) }
|
func init() { proto.RegisterFile("gogo.proto", fileDescriptor_592445b5231bc2b9) }
|
||||||
|
|
||||||
var fileDescriptorGogo = []byte{
|
var fileDescriptor_592445b5231bc2b9 = []byte{
|
||||||
// 1220 bytes of a gzipped FileDescriptorProto
|
// 1328 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0x4b, 0x6f, 0x1c, 0x45,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0x49, 0x6f, 0x1c, 0x45,
|
||||||
0x10, 0x80, 0x85, 0x48, 0x14, 0x6f, 0xd9, 0x8e, 0xf1, 0xda, 0x98, 0x10, 0x81, 0x08, 0x9c, 0x38,
|
0x14, 0x80, 0x85, 0x48, 0x64, 0x4f, 0x79, 0x8b, 0xc7, 0xc6, 0x84, 0x08, 0x44, 0xe0, 0xc4, 0xc9,
|
||||||
0xd9, 0xa7, 0x08, 0xa5, 0xad, 0xc8, 0x72, 0x2c, 0xc7, 0x4a, 0x84, 0xc1, 0x98, 0x38, 0xbc, 0x0e,
|
0x3e, 0x45, 0x28, 0x65, 0x45, 0x96, 0x63, 0x39, 0x56, 0x10, 0x0e, 0xc6, 0x89, 0xc3, 0x76, 0x18,
|
||||||
0xab, 0xd9, 0xdd, 0xf6, 0x78, 0x60, 0x66, 0x7a, 0x98, 0xe9, 0x89, 0xe2, 0xdc, 0x50, 0x78, 0x08,
|
0xf5, 0xf4, 0x94, 0xdb, 0x8d, 0xbb, 0xbb, 0x9a, 0xee, 0xea, 0x10, 0xe7, 0x86, 0xc2, 0x22, 0x84,
|
||||||
0x21, 0xde, 0x48, 0x90, 0x90, 0x04, 0x38, 0xf0, 0x7e, 0x86, 0xf7, 0x91, 0x0b, 0x8f, 0x2b, 0xff,
|
0xd8, 0x91, 0x20, 0x21, 0x09, 0x04, 0xc4, 0xbe, 0x86, 0x7d, 0xb9, 0x70, 0x61, 0xb9, 0xf2, 0x1f,
|
||||||
0x81, 0x0b, 0x60, 0xde, 0xbe, 0xf9, 0x82, 0x6a, 0xb6, 0x6a, 0xb6, 0x67, 0xbd, 0x52, 0xf7, 0xde,
|
0xb8, 0x00, 0x66, 0xf7, 0xcd, 0x17, 0xf4, 0xba, 0xdf, 0xeb, 0xa9, 0x69, 0x8f, 0x54, 0x35, 0xb7,
|
||||||
0xc6, 0xeb, 0xfe, 0xbe, 0xad, 0xa9, 0x9a, 0xae, 0xea, 0x59, 0x00, 0x5f, 0xf9, 0x6a, 0x3a, 0x49,
|
0xf6, 0xb8, 0xbe, 0x6f, 0xaa, 0xdf, 0xeb, 0x7a, 0xef, 0x4d, 0x33, 0xe6, 0x49, 0x4f, 0x4e, 0xc6,
|
||||||
0x95, 0x56, 0xf5, 0x1a, 0x5e, 0x17, 0x97, 0x07, 0x0f, 0xf9, 0x4a, 0xf9, 0xa1, 0x9c, 0x29, 0xfe,
|
0x89, 0x54, 0xb2, 0x5e, 0x83, 0xeb, 0xfc, 0x72, 0xdf, 0x7e, 0x4f, 0x4a, 0x2f, 0x10, 0x53, 0xf9,
|
||||||
0x6a, 0xe6, 0xeb, 0x33, 0x6d, 0x99, 0xb5, 0xd2, 0x20, 0xd1, 0x2a, 0xed, 0x2c, 0x16, 0x77, 0xc1,
|
0x5f, 0xcd, 0x6c, 0x75, 0xaa, 0x25, 0x52, 0x37, 0xf1, 0x63, 0x25, 0x93, 0x62, 0x31, 0x3f, 0xc6,
|
||||||
0x04, 0x2d, 0x6e, 0xc8, 0x38, 0x8f, 0x1a, 0x49, 0x2a, 0xd7, 0x83, 0xb3, 0xf5, 0x9b, 0xa6, 0x3b,
|
0xc6, 0x70, 0x71, 0x43, 0x44, 0x59, 0xd8, 0x88, 0x13, 0xb1, 0xea, 0x9f, 0xae, 0x5f, 0x3f, 0x59,
|
||||||
0xe4, 0x34, 0x93, 0xd3, 0x8b, 0x71, 0x1e, 0xdd, 0x9d, 0xe8, 0x40, 0xc5, 0xd9, 0x81, 0xab, 0xbf,
|
0x90, 0x93, 0x44, 0x4e, 0xce, 0x47, 0x59, 0x78, 0x47, 0xac, 0x7c, 0x19, 0xa5, 0x7b, 0xaf, 0xfc,
|
||||||
0x5c, 0x7b, 0xe8, 0x9a, 0xdb, 0x87, 0x56, 0xc7, 0x09, 0xc5, 0xff, 0xad, 0x14, 0xa0, 0x58, 0x85,
|
0x72, 0xf5, 0xfe, 0xab, 0x6e, 0xe9, 0x5f, 0x1e, 0x45, 0x14, 0xfe, 0xb7, 0x94, 0x83, 0x7c, 0x99,
|
||||||
0xeb, 0x2b, 0xbe, 0x4c, 0xa7, 0x41, 0xec, 0xcb, 0xd4, 0x62, 0xfc, 0x9e, 0x8c, 0x13, 0x86, 0xf1,
|
0x5d, 0xd3, 0xe1, 0x4b, 0x55, 0xe2, 0x47, 0x9e, 0x48, 0x0c, 0xc6, 0xef, 0xd1, 0x38, 0xa6, 0x19,
|
||||||
0x5e, 0x42, 0xc5, 0x02, 0x8c, 0x0e, 0xe2, 0xfa, 0x81, 0x5c, 0x23, 0xd2, 0x94, 0x2c, 0xc1, 0x58,
|
0x8f, 0x23, 0xca, 0xe7, 0xd8, 0x50, 0x2f, 0xae, 0x1f, 0xd0, 0x35, 0x28, 0x74, 0xc9, 0x02, 0x1b,
|
||||||
0x21, 0x69, 0xe5, 0x99, 0x56, 0x51, 0xec, 0x45, 0xd2, 0xa2, 0xf9, 0xb1, 0xd0, 0xd4, 0x56, 0xf7,
|
0xc9, 0x25, 0x6e, 0x96, 0x2a, 0x19, 0x46, 0x4e, 0x28, 0x0c, 0x9a, 0x1f, 0x73, 0x4d, 0x6d, 0x79,
|
||||||
0x23, 0xb6, 0x50, 0x52, 0x42, 0xc0, 0x10, 0x7e, 0xd2, 0x96, 0xad, 0xd0, 0x62, 0xf8, 0x89, 0x02,
|
0x18, 0xb0, 0xb9, 0x92, 0xe2, 0x9c, 0xf5, 0xc3, 0x27, 0x2d, 0xe1, 0x06, 0x06, 0xc3, 0x4f, 0xb8,
|
||||||
0x29, 0xd7, 0x8b, 0xd3, 0x30, 0x89, 0xd7, 0x67, 0xbc, 0x30, 0x97, 0x66, 0x24, 0xb7, 0xf6, 0xf5,
|
0x91, 0x72, 0x3d, 0x3f, 0xc9, 0xc6, 0xe1, 0xfa, 0x94, 0x13, 0x64, 0x42, 0xdf, 0xc9, 0x4d, 0x5d,
|
||||||
0x9c, 0xc6, 0x65, 0x2c, 0xfb, 0xf9, 0xfc, 0x9e, 0x22, 0x9c, 0x89, 0x52, 0x60, 0xc4, 0x64, 0x54,
|
0x3d, 0x27, 0x61, 0x19, 0xc9, 0x7e, 0x3e, 0xbb, 0x2b, 0xdf, 0xce, 0x58, 0x29, 0xd0, 0xf6, 0xa4,
|
||||||
0xd1, 0x97, 0x5a, 0xcb, 0x34, 0x6b, 0x78, 0x61, 0xbf, 0xf0, 0x8e, 0x07, 0x61, 0x69, 0xbc, 0xb0,
|
0x65, 0xd1, 0x13, 0x4a, 0x89, 0x24, 0x6d, 0x38, 0x41, 0xb7, 0xed, 0x1d, 0xf1, 0x83, 0xd2, 0x78,
|
||||||
0x55, 0xad, 0xe2, 0x52, 0x87, 0x9c, 0x0f, 0x43, 0xb1, 0x06, 0x37, 0xf4, 0x79, 0x2a, 0x1c, 0x9c,
|
0x6e, 0xb3, 0x33, 0x8b, 0x0b, 0x05, 0x39, 0x1b, 0x04, 0x7c, 0x85, 0x5d, 0xdb, 0xe5, 0xa9, 0xb0,
|
||||||
0x17, 0xc9, 0x39, 0xb9, 0xeb, 0xc9, 0x40, 0xed, 0x0a, 0xf0, 0xe7, 0x65, 0x2d, 0x1d, 0x9c, 0xaf,
|
0x70, 0x9e, 0x47, 0xe7, 0xf8, 0x8e, 0x27, 0x03, 0xb4, 0x4b, 0x8c, 0x3e, 0x2f, 0x73, 0x69, 0xe1,
|
||||||
0x93, 0xb3, 0x4e, 0x2c, 0x97, 0x14, 0x8d, 0x27, 0x61, 0xfc, 0x8c, 0x4c, 0x9b, 0x2a, 0x93, 0x0d,
|
0x7c, 0x19, 0x9d, 0x75, 0x64, 0x29, 0xa5, 0x60, 0xbc, 0x8d, 0x8d, 0x9e, 0x12, 0x49, 0x53, 0xa6,
|
||||||
0xf9, 0x68, 0xee, 0x85, 0x0e, 0xba, 0x4b, 0xa4, 0x1b, 0x23, 0x70, 0x11, 0x39, 0x74, 0x1d, 0x81,
|
0xa2, 0x21, 0x1e, 0xc8, 0x9c, 0xc0, 0x42, 0x77, 0x01, 0x75, 0x23, 0x08, 0xce, 0x03, 0x07, 0xae,
|
||||||
0xa1, 0x75, 0xaf, 0x25, 0x1d, 0x14, 0x97, 0x49, 0xb1, 0x0f, 0xd7, 0x23, 0x3a, 0x0f, 0x23, 0xbe,
|
0x83, 0xac, 0x7f, 0xd5, 0x71, 0x85, 0x85, 0xe2, 0x22, 0x2a, 0xfa, 0x60, 0x3d, 0xa0, 0xb3, 0x6c,
|
||||||
0xea, 0xdc, 0x92, 0x03, 0x7e, 0x85, 0xf0, 0x61, 0x66, 0x48, 0x91, 0xa8, 0x24, 0x0f, 0x3d, 0xed,
|
0xd0, 0x93, 0xc5, 0x2d, 0x59, 0xe0, 0x97, 0x10, 0x1f, 0x20, 0x06, 0x15, 0xb1, 0x8c, 0xb3, 0xc0,
|
||||||
0x12, 0xc1, 0x1b, 0xac, 0x60, 0x86, 0x14, 0x03, 0xa4, 0xf5, 0x4d, 0x56, 0x64, 0x46, 0x3e, 0xe7,
|
0x51, 0x36, 0x3b, 0x78, 0x85, 0x14, 0xc4, 0xa0, 0xa2, 0x87, 0xb0, 0xbe, 0x4a, 0x8a, 0x54, 0x8b,
|
||||||
0x60, 0x58, 0xc5, 0xe1, 0xa6, 0x8a, 0x5d, 0x82, 0x78, 0x8b, 0x0c, 0x40, 0x08, 0x0a, 0x66, 0xa1,
|
0xe7, 0x0c, 0x1b, 0x90, 0x51, 0xb0, 0x21, 0x23, 0x9b, 0x4d, 0x5c, 0x46, 0x03, 0x43, 0x04, 0x04,
|
||||||
0xe6, 0x5a, 0x88, 0xb7, 0xb7, 0x78, 0x7b, 0x70, 0x05, 0x96, 0x60, 0x8c, 0x1b, 0x54, 0xa0, 0x62,
|
0xd3, 0xac, 0x66, 0x9b, 0x88, 0x37, 0x36, 0xe9, 0x78, 0x50, 0x06, 0x16, 0xd8, 0x08, 0x15, 0x28,
|
||||||
0x07, 0xc5, 0x3b, 0xa4, 0xd8, 0x6f, 0x60, 0x74, 0x1b, 0x5a, 0x66, 0xda, 0x97, 0x2e, 0x92, 0x77,
|
0x5f, 0x46, 0x16, 0x8a, 0x37, 0x51, 0x31, 0xac, 0x61, 0x78, 0x1b, 0x4a, 0xa4, 0xca, 0x13, 0x36,
|
||||||
0xf9, 0x36, 0x08, 0xa1, 0x54, 0x36, 0x65, 0xdc, 0xda, 0x70, 0x33, 0xbc, 0xc7, 0xa9, 0x64, 0x06,
|
0x92, 0xb7, 0xe8, 0x36, 0x10, 0xc1, 0x50, 0x36, 0x45, 0xe4, 0xae, 0xd9, 0x19, 0xde, 0xa6, 0x50,
|
||||||
0x15, 0x0b, 0x30, 0x1a, 0x79, 0x69, 0xb6, 0xe1, 0x85, 0x4e, 0xe5, 0x78, 0x9f, 0x1c, 0x23, 0x25,
|
0x12, 0x03, 0x8a, 0x39, 0x36, 0x14, 0x3a, 0x49, 0xba, 0xe6, 0x04, 0x56, 0xe9, 0x78, 0x07, 0x1d,
|
||||||
0x44, 0x19, 0xc9, 0xe3, 0x41, 0x34, 0x1f, 0x70, 0x46, 0x0c, 0x8c, 0xb6, 0x5e, 0xa6, 0xbd, 0x66,
|
0x83, 0x25, 0x84, 0x11, 0xc9, 0xa2, 0x5e, 0x34, 0xef, 0x52, 0x44, 0x34, 0x0c, 0x8f, 0x5e, 0xaa,
|
||||||
0x28, 0x1b, 0x83, 0xd8, 0x3e, 0xe4, 0xad, 0xd7, 0x61, 0x97, 0x4d, 0xe3, 0x2c, 0xd4, 0xb2, 0xe0,
|
0x9c, 0x66, 0x20, 0x1a, 0xbd, 0xd8, 0xde, 0xa3, 0xa3, 0x57, 0xb0, 0x8b, 0xba, 0x71, 0x9a, 0xd5,
|
||||||
0x9c, 0x93, 0xe6, 0x23, 0xae, 0x74, 0x01, 0x20, 0xfc, 0x00, 0xdc, 0xd8, 0x77, 0x4c, 0x38, 0xc8,
|
0x52, 0xff, 0x8c, 0x95, 0xe6, 0x7d, 0xca, 0x74, 0x0e, 0x00, 0x7c, 0x0f, 0xbb, 0xae, 0x6b, 0x9b,
|
||||||
0x3e, 0x26, 0xd9, 0x54, 0x9f, 0x51, 0x41, 0x2d, 0x61, 0x50, 0xe5, 0x27, 0xdc, 0x12, 0x64, 0x8f,
|
0xb0, 0x90, 0x7d, 0x80, 0xb2, 0x89, 0x2e, 0xad, 0x02, 0x4b, 0x42, 0xaf, 0xca, 0x0f, 0xa9, 0x24,
|
||||||
0x6b, 0x05, 0x26, 0xf3, 0x38, 0xf3, 0xd6, 0x07, 0xcb, 0xda, 0xa7, 0x9c, 0xb5, 0x0e, 0x5b, 0xc9,
|
0x88, 0x8a, 0x6b, 0x89, 0x8d, 0x67, 0x51, 0xea, 0xac, 0xf6, 0x16, 0xb5, 0x8f, 0x28, 0x6a, 0x05,
|
||||||
0xda, 0x29, 0x98, 0x22, 0xe3, 0x60, 0x75, 0xfd, 0x8c, 0x1b, 0x6b, 0x87, 0x5e, 0xab, 0x56, 0xf7,
|
0xdb, 0x11, 0xb5, 0x13, 0x6c, 0x02, 0x8d, 0xbd, 0xe5, 0xf5, 0x63, 0x2a, 0xac, 0x05, 0xbd, 0xd2,
|
||||||
0x21, 0x38, 0x58, 0xa6, 0xf3, 0xac, 0x96, 0x71, 0x86, 0x4c, 0x23, 0xf2, 0x12, 0x07, 0xf3, 0x55,
|
0x99, 0xdd, 0xfb, 0xd8, 0xbe, 0x32, 0x9c, 0xa7, 0x95, 0x88, 0x52, 0x60, 0x1a, 0xa1, 0x13, 0x5b,
|
||||||
0x32, 0x73, 0xc7, 0x5f, 0x2c, 0x05, 0xcb, 0x5e, 0x82, 0xf2, 0xfb, 0xe1, 0x00, 0xcb, 0xf3, 0x38,
|
0x98, 0xaf, 0xa0, 0x99, 0x2a, 0xfe, 0x7c, 0x29, 0x58, 0x74, 0x62, 0x90, 0xdf, 0xcd, 0xf6, 0x92,
|
||||||
0x95, 0x2d, 0xe5, 0xc7, 0xc1, 0x39, 0xd9, 0x76, 0x50, 0x7f, 0xde, 0x53, 0xaa, 0x35, 0x03, 0x47,
|
0x3c, 0x8b, 0x12, 0xe1, 0x4a, 0x2f, 0xf2, 0xcf, 0x88, 0x96, 0x85, 0xfa, 0x93, 0x4a, 0xaa, 0x56,
|
||||||
0xf3, 0x09, 0xb8, 0xae, 0x3c, 0xab, 0x34, 0x82, 0x28, 0x51, 0xa9, 0xb6, 0x18, 0xbf, 0xe0, 0x4a,
|
0x34, 0x1c, 0xcc, 0x47, 0xd9, 0x9e, 0x72, 0x56, 0x69, 0xf8, 0x61, 0x2c, 0x13, 0x65, 0x30, 0x7e,
|
||||||
0x95, 0xdc, 0x89, 0x02, 0x13, 0x8b, 0xb0, 0xbf, 0xf8, 0xd3, 0xf5, 0x91, 0xfc, 0x92, 0x44, 0xa3,
|
0x4a, 0x99, 0x2a, 0xb9, 0xa3, 0x39, 0xc6, 0xe7, 0xd9, 0x70, 0xfe, 0xa7, 0xed, 0x23, 0xf9, 0x19,
|
||||||
0x5d, 0x8a, 0x1a, 0x47, 0x4b, 0x45, 0x89, 0x97, 0xba, 0xf4, 0xbf, 0xaf, 0xb8, 0x71, 0x10, 0x42,
|
0x8a, 0x86, 0xda, 0x14, 0x16, 0x0e, 0x57, 0x86, 0xb1, 0x93, 0xd8, 0xd4, 0xbf, 0xcf, 0xa9, 0x70,
|
||||||
0x8d, 0x43, 0x6f, 0x26, 0x12, 0xa7, 0xbd, 0x83, 0xe1, 0x6b, 0x6e, 0x1c, 0xcc, 0x90, 0x82, 0x0f,
|
0x20, 0x82, 0x85, 0x43, 0x6d, 0xc4, 0x02, 0xba, 0xbd, 0x85, 0xe1, 0x0b, 0x2a, 0x1c, 0xc4, 0xa0,
|
||||||
0x0c, 0x0e, 0x8a, 0x6f, 0x58, 0xc1, 0x0c, 0x2a, 0xee, 0xe9, 0x0e, 0xda, 0x54, 0xfa, 0x41, 0xa6,
|
0x82, 0x06, 0x06, 0x0b, 0xc5, 0x97, 0xa4, 0x20, 0x06, 0x14, 0x77, 0xb6, 0x1b, 0x6d, 0x22, 0x3c,
|
||||||
0x53, 0x0f, 0x57, 0x5b, 0x54, 0xdf, 0x6e, 0x55, 0x0f, 0x61, 0xab, 0x06, 0x2a, 0x4e, 0xc2, 0x58,
|
0x3f, 0x55, 0x89, 0x03, 0xab, 0x0d, 0xaa, 0xaf, 0x36, 0x3b, 0x87, 0xb0, 0x65, 0x0d, 0x85, 0x4a,
|
||||||
0xcf, 0x11, 0xa3, 0x7e, 0xcb, 0x2e, 0xdb, 0xb2, 0xcc, 0x32, 0xcf, 0x2f, 0x85, 0x8f, 0x6d, 0x53,
|
0x14, 0x8a, 0x34, 0x75, 0x3c, 0x01, 0x13, 0x87, 0xc5, 0xc6, 0xbe, 0xa6, 0x4a, 0xa4, 0x61, 0xb0,
|
||||||
0x33, 0xaa, 0x9e, 0x30, 0xc4, 0x9d, 0x58, 0xf7, 0xea, 0x39, 0xc0, 0x2e, 0x3b, 0xbf, 0x5d, 0x96,
|
0x37, 0x6d, 0x42, 0x84, 0xb0, 0xbb, 0x8e, 0xbb, 0x66, 0xa3, 0xfb, 0xa6, 0xb2, 0xb9, 0xe3, 0xc4,
|
||||||
0xbe, 0x72, 0x0c, 0x10, 0xc7, 0x61, 0xb4, 0x72, 0x06, 0xb0, 0xab, 0x1e, 0x27, 0xd5, 0x88, 0x79,
|
0x82, 0x53, 0x9b, 0x7f, 0xb2, 0x68, 0x5d, 0x6c, 0x58, 0x3d, 0x9d, 0xdf, 0x56, 0xe6, 0x9f, 0x95,
|
||||||
0x04, 0x10, 0x87, 0x61, 0x0f, 0xce, 0x73, 0x3b, 0xfe, 0x04, 0xe1, 0xc5, 0x72, 0x71, 0x14, 0x86,
|
0x82, 0x2c, 0x6a, 0xc8, 0x48, 0x65, 0x9e, 0xaa, 0xdf, 0xb8, 0xc3, 0xb5, 0x58, 0xdc, 0x17, 0xe9,
|
||||||
0x78, 0x8e, 0xdb, 0xd1, 0x27, 0x09, 0x2d, 0x11, 0xc4, 0x79, 0x86, 0xdb, 0xf1, 0xa7, 0x18, 0x67,
|
0x1e, 0xda, 0xc2, 0xfb, 0xed, 0x1c, 0xa7, 0xf8, 0xed, 0xf0, 0x90, 0x77, 0x0e, 0x3d, 0x66, 0xd9,
|
||||||
0x04, 0x71, 0xf7, 0x14, 0x7e, 0xf7, 0xcc, 0x1e, 0xea, 0xc3, 0x9c, 0xbb, 0x59, 0xd8, 0x47, 0xc3,
|
0xd9, 0xad, 0xf2, 0x39, 0xef, 0x98, 0x79, 0xf8, 0x11, 0x36, 0xd4, 0x31, 0xf0, 0x98, 0x55, 0x0f,
|
||||||
0xdb, 0x4e, 0x3f, 0x4d, 0x5f, 0xce, 0x84, 0xb8, 0x03, 0xf6, 0x3a, 0x26, 0xfc, 0x59, 0x42, 0x3b,
|
0xa3, 0x6a, 0x50, 0x9f, 0x77, 0xf8, 0x01, 0xb6, 0x0b, 0x86, 0x17, 0x33, 0xfe, 0x08, 0xe2, 0xf9,
|
||||||
0xeb, 0xc5, 0x02, 0x0c, 0x1b, 0x03, 0xdb, 0x8e, 0x3f, 0x47, 0xb8, 0x49, 0x61, 0xe8, 0x34, 0xb0,
|
0x72, 0x7e, 0x88, 0xf5, 0xd3, 0xd0, 0x62, 0x46, 0x1f, 0x45, 0xb4, 0x44, 0x00, 0xa7, 0x81, 0xc5,
|
||||||
0xed, 0x82, 0xe7, 0x39, 0x74, 0x22, 0x30, 0x6d, 0x3c, 0xab, 0xed, 0xf4, 0x0b, 0x9c, 0x75, 0x46,
|
0x8c, 0x3f, 0x46, 0x38, 0x21, 0x80, 0xdb, 0x87, 0xf0, 0xbb, 0x27, 0x76, 0x61, 0xd3, 0xa1, 0xd8,
|
||||||
0xc4, 0x1c, 0xd4, 0xca, 0xfe, 0x6b, 0xe7, 0x5f, 0x24, 0xbe, 0xcb, 0x60, 0x06, 0x8c, 0xfe, 0x6f,
|
0x4d, 0xb3, 0x3e, 0x9c, 0x54, 0xcc, 0xf4, 0xe3, 0xf8, 0xe5, 0x44, 0xf0, 0x5b, 0xd9, 0x6e, 0xcb,
|
||||||
0x57, 0xbc, 0xc4, 0x19, 0x30, 0x28, 0xdc, 0x46, 0xbd, 0x33, 0xdd, 0x6e, 0x7a, 0x99, 0xb7, 0x51,
|
0x80, 0x3f, 0x89, 0x68, 0xb1, 0x9e, 0xcf, 0xb1, 0x01, 0x6d, 0x3a, 0x31, 0xe3, 0x4f, 0x21, 0xae,
|
||||||
0xcf, 0x48, 0xc7, 0x6a, 0x16, 0x6d, 0xd0, 0xae, 0x78, 0x85, 0xab, 0x59, 0xac, 0xc7, 0x30, 0x7a,
|
0x53, 0xb0, 0x75, 0x9c, 0x4e, 0xcc, 0x82, 0xa7, 0x69, 0xeb, 0x48, 0x40, 0xd8, 0x68, 0x30, 0x31,
|
||||||
0x87, 0xa4, 0xdd, 0xf1, 0x2a, 0x87, 0xd1, 0x33, 0x23, 0xc5, 0x0a, 0xd4, 0x77, 0x0f, 0x48, 0xbb,
|
0xd3, 0xcf, 0x50, 0xd4, 0x09, 0xe1, 0x33, 0xac, 0x56, 0x36, 0x1b, 0x33, 0xff, 0x2c, 0xf2, 0x6d,
|
||||||
0xef, 0x35, 0xf2, 0x8d, 0xef, 0x9a, 0x8f, 0xe2, 0x3e, 0x98, 0xea, 0x3f, 0x1c, 0xed, 0xd6, 0x0b,
|
0x06, 0x22, 0xa0, 0x35, 0x3b, 0xb3, 0xe2, 0x39, 0x8a, 0x80, 0x46, 0xc1, 0x31, 0xaa, 0x0e, 0x30,
|
||||||
0xdb, 0x3d, 0xaf, 0x33, 0xe6, 0x6c, 0x14, 0xa7, 0xba, 0x5d, 0xd6, 0x1c, 0x8c, 0x76, 0xed, 0xc5,
|
0x66, 0xd3, 0xf3, 0x74, 0x8c, 0x2a, 0xf3, 0x0b, 0x64, 0x33, 0xaf, 0xf9, 0x66, 0xc5, 0x0b, 0x94,
|
||||||
0xed, 0x6a, 0xa3, 0x35, 0xe7, 0xa2, 0x98, 0x07, 0xe8, 0xce, 0x24, 0xbb, 0xeb, 0x12, 0xb9, 0x0c,
|
0xcd, 0x7c, 0x3d, 0x6c, 0xa3, 0x3a, 0x11, 0x98, 0x1d, 0x2f, 0xd2, 0x36, 0x2a, 0x03, 0x01, 0x5f,
|
||||||
0x08, 0xb7, 0x06, 0x8d, 0x24, 0x3b, 0x7f, 0x99, 0xb7, 0x06, 0x11, 0xb8, 0x35, 0x78, 0x1a, 0xd9,
|
0x62, 0xf5, 0x9d, 0xd3, 0x80, 0xd9, 0xf7, 0x12, 0xfa, 0x46, 0x77, 0x0c, 0x03, 0xfc, 0x2e, 0x36,
|
||||||
0xe9, 0x2b, 0xbc, 0x35, 0x18, 0x11, 0xb3, 0x30, 0x14, 0xe7, 0x61, 0x88, 0xcf, 0x56, 0xfd, 0xe6,
|
0xd1, 0x7d, 0x12, 0x30, 0x5b, 0xcf, 0x6d, 0x55, 0x7e, 0xbb, 0xe9, 0x83, 0x00, 0x3f, 0xd1, 0x6e,
|
||||||
0x3e, 0xe3, 0x46, 0x86, 0x6d, 0x86, 0x7f, 0xdd, 0x21, 0x98, 0x01, 0x71, 0x18, 0xf6, 0xca, 0xa8,
|
0x29, 0xfa, 0x14, 0x60, 0xd6, 0x9e, 0xdf, 0xea, 0x2c, 0xdc, 0xfa, 0x10, 0xc0, 0x67, 0x19, 0x6b,
|
||||||
0x29, 0xdb, 0x36, 0xf2, 0xb7, 0x1d, 0xee, 0x27, 0xb8, 0x5a, 0xcc, 0x01, 0x74, 0x5e, 0xa6, 0x31,
|
0x37, 0x60, 0xb3, 0xeb, 0x02, 0xba, 0x34, 0x08, 0x8e, 0x06, 0xf6, 0x5f, 0x33, 0x7f, 0x91, 0x8e,
|
||||||
0x0a, 0x1b, 0xfb, 0xfb, 0x4e, 0xe7, 0xbd, 0xde, 0x40, 0xba, 0x82, 0xe2, 0x6d, 0xdc, 0x22, 0xd8,
|
0x06, 0x12, 0x70, 0x34, 0xa8, 0xf5, 0x9a, 0xe9, 0x4b, 0x74, 0x34, 0x08, 0x81, 0x27, 0x5b, 0xeb,
|
||||||
0xaa, 0x0a, 0x8a, 0x17, 0xf0, 0x23, 0xb0, 0xef, 0xe1, 0x4c, 0xc5, 0xda, 0xf3, 0x6d, 0xf4, 0x1f,
|
0x6e, 0x66, 0xc3, 0x65, 0x7a, 0xb2, 0x35, 0x8a, 0x1f, 0x63, 0xa3, 0x3b, 0x1a, 0xa2, 0x59, 0xf5,
|
||||||
0x44, 0xf3, 0x7a, 0x4c, 0x58, 0xa4, 0x52, 0xa9, 0x3d, 0x3f, 0xb3, 0xb1, 0x7f, 0x12, 0x5b, 0x02,
|
0x1a, 0xaa, 0xf6, 0x54, 0xfb, 0xa1, 0xde, 0xbc, 0xb0, 0x19, 0x9a, 0x6d, 0xaf, 0x57, 0x9a, 0x17,
|
||||||
0x08, 0xb7, 0xbc, 0x4c, 0xbb, 0xdc, 0xf7, 0x5f, 0x0c, 0x33, 0x80, 0x41, 0xe3, 0xf5, 0x23, 0x72,
|
0xf6, 0x42, 0x3e, 0xcd, 0xfa, 0xa3, 0x2c, 0x08, 0xe0, 0xf0, 0xd4, 0x6f, 0xe8, 0xd2, 0x4d, 0x45,
|
||||||
0xd3, 0xc6, 0xfe, 0xcd, 0x41, 0xd3, 0x7a, 0x71, 0x14, 0x6a, 0x78, 0x59, 0xfc, 0x0e, 0x61, 0x83,
|
0xd0, 0x22, 0xc5, 0xaf, 0xdb, 0x18, 0x1d, 0x02, 0xf8, 0x01, 0xb6, 0x5b, 0x84, 0x4d, 0xd1, 0x32,
|
||||||
0xff, 0x21, 0xb8, 0x4b, 0xe0, 0x37, 0x67, 0xba, 0xad, 0x03, 0x7b, 0xb2, 0xff, 0xa5, 0x4a, 0xf3,
|
0x91, 0xbf, 0x6d, 0x53, 0xc1, 0x84, 0xd5, 0x7c, 0x86, 0xb1, 0xe2, 0xd5, 0x08, 0x84, 0xd9, 0xc4,
|
||||||
0x7a, 0x31, 0x0f, 0xc3, 0x99, 0x6e, 0xb7, 0x73, 0x3a, 0xd1, 0x58, 0xf0, 0xff, 0x76, 0xca, 0x97,
|
0xfe, 0xbe, 0x5d, 0xbc, 0xa5, 0xd1, 0x90, 0xb6, 0x20, 0x4f, 0x8a, 0x41, 0xb0, 0xd9, 0x29, 0xc8,
|
||||||
0xdc, 0x92, 0x39, 0xb6, 0x08, 0x13, 0x2d, 0x15, 0xf5, 0x82, 0xc7, 0x60, 0x49, 0x2d, 0xa9, 0x95,
|
0x33, 0x72, 0x90, 0xf5, 0xdd, 0x9f, 0xca, 0x48, 0x39, 0x9e, 0x89, 0xfe, 0x03, 0x69, 0x5a, 0x0f,
|
||||||
0x62, 0x17, 0x3d, 0x78, 0x9b, 0x1f, 0xe8, 0x8d, 0xbc, 0x39, 0xdd, 0x52, 0xd1, 0x0c, 0x1e, 0x35,
|
0x01, 0x0b, 0x65, 0x22, 0x94, 0xe3, 0xa5, 0x26, 0xf6, 0x4f, 0x64, 0x4b, 0x00, 0x60, 0xd7, 0x49,
|
||||||
0xbb, 0xbf, 0xa0, 0x95, 0x07, 0xcf, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xed, 0x5f, 0x6c, 0x20,
|
0x95, 0xcd, 0x7d, 0xff, 0x45, 0x30, 0x01, 0xb0, 0x69, 0xb8, 0x5e, 0x17, 0x1b, 0x26, 0xf6, 0x6f,
|
||||||
0x74, 0x13, 0x00, 0x00,
|
0xda, 0x34, 0xae, 0xe7, 0x87, 0x58, 0x0d, 0x2e, 0xf3, 0xb7, 0x4a, 0x26, 0xf8, 0x1f, 0x84, 0xdb,
|
||||||
|
0x04, 0x7c, 0x73, 0xaa, 0x5a, 0xca, 0x37, 0x07, 0xfb, 0x5f, 0xcc, 0x34, 0xad, 0xe7, 0xb3, 0x6c,
|
||||||
|
0x20, 0x55, 0xad, 0x56, 0x86, 0xf3, 0xa9, 0x01, 0xff, 0x6f, 0xbb, 0x7c, 0x65, 0x51, 0x32, 0x90,
|
||||||
|
0xed, 0x07, 0xd7, 0x55, 0x2c, 0xfd, 0x48, 0x89, 0xc4, 0x64, 0xd8, 0x42, 0x83, 0x86, 0x1c, 0x9e,
|
||||||
|
0x67, 0x63, 0xae, 0x0c, 0xab, 0xdc, 0x61, 0xb6, 0x20, 0x17, 0xe4, 0x52, 0x5e, 0x67, 0xee, 0xbd,
|
||||||
|
0xd9, 0xf3, 0xd5, 0x5a, 0xd6, 0x9c, 0x74, 0x65, 0x38, 0x05, 0xbf, 0x3c, 0xda, 0x2f, 0x54, 0xcb,
|
||||||
|
0xdf, 0x21, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x9c, 0xaf, 0x70, 0x4e, 0x83, 0x15, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
11
vendor/github.com/gogo/protobuf/gogoproto/gogo.proto
generated
vendored
11
vendor/github.com/gogo/protobuf/gogoproto/gogo.proto
generated
vendored
@ -83,6 +83,10 @@ extend google.protobuf.FileOptions {
|
|||||||
optional bool enumdecl_all = 63031;
|
optional bool enumdecl_all = 63031;
|
||||||
|
|
||||||
optional bool goproto_registration = 63032;
|
optional bool goproto_registration = 63032;
|
||||||
|
optional bool messagename_all = 63033;
|
||||||
|
|
||||||
|
optional bool goproto_sizecache_all = 63034;
|
||||||
|
optional bool goproto_unkeyed_all = 63035;
|
||||||
}
|
}
|
||||||
|
|
||||||
extend google.protobuf.MessageOptions {
|
extend google.protobuf.MessageOptions {
|
||||||
@ -115,6 +119,11 @@ extend google.protobuf.MessageOptions {
|
|||||||
optional bool compare = 64029;
|
optional bool compare = 64029;
|
||||||
|
|
||||||
optional bool typedecl = 64030;
|
optional bool typedecl = 64030;
|
||||||
|
|
||||||
|
optional bool messagename = 64033;
|
||||||
|
|
||||||
|
optional bool goproto_sizecache = 64034;
|
||||||
|
optional bool goproto_unkeyed = 64035;
|
||||||
}
|
}
|
||||||
|
|
||||||
extend google.protobuf.FieldOptions {
|
extend google.protobuf.FieldOptions {
|
||||||
@ -130,4 +139,6 @@ extend google.protobuf.FieldOptions {
|
|||||||
|
|
||||||
optional bool stdtime = 65010;
|
optional bool stdtime = 65010;
|
||||||
optional bool stdduration = 65011;
|
optional bool stdduration = 65011;
|
||||||
|
optional bool wktpointer = 65012;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
64
vendor/github.com/gogo/protobuf/gogoproto/helper.go
generated
vendored
64
vendor/github.com/gogo/protobuf/gogoproto/helper.go
generated
vendored
@ -47,6 +47,55 @@ func IsStdDuration(field *google_protobuf.FieldDescriptorProto) bool {
|
|||||||
return proto.GetBoolExtension(field.Options, E_Stdduration, false)
|
return proto.GetBoolExtension(field.Options, E_Stdduration, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsStdDouble(field *google_protobuf.FieldDescriptorProto) bool {
|
||||||
|
return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.DoubleValue"
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsStdFloat(field *google_protobuf.FieldDescriptorProto) bool {
|
||||||
|
return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.FloatValue"
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsStdInt64(field *google_protobuf.FieldDescriptorProto) bool {
|
||||||
|
return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.Int64Value"
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsStdUInt64(field *google_protobuf.FieldDescriptorProto) bool {
|
||||||
|
return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.UInt64Value"
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsStdInt32(field *google_protobuf.FieldDescriptorProto) bool {
|
||||||
|
return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.Int32Value"
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsStdUInt32(field *google_protobuf.FieldDescriptorProto) bool {
|
||||||
|
return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.UInt32Value"
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsStdBool(field *google_protobuf.FieldDescriptorProto) bool {
|
||||||
|
return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.BoolValue"
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsStdString(field *google_protobuf.FieldDescriptorProto) bool {
|
||||||
|
return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.StringValue"
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsStdBytes(field *google_protobuf.FieldDescriptorProto) bool {
|
||||||
|
return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.BytesValue"
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsStdType(field *google_protobuf.FieldDescriptorProto) bool {
|
||||||
|
return (IsStdTime(field) || IsStdDuration(field) ||
|
||||||
|
IsStdDouble(field) || IsStdFloat(field) ||
|
||||||
|
IsStdInt64(field) || IsStdUInt64(field) ||
|
||||||
|
IsStdInt32(field) || IsStdUInt32(field) ||
|
||||||
|
IsStdBool(field) ||
|
||||||
|
IsStdString(field) || IsStdBytes(field))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsWktPtr(field *google_protobuf.FieldDescriptorProto) bool {
|
||||||
|
return proto.GetBoolExtension(field.Options, E_Wktpointer, false)
|
||||||
|
}
|
||||||
|
|
||||||
func NeedsNilCheck(proto3 bool, field *google_protobuf.FieldDescriptorProto) bool {
|
func NeedsNilCheck(proto3 bool, field *google_protobuf.FieldDescriptorProto) bool {
|
||||||
nullable := IsNullable(field)
|
nullable := IsNullable(field)
|
||||||
if field.IsMessage() || IsCustomType(field) {
|
if field.IsMessage() || IsCustomType(field) {
|
||||||
@ -334,9 +383,6 @@ func HasExtensionsMap(file *google_protobuf.FileDescriptorProto, message *google
|
|||||||
}
|
}
|
||||||
|
|
||||||
func HasUnrecognized(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
|
func HasUnrecognized(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
|
||||||
if IsProto3(file) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return proto.GetBoolExtension(message.Options, E_GoprotoUnrecognized, proto.GetBoolExtension(file.Options, E_GoprotoUnrecognizedAll, true))
|
return proto.GetBoolExtension(message.Options, E_GoprotoUnrecognized, proto.GetBoolExtension(file.Options, E_GoprotoUnrecognizedAll, true))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -355,3 +401,15 @@ func HasCompare(file *google_protobuf.FileDescriptorProto, message *google_proto
|
|||||||
func RegistersGolangProto(file *google_protobuf.FileDescriptorProto) bool {
|
func RegistersGolangProto(file *google_protobuf.FileDescriptorProto) bool {
|
||||||
return proto.GetBoolExtension(file.Options, E_GoprotoRegistration, false)
|
return proto.GetBoolExtension(file.Options, E_GoprotoRegistration, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func HasMessageName(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
|
||||||
|
return proto.GetBoolExtension(message.Options, E_Messagename, proto.GetBoolExtension(file.Options, E_MessagenameAll, false))
|
||||||
|
}
|
||||||
|
|
||||||
|
func HasSizecache(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
|
||||||
|
return proto.GetBoolExtension(message.Options, E_GoprotoSizecache, proto.GetBoolExtension(file.Options, E_GoprotoSizecacheAll, true))
|
||||||
|
}
|
||||||
|
|
||||||
|
func HasUnkeyed(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
|
||||||
|
return proto.GetBoolExtension(message.Options, E_GoprotoUnkeyed, proto.GetBoolExtension(file.Options, E_GoprotoUnkeyedAll, true))
|
||||||
|
}
|
||||||
|
5
vendor/github.com/gogo/protobuf/plugin/embedcheck/embedcheck.go
generated
vendored
5
vendor/github.com/gogo/protobuf/plugin/embedcheck/embedcheck.go
generated
vendored
@ -47,9 +47,10 @@ package embedcheck
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/gogo/protobuf/gogoproto"
|
"github.com/gogo/protobuf/gogoproto"
|
||||||
"github.com/gogo/protobuf/protoc-gen-gogo/generator"
|
"github.com/gogo/protobuf/protoc-gen-gogo/generator"
|
||||||
"os"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type plugin struct {
|
type plugin struct {
|
||||||
@ -163,7 +164,7 @@ func (p *plugin) checkOverwrite(message *generator.Descriptor, enablers map[stri
|
|||||||
desc := p.ObjectNamed(field.GetTypeName())
|
desc := p.ObjectNamed(field.GetTypeName())
|
||||||
msg := desc.(*generator.Descriptor)
|
msg := desc.(*generator.Descriptor)
|
||||||
for errStr, enabled := range enablers {
|
for errStr, enabled := range enablers {
|
||||||
if enabled(msg.File(), msg.DescriptorProto) {
|
if enabled(msg.File().FileDescriptorProto, msg.DescriptorProto) {
|
||||||
fmt.Fprintf(os.Stderr, "WARNING: found non-%v %v with embedded %v %v\n", names, ccTypeName, errStr, fieldname)
|
fmt.Fprintf(os.Stderr, "WARNING: found non-%v %v with embedded %v %v\n", names, ccTypeName, errStr, fieldname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
73
vendor/github.com/gogo/protobuf/plugin/equal/equal.go
generated
vendored
73
vendor/github.com/gogo/protobuf/plugin/equal/equal.go
generated
vendored
@ -292,7 +292,16 @@ func (p *plugin) generateField(file *generator.FileDescriptor, message *generato
|
|||||||
repeated := field.IsRepeated()
|
repeated := field.IsRepeated()
|
||||||
ctype := gogoproto.IsCustomType(field)
|
ctype := gogoproto.IsCustomType(field)
|
||||||
nullable := gogoproto.IsNullable(field)
|
nullable := gogoproto.IsNullable(field)
|
||||||
isDuration := gogoproto.IsStdDuration(field)
|
isNormal := (gogoproto.IsStdDuration(field) ||
|
||||||
|
gogoproto.IsStdDouble(field) ||
|
||||||
|
gogoproto.IsStdFloat(field) ||
|
||||||
|
gogoproto.IsStdInt64(field) ||
|
||||||
|
gogoproto.IsStdUInt64(field) ||
|
||||||
|
gogoproto.IsStdInt32(field) ||
|
||||||
|
gogoproto.IsStdUInt32(field) ||
|
||||||
|
gogoproto.IsStdBool(field) ||
|
||||||
|
gogoproto.IsStdString(field))
|
||||||
|
isBytes := gogoproto.IsStdBytes(field)
|
||||||
isTimestamp := gogoproto.IsStdTime(field)
|
isTimestamp := gogoproto.IsStdTime(field)
|
||||||
// oneof := field.OneofIndex != nil
|
// oneof := field.OneofIndex != nil
|
||||||
if !repeated {
|
if !repeated {
|
||||||
@ -322,7 +331,7 @@ func (p *plugin) generateField(file *generator.FileDescriptor, message *generato
|
|||||||
}
|
}
|
||||||
p.Out()
|
p.Out()
|
||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
} else if isDuration {
|
} else if isNormal {
|
||||||
if nullable {
|
if nullable {
|
||||||
p.generateNullableField(fieldname, verbose)
|
p.generateNullableField(fieldname, verbose)
|
||||||
} else {
|
} else {
|
||||||
@ -336,6 +345,32 @@ func (p *plugin) generateField(file *generator.FileDescriptor, message *generato
|
|||||||
}
|
}
|
||||||
p.Out()
|
p.Out()
|
||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
|
} else if isBytes {
|
||||||
|
if nullable {
|
||||||
|
p.P(`if that1.`, fieldname, ` == nil {`)
|
||||||
|
p.In()
|
||||||
|
p.P(`if this.`, fieldname, ` != nil {`)
|
||||||
|
p.In()
|
||||||
|
if verbose {
|
||||||
|
p.P(`return `, p.fmtPkg.Use(), `.Errorf("this.`, fieldname, ` != nil && that1.`, fieldname, ` == nil")`)
|
||||||
|
} else {
|
||||||
|
p.P(`return false`)
|
||||||
|
}
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
|
p.Out()
|
||||||
|
p.P(`} else if !`, p.bytesPkg.Use(), `.Equal(*this.`, fieldname, `, *that1.`, fieldname, `) {`)
|
||||||
|
} else {
|
||||||
|
p.P(`if !`, p.bytesPkg.Use(), `.Equal(this.`, fieldname, `, that1.`, fieldname, `) {`)
|
||||||
|
}
|
||||||
|
p.In()
|
||||||
|
if verbose {
|
||||||
|
p.P(`return `, p.fmtPkg.Use(), `.Errorf("`, fieldname, ` this(%v) Not Equal that(%v)", this.`, fieldname, `, that1.`, fieldname, `)`)
|
||||||
|
} else {
|
||||||
|
p.P(`return false`)
|
||||||
|
}
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
} else {
|
} else {
|
||||||
if field.IsMessage() || p.IsGroup(field) {
|
if field.IsMessage() || p.IsGroup(field) {
|
||||||
if nullable {
|
if nullable {
|
||||||
@ -387,12 +422,18 @@ func (p *plugin) generateField(file *generator.FileDescriptor, message *generato
|
|||||||
} else {
|
} else {
|
||||||
p.P(`if !this.`, fieldname, `[i].Equal(that1.`, fieldname, `[i]) {`)
|
p.P(`if !this.`, fieldname, `[i].Equal(that1.`, fieldname, `[i]) {`)
|
||||||
}
|
}
|
||||||
} else if isDuration {
|
} else if isNormal {
|
||||||
if nullable {
|
if nullable {
|
||||||
p.P(`if dthis, dthat := this.`, fieldname, `[i], that1.`, fieldname, `[i]; (dthis != nil && dthat != nil && *dthis != *dthat) || (dthis != nil && dthat == nil) || (dthis == nil && dthat != nil) {`)
|
p.P(`if dthis, dthat := this.`, fieldname, `[i], that1.`, fieldname, `[i]; (dthis != nil && dthat != nil && *dthis != *dthat) || (dthis != nil && dthat == nil) || (dthis == nil && dthat != nil) {`)
|
||||||
} else {
|
} else {
|
||||||
p.P(`if this.`, fieldname, `[i] != that1.`, fieldname, `[i] {`)
|
p.P(`if this.`, fieldname, `[i] != that1.`, fieldname, `[i] {`)
|
||||||
}
|
}
|
||||||
|
} else if isBytes {
|
||||||
|
if nullable {
|
||||||
|
p.P(`if !`, p.bytesPkg.Use(), `.Equal(*this.`, fieldname, `[i], *that1.`, fieldname, `[i]) {`)
|
||||||
|
} else {
|
||||||
|
p.P(`if !`, p.bytesPkg.Use(), `.Equal(this.`, fieldname, `[i], that1.`, fieldname, `[i]) {`)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if p.IsMap(field) {
|
if p.IsMap(field) {
|
||||||
m := p.GoMapType(nil, field)
|
m := p.GoMapType(nil, field)
|
||||||
@ -401,6 +442,16 @@ func (p *plugin) generateField(file *generator.FileDescriptor, message *generato
|
|||||||
nullable, valuegoTyp, valuegoAliasTyp = generator.GoMapValueTypes(field, m.ValueField, valuegoTyp, valuegoAliasTyp)
|
nullable, valuegoTyp, valuegoAliasTyp = generator.GoMapValueTypes(field, m.ValueField, valuegoTyp, valuegoAliasTyp)
|
||||||
|
|
||||||
mapValue := m.ValueAliasField
|
mapValue := m.ValueAliasField
|
||||||
|
mapValueNormal := (gogoproto.IsStdDuration(mapValue) ||
|
||||||
|
gogoproto.IsStdDouble(mapValue) ||
|
||||||
|
gogoproto.IsStdFloat(mapValue) ||
|
||||||
|
gogoproto.IsStdInt64(mapValue) ||
|
||||||
|
gogoproto.IsStdUInt64(mapValue) ||
|
||||||
|
gogoproto.IsStdInt32(mapValue) ||
|
||||||
|
gogoproto.IsStdUInt32(mapValue) ||
|
||||||
|
gogoproto.IsStdBool(mapValue) ||
|
||||||
|
gogoproto.IsStdString(mapValue))
|
||||||
|
mapValueBytes := gogoproto.IsStdBytes(mapValue)
|
||||||
if mapValue.IsMessage() || p.IsGroup(mapValue) {
|
if mapValue.IsMessage() || p.IsGroup(mapValue) {
|
||||||
if nullable && valuegoTyp == valuegoAliasTyp {
|
if nullable && valuegoTyp == valuegoAliasTyp {
|
||||||
p.P(`if !this.`, fieldname, `[i].Equal(that1.`, fieldname, `[i]) {`)
|
p.P(`if !this.`, fieldname, `[i].Equal(that1.`, fieldname, `[i]) {`)
|
||||||
@ -408,14 +459,26 @@ func (p *plugin) generateField(file *generator.FileDescriptor, message *generato
|
|||||||
// Equal() has a pointer receiver, but map value is a value type
|
// Equal() has a pointer receiver, but map value is a value type
|
||||||
a := `this.` + fieldname + `[i]`
|
a := `this.` + fieldname + `[i]`
|
||||||
b := `that1.` + fieldname + `[i]`
|
b := `that1.` + fieldname + `[i]`
|
||||||
if valuegoTyp != valuegoAliasTyp {
|
if !mapValueNormal && !mapValueBytes && valuegoTyp != valuegoAliasTyp {
|
||||||
// cast back to the type that has the generated methods on it
|
// cast back to the type that has the generated methods on it
|
||||||
a = `(` + valuegoTyp + `)(` + a + `)`
|
a = `(` + valuegoTyp + `)(` + a + `)`
|
||||||
b = `(` + valuegoTyp + `)(` + b + `)`
|
b = `(` + valuegoTyp + `)(` + b + `)`
|
||||||
}
|
}
|
||||||
p.P(`a := `, a)
|
p.P(`a := `, a)
|
||||||
p.P(`b := `, b)
|
p.P(`b := `, b)
|
||||||
if nullable {
|
if mapValueNormal {
|
||||||
|
if nullable {
|
||||||
|
p.P(`if *a != *b {`)
|
||||||
|
} else {
|
||||||
|
p.P(`if a != b {`)
|
||||||
|
}
|
||||||
|
} else if mapValueBytes {
|
||||||
|
if nullable {
|
||||||
|
p.P(`if !`, p.bytesPkg.Use(), `.Equal(*a, *b) {`)
|
||||||
|
} else {
|
||||||
|
p.P(`if !`, p.bytesPkg.Use(), `.Equal(a, b) {`)
|
||||||
|
}
|
||||||
|
} else if nullable {
|
||||||
p.P(`if !a.Equal(b) {`)
|
p.P(`if !a.Equal(b) {`)
|
||||||
} else {
|
} else {
|
||||||
p.P(`if !(&a).Equal(&b) {`)
|
p.P(`if !(&a).Equal(&b) {`)
|
||||||
|
4
vendor/github.com/gogo/protobuf/plugin/gostring/gostring.go
generated
vendored
4
vendor/github.com/gogo/protobuf/plugin/gostring/gostring.go
generated
vendored
@ -157,7 +157,7 @@ func (p *gostring) Generate(file *generator.FileDescriptor) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
p.atleastOne = true
|
p.atleastOne = true
|
||||||
packageName := file.PackageName()
|
packageName := file.GoPackageName()
|
||||||
|
|
||||||
ccTypeName := generator.CamelCaseSlice(message.TypeName())
|
ccTypeName := generator.CamelCaseSlice(message.TypeName())
|
||||||
p.P(`func (this *`, ccTypeName, `) GoString() string {`)
|
p.P(`func (this *`, ccTypeName, `) GoString() string {`)
|
||||||
@ -225,7 +225,7 @@ func (p *gostring) Generate(file *generator.FileDescriptor) {
|
|||||||
p.P(`s = append(s, "`, fieldname, `: " + `, mapName, `+ ",\n")`)
|
p.P(`s = append(s, "`, fieldname, `: " + `, mapName, `+ ",\n")`)
|
||||||
p.Out()
|
p.Out()
|
||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
} else if (field.IsMessage() && !gogoproto.IsCustomType(field) && !gogoproto.IsStdTime(field) && !gogoproto.IsStdDuration(field)) || p.IsGroup(field) {
|
} else if (field.IsMessage() && !gogoproto.IsCustomType(field) && !gogoproto.IsStdType(field)) || p.IsGroup(field) {
|
||||||
if nullable || repeated {
|
if nullable || repeated {
|
||||||
p.P(`if this.`, fieldname, ` != nil {`)
|
p.P(`if this.`, fieldname, ` != nil {`)
|
||||||
p.In()
|
p.In()
|
||||||
|
166
vendor/github.com/gogo/protobuf/plugin/marshalto/marshalto.go
generated
vendored
166
vendor/github.com/gogo/protobuf/plugin/marshalto/marshalto.go
generated
vendored
@ -313,12 +313,39 @@ func (p *marshalto) mapField(numGen NumGen, field *descriptor.FieldDescriptorPro
|
|||||||
case descriptor.FieldDescriptorProto_TYPE_SINT64:
|
case descriptor.FieldDescriptorProto_TYPE_SINT64:
|
||||||
p.callVarint(`(uint64(`, varName, `) << 1) ^ uint64((`, varName, ` >> 63))`)
|
p.callVarint(`(uint64(`, varName, `) << 1) ^ uint64((`, varName, ` >> 63))`)
|
||||||
case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
|
case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
|
||||||
if gogoproto.IsStdTime(field) {
|
if gogoproto.IsStdTime(kvField) {
|
||||||
p.callVarint(p.typesPkg.Use(), `.SizeOfStdTime(*`, varName, `)`)
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdTime(*`, varName, `)`)
|
||||||
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdTimeMarshalTo(*`, varName, `, dAtA[i:])`)
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdTimeMarshalTo(*`, varName, `, dAtA[i:])`)
|
||||||
} else if gogoproto.IsStdDuration(field) {
|
} else if gogoproto.IsStdDuration(kvField) {
|
||||||
p.callVarint(p.typesPkg.Use(), `.SizeOfStdDuration(*`, varName, `)`)
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdDuration(*`, varName, `)`)
|
||||||
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdDurationMarshalTo(*`, varName, `, dAtA[i:])`)
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdDurationMarshalTo(*`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdDouble(kvField) {
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdDouble(*`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdDoubleMarshalTo(*`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdFloat(kvField) {
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdFloat(*`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdFloatMarshalTo(*`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdInt64(kvField) {
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdInt64(*`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdInt64MarshalTo(*`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdUInt64(kvField) {
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdUInt64(*`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdUInt64MarshalTo(*`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdInt32(kvField) {
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdInt32(*`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdInt32MarshalTo(*`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdUInt32(kvField) {
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdUInt32(*`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdUInt32MarshalTo(*`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdBool(kvField) {
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdBool(*`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdBoolMarshalTo(*`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdString(kvField) {
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdString(*`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdStringMarshalTo(*`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdBytes(kvField) {
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdBytes(*`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdBytesMarshalTo(*`, varName, `, dAtA[i:])`)
|
||||||
} else if protoSizer {
|
} else if protoSizer {
|
||||||
p.callVarint(varName, `.ProtoSize()`)
|
p.callVarint(varName, `.ProtoSize()`)
|
||||||
p.P(`n`, numGen.Next(), `, err := `, varName, `.MarshalTo(dAtA[i:])`)
|
p.P(`n`, numGen.Next(), `, err := `, varName, `.MarshalTo(dAtA[i:])`)
|
||||||
@ -781,8 +808,7 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi
|
|||||||
sum = append(sum, `soz`+p.localName+`(uint64(v))`)
|
sum = append(sum, `soz`+p.localName+`(uint64(v))`)
|
||||||
case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
|
case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
|
||||||
if valuegoTyp != valuegoAliasTyp &&
|
if valuegoTyp != valuegoAliasTyp &&
|
||||||
!gogoproto.IsStdTime(field) &&
|
!gogoproto.IsStdType(m.ValueAliasField) {
|
||||||
!gogoproto.IsStdDuration(field) {
|
|
||||||
if nullable {
|
if nullable {
|
||||||
// cast back to the type that has the generated methods on it
|
// cast back to the type that has the generated methods on it
|
||||||
accessor = `((` + valuegoTyp + `)(` + accessor + `))`
|
accessor = `((` + valuegoTyp + `)(` + accessor + `))`
|
||||||
@ -795,10 +821,28 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi
|
|||||||
p.P(`msgSize := 0`)
|
p.P(`msgSize := 0`)
|
||||||
p.P(`if `, accessor, ` != nil {`)
|
p.P(`if `, accessor, ` != nil {`)
|
||||||
p.In()
|
p.In()
|
||||||
if gogoproto.IsStdTime(field) {
|
if gogoproto.IsStdTime(m.ValueAliasField) {
|
||||||
p.P(`msgSize = `, p.typesPkg.Use(), `.SizeOfStdTime(*`, accessor, `)`)
|
p.P(`msgSize = `, p.typesPkg.Use(), `.SizeOfStdTime(*`, accessor, `)`)
|
||||||
} else if gogoproto.IsStdDuration(field) {
|
} else if gogoproto.IsStdDuration(m.ValueAliasField) {
|
||||||
p.P(`msgSize = `, p.typesPkg.Use(), `.SizeOfStdDuration(*`, accessor, `)`)
|
p.P(`msgSize = `, p.typesPkg.Use(), `.SizeOfStdDuration(*`, accessor, `)`)
|
||||||
|
} else if gogoproto.IsStdDouble(m.ValueAliasField) {
|
||||||
|
p.P(`msgSize = `, p.typesPkg.Use(), `.SizeOfStdDouble(*`, accessor, `)`)
|
||||||
|
} else if gogoproto.IsStdFloat(m.ValueAliasField) {
|
||||||
|
p.P(`msgSize = `, p.typesPkg.Use(), `.SizeOfStdFloat(*`, accessor, `)`)
|
||||||
|
} else if gogoproto.IsStdInt64(m.ValueAliasField) {
|
||||||
|
p.P(`msgSize = `, p.typesPkg.Use(), `.SizeOfStdInt64(*`, accessor, `)`)
|
||||||
|
} else if gogoproto.IsStdUInt64(m.ValueAliasField) {
|
||||||
|
p.P(`msgSize = `, p.typesPkg.Use(), `.SizeOfStdUInt64(*`, accessor, `)`)
|
||||||
|
} else if gogoproto.IsStdInt32(m.ValueAliasField) {
|
||||||
|
p.P(`msgSize = `, p.typesPkg.Use(), `.SizeOfStdInt32(*`, accessor, `)`)
|
||||||
|
} else if gogoproto.IsStdUInt32(m.ValueAliasField) {
|
||||||
|
p.P(`msgSize = `, p.typesPkg.Use(), `.SizeOfStdUInt32(*`, accessor, `)`)
|
||||||
|
} else if gogoproto.IsStdBool(m.ValueAliasField) {
|
||||||
|
p.P(`msgSize = `, p.typesPkg.Use(), `.SizeOfStdBool(*`, accessor, `)`)
|
||||||
|
} else if gogoproto.IsStdString(m.ValueAliasField) {
|
||||||
|
p.P(`msgSize = `, p.typesPkg.Use(), `.SizeOfStdString(*`, accessor, `)`)
|
||||||
|
} else if gogoproto.IsStdBytes(m.ValueAliasField) {
|
||||||
|
p.P(`msgSize = `, p.typesPkg.Use(), `.SizeOfStdBytes(*`, accessor, `)`)
|
||||||
} else if protoSizer {
|
} else if protoSizer {
|
||||||
p.P(`msgSize = `, accessor, `.ProtoSize()`)
|
p.P(`msgSize = `, accessor, `.ProtoSize()`)
|
||||||
} else {
|
} else {
|
||||||
@ -828,7 +872,7 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi
|
|||||||
p.In()
|
p.In()
|
||||||
}
|
}
|
||||||
p.encodeKey(2, wireToType(valuewire))
|
p.encodeKey(2, wireToType(valuewire))
|
||||||
p.mapField(numGen, field, m.ValueField, accessor, protoSizer)
|
p.mapField(numGen, field, m.ValueAliasField, accessor, protoSizer)
|
||||||
if nullableMsg || plainBytes {
|
if nullableMsg || plainBytes {
|
||||||
p.Out()
|
p.Out()
|
||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
@ -852,6 +896,60 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi
|
|||||||
}
|
}
|
||||||
p.callVarint(p.typesPkg.Use(), `.SizeOfStdDuration(`, varName, `)`)
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdDuration(`, varName, `)`)
|
||||||
p.P(`n, err := `, p.typesPkg.Use(), `.StdDurationMarshalTo(`, varName, `, dAtA[i:])`)
|
p.P(`n, err := `, p.typesPkg.Use(), `.StdDurationMarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdDouble(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdDouble(`, varName, `)`)
|
||||||
|
p.P(`n, err := `, p.typesPkg.Use(), `.StdDoubleMarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdFloat(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdFloat(`, varName, `)`)
|
||||||
|
p.P(`n, err := `, p.typesPkg.Use(), `.StdFloatMarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdInt64(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdInt64(`, varName, `)`)
|
||||||
|
p.P(`n, err := `, p.typesPkg.Use(), `.StdInt64MarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdUInt64(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdUInt64(`, varName, `)`)
|
||||||
|
p.P(`n, err := `, p.typesPkg.Use(), `.StdUInt64MarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdInt32(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdInt32(`, varName, `)`)
|
||||||
|
p.P(`n, err := `, p.typesPkg.Use(), `.StdInt32MarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdUInt32(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdUInt32(`, varName, `)`)
|
||||||
|
p.P(`n, err := `, p.typesPkg.Use(), `.StdUInt32MarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdBool(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdBool(`, varName, `)`)
|
||||||
|
p.P(`n, err := `, p.typesPkg.Use(), `.StdBoolMarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdString(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdString(`, varName, `)`)
|
||||||
|
p.P(`n, err := `, p.typesPkg.Use(), `.StdStringMarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdBytes(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdBytes(`, varName, `)`)
|
||||||
|
p.P(`n, err := `, p.typesPkg.Use(), `.StdBytesMarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
} else if protoSizer {
|
} else if protoSizer {
|
||||||
p.callVarint(varName, ".ProtoSize()")
|
p.callVarint(varName, ".ProtoSize()")
|
||||||
p.P(`n, err := `, varName, `.MarshalTo(dAtA[i:])`)
|
p.P(`n, err := `, varName, `.MarshalTo(dAtA[i:])`)
|
||||||
@ -882,6 +980,60 @@ func (p *marshalto) generateField(proto3 bool, numGen NumGen, file *generator.Fi
|
|||||||
}
|
}
|
||||||
p.callVarint(p.typesPkg.Use(), `.SizeOfStdDuration(`, varName, `)`)
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdDuration(`, varName, `)`)
|
||||||
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdDurationMarshalTo(`, varName, `, dAtA[i:])`)
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdDurationMarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdDouble(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdDouble(`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdDoubleMarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdFloat(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdFloat(`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdFloatMarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdInt64(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdInt64(`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdInt64MarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdUInt64(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdUInt64(`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdUInt64MarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdInt32(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdInt32(`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdInt32MarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdUInt32(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdUInt32(`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdUInt32MarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdBool(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdBool(`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdBoolMarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdString(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdString(`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdStringMarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
|
} else if gogoproto.IsStdBytes(field) {
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
varName = "*" + varName
|
||||||
|
}
|
||||||
|
p.callVarint(p.typesPkg.Use(), `.SizeOfStdBytes(`, varName, `)`)
|
||||||
|
p.P(`n`, numGen.Next(), `, err := `, p.typesPkg.Use(), `.StdBytesMarshalTo(`, varName, `, dAtA[i:])`)
|
||||||
} else if protoSizer {
|
} else if protoSizer {
|
||||||
p.callVarint(varName, `.ProtoSize()`)
|
p.callVarint(varName, `.ProtoSize()`)
|
||||||
p.P(`n`, numGen.Next(), `, err := `, varName, `.MarshalTo(dAtA[i:])`)
|
p.P(`n`, numGen.Next(), `, err := `, varName, `.MarshalTo(dAtA[i:])`)
|
||||||
|
46
vendor/github.com/gogo/protobuf/plugin/populate/populate.go
generated
vendored
46
vendor/github.com/gogo/protobuf/plugin/populate/populate.go
generated
vendored
@ -182,7 +182,7 @@ func negative(fieldType descriptor.FieldDescriptorProto_Type) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *plugin) getFuncName(goTypName string) string {
|
func (p *plugin) getFuncName(goTypName string, field *descriptor.FieldDescriptorProto) string {
|
||||||
funcName := "NewPopulated" + goTypName
|
funcName := "NewPopulated" + goTypName
|
||||||
goTypNames := strings.Split(goTypName, ".")
|
goTypNames := strings.Split(goTypName, ".")
|
||||||
if len(goTypNames) == 2 {
|
if len(goTypNames) == 2 {
|
||||||
@ -190,23 +190,43 @@ func (p *plugin) getFuncName(goTypName string) string {
|
|||||||
} else if len(goTypNames) != 1 {
|
} else if len(goTypNames) != 1 {
|
||||||
panic(fmt.Errorf("unreachable: too many dots in %v", goTypName))
|
panic(fmt.Errorf("unreachable: too many dots in %v", goTypName))
|
||||||
}
|
}
|
||||||
switch funcName {
|
if field != nil {
|
||||||
case "time.NewPopulatedTime":
|
switch {
|
||||||
funcName = p.typesPkg.Use() + ".NewPopulatedStdTime"
|
case gogoproto.IsStdTime(field):
|
||||||
case "time.NewPopulatedDuration":
|
funcName = p.typesPkg.Use() + ".NewPopulatedStdTime"
|
||||||
funcName = p.typesPkg.Use() + ".NewPopulatedStdDuration"
|
case gogoproto.IsStdDuration(field):
|
||||||
|
funcName = p.typesPkg.Use() + ".NewPopulatedStdDuration"
|
||||||
|
case gogoproto.IsStdDouble(field):
|
||||||
|
funcName = p.typesPkg.Use() + ".NewPopulatedStdDouble"
|
||||||
|
case gogoproto.IsStdFloat(field):
|
||||||
|
funcName = p.typesPkg.Use() + ".NewPopulatedStdFloat"
|
||||||
|
case gogoproto.IsStdInt64(field):
|
||||||
|
funcName = p.typesPkg.Use() + ".NewPopulatedStdInt64"
|
||||||
|
case gogoproto.IsStdUInt64(field):
|
||||||
|
funcName = p.typesPkg.Use() + ".NewPopulatedStdUInt64"
|
||||||
|
case gogoproto.IsStdInt32(field):
|
||||||
|
funcName = p.typesPkg.Use() + ".NewPopulatedStdInt32"
|
||||||
|
case gogoproto.IsStdUInt32(field):
|
||||||
|
funcName = p.typesPkg.Use() + ".NewPopulatedStdUInt32"
|
||||||
|
case gogoproto.IsStdBool(field):
|
||||||
|
funcName = p.typesPkg.Use() + ".NewPopulatedStdBool"
|
||||||
|
case gogoproto.IsStdString(field):
|
||||||
|
funcName = p.typesPkg.Use() + ".NewPopulatedStdString"
|
||||||
|
case gogoproto.IsStdBytes(field):
|
||||||
|
funcName = p.typesPkg.Use() + ".NewPopulatedStdBytes"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return funcName
|
return funcName
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *plugin) getFuncCall(goTypName string) string {
|
func (p *plugin) getFuncCall(goTypName string, field *descriptor.FieldDescriptorProto) string {
|
||||||
funcName := p.getFuncName(goTypName)
|
funcName := p.getFuncName(goTypName, field)
|
||||||
funcCall := funcName + "(r, easy)"
|
funcCall := funcName + "(r, easy)"
|
||||||
return funcCall
|
return funcCall
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *plugin) getCustomFuncCall(goTypName string) string {
|
func (p *plugin) getCustomFuncCall(goTypName string) string {
|
||||||
funcName := p.getFuncName(goTypName)
|
funcName := p.getFuncName(goTypName, nil)
|
||||||
funcCall := funcName + "(r)"
|
funcCall := funcName + "(r)"
|
||||||
return funcCall
|
return funcCall
|
||||||
}
|
}
|
||||||
@ -259,13 +279,13 @@ func (p *plugin) GenerateField(file *generator.FileDescriptor, message *generato
|
|||||||
if m.ValueField.IsMessage() || p.IsGroup(field) ||
|
if m.ValueField.IsMessage() || p.IsGroup(field) ||
|
||||||
(m.ValueField.IsBytes() && gogoproto.IsCustomType(field)) {
|
(m.ValueField.IsBytes() && gogoproto.IsCustomType(field)) {
|
||||||
s := `this.` + fieldname + `[` + keyval + `] = `
|
s := `this.` + fieldname + `[` + keyval + `] = `
|
||||||
if gogoproto.IsStdTime(field) || gogoproto.IsStdDuration(field) {
|
if gogoproto.IsStdType(field) {
|
||||||
valuegoTyp = valuegoAliasTyp
|
valuegoTyp = valuegoAliasTyp
|
||||||
}
|
}
|
||||||
funcCall := p.getCustomFuncCall(goTypName)
|
funcCall := p.getCustomFuncCall(goTypName)
|
||||||
if !gogoproto.IsCustomType(field) {
|
if !gogoproto.IsCustomType(field) {
|
||||||
goTypName = generator.GoTypeToName(valuegoTyp)
|
goTypName = generator.GoTypeToName(valuegoTyp)
|
||||||
funcCall = p.getFuncCall(goTypName)
|
funcCall = p.getFuncCall(goTypName, m.ValueAliasField)
|
||||||
}
|
}
|
||||||
if !nullable {
|
if !nullable {
|
||||||
funcCall = `*` + funcCall
|
funcCall = `*` + funcCall
|
||||||
@ -322,7 +342,7 @@ func (p *plugin) GenerateField(file *generator.FileDescriptor, message *generato
|
|||||||
p.P(`this.`, fieldname, ` = *`, p.varGen.Current())
|
p.P(`this.`, fieldname, ` = *`, p.varGen.Current())
|
||||||
}
|
}
|
||||||
} else if field.IsMessage() || p.IsGroup(field) {
|
} else if field.IsMessage() || p.IsGroup(field) {
|
||||||
funcCall := p.getFuncCall(goTypName)
|
funcCall := p.getFuncCall(goTypName, field)
|
||||||
if field.IsRepeated() {
|
if field.IsRepeated() {
|
||||||
p.P(p.varGen.Next(), ` := r.Intn(5)`)
|
p.P(p.varGen.Next(), ` := r.Intn(5)`)
|
||||||
p.P(`this.`, fieldname, ` = make(`, goTyp, `, `, p.varGen.Current(), `)`)
|
p.P(`this.`, fieldname, ` = make(`, goTyp, `, `, p.varGen.Current(), `)`)
|
||||||
@ -534,7 +554,7 @@ func (p *plugin) Generate(file *generator.FileDescriptor) {
|
|||||||
p.P(`func NewPopulated`, ccTypeName, `(r randy`, p.localName, `, easy bool) *`, ccTypeName, ` {`)
|
p.P(`func NewPopulated`, ccTypeName, `(r randy`, p.localName, `, easy bool) *`, ccTypeName, ` {`)
|
||||||
p.In()
|
p.In()
|
||||||
p.P(`this := &`, ccTypeName, `{}`)
|
p.P(`this := &`, ccTypeName, `{}`)
|
||||||
if gogoproto.IsUnion(message.File(), message.DescriptorProto) && len(message.Field) > 0 {
|
if gogoproto.IsUnion(message.File().FileDescriptorProto, message.DescriptorProto) && len(message.Field) > 0 {
|
||||||
p.P(`fieldNum := r.Intn(`, fmt.Sprintf("%d", ranTotal), `)`)
|
p.P(`fieldNum := r.Intn(`, fmt.Sprintf("%d", ranTotal), `)`)
|
||||||
p.P(`switch fieldNum {`)
|
p.P(`switch fieldNum {`)
|
||||||
k := 0
|
k := 0
|
||||||
|
49
vendor/github.com/gogo/protobuf/plugin/size/size.go
generated
vendored
49
vendor/github.com/gogo/protobuf/plugin/size/size.go
generated
vendored
@ -69,6 +69,9 @@ The following message:
|
|||||||
given to the size plugin, will generate the following code:
|
given to the size plugin, will generate the following code:
|
||||||
|
|
||||||
func (m *B) Size() (n int) {
|
func (m *B) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
l = m.A.Size()
|
l = m.A.Size()
|
||||||
@ -203,18 +206,32 @@ func (p *size) sizeZigZag() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *size) std(field *descriptor.FieldDescriptorProto, name string) (string, bool) {
|
func (p *size) std(field *descriptor.FieldDescriptorProto, name string) (string, bool) {
|
||||||
|
ptr := ""
|
||||||
|
if gogoproto.IsNullable(field) {
|
||||||
|
ptr = "*"
|
||||||
|
}
|
||||||
if gogoproto.IsStdTime(field) {
|
if gogoproto.IsStdTime(field) {
|
||||||
if gogoproto.IsNullable(field) {
|
return p.typesPkg.Use() + `.SizeOfStdTime(` + ptr + name + `)`, true
|
||||||
return p.typesPkg.Use() + `.SizeOfStdTime(*` + name + `)`, true
|
|
||||||
} else {
|
|
||||||
return p.typesPkg.Use() + `.SizeOfStdTime(` + name + `)`, true
|
|
||||||
}
|
|
||||||
} else if gogoproto.IsStdDuration(field) {
|
} else if gogoproto.IsStdDuration(field) {
|
||||||
if gogoproto.IsNullable(field) {
|
return p.typesPkg.Use() + `.SizeOfStdDuration(` + ptr + name + `)`, true
|
||||||
return p.typesPkg.Use() + `.SizeOfStdDuration(*` + name + `)`, true
|
} else if gogoproto.IsStdDouble(field) {
|
||||||
} else {
|
return p.typesPkg.Use() + `.SizeOfStdDouble(` + ptr + name + `)`, true
|
||||||
return p.typesPkg.Use() + `.SizeOfStdDuration(` + name + `)`, true
|
} else if gogoproto.IsStdFloat(field) {
|
||||||
}
|
return p.typesPkg.Use() + `.SizeOfStdFloat(` + ptr + name + `)`, true
|
||||||
|
} else if gogoproto.IsStdInt64(field) {
|
||||||
|
return p.typesPkg.Use() + `.SizeOfStdInt64(` + ptr + name + `)`, true
|
||||||
|
} else if gogoproto.IsStdUInt64(field) {
|
||||||
|
return p.typesPkg.Use() + `.SizeOfStdUInt64(` + ptr + name + `)`, true
|
||||||
|
} else if gogoproto.IsStdInt32(field) {
|
||||||
|
return p.typesPkg.Use() + `.SizeOfStdInt32(` + ptr + name + `)`, true
|
||||||
|
} else if gogoproto.IsStdUInt32(field) {
|
||||||
|
return p.typesPkg.Use() + `.SizeOfStdUInt32(` + ptr + name + `)`, true
|
||||||
|
} else if gogoproto.IsStdBool(field) {
|
||||||
|
return p.typesPkg.Use() + `.SizeOfStdBool(` + ptr + name + `)`, true
|
||||||
|
} else if gogoproto.IsStdString(field) {
|
||||||
|
return p.typesPkg.Use() + `.SizeOfStdString(` + ptr + name + `)`, true
|
||||||
|
} else if gogoproto.IsStdBytes(field) {
|
||||||
|
return p.typesPkg.Use() + `.SizeOfStdBytes(` + ptr + name + `)`, true
|
||||||
}
|
}
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
@ -444,7 +461,7 @@ func (p *size) generateField(proto3 bool, file *generator.FileDescriptor, messag
|
|||||||
sum = append(sum, strconv.Itoa(valueKeySize))
|
sum = append(sum, strconv.Itoa(valueKeySize))
|
||||||
sum = append(sum, `soz`+p.localName+`(uint64(v))`)
|
sum = append(sum, `soz`+p.localName+`(uint64(v))`)
|
||||||
case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
|
case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
|
||||||
stdSizeCall, stdOk := p.std(field, "v")
|
stdSizeCall, stdOk := p.std(m.ValueAliasField, "v")
|
||||||
if nullable {
|
if nullable {
|
||||||
p.P(`l = 0`)
|
p.P(`l = 0`)
|
||||||
p.P(`if v != nil {`)
|
p.P(`if v != nil {`)
|
||||||
@ -595,6 +612,11 @@ func (p *size) Generate(file *generator.FileDescriptor) {
|
|||||||
ccTypeName := generator.CamelCaseSlice(message.TypeName())
|
ccTypeName := generator.CamelCaseSlice(message.TypeName())
|
||||||
p.P(`func (m *`, ccTypeName, `) `, sizeName, `() (n int) {`)
|
p.P(`func (m *`, ccTypeName, `) `, sizeName, `() (n int) {`)
|
||||||
p.In()
|
p.In()
|
||||||
|
p.P(`if m == nil {`)
|
||||||
|
p.In()
|
||||||
|
p.P(`return 0`)
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
p.P(`var l int`)
|
p.P(`var l int`)
|
||||||
p.P(`_ = l`)
|
p.P(`_ = l`)
|
||||||
oneofs := make(map[string]struct{})
|
oneofs := make(map[string]struct{})
|
||||||
@ -650,6 +672,11 @@ func (p *size) Generate(file *generator.FileDescriptor) {
|
|||||||
ccTypeName := p.OneOfTypeName(message, f)
|
ccTypeName := p.OneOfTypeName(message, f)
|
||||||
p.P(`func (m *`, ccTypeName, `) `, sizeName, `() (n int) {`)
|
p.P(`func (m *`, ccTypeName, `) `, sizeName, `() (n int) {`)
|
||||||
p.In()
|
p.In()
|
||||||
|
p.P(`if m == nil {`)
|
||||||
|
p.In()
|
||||||
|
p.P(`return 0`)
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
p.P(`var l int`)
|
p.P(`var l int`)
|
||||||
p.P(`_ = l`)
|
p.P(`_ = l`)
|
||||||
vanity.TurnOffNullableForNativeTypes(f)
|
vanity.TurnOffNullableForNativeTypes(f)
|
||||||
|
2
vendor/github.com/gogo/protobuf/plugin/union/union.go
generated
vendored
2
vendor/github.com/gogo/protobuf/plugin/union/union.go
generated
vendored
@ -184,7 +184,7 @@ func (p *union) Generate(file *generator.FileDescriptor) {
|
|||||||
goTyp, _ := p.GoType(message, field)
|
goTyp, _ := p.GoType(message, field)
|
||||||
obj := p.ObjectNamed(field.GetTypeName()).(*generator.Descriptor)
|
obj := p.ObjectNamed(field.GetTypeName()).(*generator.Descriptor)
|
||||||
|
|
||||||
if gogoproto.IsUnion(obj.File(), obj.DescriptorProto) {
|
if gogoproto.IsUnion(obj.File().FileDescriptorProto, obj.DescriptorProto) {
|
||||||
p.P(`this.`, fieldname, ` = new(`, generator.GoTypeToName(goTyp), `)`)
|
p.P(`this.`, fieldname, ` = new(`, generator.GoTypeToName(goTyp), `)`)
|
||||||
p.P(`if set := this.`, fieldname, `.SetValue(value); set {`)
|
p.P(`if set := this.`, fieldname, `.SetValue(value); set {`)
|
||||||
p.In()
|
p.In()
|
||||||
|
356
vendor/github.com/gogo/protobuf/plugin/unmarshal/unmarshal.go
generated
vendored
356
vendor/github.com/gogo/protobuf/plugin/unmarshal/unmarshal.go
generated
vendored
@ -223,7 +223,7 @@ func (p *unmarshal) decodeVarint(varName string, typName string) {
|
|||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
p.P(`b := dAtA[iNdEx]`)
|
p.P(`b := dAtA[iNdEx]`)
|
||||||
p.P(`iNdEx++`)
|
p.P(`iNdEx++`)
|
||||||
p.P(varName, ` |= (`, typName, `(b) & 0x7F) << shift`)
|
p.P(varName, ` |= `, typName, `(b&0x7F) << shift`)
|
||||||
p.P(`if b < 0x80 {`)
|
p.P(`if b < 0x80 {`)
|
||||||
p.In()
|
p.In()
|
||||||
p.P(`break`)
|
p.P(`break`)
|
||||||
@ -280,6 +280,24 @@ func (p *unmarshal) declareMapField(varName string, nullable bool, customType bo
|
|||||||
p.P(varName, ` := new(time.Time)`)
|
p.P(varName, ` := new(time.Time)`)
|
||||||
} else if gogoproto.IsStdDuration(field) {
|
} else if gogoproto.IsStdDuration(field) {
|
||||||
p.P(varName, ` := new(time.Duration)`)
|
p.P(varName, ` := new(time.Duration)`)
|
||||||
|
} else if gogoproto.IsStdDouble(field) {
|
||||||
|
p.P(varName, ` := new(float64)`)
|
||||||
|
} else if gogoproto.IsStdFloat(field) {
|
||||||
|
p.P(varName, ` := new(float32)`)
|
||||||
|
} else if gogoproto.IsStdInt64(field) {
|
||||||
|
p.P(varName, ` := new(int64)`)
|
||||||
|
} else if gogoproto.IsStdUInt64(field) {
|
||||||
|
p.P(varName, ` := new(uint64)`)
|
||||||
|
} else if gogoproto.IsStdInt32(field) {
|
||||||
|
p.P(varName, ` := new(int32)`)
|
||||||
|
} else if gogoproto.IsStdUInt32(field) {
|
||||||
|
p.P(varName, ` := new(uint32)`)
|
||||||
|
} else if gogoproto.IsStdBool(field) {
|
||||||
|
p.P(varName, ` := new(bool)`)
|
||||||
|
} else if gogoproto.IsStdString(field) {
|
||||||
|
p.P(varName, ` := new(string)`)
|
||||||
|
} else if gogoproto.IsStdBytes(field) {
|
||||||
|
p.P(varName, ` := new([]byte)`)
|
||||||
} else {
|
} else {
|
||||||
desc := p.ObjectNamed(field.GetTypeName())
|
desc := p.ObjectNamed(field.GetTypeName())
|
||||||
msgname := p.TypeName(desc)
|
msgname := p.TypeName(desc)
|
||||||
@ -350,6 +368,11 @@ func (p *unmarshal) mapField(varName string, customType bool, field *descriptor.
|
|||||||
p.Out()
|
p.Out()
|
||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
p.P(`postStringIndex`, varName, ` := iNdEx + intStringLen`, varName)
|
p.P(`postStringIndex`, varName, ` := iNdEx + intStringLen`, varName)
|
||||||
|
p.P(`if postStringIndex`, varName, ` < 0 {`)
|
||||||
|
p.In()
|
||||||
|
p.P(`return ErrInvalidLength` + p.localName)
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
p.P(`if postStringIndex`, varName, ` > l {`)
|
p.P(`if postStringIndex`, varName, ` > l {`)
|
||||||
p.In()
|
p.In()
|
||||||
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
||||||
@ -368,7 +391,7 @@ func (p *unmarshal) mapField(varName string, customType bool, field *descriptor.
|
|||||||
p.Out()
|
p.Out()
|
||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
p.P(`postmsgIndex := iNdEx + mapmsglen`)
|
p.P(`postmsgIndex := iNdEx + mapmsglen`)
|
||||||
p.P(`if mapmsglen < 0 {`)
|
p.P(`if postmsgIndex < 0 {`)
|
||||||
p.In()
|
p.In()
|
||||||
p.P(`return ErrInvalidLength` + p.localName)
|
p.P(`return ErrInvalidLength` + p.localName)
|
||||||
p.Out()
|
p.Out()
|
||||||
@ -383,6 +406,24 @@ func (p *unmarshal) mapField(varName string, customType bool, field *descriptor.
|
|||||||
p.P(`if err := `, p.typesPkg.Use(), `.StdTimeUnmarshal(`, varName, `, `, buf, `); err != nil {`)
|
p.P(`if err := `, p.typesPkg.Use(), `.StdTimeUnmarshal(`, varName, `, `, buf, `); err != nil {`)
|
||||||
} else if gogoproto.IsStdDuration(field) {
|
} else if gogoproto.IsStdDuration(field) {
|
||||||
p.P(`if err := `, p.typesPkg.Use(), `.StdDurationUnmarshal(`, varName, `, `, buf, `); err != nil {`)
|
p.P(`if err := `, p.typesPkg.Use(), `.StdDurationUnmarshal(`, varName, `, `, buf, `); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdDouble(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdDoubleUnmarshal(`, varName, `, `, buf, `); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdFloat(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdFloatUnmarshal(`, varName, `, `, buf, `); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdInt64(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdInt64Unmarshal(`, varName, `, `, buf, `); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdUInt64(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdUInt64Unmarshal(`, varName, `, `, buf, `); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdInt32(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdInt32Unmarshal(`, varName, `, `, buf, `); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdUInt32(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdUInt32Unmarshal(`, varName, `, `, buf, `); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdBool(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdBoolUnmarshal(`, varName, `, `, buf, `); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdString(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdStringUnmarshal(`, varName, `, `, buf, `); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdBytes(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdBytesUnmarshal(`, varName, `, `, buf, `); err != nil {`)
|
||||||
} else {
|
} else {
|
||||||
desc := p.ObjectNamed(field.GetTypeName())
|
desc := p.ObjectNamed(field.GetTypeName())
|
||||||
msgname := p.TypeName(desc)
|
msgname := p.TypeName(desc)
|
||||||
@ -404,6 +445,11 @@ func (p *unmarshal) mapField(varName string, customType bool, field *descriptor.
|
|||||||
p.Out()
|
p.Out()
|
||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
p.P(`postbytesIndex := iNdEx + intMapbyteLen`)
|
p.P(`postbytesIndex := iNdEx + intMapbyteLen`)
|
||||||
|
p.P(`if postbytesIndex < 0 {`)
|
||||||
|
p.In()
|
||||||
|
p.P(`return ErrInvalidLength` + p.localName)
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
p.P(`if postbytesIndex > l {`)
|
p.P(`if postbytesIndex > l {`)
|
||||||
p.In()
|
p.In()
|
||||||
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
||||||
@ -596,6 +642,11 @@ func (p *unmarshal) field(file *generator.FileDescriptor, msg *generator.Descrip
|
|||||||
p.Out()
|
p.Out()
|
||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
p.P(`postIndex := iNdEx + intStringLen`)
|
p.P(`postIndex := iNdEx + intStringLen`)
|
||||||
|
p.P(`if postIndex < 0 {`)
|
||||||
|
p.In()
|
||||||
|
p.P(`return ErrInvalidLength` + p.localName)
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
p.P(`if postIndex > l {`)
|
p.P(`if postIndex > l {`)
|
||||||
p.In()
|
p.In()
|
||||||
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
||||||
@ -625,6 +676,11 @@ func (p *unmarshal) field(file *generator.FileDescriptor, msg *generator.Descrip
|
|||||||
p.Out()
|
p.Out()
|
||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
p.P(`postIndex := iNdEx + msglen`)
|
p.P(`postIndex := iNdEx + msglen`)
|
||||||
|
p.P(`if postIndex < 0 {`)
|
||||||
|
p.In()
|
||||||
|
p.P(`return ErrInvalidLength` + p.localName)
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
p.P(`if postIndex > l {`)
|
p.P(`if postIndex > l {`)
|
||||||
p.In()
|
p.In()
|
||||||
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
||||||
@ -648,6 +704,78 @@ func (p *unmarshal) field(file *generator.FileDescriptor, msg *generator.Descrip
|
|||||||
p.P(`v := time.Duration(0)`)
|
p.P(`v := time.Duration(0)`)
|
||||||
p.P(`if err := `, p.typesPkg.Use(), `.StdDurationUnmarshal(&v, `, buf, `); err != nil {`)
|
p.P(`if err := `, p.typesPkg.Use(), `.StdDurationUnmarshal(&v, `, buf, `); err != nil {`)
|
||||||
}
|
}
|
||||||
|
} else if gogoproto.IsStdDouble(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`v := new(float64)`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdDoubleUnmarshal(v, `, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`v := 0`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdDoubleUnmarshal(&v, `, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdFloat(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`v := new(float32)`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdFloatUnmarshal(v, `, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`v := 0`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdFloatUnmarshal(&v, `, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdInt64(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`v := new(int64)`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdInt64Unmarshal(v, `, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`v := 0`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdInt64Unmarshal(&v, `, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdUInt64(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`v := new(uint64)`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdUInt64Unmarshal(v, `, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`v := 0`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdUInt64Unmarshal(&v, `, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdInt32(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`v := new(int32)`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdInt32Unmarshal(v, `, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`v := 0`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdInt32Unmarshal(&v, `, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdUInt32(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`v := new(uint32)`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdUInt32Unmarshal(v, `, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`v := 0`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdUInt32Unmarshal(&v, `, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdBool(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`v := new(bool)`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdBoolUnmarshal(v, `, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`v := false`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdBoolUnmarshal(&v, `, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdString(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`v := new(string)`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdStringUnmarshal(v, `, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`v := ""`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdStringUnmarshal(&v, `, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdBytes(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`v := new([]byte)`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdBytesUnmarshal(v, `, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`var v []byte`)
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdBytesUnmarshal(&v, `, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
p.P(`v := &`, msgname, `{}`)
|
p.P(`v := &`, msgname, `{}`)
|
||||||
p.P(`if err := v.Unmarshal(`, buf, `); err != nil {`)
|
p.P(`if err := v.Unmarshal(`, buf, `); err != nil {`)
|
||||||
@ -679,7 +807,7 @@ func (p *unmarshal) field(file *generator.FileDescriptor, msg *generator.Descrip
|
|||||||
}
|
}
|
||||||
|
|
||||||
nullable, valuegoTyp, valuegoAliasTyp = generator.GoMapValueTypes(field, m.ValueField, valuegoTyp, valuegoAliasTyp)
|
nullable, valuegoTyp, valuegoAliasTyp = generator.GoMapValueTypes(field, m.ValueField, valuegoTyp, valuegoAliasTyp)
|
||||||
if gogoproto.IsStdTime(field) || gogoproto.IsStdDuration(field) {
|
if gogoproto.IsStdType(field) {
|
||||||
valuegoTyp = valuegoAliasTyp
|
valuegoTyp = valuegoAliasTyp
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -762,6 +890,60 @@ func (p *unmarshal) field(file *generator.FileDescriptor, msg *generator.Descrip
|
|||||||
} else {
|
} else {
|
||||||
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, time.Duration(0))`)
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, time.Duration(0))`)
|
||||||
}
|
}
|
||||||
|
} else if gogoproto.IsStdDouble(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, new(float64))`)
|
||||||
|
} else {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, 0)`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdFloat(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, new(float32))`)
|
||||||
|
} else {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, 0)`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdInt64(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, new(int64))`)
|
||||||
|
} else {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, 0)`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdUInt64(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, new(uint64))`)
|
||||||
|
} else {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, 0)`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdInt32(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, new(int32))`)
|
||||||
|
} else {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, 0)`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdUInt32(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, new(uint32))`)
|
||||||
|
} else {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, 0)`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdBool(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, new(bool))`)
|
||||||
|
} else {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, false)`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdString(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, new(string))`)
|
||||||
|
} else {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, "")`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdBytes(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, new([]byte))`)
|
||||||
|
} else {
|
||||||
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, []byte{})`)
|
||||||
|
}
|
||||||
} else if nullable && !gogoproto.IsCustomType(field) {
|
} else if nullable && !gogoproto.IsCustomType(field) {
|
||||||
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, &`, msgname, `{})`)
|
p.P(`m.`, fieldname, ` = append(m.`, fieldname, `, &`, msgname, `{})`)
|
||||||
} else {
|
} else {
|
||||||
@ -784,6 +966,60 @@ func (p *unmarshal) field(file *generator.FileDescriptor, msg *generator.Descrip
|
|||||||
} else {
|
} else {
|
||||||
p.P(`if err := `, p.typesPkg.Use(), `.StdDurationUnmarshal(&(`, varName, `),`, buf, `); err != nil {`)
|
p.P(`if err := `, p.typesPkg.Use(), `.StdDurationUnmarshal(&(`, varName, `),`, buf, `); err != nil {`)
|
||||||
}
|
}
|
||||||
|
} else if gogoproto.IsStdDouble(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdDoubleUnmarshal(`, varName, `,`, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdDoubleUnmarshal(&(`, varName, `),`, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdFloat(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdFloatUnmarshal(`, varName, `,`, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdFloatUnmarshal(&(`, varName, `),`, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdInt64(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdInt64Unmarshal(`, varName, `,`, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdInt64Unmarshal(&(`, varName, `),`, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdUInt64(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdUInt64Unmarshal(`, varName, `,`, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdUInt64Unmarshal(&(`, varName, `),`, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdInt32(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdInt32Unmarshal(`, varName, `,`, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdInt32Unmarshal(&(`, varName, `),`, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdUInt32(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdUInt32Unmarshal(`, varName, `,`, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdUInt32Unmarshal(&(`, varName, `),`, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdBool(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdBoolUnmarshal(`, varName, `,`, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdBoolUnmarshal(&(`, varName, `),`, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdString(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdStringUnmarshal(`, varName, `,`, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdStringUnmarshal(&(`, varName, `),`, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
|
} else if gogoproto.IsStdBytes(field) {
|
||||||
|
if nullable {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdBytesUnmarshal(`, varName, `,`, buf, `); err != nil {`)
|
||||||
|
} else {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdBytesUnmarshal(&(`, varName, `),`, buf, `); err != nil {`)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
p.P(`if err := `, varName, `.Unmarshal(`, buf, `); err != nil {`)
|
p.P(`if err := `, varName, `.Unmarshal(`, buf, `); err != nil {`)
|
||||||
}
|
}
|
||||||
@ -798,6 +1034,24 @@ func (p *unmarshal) field(file *generator.FileDescriptor, msg *generator.Descrip
|
|||||||
p.P(`m.`, fieldname, ` = new(time.Time)`)
|
p.P(`m.`, fieldname, ` = new(time.Time)`)
|
||||||
} else if gogoproto.IsStdDuration(field) {
|
} else if gogoproto.IsStdDuration(field) {
|
||||||
p.P(`m.`, fieldname, ` = new(time.Duration)`)
|
p.P(`m.`, fieldname, ` = new(time.Duration)`)
|
||||||
|
} else if gogoproto.IsStdDouble(field) {
|
||||||
|
p.P(`m.`, fieldname, ` = new(float64)`)
|
||||||
|
} else if gogoproto.IsStdFloat(field) {
|
||||||
|
p.P(`m.`, fieldname, ` = new(float32)`)
|
||||||
|
} else if gogoproto.IsStdInt64(field) {
|
||||||
|
p.P(`m.`, fieldname, ` = new(int64)`)
|
||||||
|
} else if gogoproto.IsStdUInt64(field) {
|
||||||
|
p.P(`m.`, fieldname, ` = new(uint64)`)
|
||||||
|
} else if gogoproto.IsStdInt32(field) {
|
||||||
|
p.P(`m.`, fieldname, ` = new(int32)`)
|
||||||
|
} else if gogoproto.IsStdUInt32(field) {
|
||||||
|
p.P(`m.`, fieldname, ` = new(uint32)`)
|
||||||
|
} else if gogoproto.IsStdBool(field) {
|
||||||
|
p.P(`m.`, fieldname, ` = new(bool)`)
|
||||||
|
} else if gogoproto.IsStdString(field) {
|
||||||
|
p.P(`m.`, fieldname, ` = new(string)`)
|
||||||
|
} else if gogoproto.IsStdBytes(field) {
|
||||||
|
p.P(`m.`, fieldname, ` = new([]byte)`)
|
||||||
} else {
|
} else {
|
||||||
goType, _ := p.GoType(nil, field)
|
goType, _ := p.GoType(nil, field)
|
||||||
// remove the star from the type
|
// remove the star from the type
|
||||||
@ -809,6 +1063,24 @@ func (p *unmarshal) field(file *generator.FileDescriptor, msg *generator.Descrip
|
|||||||
p.P(`if err := `, p.typesPkg.Use(), `.StdTimeUnmarshal(m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
p.P(`if err := `, p.typesPkg.Use(), `.StdTimeUnmarshal(m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
} else if gogoproto.IsStdDuration(field) {
|
} else if gogoproto.IsStdDuration(field) {
|
||||||
p.P(`if err := `, p.typesPkg.Use(), `.StdDurationUnmarshal(m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
p.P(`if err := `, p.typesPkg.Use(), `.StdDurationUnmarshal(m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdDouble(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdDoubleUnmarshal(m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdFloat(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdFloatUnmarshal(m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdInt64(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdInt64Unmarshal(m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdUInt64(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdUInt64Unmarshal(m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdInt32(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdInt32Unmarshal(m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdUInt32(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdUInt32Unmarshal(m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdBool(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdBoolUnmarshal(m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdString(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdStringUnmarshal(m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdBytes(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdBytesUnmarshal(m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
} else {
|
} else {
|
||||||
p.P(`if err := m.`, fieldname, `.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {`)
|
p.P(`if err := m.`, fieldname, `.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
}
|
}
|
||||||
@ -821,6 +1093,24 @@ func (p *unmarshal) field(file *generator.FileDescriptor, msg *generator.Descrip
|
|||||||
p.P(`if err := `, p.typesPkg.Use(), `.StdTimeUnmarshal(&m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
p.P(`if err := `, p.typesPkg.Use(), `.StdTimeUnmarshal(&m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
} else if gogoproto.IsStdDuration(field) {
|
} else if gogoproto.IsStdDuration(field) {
|
||||||
p.P(`if err := `, p.typesPkg.Use(), `.StdDurationUnmarshal(&m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
p.P(`if err := `, p.typesPkg.Use(), `.StdDurationUnmarshal(&m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdDouble(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdDoubleUnmarshal(&m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdFloat(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdFloatUnmarshal(&m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdInt64(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdInt64Unmarshal(&m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdUInt64(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdUInt64Unmarshal(&m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdInt32(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdInt32Unmarshal(&m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdUInt32(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdUInt32Unmarshal(&m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdBool(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdBoolUnmarshal(&m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdString(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdStringUnmarshal(&m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
|
} else if gogoproto.IsStdBytes(field) {
|
||||||
|
p.P(`if err := `, p.typesPkg.Use(), `.StdBytesUnmarshal(&m.`, fieldname, `, dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
} else {
|
} else {
|
||||||
p.P(`if err := m.`, fieldname, `.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {`)
|
p.P(`if err := m.`, fieldname, `.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {`)
|
||||||
}
|
}
|
||||||
@ -840,6 +1130,11 @@ func (p *unmarshal) field(file *generator.FileDescriptor, msg *generator.Descrip
|
|||||||
p.Out()
|
p.Out()
|
||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
p.P(`postIndex := iNdEx + byteLen`)
|
p.P(`postIndex := iNdEx + byteLen`)
|
||||||
|
p.P(`if postIndex < 0 {`)
|
||||||
|
p.In()
|
||||||
|
p.P(`return ErrInvalidLength` + p.localName)
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
p.P(`if postIndex > l {`)
|
p.P(`if postIndex > l {`)
|
||||||
p.In()
|
p.In()
|
||||||
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
||||||
@ -1094,11 +1389,44 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) {
|
|||||||
p.Out()
|
p.Out()
|
||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
p.P(`postIndex := iNdEx + packedLen`)
|
p.P(`postIndex := iNdEx + packedLen`)
|
||||||
|
p.P(`if postIndex < 0 {`)
|
||||||
|
p.In()
|
||||||
|
p.P(`return ErrInvalidLength` + p.localName)
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
p.P(`if postIndex > l {`)
|
p.P(`if postIndex > l {`)
|
||||||
p.In()
|
p.In()
|
||||||
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
||||||
p.Out()
|
p.Out()
|
||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
|
|
||||||
|
p.P(`var elementCount int`)
|
||||||
|
switch *field.Type {
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_DOUBLE, descriptor.FieldDescriptorProto_TYPE_FIXED64, descriptor.FieldDescriptorProto_TYPE_SFIXED64:
|
||||||
|
p.P(`elementCount = packedLen/`, 8)
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_FLOAT, descriptor.FieldDescriptorProto_TYPE_FIXED32, descriptor.FieldDescriptorProto_TYPE_SFIXED32:
|
||||||
|
p.P(`elementCount = packedLen/`, 4)
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_INT64, descriptor.FieldDescriptorProto_TYPE_UINT64, descriptor.FieldDescriptorProto_TYPE_INT32, descriptor.FieldDescriptorProto_TYPE_UINT32, descriptor.FieldDescriptorProto_TYPE_SINT32, descriptor.FieldDescriptorProto_TYPE_SINT64:
|
||||||
|
p.P(`var count int`)
|
||||||
|
p.P(`for _, integer := range dAtA[iNdEx:postIndex] {`)
|
||||||
|
p.In()
|
||||||
|
p.P(`if integer < 128 {`)
|
||||||
|
p.In()
|
||||||
|
p.P(`count++`)
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
|
p.P(`elementCount = count`)
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_BOOL:
|
||||||
|
p.P(`elementCount = packedLen`)
|
||||||
|
}
|
||||||
|
p.P(`if elementCount != 0 && len(m.`, fieldname, `) == 0 {`)
|
||||||
|
p.In()
|
||||||
|
p.P(`m.`, fieldname, ` = make([]`, p.noStarOrSliceType(message, field), `, 0, elementCount)`)
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
|
|
||||||
p.P(`for iNdEx < postIndex {`)
|
p.P(`for iNdEx < postIndex {`)
|
||||||
p.In()
|
p.In()
|
||||||
p.field(file, message, field, fieldname, false)
|
p.field(file, message, field, fieldname, false)
|
||||||
@ -1124,7 +1452,7 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
panic("field is required, but no bit registered")
|
panic("field is required, but no bit registered")
|
||||||
}
|
}
|
||||||
p.P(`hasFields[`, strconv.Itoa(int(fieldBit/64)), `] |= uint64(`, fmt.Sprintf("0x%08x", 1<<(fieldBit%64)), `)`)
|
p.P(`hasFields[`, strconv.Itoa(int(fieldBit/64)), `] |= uint64(`, fmt.Sprintf("0x%08x", uint64(1)<<(fieldBit%64)), `)`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.Out()
|
p.Out()
|
||||||
@ -1161,6 +1489,11 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) {
|
|||||||
p.P(`return ErrInvalidLength`, p.localName)
|
p.P(`return ErrInvalidLength`, p.localName)
|
||||||
p.Out()
|
p.Out()
|
||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
|
p.P(`if (iNdEx + skippy) < 0 {`)
|
||||||
|
p.In()
|
||||||
|
p.P(`return ErrInvalidLength`, p.localName)
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
p.P(`if (iNdEx + skippy) > l {`)
|
p.P(`if (iNdEx + skippy) > l {`)
|
||||||
p.In()
|
p.In()
|
||||||
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
||||||
@ -1184,6 +1517,11 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) {
|
|||||||
p.P(`return ErrInvalidLength`, p.localName)
|
p.P(`return ErrInvalidLength`, p.localName)
|
||||||
p.Out()
|
p.Out()
|
||||||
p.P(`}`)
|
p.P(`}`)
|
||||||
|
p.P(`if (iNdEx + skippy) < 0 {`)
|
||||||
|
p.In()
|
||||||
|
p.P(`return ErrInvalidLength`, p.localName)
|
||||||
|
p.Out()
|
||||||
|
p.P(`}`)
|
||||||
p.P(`if (iNdEx + skippy) > l {`)
|
p.P(`if (iNdEx + skippy) > l {`)
|
||||||
p.In()
|
p.In()
|
||||||
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
p.P(`return `, p.ioPkg.Use(), `.ErrUnexpectedEOF`)
|
||||||
@ -1213,7 +1551,7 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) {
|
|||||||
panic("field is required, but no bit registered")
|
panic("field is required, but no bit registered")
|
||||||
}
|
}
|
||||||
|
|
||||||
p.P(`if hasFields[`, strconv.Itoa(int(fieldBit/64)), `] & uint64(`, fmt.Sprintf("0x%08x", 1<<(fieldBit%64)), `) == 0 {`)
|
p.P(`if hasFields[`, strconv.Itoa(int(fieldBit/64)), `] & uint64(`, fmt.Sprintf("0x%08x", uint64(1)<<(fieldBit%64)), `) == 0 {`)
|
||||||
p.In()
|
p.In()
|
||||||
if !gogoproto.ImportsGoGoProto(file.FileDescriptorProto) {
|
if !gogoproto.ImportsGoGoProto(file.FileDescriptorProto) {
|
||||||
p.P(`return new(`, protoPkg.Use(), `.RequiredNotSetError)`)
|
p.P(`return new(`, protoPkg.Use(), `.RequiredNotSetError)`)
|
||||||
@ -1291,10 +1629,13 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iNdEx += length
|
|
||||||
if length < 0 {
|
if length < 0 {
|
||||||
return 0, ErrInvalidLength` + p.localName + `
|
return 0, ErrInvalidLength` + p.localName + `
|
||||||
}
|
}
|
||||||
|
iNdEx += length
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLength` + p.localName + `
|
||||||
|
}
|
||||||
return iNdEx, nil
|
return iNdEx, nil
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
for {
|
||||||
@ -1323,6 +1664,9 @@ func (p *unmarshal) Generate(file *generator.FileDescriptor) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
iNdEx = start + next
|
iNdEx = start + next
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLength` + p.localName + `
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
return iNdEx, nil
|
||||||
case 4:
|
case 4:
|
||||||
|
46
vendor/github.com/gogo/protobuf/proto/clone.go
generated
vendored
46
vendor/github.com/gogo/protobuf/proto/clone.go
generated
vendored
@ -35,22 +35,39 @@
|
|||||||
package proto
|
package proto
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Clone returns a deep copy of a protocol buffer.
|
// Clone returns a deep copy of a protocol buffer.
|
||||||
func Clone(pb Message) Message {
|
func Clone(src Message) Message {
|
||||||
in := reflect.ValueOf(pb)
|
in := reflect.ValueOf(src)
|
||||||
if in.IsNil() {
|
if in.IsNil() {
|
||||||
return pb
|
return src
|
||||||
}
|
}
|
||||||
|
|
||||||
out := reflect.New(in.Type().Elem())
|
out := reflect.New(in.Type().Elem())
|
||||||
// out is empty so a merge is a deep copy.
|
dst := out.Interface().(Message)
|
||||||
mergeStruct(out.Elem(), in.Elem())
|
Merge(dst, src)
|
||||||
return out.Interface().(Message)
|
return dst
|
||||||
|
}
|
||||||
|
|
||||||
|
// Merger is the interface representing objects that can merge messages of the same type.
|
||||||
|
type Merger interface {
|
||||||
|
// Merge merges src into this message.
|
||||||
|
// Required and optional fields that are set in src will be set to that value in dst.
|
||||||
|
// Elements of repeated fields will be appended.
|
||||||
|
//
|
||||||
|
// Merge may panic if called with a different argument type than the receiver.
|
||||||
|
Merge(src Message)
|
||||||
|
}
|
||||||
|
|
||||||
|
// generatedMerger is the custom merge method that generated protos will have.
|
||||||
|
// We must add this method since a generate Merge method will conflict with
|
||||||
|
// many existing protos that have a Merge data field already defined.
|
||||||
|
type generatedMerger interface {
|
||||||
|
XXX_Merge(src Message)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merge merges src into dst.
|
// Merge merges src into dst.
|
||||||
@ -58,17 +75,24 @@ func Clone(pb Message) Message {
|
|||||||
// Elements of repeated fields will be appended.
|
// Elements of repeated fields will be appended.
|
||||||
// Merge panics if src and dst are not the same type, or if dst is nil.
|
// Merge panics if src and dst are not the same type, or if dst is nil.
|
||||||
func Merge(dst, src Message) {
|
func Merge(dst, src Message) {
|
||||||
|
if m, ok := dst.(Merger); ok {
|
||||||
|
m.Merge(src)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
in := reflect.ValueOf(src)
|
in := reflect.ValueOf(src)
|
||||||
out := reflect.ValueOf(dst)
|
out := reflect.ValueOf(dst)
|
||||||
if out.IsNil() {
|
if out.IsNil() {
|
||||||
panic("proto: nil destination")
|
panic("proto: nil destination")
|
||||||
}
|
}
|
||||||
if in.Type() != out.Type() {
|
if in.Type() != out.Type() {
|
||||||
// Explicit test prior to mergeStruct so that mistyped nils will fail
|
panic(fmt.Sprintf("proto.Merge(%T, %T) type mismatch", dst, src))
|
||||||
panic("proto: type mismatch")
|
|
||||||
}
|
}
|
||||||
if in.IsNil() {
|
if in.IsNil() {
|
||||||
// Merging nil into non-nil is a quiet no-op
|
return // Merge from nil src is a noop
|
||||||
|
}
|
||||||
|
if m, ok := dst.(generatedMerger); ok {
|
||||||
|
m.XXX_Merge(src)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
mergeStruct(out.Elem(), in.Elem())
|
mergeStruct(out.Elem(), in.Elem())
|
||||||
@ -89,7 +113,7 @@ func mergeStruct(out, in reflect.Value) {
|
|||||||
bIn := emIn.GetExtensions()
|
bIn := emIn.GetExtensions()
|
||||||
bOut := emOut.GetExtensions()
|
bOut := emOut.GetExtensions()
|
||||||
*bOut = append(*bOut, *bIn...)
|
*bOut = append(*bOut, *bIn...)
|
||||||
} else if emIn, ok := extendable(in.Addr().Interface()); ok {
|
} else if emIn, err := extendable(in.Addr().Interface()); err == nil {
|
||||||
emOut, _ := extendable(out.Addr().Interface())
|
emOut, _ := extendable(out.Addr().Interface())
|
||||||
mIn, muIn := emIn.extensionsRead()
|
mIn, muIn := emIn.extensionsRead()
|
||||||
if mIn != nil {
|
if mIn != nil {
|
||||||
|
39
vendor/github.com/gogo/protobuf/proto/custom_gogo.go
generated
vendored
Normal file
39
vendor/github.com/gogo/protobuf/proto/custom_gogo.go
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
// Protocol Buffers for Go with Gadgets
|
||||||
|
//
|
||||||
|
// Copyright (c) 2018, The GoGo Authors. All rights reserved.
|
||||||
|
// http://github.com/gogo/protobuf
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
package proto
|
||||||
|
|
||||||
|
import "reflect"
|
||||||
|
|
||||||
|
type custom interface {
|
||||||
|
Marshal() ([]byte, error)
|
||||||
|
Unmarshal(data []byte) error
|
||||||
|
Size() int
|
||||||
|
}
|
||||||
|
|
||||||
|
var customType = reflect.TypeOf((*custom)(nil)).Elem()
|
677
vendor/github.com/gogo/protobuf/proto/decode.go
generated
vendored
677
vendor/github.com/gogo/protobuf/proto/decode.go
generated
vendored
@ -39,8 +39,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
|
||||||
"reflect"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// errOverflow is returned when an integer is too large to be represented.
|
// errOverflow is returned when an integer is too large to be represented.
|
||||||
@ -50,10 +48,6 @@ var errOverflow = errors.New("proto: integer overflow")
|
|||||||
// wire type is encountered. It does not get returned to user code.
|
// wire type is encountered. It does not get returned to user code.
|
||||||
var ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof")
|
var ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof")
|
||||||
|
|
||||||
// The fundamental decoders that interpret bytes on the wire.
|
|
||||||
// Those that take integer types all return uint64 and are
|
|
||||||
// therefore of type valueDecoder.
|
|
||||||
|
|
||||||
// DecodeVarint reads a varint-encoded integer from the slice.
|
// DecodeVarint reads a varint-encoded integer from the slice.
|
||||||
// It returns the integer and the number of bytes consumed, or
|
// It returns the integer and the number of bytes consumed, or
|
||||||
// zero if there is not enough.
|
// zero if there is not enough.
|
||||||
@ -192,7 +186,6 @@ func (p *Buffer) DecodeVarint() (x uint64, err error) {
|
|||||||
if b&0x80 == 0 {
|
if b&0x80 == 0 {
|
||||||
goto done
|
goto done
|
||||||
}
|
}
|
||||||
// x -= 0x80 << 63 // Always zero.
|
|
||||||
|
|
||||||
return 0, errOverflow
|
return 0, errOverflow
|
||||||
|
|
||||||
@ -267,9 +260,6 @@ func (p *Buffer) DecodeZigzag32() (x uint64, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// These are not ValueDecoders: they produce an array of bytes or a string.
|
|
||||||
// bytes, embedded messages
|
|
||||||
|
|
||||||
// DecodeRawBytes reads a count-delimited byte buffer from the Buffer.
|
// DecodeRawBytes reads a count-delimited byte buffer from the Buffer.
|
||||||
// This is the format used for the bytes protocol buffer
|
// This is the format used for the bytes protocol buffer
|
||||||
// type and for embedded messages.
|
// type and for embedded messages.
|
||||||
@ -311,81 +301,29 @@ func (p *Buffer) DecodeStringBytes() (s string, err error) {
|
|||||||
return string(buf), nil
|
return string(buf), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip the next item in the buffer. Its wire type is decoded and presented as an argument.
|
|
||||||
// If the protocol buffer has extensions, and the field matches, add it as an extension.
|
|
||||||
// Otherwise, if the XXX_unrecognized field exists, append the skipped data there.
|
|
||||||
func (o *Buffer) skipAndSave(t reflect.Type, tag, wire int, base structPointer, unrecField field) error {
|
|
||||||
oi := o.index
|
|
||||||
|
|
||||||
err := o.skip(t, tag, wire)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if !unrecField.IsValid() {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
ptr := structPointer_Bytes(base, unrecField)
|
|
||||||
|
|
||||||
// Add the skipped field to struct field
|
|
||||||
obuf := o.buf
|
|
||||||
|
|
||||||
o.buf = *ptr
|
|
||||||
o.EncodeVarint(uint64(tag<<3 | wire))
|
|
||||||
*ptr = append(o.buf, obuf[oi:o.index]...)
|
|
||||||
|
|
||||||
o.buf = obuf
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Skip the next item in the buffer. Its wire type is decoded and presented as an argument.
|
|
||||||
func (o *Buffer) skip(t reflect.Type, tag, wire int) error {
|
|
||||||
|
|
||||||
var u uint64
|
|
||||||
var err error
|
|
||||||
|
|
||||||
switch wire {
|
|
||||||
case WireVarint:
|
|
||||||
_, err = o.DecodeVarint()
|
|
||||||
case WireFixed64:
|
|
||||||
_, err = o.DecodeFixed64()
|
|
||||||
case WireBytes:
|
|
||||||
_, err = o.DecodeRawBytes(false)
|
|
||||||
case WireFixed32:
|
|
||||||
_, err = o.DecodeFixed32()
|
|
||||||
case WireStartGroup:
|
|
||||||
for {
|
|
||||||
u, err = o.DecodeVarint()
|
|
||||||
if err != nil {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
fwire := int(u & 0x7)
|
|
||||||
if fwire == WireEndGroup {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
ftag := int(u >> 3)
|
|
||||||
err = o.skip(t, ftag, fwire)
|
|
||||||
if err != nil {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
err = fmt.Errorf("proto: can't skip unknown wire type %d for %s", wire, t)
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unmarshaler is the interface representing objects that can
|
// Unmarshaler is the interface representing objects that can
|
||||||
// unmarshal themselves. The method should reset the receiver before
|
// unmarshal themselves. The argument points to data that may be
|
||||||
// decoding starts. The argument points to data that may be
|
|
||||||
// overwritten, so implementations should not keep references to the
|
// overwritten, so implementations should not keep references to the
|
||||||
// buffer.
|
// buffer.
|
||||||
|
// Unmarshal implementations should not clear the receiver.
|
||||||
|
// Any unmarshaled data should be merged into the receiver.
|
||||||
|
// Callers of Unmarshal that do not want to retain existing data
|
||||||
|
// should Reset the receiver before calling Unmarshal.
|
||||||
type Unmarshaler interface {
|
type Unmarshaler interface {
|
||||||
Unmarshal([]byte) error
|
Unmarshal([]byte) error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// newUnmarshaler is the interface representing objects that can
|
||||||
|
// unmarshal themselves. The semantics are identical to Unmarshaler.
|
||||||
|
//
|
||||||
|
// This exists to support protoc-gen-go generated messages.
|
||||||
|
// The proto package will stop type-asserting to this interface in the future.
|
||||||
|
//
|
||||||
|
// DO NOT DEPEND ON THIS.
|
||||||
|
type newUnmarshaler interface {
|
||||||
|
XXX_Unmarshal([]byte) error
|
||||||
|
}
|
||||||
|
|
||||||
// Unmarshal parses the protocol buffer representation in buf and places the
|
// Unmarshal parses the protocol buffer representation in buf and places the
|
||||||
// decoded result in pb. If the struct underlying pb does not match
|
// decoded result in pb. If the struct underlying pb does not match
|
||||||
// the data in buf, the results can be unpredictable.
|
// the data in buf, the results can be unpredictable.
|
||||||
@ -395,7 +333,13 @@ type Unmarshaler interface {
|
|||||||
// to preserve and append to existing data.
|
// to preserve and append to existing data.
|
||||||
func Unmarshal(buf []byte, pb Message) error {
|
func Unmarshal(buf []byte, pb Message) error {
|
||||||
pb.Reset()
|
pb.Reset()
|
||||||
return UnmarshalMerge(buf, pb)
|
if u, ok := pb.(newUnmarshaler); ok {
|
||||||
|
return u.XXX_Unmarshal(buf)
|
||||||
|
}
|
||||||
|
if u, ok := pb.(Unmarshaler); ok {
|
||||||
|
return u.Unmarshal(buf)
|
||||||
|
}
|
||||||
|
return NewBuffer(buf).Unmarshal(pb)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalMerge parses the protocol buffer representation in buf and
|
// UnmarshalMerge parses the protocol buffer representation in buf and
|
||||||
@ -405,8 +349,16 @@ func Unmarshal(buf []byte, pb Message) error {
|
|||||||
// UnmarshalMerge merges into existing data in pb.
|
// UnmarshalMerge merges into existing data in pb.
|
||||||
// Most code should use Unmarshal instead.
|
// Most code should use Unmarshal instead.
|
||||||
func UnmarshalMerge(buf []byte, pb Message) error {
|
func UnmarshalMerge(buf []byte, pb Message) error {
|
||||||
// If the object can unmarshal itself, let it.
|
if u, ok := pb.(newUnmarshaler); ok {
|
||||||
|
return u.XXX_Unmarshal(buf)
|
||||||
|
}
|
||||||
if u, ok := pb.(Unmarshaler); ok {
|
if u, ok := pb.(Unmarshaler); ok {
|
||||||
|
// NOTE: The history of proto have unfortunately been inconsistent
|
||||||
|
// whether Unmarshaler should or should not implicitly clear itself.
|
||||||
|
// Some implementations do, most do not.
|
||||||
|
// Thus, calling this here may or may not do what people want.
|
||||||
|
//
|
||||||
|
// See https://github.com/golang/protobuf/issues/424
|
||||||
return u.Unmarshal(buf)
|
return u.Unmarshal(buf)
|
||||||
}
|
}
|
||||||
return NewBuffer(buf).Unmarshal(pb)
|
return NewBuffer(buf).Unmarshal(pb)
|
||||||
@ -422,12 +374,17 @@ func (p *Buffer) DecodeMessage(pb Message) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DecodeGroup reads a tag-delimited group from the Buffer.
|
// DecodeGroup reads a tag-delimited group from the Buffer.
|
||||||
|
// StartGroup tag is already consumed. This function consumes
|
||||||
|
// EndGroup tag.
|
||||||
func (p *Buffer) DecodeGroup(pb Message) error {
|
func (p *Buffer) DecodeGroup(pb Message) error {
|
||||||
typ, base, err := getbase(pb)
|
b := p.buf[p.index:]
|
||||||
if err != nil {
|
x, y := findEndGroup(b)
|
||||||
return err
|
if x < 0 {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
return p.unmarshalType(typ.Elem(), GetProperties(typ.Elem()), true, base)
|
err := Unmarshal(b[:x], pb)
|
||||||
|
p.index += y
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unmarshal parses the protocol buffer representation in the
|
// Unmarshal parses the protocol buffer representation in the
|
||||||
@ -438,541 +395,33 @@ func (p *Buffer) DecodeGroup(pb Message) error {
|
|||||||
// Unlike proto.Unmarshal, this does not reset pb before starting to unmarshal.
|
// Unlike proto.Unmarshal, this does not reset pb before starting to unmarshal.
|
||||||
func (p *Buffer) Unmarshal(pb Message) error {
|
func (p *Buffer) Unmarshal(pb Message) error {
|
||||||
// If the object can unmarshal itself, let it.
|
// If the object can unmarshal itself, let it.
|
||||||
|
if u, ok := pb.(newUnmarshaler); ok {
|
||||||
|
err := u.XXX_Unmarshal(p.buf[p.index:])
|
||||||
|
p.index = len(p.buf)
|
||||||
|
return err
|
||||||
|
}
|
||||||
if u, ok := pb.(Unmarshaler); ok {
|
if u, ok := pb.(Unmarshaler); ok {
|
||||||
|
// NOTE: The history of proto have unfortunately been inconsistent
|
||||||
|
// whether Unmarshaler should or should not implicitly clear itself.
|
||||||
|
// Some implementations do, most do not.
|
||||||
|
// Thus, calling this here may or may not do what people want.
|
||||||
|
//
|
||||||
|
// See https://github.com/golang/protobuf/issues/424
|
||||||
err := u.Unmarshal(p.buf[p.index:])
|
err := u.Unmarshal(p.buf[p.index:])
|
||||||
p.index = len(p.buf)
|
p.index = len(p.buf)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
typ, base, err := getbase(pb)
|
// Slow workaround for messages that aren't Unmarshalers.
|
||||||
if err != nil {
|
// This includes some hand-coded .pb.go files and
|
||||||
return err
|
// bootstrap protos.
|
||||||
}
|
// TODO: fix all of those and then add Unmarshal to
|
||||||
|
// the Message interface. Then:
|
||||||
err = p.unmarshalType(typ.Elem(), GetProperties(typ.Elem()), false, base)
|
// The cast above and code below can be deleted.
|
||||||
|
// The old unmarshaler can be deleted.
|
||||||
if collectStats {
|
// Clients can call Unmarshal directly (can already do that, actually).
|
||||||
stats.Decode++
|
var info InternalMessageInfo
|
||||||
}
|
err := info.Unmarshal(pb, p.buf[p.index:])
|
||||||
|
p.index = len(p.buf)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// unmarshalType does the work of unmarshaling a structure.
|
|
||||||
func (o *Buffer) unmarshalType(st reflect.Type, prop *StructProperties, is_group bool, base structPointer) error {
|
|
||||||
var state errorState
|
|
||||||
required, reqFields := prop.reqCount, uint64(0)
|
|
||||||
|
|
||||||
var err error
|
|
||||||
for err == nil && o.index < len(o.buf) {
|
|
||||||
oi := o.index
|
|
||||||
var u uint64
|
|
||||||
u, err = o.DecodeVarint()
|
|
||||||
if err != nil {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
wire := int(u & 0x7)
|
|
||||||
if wire == WireEndGroup {
|
|
||||||
if is_group {
|
|
||||||
if required > 0 {
|
|
||||||
// Not enough information to determine the exact field.
|
|
||||||
// (See below.)
|
|
||||||
return &RequiredNotSetError{"{Unknown}"}
|
|
||||||
}
|
|
||||||
return nil // input is satisfied
|
|
||||||
}
|
|
||||||
return fmt.Errorf("proto: %s: wiretype end group for non-group", st)
|
|
||||||
}
|
|
||||||
tag := int(u >> 3)
|
|
||||||
if tag <= 0 {
|
|
||||||
return fmt.Errorf("proto: %s: illegal tag %d (wire type %d)", st, tag, wire)
|
|
||||||
}
|
|
||||||
fieldnum, ok := prop.decoderTags.get(tag)
|
|
||||||
if !ok {
|
|
||||||
// Maybe it's an extension?
|
|
||||||
if prop.extendable {
|
|
||||||
if e, eok := structPointer_Interface(base, st).(extensionsBytes); eok {
|
|
||||||
if isExtensionField(e, int32(tag)) {
|
|
||||||
if err = o.skip(st, tag, wire); err == nil {
|
|
||||||
ext := e.GetExtensions()
|
|
||||||
*ext = append(*ext, o.buf[oi:o.index]...)
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
} else if e, _ := extendable(structPointer_Interface(base, st)); isExtensionField(e, int32(tag)) {
|
|
||||||
if err = o.skip(st, tag, wire); err == nil {
|
|
||||||
extmap := e.extensionsWrite()
|
|
||||||
ext := extmap[int32(tag)] // may be missing
|
|
||||||
ext.enc = append(ext.enc, o.buf[oi:o.index]...)
|
|
||||||
extmap[int32(tag)] = ext
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Maybe it's a oneof?
|
|
||||||
if prop.oneofUnmarshaler != nil {
|
|
||||||
m := structPointer_Interface(base, st).(Message)
|
|
||||||
// First return value indicates whether tag is a oneof field.
|
|
||||||
ok, err = prop.oneofUnmarshaler(m, tag, wire, o)
|
|
||||||
if err == ErrInternalBadWireType {
|
|
||||||
// Map the error to something more descriptive.
|
|
||||||
// Do the formatting here to save generated code space.
|
|
||||||
err = fmt.Errorf("bad wiretype for oneof field in %T", m)
|
|
||||||
}
|
|
||||||
if ok {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
err = o.skipAndSave(st, tag, wire, base, prop.unrecField)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
p := prop.Prop[fieldnum]
|
|
||||||
|
|
||||||
if p.dec == nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "proto: no protobuf decoder for %s.%s\n", st, st.Field(fieldnum).Name)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
dec := p.dec
|
|
||||||
if wire != WireStartGroup && wire != p.WireType {
|
|
||||||
if wire == WireBytes && p.packedDec != nil {
|
|
||||||
// a packable field
|
|
||||||
dec = p.packedDec
|
|
||||||
} else {
|
|
||||||
err = fmt.Errorf("proto: bad wiretype for field %s.%s: got wiretype %d, want %d", st, st.Field(fieldnum).Name, wire, p.WireType)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
decErr := dec(o, p, base)
|
|
||||||
if decErr != nil && !state.shouldContinue(decErr, p) {
|
|
||||||
err = decErr
|
|
||||||
}
|
|
||||||
if err == nil && p.Required {
|
|
||||||
// Successfully decoded a required field.
|
|
||||||
if tag <= 64 {
|
|
||||||
// use bitmap for fields 1-64 to catch field reuse.
|
|
||||||
var mask uint64 = 1 << uint64(tag-1)
|
|
||||||
if reqFields&mask == 0 {
|
|
||||||
// new required field
|
|
||||||
reqFields |= mask
|
|
||||||
required--
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// This is imprecise. It can be fooled by a required field
|
|
||||||
// with a tag > 64 that is encoded twice; that's very rare.
|
|
||||||
// A fully correct implementation would require allocating
|
|
||||||
// a data structure, which we would like to avoid.
|
|
||||||
required--
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err == nil {
|
|
||||||
if is_group {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if state.err != nil {
|
|
||||||
return state.err
|
|
||||||
}
|
|
||||||
if required > 0 {
|
|
||||||
// Not enough information to determine the exact field. If we use extra
|
|
||||||
// CPU, we could determine the field only if the missing required field
|
|
||||||
// has a tag <= 64 and we check reqFields.
|
|
||||||
return &RequiredNotSetError{"{Unknown}"}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Individual type decoders
|
|
||||||
// For each,
|
|
||||||
// u is the decoded value,
|
|
||||||
// v is a pointer to the field (pointer) in the struct
|
|
||||||
|
|
||||||
// Sizes of the pools to allocate inside the Buffer.
|
|
||||||
// The goal is modest amortization and allocation
|
|
||||||
// on at least 16-byte boundaries.
|
|
||||||
const (
|
|
||||||
boolPoolSize = 16
|
|
||||||
uint32PoolSize = 8
|
|
||||||
uint64PoolSize = 4
|
|
||||||
)
|
|
||||||
|
|
||||||
// Decode a bool.
|
|
||||||
func (o *Buffer) dec_bool(p *Properties, base structPointer) error {
|
|
||||||
u, err := p.valDec(o)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if len(o.bools) == 0 {
|
|
||||||
o.bools = make([]bool, boolPoolSize)
|
|
||||||
}
|
|
||||||
o.bools[0] = u != 0
|
|
||||||
*structPointer_Bool(base, p.field) = &o.bools[0]
|
|
||||||
o.bools = o.bools[1:]
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) dec_proto3_bool(p *Properties, base structPointer) error {
|
|
||||||
u, err := p.valDec(o)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
*structPointer_BoolVal(base, p.field) = u != 0
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode an int32.
|
|
||||||
func (o *Buffer) dec_int32(p *Properties, base structPointer) error {
|
|
||||||
u, err := p.valDec(o)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
word32_Set(structPointer_Word32(base, p.field), o, uint32(u))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) dec_proto3_int32(p *Properties, base structPointer) error {
|
|
||||||
u, err := p.valDec(o)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
word32Val_Set(structPointer_Word32Val(base, p.field), uint32(u))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode an int64.
|
|
||||||
func (o *Buffer) dec_int64(p *Properties, base structPointer) error {
|
|
||||||
u, err := p.valDec(o)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
word64_Set(structPointer_Word64(base, p.field), o, u)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) dec_proto3_int64(p *Properties, base structPointer) error {
|
|
||||||
u, err := p.valDec(o)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
word64Val_Set(structPointer_Word64Val(base, p.field), o, u)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a string.
|
|
||||||
func (o *Buffer) dec_string(p *Properties, base structPointer) error {
|
|
||||||
s, err := o.DecodeStringBytes()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
*structPointer_String(base, p.field) = &s
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) dec_proto3_string(p *Properties, base structPointer) error {
|
|
||||||
s, err := o.DecodeStringBytes()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
*structPointer_StringVal(base, p.field) = s
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of bytes ([]byte).
|
|
||||||
func (o *Buffer) dec_slice_byte(p *Properties, base structPointer) error {
|
|
||||||
b, err := o.DecodeRawBytes(true)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
*structPointer_Bytes(base, p.field) = b
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of bools ([]bool).
|
|
||||||
func (o *Buffer) dec_slice_bool(p *Properties, base structPointer) error {
|
|
||||||
u, err := p.valDec(o)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
v := structPointer_BoolSlice(base, p.field)
|
|
||||||
*v = append(*v, u != 0)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of bools ([]bool) in packed format.
|
|
||||||
func (o *Buffer) dec_slice_packed_bool(p *Properties, base structPointer) error {
|
|
||||||
v := structPointer_BoolSlice(base, p.field)
|
|
||||||
|
|
||||||
nn, err := o.DecodeVarint()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
nb := int(nn) // number of bytes of encoded bools
|
|
||||||
fin := o.index + nb
|
|
||||||
if fin < o.index {
|
|
||||||
return errOverflow
|
|
||||||
}
|
|
||||||
|
|
||||||
y := *v
|
|
||||||
for o.index < fin {
|
|
||||||
u, err := p.valDec(o)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
y = append(y, u != 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
*v = y
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of int32s ([]int32).
|
|
||||||
func (o *Buffer) dec_slice_int32(p *Properties, base structPointer) error {
|
|
||||||
u, err := p.valDec(o)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
structPointer_Word32Slice(base, p.field).Append(uint32(u))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of int32s ([]int32) in packed format.
|
|
||||||
func (o *Buffer) dec_slice_packed_int32(p *Properties, base structPointer) error {
|
|
||||||
v := structPointer_Word32Slice(base, p.field)
|
|
||||||
|
|
||||||
nn, err := o.DecodeVarint()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
nb := int(nn) // number of bytes of encoded int32s
|
|
||||||
|
|
||||||
fin := o.index + nb
|
|
||||||
if fin < o.index {
|
|
||||||
return errOverflow
|
|
||||||
}
|
|
||||||
for o.index < fin {
|
|
||||||
u, err := p.valDec(o)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
v.Append(uint32(u))
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of int64s ([]int64).
|
|
||||||
func (o *Buffer) dec_slice_int64(p *Properties, base structPointer) error {
|
|
||||||
u, err := p.valDec(o)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
structPointer_Word64Slice(base, p.field).Append(u)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of int64s ([]int64) in packed format.
|
|
||||||
func (o *Buffer) dec_slice_packed_int64(p *Properties, base structPointer) error {
|
|
||||||
v := structPointer_Word64Slice(base, p.field)
|
|
||||||
|
|
||||||
nn, err := o.DecodeVarint()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
nb := int(nn) // number of bytes of encoded int64s
|
|
||||||
|
|
||||||
fin := o.index + nb
|
|
||||||
if fin < o.index {
|
|
||||||
return errOverflow
|
|
||||||
}
|
|
||||||
for o.index < fin {
|
|
||||||
u, err := p.valDec(o)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
v.Append(u)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of strings ([]string).
|
|
||||||
func (o *Buffer) dec_slice_string(p *Properties, base structPointer) error {
|
|
||||||
s, err := o.DecodeStringBytes()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
v := structPointer_StringSlice(base, p.field)
|
|
||||||
*v = append(*v, s)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of slice of bytes ([][]byte).
|
|
||||||
func (o *Buffer) dec_slice_slice_byte(p *Properties, base structPointer) error {
|
|
||||||
b, err := o.DecodeRawBytes(true)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
v := structPointer_BytesSlice(base, p.field)
|
|
||||||
*v = append(*v, b)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a map field.
|
|
||||||
func (o *Buffer) dec_new_map(p *Properties, base structPointer) error {
|
|
||||||
raw, err := o.DecodeRawBytes(false)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
oi := o.index // index at the end of this map entry
|
|
||||||
o.index -= len(raw) // move buffer back to start of map entry
|
|
||||||
|
|
||||||
mptr := structPointer_NewAt(base, p.field, p.mtype) // *map[K]V
|
|
||||||
if mptr.Elem().IsNil() {
|
|
||||||
mptr.Elem().Set(reflect.MakeMap(mptr.Type().Elem()))
|
|
||||||
}
|
|
||||||
v := mptr.Elem() // map[K]V
|
|
||||||
|
|
||||||
// Prepare addressable doubly-indirect placeholders for the key and value types.
|
|
||||||
// See enc_new_map for why.
|
|
||||||
keyptr := reflect.New(reflect.PtrTo(p.mtype.Key())).Elem() // addressable *K
|
|
||||||
keybase := toStructPointer(keyptr.Addr()) // **K
|
|
||||||
|
|
||||||
var valbase structPointer
|
|
||||||
var valptr reflect.Value
|
|
||||||
switch p.mtype.Elem().Kind() {
|
|
||||||
case reflect.Slice:
|
|
||||||
// []byte
|
|
||||||
var dummy []byte
|
|
||||||
valptr = reflect.ValueOf(&dummy) // *[]byte
|
|
||||||
valbase = toStructPointer(valptr) // *[]byte
|
|
||||||
case reflect.Ptr:
|
|
||||||
// message; valptr is **Msg; need to allocate the intermediate pointer
|
|
||||||
valptr = reflect.New(reflect.PtrTo(p.mtype.Elem())).Elem() // addressable *V
|
|
||||||
valptr.Set(reflect.New(valptr.Type().Elem()))
|
|
||||||
valbase = toStructPointer(valptr)
|
|
||||||
default:
|
|
||||||
// everything else
|
|
||||||
valptr = reflect.New(reflect.PtrTo(p.mtype.Elem())).Elem() // addressable *V
|
|
||||||
valbase = toStructPointer(valptr.Addr()) // **V
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode.
|
|
||||||
// This parses a restricted wire format, namely the encoding of a message
|
|
||||||
// with two fields. See enc_new_map for the format.
|
|
||||||
for o.index < oi {
|
|
||||||
// tagcode for key and value properties are always a single byte
|
|
||||||
// because they have tags 1 and 2.
|
|
||||||
tagcode := o.buf[o.index]
|
|
||||||
o.index++
|
|
||||||
switch tagcode {
|
|
||||||
case p.mkeyprop.tagcode[0]:
|
|
||||||
if err := p.mkeyprop.dec(o, p.mkeyprop, keybase); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
case p.mvalprop.tagcode[0]:
|
|
||||||
if err := p.mvalprop.dec(o, p.mvalprop, valbase); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
// TODO: Should we silently skip this instead?
|
|
||||||
return fmt.Errorf("proto: bad map data tag %d", raw[0])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
keyelem, valelem := keyptr.Elem(), valptr.Elem()
|
|
||||||
if !keyelem.IsValid() {
|
|
||||||
keyelem = reflect.Zero(p.mtype.Key())
|
|
||||||
}
|
|
||||||
if !valelem.IsValid() {
|
|
||||||
valelem = reflect.Zero(p.mtype.Elem())
|
|
||||||
}
|
|
||||||
|
|
||||||
v.SetMapIndex(keyelem, valelem)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a group.
|
|
||||||
func (o *Buffer) dec_struct_group(p *Properties, base structPointer) error {
|
|
||||||
bas := structPointer_GetStructPointer(base, p.field)
|
|
||||||
if structPointer_IsNil(bas) {
|
|
||||||
// allocate new nested message
|
|
||||||
bas = toStructPointer(reflect.New(p.stype))
|
|
||||||
structPointer_SetStructPointer(base, p.field, bas)
|
|
||||||
}
|
|
||||||
return o.unmarshalType(p.stype, p.sprop, true, bas)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode an embedded message.
|
|
||||||
func (o *Buffer) dec_struct_message(p *Properties, base structPointer) (err error) {
|
|
||||||
raw, e := o.DecodeRawBytes(false)
|
|
||||||
if e != nil {
|
|
||||||
return e
|
|
||||||
}
|
|
||||||
|
|
||||||
bas := structPointer_GetStructPointer(base, p.field)
|
|
||||||
if structPointer_IsNil(bas) {
|
|
||||||
// allocate new nested message
|
|
||||||
bas = toStructPointer(reflect.New(p.stype))
|
|
||||||
structPointer_SetStructPointer(base, p.field, bas)
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the object can unmarshal itself, let it.
|
|
||||||
if p.isUnmarshaler {
|
|
||||||
iv := structPointer_Interface(bas, p.stype)
|
|
||||||
return iv.(Unmarshaler).Unmarshal(raw)
|
|
||||||
}
|
|
||||||
|
|
||||||
obuf := o.buf
|
|
||||||
oi := o.index
|
|
||||||
o.buf = raw
|
|
||||||
o.index = 0
|
|
||||||
|
|
||||||
err = o.unmarshalType(p.stype, p.sprop, false, bas)
|
|
||||||
o.buf = obuf
|
|
||||||
o.index = oi
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of embedded messages.
|
|
||||||
func (o *Buffer) dec_slice_struct_message(p *Properties, base structPointer) error {
|
|
||||||
return o.dec_slice_struct(p, false, base)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of embedded groups.
|
|
||||||
func (o *Buffer) dec_slice_struct_group(p *Properties, base structPointer) error {
|
|
||||||
return o.dec_slice_struct(p, true, base)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of structs ([]*struct).
|
|
||||||
func (o *Buffer) dec_slice_struct(p *Properties, is_group bool, base structPointer) error {
|
|
||||||
v := reflect.New(p.stype)
|
|
||||||
bas := toStructPointer(v)
|
|
||||||
structPointer_StructPointerSlice(base, p.field).Append(bas)
|
|
||||||
|
|
||||||
if is_group {
|
|
||||||
err := o.unmarshalType(p.stype, p.sprop, is_group, bas)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
raw, err := o.DecodeRawBytes(false)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the object can unmarshal itself, let it.
|
|
||||||
if p.isUnmarshaler {
|
|
||||||
iv := v.Interface()
|
|
||||||
return iv.(Unmarshaler).Unmarshal(raw)
|
|
||||||
}
|
|
||||||
|
|
||||||
obuf := o.buf
|
|
||||||
oi := o.index
|
|
||||||
o.buf = raw
|
|
||||||
o.index = 0
|
|
||||||
|
|
||||||
err = o.unmarshalType(p.stype, p.sprop, is_group, bas)
|
|
||||||
|
|
||||||
o.buf = obuf
|
|
||||||
o.index = oi
|
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
172
vendor/github.com/gogo/protobuf/proto/decode_gogo.go
generated
vendored
172
vendor/github.com/gogo/protobuf/proto/decode_gogo.go
generated
vendored
@ -1,172 +0,0 @@
|
|||||||
// Protocol Buffers for Go with Gadgets
|
|
||||||
//
|
|
||||||
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
|
|
||||||
// http://github.com/gogo/protobuf
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without
|
|
||||||
// modification, are permitted provided that the following conditions are
|
|
||||||
// met:
|
|
||||||
//
|
|
||||||
// * Redistributions of source code must retain the above copyright
|
|
||||||
// notice, this list of conditions and the following disclaimer.
|
|
||||||
// * Redistributions in binary form must reproduce the above
|
|
||||||
// copyright notice, this list of conditions and the following disclaimer
|
|
||||||
// in the documentation and/or other materials provided with the
|
|
||||||
// distribution.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
package proto
|
|
||||||
|
|
||||||
import (
|
|
||||||
"reflect"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Decode a reference to a struct pointer.
|
|
||||||
func (o *Buffer) dec_ref_struct_message(p *Properties, base structPointer) (err error) {
|
|
||||||
raw, e := o.DecodeRawBytes(false)
|
|
||||||
if e != nil {
|
|
||||||
return e
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the object can unmarshal itself, let it.
|
|
||||||
if p.isUnmarshaler {
|
|
||||||
panic("not supported, since this is a pointer receiver")
|
|
||||||
}
|
|
||||||
|
|
||||||
obuf := o.buf
|
|
||||||
oi := o.index
|
|
||||||
o.buf = raw
|
|
||||||
o.index = 0
|
|
||||||
|
|
||||||
bas := structPointer_FieldPointer(base, p.field)
|
|
||||||
|
|
||||||
err = o.unmarshalType(p.stype, p.sprop, false, bas)
|
|
||||||
o.buf = obuf
|
|
||||||
o.index = oi
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of references to struct pointers ([]struct).
|
|
||||||
func (o *Buffer) dec_slice_ref_struct(p *Properties, is_group bool, base structPointer) error {
|
|
||||||
newBas := appendStructPointer(base, p.field, p.sstype)
|
|
||||||
|
|
||||||
if is_group {
|
|
||||||
panic("not supported, maybe in future, if requested.")
|
|
||||||
}
|
|
||||||
|
|
||||||
raw, err := o.DecodeRawBytes(false)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the object can unmarshal itself, let it.
|
|
||||||
if p.isUnmarshaler {
|
|
||||||
panic("not supported, since this is not a pointer receiver.")
|
|
||||||
}
|
|
||||||
|
|
||||||
obuf := o.buf
|
|
||||||
oi := o.index
|
|
||||||
o.buf = raw
|
|
||||||
o.index = 0
|
|
||||||
|
|
||||||
err = o.unmarshalType(p.stype, p.sprop, is_group, newBas)
|
|
||||||
|
|
||||||
o.buf = obuf
|
|
||||||
o.index = oi
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of references to struct pointers.
|
|
||||||
func (o *Buffer) dec_slice_ref_struct_message(p *Properties, base structPointer) error {
|
|
||||||
return o.dec_slice_ref_struct(p, false, base)
|
|
||||||
}
|
|
||||||
|
|
||||||
func setPtrCustomType(base structPointer, f field, v interface{}) {
|
|
||||||
if v == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
structPointer_SetStructPointer(base, f, toStructPointer(reflect.ValueOf(v)))
|
|
||||||
}
|
|
||||||
|
|
||||||
func setCustomType(base structPointer, f field, value interface{}) {
|
|
||||||
if value == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
v := reflect.ValueOf(value).Elem()
|
|
||||||
t := reflect.TypeOf(value).Elem()
|
|
||||||
kind := t.Kind()
|
|
||||||
switch kind {
|
|
||||||
case reflect.Slice:
|
|
||||||
slice := reflect.MakeSlice(t, v.Len(), v.Cap())
|
|
||||||
reflect.Copy(slice, v)
|
|
||||||
oldHeader := structPointer_GetSliceHeader(base, f)
|
|
||||||
oldHeader.Data = slice.Pointer()
|
|
||||||
oldHeader.Len = v.Len()
|
|
||||||
oldHeader.Cap = v.Cap()
|
|
||||||
default:
|
|
||||||
size := reflect.TypeOf(value).Elem().Size()
|
|
||||||
structPointer_Copy(toStructPointer(reflect.ValueOf(value)), structPointer_Add(base, f), int(size))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) dec_custom_bytes(p *Properties, base structPointer) error {
|
|
||||||
b, err := o.DecodeRawBytes(true)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
i := reflect.New(p.ctype.Elem()).Interface()
|
|
||||||
custom := (i).(Unmarshaler)
|
|
||||||
if err := custom.Unmarshal(b); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
setPtrCustomType(base, p.field, custom)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) dec_custom_ref_bytes(p *Properties, base structPointer) error {
|
|
||||||
b, err := o.DecodeRawBytes(true)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
i := reflect.New(p.ctype).Interface()
|
|
||||||
custom := (i).(Unmarshaler)
|
|
||||||
if err := custom.Unmarshal(b); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if custom != nil {
|
|
||||||
setCustomType(base, p.field, custom)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Decode a slice of bytes ([]byte) into a slice of custom types.
|
|
||||||
func (o *Buffer) dec_custom_slice_bytes(p *Properties, base structPointer) error {
|
|
||||||
b, err := o.DecodeRawBytes(true)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
i := reflect.New(p.ctype.Elem()).Interface()
|
|
||||||
custom := (i).(Unmarshaler)
|
|
||||||
if err := custom.Unmarshal(b); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
newBas := appendStructPointer(base, p.field, p.ctype)
|
|
||||||
|
|
||||||
var zero field
|
|
||||||
setCustomType(newBas, zero, custom)
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
63
vendor/github.com/gogo/protobuf/proto/deprecated.go
generated
vendored
Normal file
63
vendor/github.com/gogo/protobuf/proto/deprecated.go
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
// Go support for Protocol Buffers - Google's data interchange format
|
||||||
|
//
|
||||||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
|
// https://github.com/golang/protobuf
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
// * Neither the name of Google Inc. nor the names of its
|
||||||
|
// contributors may be used to endorse or promote products derived from
|
||||||
|
// this software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
package proto
|
||||||
|
|
||||||
|
import "errors"
|
||||||
|
|
||||||
|
// Deprecated: do not use.
|
||||||
|
type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 }
|
||||||
|
|
||||||
|
// Deprecated: do not use.
|
||||||
|
func GetStats() Stats { return Stats{} }
|
||||||
|
|
||||||
|
// Deprecated: do not use.
|
||||||
|
func MarshalMessageSet(interface{}) ([]byte, error) {
|
||||||
|
return nil, errors.New("proto: not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: do not use.
|
||||||
|
func UnmarshalMessageSet([]byte, interface{}) error {
|
||||||
|
return errors.New("proto: not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: do not use.
|
||||||
|
func MarshalMessageSetJSON(interface{}) ([]byte, error) {
|
||||||
|
return nil, errors.New("proto: not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: do not use.
|
||||||
|
func UnmarshalMessageSetJSON([]byte, interface{}) error {
|
||||||
|
return errors.New("proto: not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: do not use.
|
||||||
|
func RegisterMessageSetType(Message, int32, string) {}
|
201
vendor/github.com/gogo/protobuf/proto/discard.go
generated
vendored
201
vendor/github.com/gogo/protobuf/proto/discard.go
generated
vendored
@ -35,8 +35,14 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
|
"sync/atomic"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type generatedDiscarder interface {
|
||||||
|
XXX_DiscardUnknown()
|
||||||
|
}
|
||||||
|
|
||||||
// DiscardUnknown recursively discards all unknown fields from this message
|
// DiscardUnknown recursively discards all unknown fields from this message
|
||||||
// and all embedded messages.
|
// and all embedded messages.
|
||||||
//
|
//
|
||||||
@ -49,9 +55,202 @@ import (
|
|||||||
// For proto2 messages, the unknown fields of message extensions are only
|
// For proto2 messages, the unknown fields of message extensions are only
|
||||||
// discarded from messages that have been accessed via GetExtension.
|
// discarded from messages that have been accessed via GetExtension.
|
||||||
func DiscardUnknown(m Message) {
|
func DiscardUnknown(m Message) {
|
||||||
|
if m, ok := m.(generatedDiscarder); ok {
|
||||||
|
m.XXX_DiscardUnknown()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// TODO: Dynamically populate a InternalMessageInfo for legacy messages,
|
||||||
|
// but the master branch has no implementation for InternalMessageInfo,
|
||||||
|
// so it would be more work to replicate that approach.
|
||||||
discardLegacy(m)
|
discardLegacy(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DiscardUnknown recursively discards all unknown fields.
|
||||||
|
func (a *InternalMessageInfo) DiscardUnknown(m Message) {
|
||||||
|
di := atomicLoadDiscardInfo(&a.discard)
|
||||||
|
if di == nil {
|
||||||
|
di = getDiscardInfo(reflect.TypeOf(m).Elem())
|
||||||
|
atomicStoreDiscardInfo(&a.discard, di)
|
||||||
|
}
|
||||||
|
di.discard(toPointer(&m))
|
||||||
|
}
|
||||||
|
|
||||||
|
type discardInfo struct {
|
||||||
|
typ reflect.Type
|
||||||
|
|
||||||
|
initialized int32 // 0: only typ is valid, 1: everything is valid
|
||||||
|
lock sync.Mutex
|
||||||
|
|
||||||
|
fields []discardFieldInfo
|
||||||
|
unrecognized field
|
||||||
|
}
|
||||||
|
|
||||||
|
type discardFieldInfo struct {
|
||||||
|
field field // Offset of field, guaranteed to be valid
|
||||||
|
discard func(src pointer)
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
discardInfoMap = map[reflect.Type]*discardInfo{}
|
||||||
|
discardInfoLock sync.Mutex
|
||||||
|
)
|
||||||
|
|
||||||
|
func getDiscardInfo(t reflect.Type) *discardInfo {
|
||||||
|
discardInfoLock.Lock()
|
||||||
|
defer discardInfoLock.Unlock()
|
||||||
|
di := discardInfoMap[t]
|
||||||
|
if di == nil {
|
||||||
|
di = &discardInfo{typ: t}
|
||||||
|
discardInfoMap[t] = di
|
||||||
|
}
|
||||||
|
return di
|
||||||
|
}
|
||||||
|
|
||||||
|
func (di *discardInfo) discard(src pointer) {
|
||||||
|
if src.isNil() {
|
||||||
|
return // Nothing to do.
|
||||||
|
}
|
||||||
|
|
||||||
|
if atomic.LoadInt32(&di.initialized) == 0 {
|
||||||
|
di.computeDiscardInfo()
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, fi := range di.fields {
|
||||||
|
sfp := src.offset(fi.field)
|
||||||
|
fi.discard(sfp)
|
||||||
|
}
|
||||||
|
|
||||||
|
// For proto2 messages, only discard unknown fields in message extensions
|
||||||
|
// that have been accessed via GetExtension.
|
||||||
|
if em, err := extendable(src.asPointerTo(di.typ).Interface()); err == nil {
|
||||||
|
// Ignore lock since DiscardUnknown is not concurrency safe.
|
||||||
|
emm, _ := em.extensionsRead()
|
||||||
|
for _, mx := range emm {
|
||||||
|
if m, ok := mx.value.(Message); ok {
|
||||||
|
DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if di.unrecognized.IsValid() {
|
||||||
|
*src.offset(di.unrecognized).toBytes() = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (di *discardInfo) computeDiscardInfo() {
|
||||||
|
di.lock.Lock()
|
||||||
|
defer di.lock.Unlock()
|
||||||
|
if di.initialized != 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
t := di.typ
|
||||||
|
n := t.NumField()
|
||||||
|
|
||||||
|
for i := 0; i < n; i++ {
|
||||||
|
f := t.Field(i)
|
||||||
|
if strings.HasPrefix(f.Name, "XXX_") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
dfi := discardFieldInfo{field: toField(&f)}
|
||||||
|
tf := f.Type
|
||||||
|
|
||||||
|
// Unwrap tf to get its most basic type.
|
||||||
|
var isPointer, isSlice bool
|
||||||
|
if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 {
|
||||||
|
isSlice = true
|
||||||
|
tf = tf.Elem()
|
||||||
|
}
|
||||||
|
if tf.Kind() == reflect.Ptr {
|
||||||
|
isPointer = true
|
||||||
|
tf = tf.Elem()
|
||||||
|
}
|
||||||
|
if isPointer && isSlice && tf.Kind() != reflect.Struct {
|
||||||
|
panic(fmt.Sprintf("%v.%s cannot be a slice of pointers to primitive types", t, f.Name))
|
||||||
|
}
|
||||||
|
|
||||||
|
switch tf.Kind() {
|
||||||
|
case reflect.Struct:
|
||||||
|
switch {
|
||||||
|
case !isPointer:
|
||||||
|
panic(fmt.Sprintf("%v.%s cannot be a direct struct value", t, f.Name))
|
||||||
|
case isSlice: // E.g., []*pb.T
|
||||||
|
discardInfo := getDiscardInfo(tf)
|
||||||
|
dfi.discard = func(src pointer) {
|
||||||
|
sps := src.getPointerSlice()
|
||||||
|
for _, sp := range sps {
|
||||||
|
if !sp.isNil() {
|
||||||
|
discardInfo.discard(sp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: // E.g., *pb.T
|
||||||
|
discardInfo := getDiscardInfo(tf)
|
||||||
|
dfi.discard = func(src pointer) {
|
||||||
|
sp := src.getPointer()
|
||||||
|
if !sp.isNil() {
|
||||||
|
discardInfo.discard(sp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case reflect.Map:
|
||||||
|
switch {
|
||||||
|
case isPointer || isSlice:
|
||||||
|
panic(fmt.Sprintf("%v.%s cannot be a pointer to a map or a slice of map values", t, f.Name))
|
||||||
|
default: // E.g., map[K]V
|
||||||
|
if tf.Elem().Kind() == reflect.Ptr { // Proto struct (e.g., *T)
|
||||||
|
dfi.discard = func(src pointer) {
|
||||||
|
sm := src.asPointerTo(tf).Elem()
|
||||||
|
if sm.Len() == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
for _, key := range sm.MapKeys() {
|
||||||
|
val := sm.MapIndex(key)
|
||||||
|
DiscardUnknown(val.Interface().(Message))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dfi.discard = func(pointer) {} // Noop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case reflect.Interface:
|
||||||
|
// Must be oneof field.
|
||||||
|
switch {
|
||||||
|
case isPointer || isSlice:
|
||||||
|
panic(fmt.Sprintf("%v.%s cannot be a pointer to a interface or a slice of interface values", t, f.Name))
|
||||||
|
default: // E.g., interface{}
|
||||||
|
// TODO: Make this faster?
|
||||||
|
dfi.discard = func(src pointer) {
|
||||||
|
su := src.asPointerTo(tf).Elem()
|
||||||
|
if !su.IsNil() {
|
||||||
|
sv := su.Elem().Elem().Field(0)
|
||||||
|
if sv.Kind() == reflect.Ptr && sv.IsNil() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
switch sv.Type().Kind() {
|
||||||
|
case reflect.Ptr: // Proto struct (e.g., *T)
|
||||||
|
DiscardUnknown(sv.Interface().(Message))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
di.fields = append(di.fields, dfi)
|
||||||
|
}
|
||||||
|
|
||||||
|
di.unrecognized = invalidField
|
||||||
|
if f, ok := t.FieldByName("XXX_unrecognized"); ok {
|
||||||
|
if f.Type != reflect.TypeOf([]byte{}) {
|
||||||
|
panic("expected XXX_unrecognized to be of type []byte")
|
||||||
|
}
|
||||||
|
di.unrecognized = toField(&f)
|
||||||
|
}
|
||||||
|
|
||||||
|
atomic.StoreInt32(&di.initialized, 1)
|
||||||
|
}
|
||||||
|
|
||||||
func discardLegacy(m Message) {
|
func discardLegacy(m Message) {
|
||||||
v := reflect.ValueOf(m)
|
v := reflect.ValueOf(m)
|
||||||
if v.Kind() != reflect.Ptr || v.IsNil() {
|
if v.Kind() != reflect.Ptr || v.IsNil() {
|
||||||
@ -139,7 +338,7 @@ func discardLegacy(m Message) {
|
|||||||
|
|
||||||
// For proto2 messages, only discard unknown fields in message extensions
|
// For proto2 messages, only discard unknown fields in message extensions
|
||||||
// that have been accessed via GetExtension.
|
// that have been accessed via GetExtension.
|
||||||
if em, ok := extendable(m); ok {
|
if em, err := extendable(m); err == nil {
|
||||||
// Ignore lock since discardLegacy is not concurrency safe.
|
// Ignore lock since discardLegacy is not concurrency safe.
|
||||||
emm, _ := em.extensionsRead()
|
emm, _ := em.extensionsRead()
|
||||||
for _, mx := range emm {
|
for _, mx := range emm {
|
||||||
|
154
vendor/github.com/gogo/protobuf/proto/duration_gogo.go
generated
vendored
154
vendor/github.com/gogo/protobuf/proto/duration_gogo.go
generated
vendored
@ -47,157 +47,3 @@ func (*duration) String() string { return "duration<string>" }
|
|||||||
func init() {
|
func init() {
|
||||||
RegisterType((*duration)(nil), "gogo.protobuf.proto.duration")
|
RegisterType((*duration)(nil), "gogo.protobuf.proto.duration")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Buffer) decDuration() (time.Duration, error) {
|
|
||||||
b, err := o.DecodeRawBytes(true)
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
dproto := &duration{}
|
|
||||||
if err := Unmarshal(b, dproto); err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
return durationFromProto(dproto)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) dec_duration(p *Properties, base structPointer) error {
|
|
||||||
d, err := o.decDuration()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
word64_Set(structPointer_Word64(base, p.field), o, uint64(d))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) dec_ref_duration(p *Properties, base structPointer) error {
|
|
||||||
d, err := o.decDuration()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
word64Val_Set(structPointer_Word64Val(base, p.field), o, uint64(d))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) dec_slice_duration(p *Properties, base structPointer) error {
|
|
||||||
d, err := o.decDuration()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
newBas := appendStructPointer(base, p.field, reflect.SliceOf(reflect.PtrTo(durationType)))
|
|
||||||
var zero field
|
|
||||||
setPtrCustomType(newBas, zero, &d)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) dec_slice_ref_duration(p *Properties, base structPointer) error {
|
|
||||||
d, err := o.decDuration()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
structPointer_Word64Slice(base, p.field).Append(uint64(d))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_duration(p *Properties, base structPointer) (n int) {
|
|
||||||
structp := structPointer_GetStructPointer(base, p.field)
|
|
||||||
if structPointer_IsNil(structp) {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
dur := structPointer_Interface(structp, durationType).(*time.Duration)
|
|
||||||
d := durationProto(*dur)
|
|
||||||
size := Size(d)
|
|
||||||
return size + sizeVarint(uint64(size)) + len(p.tagcode)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) enc_duration(p *Properties, base structPointer) error {
|
|
||||||
structp := structPointer_GetStructPointer(base, p.field)
|
|
||||||
if structPointer_IsNil(structp) {
|
|
||||||
return ErrNil
|
|
||||||
}
|
|
||||||
dur := structPointer_Interface(structp, durationType).(*time.Duration)
|
|
||||||
d := durationProto(*dur)
|
|
||||||
data, err := Marshal(d)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
o.EncodeRawBytes(data)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_ref_duration(p *Properties, base structPointer) (n int) {
|
|
||||||
dur := structPointer_InterfaceAt(base, p.field, durationType).(*time.Duration)
|
|
||||||
d := durationProto(*dur)
|
|
||||||
size := Size(d)
|
|
||||||
return size + sizeVarint(uint64(size)) + len(p.tagcode)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) enc_ref_duration(p *Properties, base structPointer) error {
|
|
||||||
dur := structPointer_InterfaceAt(base, p.field, durationType).(*time.Duration)
|
|
||||||
d := durationProto(*dur)
|
|
||||||
data, err := Marshal(d)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
o.EncodeRawBytes(data)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_slice_duration(p *Properties, base structPointer) (n int) {
|
|
||||||
pdurs := structPointer_InterfaceAt(base, p.field, reflect.SliceOf(reflect.PtrTo(durationType))).(*[]*time.Duration)
|
|
||||||
durs := *pdurs
|
|
||||||
for i := 0; i < len(durs); i++ {
|
|
||||||
if durs[i] == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
dproto := durationProto(*durs[i])
|
|
||||||
size := Size(dproto)
|
|
||||||
n += len(p.tagcode) + size + sizeVarint(uint64(size))
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) enc_slice_duration(p *Properties, base structPointer) error {
|
|
||||||
pdurs := structPointer_InterfaceAt(base, p.field, reflect.SliceOf(reflect.PtrTo(durationType))).(*[]*time.Duration)
|
|
||||||
durs := *pdurs
|
|
||||||
for i := 0; i < len(durs); i++ {
|
|
||||||
if durs[i] == nil {
|
|
||||||
return errRepeatedHasNil
|
|
||||||
}
|
|
||||||
dproto := durationProto(*durs[i])
|
|
||||||
data, err := Marshal(dproto)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
o.EncodeRawBytes(data)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_slice_ref_duration(p *Properties, base structPointer) (n int) {
|
|
||||||
pdurs := structPointer_InterfaceAt(base, p.field, reflect.SliceOf(durationType)).(*[]time.Duration)
|
|
||||||
durs := *pdurs
|
|
||||||
for i := 0; i < len(durs); i++ {
|
|
||||||
dproto := durationProto(durs[i])
|
|
||||||
size := Size(dproto)
|
|
||||||
n += len(p.tagcode) + size + sizeVarint(uint64(size))
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) enc_slice_ref_duration(p *Properties, base structPointer) error {
|
|
||||||
pdurs := structPointer_InterfaceAt(base, p.field, reflect.SliceOf(durationType)).(*[]time.Duration)
|
|
||||||
durs := *pdurs
|
|
||||||
for i := 0; i < len(durs); i++ {
|
|
||||||
dproto := durationProto(durs[i])
|
|
||||||
data, err := Marshal(dproto)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
o.EncodeRawBytes(data)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
1207
vendor/github.com/gogo/protobuf/proto/encode.go
generated
vendored
1207
vendor/github.com/gogo/protobuf/proto/encode.go
generated
vendored
File diff suppressed because it is too large
Load Diff
317
vendor/github.com/gogo/protobuf/proto/encode_gogo.go
generated
vendored
317
vendor/github.com/gogo/protobuf/proto/encode_gogo.go
generated
vendored
@ -3,11 +3,6 @@
|
|||||||
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
|
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
|
||||||
// http://github.com/gogo/protobuf
|
// http://github.com/gogo/protobuf
|
||||||
//
|
//
|
||||||
// Go support for Protocol Buffers - Google's data interchange format
|
|
||||||
//
|
|
||||||
// Copyright 2010 The Go Authors. All rights reserved.
|
|
||||||
// http://github.com/golang/protobuf/
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are
|
// modification, are permitted provided that the following conditions are
|
||||||
// met:
|
// met:
|
||||||
@ -18,9 +13,6 @@
|
|||||||
// copyright notice, this list of conditions and the following disclaimer
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
// in the documentation and/or other materials provided with the
|
// in the documentation and/or other materials provided with the
|
||||||
// distribution.
|
// distribution.
|
||||||
// * Neither the name of Google Inc. nor the names of its
|
|
||||||
// contributors may be used to endorse or promote products derived from
|
|
||||||
// this software without specific prior written permission.
|
|
||||||
//
|
//
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
@ -36,315 +28,6 @@
|
|||||||
|
|
||||||
package proto
|
package proto
|
||||||
|
|
||||||
import (
|
|
||||||
"reflect"
|
|
||||||
)
|
|
||||||
|
|
||||||
func NewRequiredNotSetError(field string) *RequiredNotSetError {
|
func NewRequiredNotSetError(field string) *RequiredNotSetError {
|
||||||
return &RequiredNotSetError{field}
|
return &RequiredNotSetError{field}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Sizer interface {
|
|
||||||
Size() int
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) enc_ext_slice_byte(p *Properties, base structPointer) error {
|
|
||||||
s := *structPointer_Bytes(base, p.field)
|
|
||||||
if s == nil {
|
|
||||||
return ErrNil
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, s...)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_ext_slice_byte(p *Properties, base structPointer) (n int) {
|
|
||||||
s := *structPointer_Bytes(base, p.field)
|
|
||||||
if s == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
n += len(s)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Encode a reference to bool pointer.
|
|
||||||
func (o *Buffer) enc_ref_bool(p *Properties, base structPointer) error {
|
|
||||||
v := *structPointer_BoolVal(base, p.field)
|
|
||||||
x := 0
|
|
||||||
if v {
|
|
||||||
x = 1
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
p.valEnc(o, uint64(x))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_ref_bool(p *Properties, base structPointer) int {
|
|
||||||
return len(p.tagcode) + 1 // each bool takes exactly one byte
|
|
||||||
}
|
|
||||||
|
|
||||||
// Encode a reference to int32 pointer.
|
|
||||||
func (o *Buffer) enc_ref_int32(p *Properties, base structPointer) error {
|
|
||||||
v := structPointer_Word32Val(base, p.field)
|
|
||||||
x := int32(word32Val_Get(v))
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
p.valEnc(o, uint64(x))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_ref_int32(p *Properties, base structPointer) (n int) {
|
|
||||||
v := structPointer_Word32Val(base, p.field)
|
|
||||||
x := int32(word32Val_Get(v))
|
|
||||||
n += len(p.tagcode)
|
|
||||||
n += p.valSize(uint64(x))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) enc_ref_uint32(p *Properties, base structPointer) error {
|
|
||||||
v := structPointer_Word32Val(base, p.field)
|
|
||||||
x := word32Val_Get(v)
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
p.valEnc(o, uint64(x))
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_ref_uint32(p *Properties, base structPointer) (n int) {
|
|
||||||
v := structPointer_Word32Val(base, p.field)
|
|
||||||
x := word32Val_Get(v)
|
|
||||||
n += len(p.tagcode)
|
|
||||||
n += p.valSize(uint64(x))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Encode a reference to an int64 pointer.
|
|
||||||
func (o *Buffer) enc_ref_int64(p *Properties, base structPointer) error {
|
|
||||||
v := structPointer_Word64Val(base, p.field)
|
|
||||||
x := word64Val_Get(v)
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
p.valEnc(o, x)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_ref_int64(p *Properties, base structPointer) (n int) {
|
|
||||||
v := structPointer_Word64Val(base, p.field)
|
|
||||||
x := word64Val_Get(v)
|
|
||||||
n += len(p.tagcode)
|
|
||||||
n += p.valSize(x)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Encode a reference to a string pointer.
|
|
||||||
func (o *Buffer) enc_ref_string(p *Properties, base structPointer) error {
|
|
||||||
v := *structPointer_StringVal(base, p.field)
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
o.EncodeStringBytes(v)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_ref_string(p *Properties, base structPointer) (n int) {
|
|
||||||
v := *structPointer_StringVal(base, p.field)
|
|
||||||
n += len(p.tagcode)
|
|
||||||
n += sizeStringBytes(v)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Encode a reference to a message struct.
|
|
||||||
func (o *Buffer) enc_ref_struct_message(p *Properties, base structPointer) error {
|
|
||||||
var state errorState
|
|
||||||
structp := structPointer_GetRefStructPointer(base, p.field)
|
|
||||||
if structPointer_IsNil(structp) {
|
|
||||||
return ErrNil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Can the object marshal itself?
|
|
||||||
if p.isMarshaler {
|
|
||||||
m := structPointer_Interface(structp, p.stype).(Marshaler)
|
|
||||||
data, err := m.Marshal()
|
|
||||||
if err != nil && !state.shouldContinue(err, nil) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
o.EncodeRawBytes(data)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
return o.enc_len_struct(p.sprop, structp, &state)
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO this is only copied, please fix this
|
|
||||||
func size_ref_struct_message(p *Properties, base structPointer) int {
|
|
||||||
structp := structPointer_GetRefStructPointer(base, p.field)
|
|
||||||
if structPointer_IsNil(structp) {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// Can the object marshal itself?
|
|
||||||
if p.isMarshaler {
|
|
||||||
m := structPointer_Interface(structp, p.stype).(Marshaler)
|
|
||||||
data, _ := m.Marshal()
|
|
||||||
n0 := len(p.tagcode)
|
|
||||||
n1 := sizeRawBytes(data)
|
|
||||||
return n0 + n1
|
|
||||||
}
|
|
||||||
|
|
||||||
n0 := len(p.tagcode)
|
|
||||||
n1 := size_struct(p.sprop, structp)
|
|
||||||
n2 := sizeVarint(uint64(n1)) // size of encoded length
|
|
||||||
return n0 + n1 + n2
|
|
||||||
}
|
|
||||||
|
|
||||||
// Encode a slice of references to message struct pointers ([]struct).
|
|
||||||
func (o *Buffer) enc_slice_ref_struct_message(p *Properties, base structPointer) error {
|
|
||||||
var state errorState
|
|
||||||
ss := structPointer_StructRefSlice(base, p.field, p.stype.Size())
|
|
||||||
l := ss.Len()
|
|
||||||
for i := 0; i < l; i++ {
|
|
||||||
structp := ss.Index(i)
|
|
||||||
if structPointer_IsNil(structp) {
|
|
||||||
return errRepeatedHasNil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Can the object marshal itself?
|
|
||||||
if p.isMarshaler {
|
|
||||||
m := structPointer_Interface(structp, p.stype).(Marshaler)
|
|
||||||
data, err := m.Marshal()
|
|
||||||
if err != nil && !state.shouldContinue(err, nil) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
o.EncodeRawBytes(data)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
err := o.enc_len_struct(p.sprop, structp, &state)
|
|
||||||
if err != nil && !state.shouldContinue(err, nil) {
|
|
||||||
if err == ErrNil {
|
|
||||||
return errRepeatedHasNil
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return state.err
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO this is only copied, please fix this
|
|
||||||
func size_slice_ref_struct_message(p *Properties, base structPointer) (n int) {
|
|
||||||
ss := structPointer_StructRefSlice(base, p.field, p.stype.Size())
|
|
||||||
l := ss.Len()
|
|
||||||
n += l * len(p.tagcode)
|
|
||||||
for i := 0; i < l; i++ {
|
|
||||||
structp := ss.Index(i)
|
|
||||||
if structPointer_IsNil(structp) {
|
|
||||||
return // return the size up to this point
|
|
||||||
}
|
|
||||||
|
|
||||||
// Can the object marshal itself?
|
|
||||||
if p.isMarshaler {
|
|
||||||
m := structPointer_Interface(structp, p.stype).(Marshaler)
|
|
||||||
data, _ := m.Marshal()
|
|
||||||
n += len(p.tagcode)
|
|
||||||
n += sizeRawBytes(data)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
n0 := size_struct(p.sprop, structp)
|
|
||||||
n1 := sizeVarint(uint64(n0)) // size of encoded length
|
|
||||||
n += n0 + n1
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) enc_custom_bytes(p *Properties, base structPointer) error {
|
|
||||||
i := structPointer_InterfaceRef(base, p.field, p.ctype)
|
|
||||||
if i == nil {
|
|
||||||
return ErrNil
|
|
||||||
}
|
|
||||||
custom := i.(Marshaler)
|
|
||||||
data, err := custom.Marshal()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if data == nil {
|
|
||||||
return ErrNil
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
o.EncodeRawBytes(data)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_custom_bytes(p *Properties, base structPointer) (n int) {
|
|
||||||
n += len(p.tagcode)
|
|
||||||
i := structPointer_InterfaceRef(base, p.field, p.ctype)
|
|
||||||
if i == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
custom := i.(Marshaler)
|
|
||||||
data, _ := custom.Marshal()
|
|
||||||
n += sizeRawBytes(data)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) enc_custom_ref_bytes(p *Properties, base structPointer) error {
|
|
||||||
custom := structPointer_InterfaceAt(base, p.field, p.ctype).(Marshaler)
|
|
||||||
data, err := custom.Marshal()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if data == nil {
|
|
||||||
return ErrNil
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
o.EncodeRawBytes(data)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_custom_ref_bytes(p *Properties, base structPointer) (n int) {
|
|
||||||
n += len(p.tagcode)
|
|
||||||
i := structPointer_InterfaceAt(base, p.field, p.ctype)
|
|
||||||
if i == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
custom := i.(Marshaler)
|
|
||||||
data, _ := custom.Marshal()
|
|
||||||
n += sizeRawBytes(data)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) enc_custom_slice_bytes(p *Properties, base structPointer) error {
|
|
||||||
inter := structPointer_InterfaceRef(base, p.field, p.ctype)
|
|
||||||
if inter == nil {
|
|
||||||
return ErrNil
|
|
||||||
}
|
|
||||||
slice := reflect.ValueOf(inter)
|
|
||||||
l := slice.Len()
|
|
||||||
for i := 0; i < l; i++ {
|
|
||||||
v := slice.Index(i)
|
|
||||||
custom := v.Interface().(Marshaler)
|
|
||||||
data, err := custom.Marshal()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
o.EncodeRawBytes(data)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_custom_slice_bytes(p *Properties, base structPointer) (n int) {
|
|
||||||
inter := structPointer_InterfaceRef(base, p.field, p.ctype)
|
|
||||||
if inter == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
slice := reflect.ValueOf(inter)
|
|
||||||
l := slice.Len()
|
|
||||||
n += l * len(p.tagcode)
|
|
||||||
for i := 0; i < l; i++ {
|
|
||||||
v := slice.Index(i)
|
|
||||||
custom := v.Interface().(Marshaler)
|
|
||||||
data, _ := custom.Marshal()
|
|
||||||
n += sizeRawBytes(data)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
30
vendor/github.com/gogo/protobuf/proto/equal.go
generated
vendored
30
vendor/github.com/gogo/protobuf/proto/equal.go
generated
vendored
@ -109,15 +109,6 @@ func equalStruct(v1, v2 reflect.Value) bool {
|
|||||||
// set/unset mismatch
|
// set/unset mismatch
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
b1, ok := f1.Interface().(raw)
|
|
||||||
if ok {
|
|
||||||
b2 := f2.Interface().(raw)
|
|
||||||
// RawMessage
|
|
||||||
if !bytes.Equal(b1.Bytes(), b2.Bytes()) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
f1, f2 = f1.Elem(), f2.Elem()
|
f1, f2 = f1.Elem(), f2.Elem()
|
||||||
}
|
}
|
||||||
if !equalAny(f1, f2, sprop.Prop[i]) {
|
if !equalAny(f1, f2, sprop.Prop[i]) {
|
||||||
@ -146,11 +137,7 @@ func equalStruct(v1, v2 reflect.Value) bool {
|
|||||||
|
|
||||||
u1 := uf.Bytes()
|
u1 := uf.Bytes()
|
||||||
u2 := v2.FieldByName("XXX_unrecognized").Bytes()
|
u2 := v2.FieldByName("XXX_unrecognized").Bytes()
|
||||||
if !bytes.Equal(u1, u2) {
|
return bytes.Equal(u1, u2)
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// v1 and v2 are known to have the same type.
|
// v1 and v2 are known to have the same type.
|
||||||
@ -261,6 +248,15 @@ func equalExtMap(base reflect.Type, em1, em2 map[int32]Extension) bool {
|
|||||||
|
|
||||||
m1, m2 := e1.value, e2.value
|
m1, m2 := e1.value, e2.value
|
||||||
|
|
||||||
|
if m1 == nil && m2 == nil {
|
||||||
|
// Both have only encoded form.
|
||||||
|
if bytes.Equal(e1.enc, e2.enc) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
// The bytes are different, but the extensions might still be
|
||||||
|
// equal. We need to decode them to compare.
|
||||||
|
}
|
||||||
|
|
||||||
if m1 != nil && m2 != nil {
|
if m1 != nil && m2 != nil {
|
||||||
// Both are unencoded.
|
// Both are unencoded.
|
||||||
if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2), nil) {
|
if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2), nil) {
|
||||||
@ -276,8 +272,12 @@ func equalExtMap(base reflect.Type, em1, em2 map[int32]Extension) bool {
|
|||||||
desc = m[extNum]
|
desc = m[extNum]
|
||||||
}
|
}
|
||||||
if desc == nil {
|
if desc == nil {
|
||||||
|
// If both have only encoded form and the bytes are the same,
|
||||||
|
// it is handled above. We get here when the bytes are different.
|
||||||
|
// We don't know how to decode it, so just compare them as byte
|
||||||
|
// slices.
|
||||||
log.Printf("proto: don't know how to compare extension %d of %v", extNum, base)
|
log.Printf("proto: don't know how to compare extension %d of %v", extNum, base)
|
||||||
continue
|
return false
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
if m1 == nil {
|
if m1 == nil {
|
||||||
|
289
vendor/github.com/gogo/protobuf/proto/extensions.go
generated
vendored
289
vendor/github.com/gogo/protobuf/proto/extensions.go
generated
vendored
@ -38,6 +38,7 @@ package proto
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
@ -69,12 +70,6 @@ type extendableProtoV1 interface {
|
|||||||
ExtensionMap() map[int32]Extension
|
ExtensionMap() map[int32]Extension
|
||||||
}
|
}
|
||||||
|
|
||||||
type extensionsBytes interface {
|
|
||||||
Message
|
|
||||||
ExtensionRangeArray() []ExtensionRange
|
|
||||||
GetExtensions() *[]byte
|
|
||||||
}
|
|
||||||
|
|
||||||
// extensionAdapter is a wrapper around extendableProtoV1 that implements extendableProto.
|
// extensionAdapter is a wrapper around extendableProtoV1 that implements extendableProto.
|
||||||
type extensionAdapter struct {
|
type extensionAdapter struct {
|
||||||
extendableProtoV1
|
extendableProtoV1
|
||||||
@ -97,14 +92,31 @@ func (n notLocker) Unlock() {}
|
|||||||
// extendable returns the extendableProto interface for the given generated proto message.
|
// extendable returns the extendableProto interface for the given generated proto message.
|
||||||
// If the proto message has the old extension format, it returns a wrapper that implements
|
// If the proto message has the old extension format, it returns a wrapper that implements
|
||||||
// the extendableProto interface.
|
// the extendableProto interface.
|
||||||
func extendable(p interface{}) (extendableProto, bool) {
|
func extendable(p interface{}) (extendableProto, error) {
|
||||||
if ep, ok := p.(extendableProto); ok {
|
switch p := p.(type) {
|
||||||
return ep, ok
|
case extendableProto:
|
||||||
|
if isNilPtr(p) {
|
||||||
|
return nil, fmt.Errorf("proto: nil %T is not extendable", p)
|
||||||
|
}
|
||||||
|
return p, nil
|
||||||
|
case extendableProtoV1:
|
||||||
|
if isNilPtr(p) {
|
||||||
|
return nil, fmt.Errorf("proto: nil %T is not extendable", p)
|
||||||
|
}
|
||||||
|
return extensionAdapter{p}, nil
|
||||||
|
case extensionsBytes:
|
||||||
|
return slowExtensionAdapter{p}, nil
|
||||||
}
|
}
|
||||||
if ep, ok := p.(extendableProtoV1); ok {
|
// Don't allocate a specific error containing %T:
|
||||||
return extensionAdapter{ep}, ok
|
// this is the hot path for Clone and MarshalText.
|
||||||
}
|
return nil, errNotExtendable
|
||||||
return nil, false
|
}
|
||||||
|
|
||||||
|
var errNotExtendable = errors.New("proto: not an extendable proto.Message")
|
||||||
|
|
||||||
|
func isNilPtr(x interface{}) bool {
|
||||||
|
v := reflect.ValueOf(x)
|
||||||
|
return v.Kind() == reflect.Ptr && v.IsNil()
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX_InternalExtensions is an internal representation of proto extensions.
|
// XXX_InternalExtensions is an internal representation of proto extensions.
|
||||||
@ -149,16 +161,6 @@ func (e *XXX_InternalExtensions) extensionsRead() (map[int32]Extension, sync.Loc
|
|||||||
return e.p.extensionMap, &e.p.mu
|
return e.p.extensionMap, &e.p.mu
|
||||||
}
|
}
|
||||||
|
|
||||||
type extensionRange interface {
|
|
||||||
Message
|
|
||||||
ExtensionRangeArray() []ExtensionRange
|
|
||||||
}
|
|
||||||
|
|
||||||
var extendableProtoType = reflect.TypeOf((*extendableProto)(nil)).Elem()
|
|
||||||
var extendableProtoV1Type = reflect.TypeOf((*extendableProtoV1)(nil)).Elem()
|
|
||||||
var extendableBytesType = reflect.TypeOf((*extensionsBytes)(nil)).Elem()
|
|
||||||
var extensionRangeType = reflect.TypeOf((*extensionRange)(nil)).Elem()
|
|
||||||
|
|
||||||
// ExtensionDesc represents an extension specification.
|
// ExtensionDesc represents an extension specification.
|
||||||
// Used in generated code from the protocol compiler.
|
// Used in generated code from the protocol compiler.
|
||||||
type ExtensionDesc struct {
|
type ExtensionDesc struct {
|
||||||
@ -198,8 +200,8 @@ func SetRawExtension(base Message, id int32, b []byte) {
|
|||||||
*ext = append(*ext, b...)
|
*ext = append(*ext, b...)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
epb, ok := extendable(base)
|
epb, err := extendable(base)
|
||||||
if !ok {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
extmap := epb.extensionsWrite()
|
extmap := epb.extensionsWrite()
|
||||||
@ -207,7 +209,7 @@ func SetRawExtension(base Message, id int32, b []byte) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// isExtensionField returns true iff the given field number is in an extension range.
|
// isExtensionField returns true iff the given field number is in an extension range.
|
||||||
func isExtensionField(pb extensionRange, field int32) bool {
|
func isExtensionField(pb extendableProto, field int32) bool {
|
||||||
for _, er := range pb.ExtensionRangeArray() {
|
for _, er := range pb.ExtensionRangeArray() {
|
||||||
if er.Start <= field && field <= er.End {
|
if er.Start <= field && field <= er.End {
|
||||||
return true
|
return true
|
||||||
@ -223,8 +225,11 @@ func checkExtensionTypes(pb extendableProto, extension *ExtensionDesc) error {
|
|||||||
if ea, ok := pbi.(extensionAdapter); ok {
|
if ea, ok := pbi.(extensionAdapter); ok {
|
||||||
pbi = ea.extendableProtoV1
|
pbi = ea.extendableProtoV1
|
||||||
}
|
}
|
||||||
|
if ea, ok := pbi.(slowExtensionAdapter); ok {
|
||||||
|
pbi = ea.extensionsBytes
|
||||||
|
}
|
||||||
if a, b := reflect.TypeOf(pbi), reflect.TypeOf(extension.ExtendedType); a != b {
|
if a, b := reflect.TypeOf(pbi), reflect.TypeOf(extension.ExtendedType); a != b {
|
||||||
return errors.New("proto: bad extended type; " + b.String() + " does not extend " + a.String())
|
return fmt.Errorf("proto: bad extended type; %v does not extend %v", b, a)
|
||||||
}
|
}
|
||||||
// Check the range.
|
// Check the range.
|
||||||
if !isExtensionField(pb, extension.Field) {
|
if !isExtensionField(pb, extension.Field) {
|
||||||
@ -269,80 +274,6 @@ func extensionProperties(ed *ExtensionDesc) *Properties {
|
|||||||
return prop
|
return prop
|
||||||
}
|
}
|
||||||
|
|
||||||
// encode encodes any unmarshaled (unencoded) extensions in e.
|
|
||||||
func encodeExtensions(e *XXX_InternalExtensions) error {
|
|
||||||
m, mu := e.extensionsRead()
|
|
||||||
if m == nil {
|
|
||||||
return nil // fast path
|
|
||||||
}
|
|
||||||
mu.Lock()
|
|
||||||
defer mu.Unlock()
|
|
||||||
return encodeExtensionsMap(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
// encode encodes any unmarshaled (unencoded) extensions in e.
|
|
||||||
func encodeExtensionsMap(m map[int32]Extension) error {
|
|
||||||
for k, e := range m {
|
|
||||||
if e.value == nil || e.desc == nil {
|
|
||||||
// Extension is only in its encoded form.
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// We don't skip extensions that have an encoded form set,
|
|
||||||
// because the extension value may have been mutated after
|
|
||||||
// the last time this function was called.
|
|
||||||
|
|
||||||
et := reflect.TypeOf(e.desc.ExtensionType)
|
|
||||||
props := extensionProperties(e.desc)
|
|
||||||
|
|
||||||
p := NewBuffer(nil)
|
|
||||||
// If e.value has type T, the encoder expects a *struct{ X T }.
|
|
||||||
// Pass a *T with a zero field and hope it all works out.
|
|
||||||
x := reflect.New(et)
|
|
||||||
x.Elem().Set(reflect.ValueOf(e.value))
|
|
||||||
if err := props.enc(p, props, toStructPointer(x)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
e.enc = p.buf
|
|
||||||
m[k] = e
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func extensionsSize(e *XXX_InternalExtensions) (n int) {
|
|
||||||
m, mu := e.extensionsRead()
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
mu.Lock()
|
|
||||||
defer mu.Unlock()
|
|
||||||
return extensionsMapSize(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
func extensionsMapSize(m map[int32]Extension) (n int) {
|
|
||||||
for _, e := range m {
|
|
||||||
if e.value == nil || e.desc == nil {
|
|
||||||
// Extension is only in its encoded form.
|
|
||||||
n += len(e.enc)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// We don't skip extensions that have an encoded form set,
|
|
||||||
// because the extension value may have been mutated after
|
|
||||||
// the last time this function was called.
|
|
||||||
|
|
||||||
et := reflect.TypeOf(e.desc.ExtensionType)
|
|
||||||
props := extensionProperties(e.desc)
|
|
||||||
|
|
||||||
// If e.value has type T, the encoder expects a *struct{ X T }.
|
|
||||||
// Pass a *T with a zero field and hope it all works out.
|
|
||||||
x := reflect.New(et)
|
|
||||||
x.Elem().Set(reflect.ValueOf(e.value))
|
|
||||||
n += props.size(props, toStructPointer(x))
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// HasExtension returns whether the given extension is present in pb.
|
// HasExtension returns whether the given extension is present in pb.
|
||||||
func HasExtension(pb Message, extension *ExtensionDesc) bool {
|
func HasExtension(pb Message, extension *ExtensionDesc) bool {
|
||||||
if epb, doki := pb.(extensionsBytes); doki {
|
if epb, doki := pb.(extensionsBytes); doki {
|
||||||
@ -366,8 +297,8 @@ func HasExtension(pb Message, extension *ExtensionDesc) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// TODO: Check types, field numbers, etc.?
|
// TODO: Check types, field numbers, etc.?
|
||||||
epb, ok := extendable(pb)
|
epb, err := extendable(pb)
|
||||||
if !ok {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
extmap, mu := epb.extensionsRead()
|
extmap, mu := epb.extensionsRead()
|
||||||
@ -375,46 +306,26 @@ func HasExtension(pb Message, extension *ExtensionDesc) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
_, ok = extmap[extension.Field]
|
_, ok := extmap[extension.Field]
|
||||||
mu.Unlock()
|
mu.Unlock()
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
func deleteExtension(pb extensionsBytes, theFieldNum int32, offset int) int {
|
|
||||||
ext := pb.GetExtensions()
|
|
||||||
for offset < len(*ext) {
|
|
||||||
tag, n1 := DecodeVarint((*ext)[offset:])
|
|
||||||
fieldNum := int32(tag >> 3)
|
|
||||||
wireType := int(tag & 0x7)
|
|
||||||
n2, err := size((*ext)[offset+n1:], wireType)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
newOffset := offset + n1 + n2
|
|
||||||
if fieldNum == theFieldNum {
|
|
||||||
*ext = append((*ext)[:offset], (*ext)[newOffset:]...)
|
|
||||||
return offset
|
|
||||||
}
|
|
||||||
offset = newOffset
|
|
||||||
}
|
|
||||||
return -1
|
|
||||||
}
|
|
||||||
|
|
||||||
// ClearExtension removes the given extension from pb.
|
// ClearExtension removes the given extension from pb.
|
||||||
func ClearExtension(pb Message, extension *ExtensionDesc) {
|
func ClearExtension(pb Message, extension *ExtensionDesc) {
|
||||||
clearExtension(pb, extension.Field)
|
clearExtension(pb, extension.Field)
|
||||||
}
|
}
|
||||||
|
|
||||||
func clearExtension(pb Message, fieldNum int32) {
|
func clearExtension(pb Message, fieldNum int32) {
|
||||||
if epb, doki := pb.(extensionsBytes); doki {
|
if epb, ok := pb.(extensionsBytes); ok {
|
||||||
offset := 0
|
offset := 0
|
||||||
for offset != -1 {
|
for offset != -1 {
|
||||||
offset = deleteExtension(epb, fieldNum, offset)
|
offset = deleteExtension(epb, fieldNum, offset)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
epb, ok := extendable(pb)
|
epb, err := extendable(pb)
|
||||||
if !ok {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// TODO: Check types, field numbers, etc.?
|
// TODO: Check types, field numbers, etc.?
|
||||||
@ -422,39 +333,33 @@ func clearExtension(pb Message, fieldNum int32) {
|
|||||||
delete(extmap, fieldNum)
|
delete(extmap, fieldNum)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetExtension parses and returns the given extension of pb.
|
// GetExtension retrieves a proto2 extended field from pb.
|
||||||
// If the extension is not present and has no default value it returns ErrMissingExtension.
|
//
|
||||||
|
// If the descriptor is type complete (i.e., ExtensionDesc.ExtensionType is non-nil),
|
||||||
|
// then GetExtension parses the encoded field and returns a Go value of the specified type.
|
||||||
|
// If the field is not present, then the default value is returned (if one is specified),
|
||||||
|
// otherwise ErrMissingExtension is reported.
|
||||||
|
//
|
||||||
|
// If the descriptor is not type complete (i.e., ExtensionDesc.ExtensionType is nil),
|
||||||
|
// then GetExtension returns the raw encoded bytes of the field extension.
|
||||||
func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {
|
func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {
|
||||||
if epb, doki := pb.(extensionsBytes); doki {
|
if epb, doki := pb.(extensionsBytes); doki {
|
||||||
ext := epb.GetExtensions()
|
ext := epb.GetExtensions()
|
||||||
o := 0
|
return decodeExtensionFromBytes(extension, *ext)
|
||||||
for o < len(*ext) {
|
|
||||||
tag, n := DecodeVarint((*ext)[o:])
|
|
||||||
fieldNum := int32(tag >> 3)
|
|
||||||
wireType := int(tag & 0x7)
|
|
||||||
l, err := size((*ext)[o+n:], wireType)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if int32(fieldNum) == extension.Field {
|
|
||||||
v, err := decodeExtension((*ext)[o:o+n+l], extension)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return v, nil
|
|
||||||
}
|
|
||||||
o += n + l
|
|
||||||
}
|
|
||||||
return defaultExtensionValue(extension)
|
|
||||||
}
|
}
|
||||||
epb, ok := extendable(pb)
|
|
||||||
if !ok {
|
epb, err := extendable(pb)
|
||||||
return nil, errors.New("proto: not an extendable proto")
|
if err != nil {
|
||||||
}
|
|
||||||
if err := checkExtensionTypes(epb, extension); err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if extension.ExtendedType != nil {
|
||||||
|
// can only check type if this is a complete descriptor
|
||||||
|
if cerr := checkExtensionTypes(epb, extension); cerr != nil {
|
||||||
|
return nil, cerr
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
emap, mu := epb.extensionsRead()
|
emap, mu := epb.extensionsRead()
|
||||||
if emap == nil {
|
if emap == nil {
|
||||||
return defaultExtensionValue(extension)
|
return defaultExtensionValue(extension)
|
||||||
@ -479,6 +384,11 @@ func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {
|
|||||||
return e.value, nil
|
return e.value, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if extension.ExtensionType == nil {
|
||||||
|
// incomplete descriptor
|
||||||
|
return e.enc, nil
|
||||||
|
}
|
||||||
|
|
||||||
v, err := decodeExtension(e.enc, extension)
|
v, err := decodeExtension(e.enc, extension)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -496,6 +406,11 @@ func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {
|
|||||||
// defaultExtensionValue returns the default value for extension.
|
// defaultExtensionValue returns the default value for extension.
|
||||||
// If no default for an extension is defined ErrMissingExtension is returned.
|
// If no default for an extension is defined ErrMissingExtension is returned.
|
||||||
func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) {
|
func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) {
|
||||||
|
if extension.ExtensionType == nil {
|
||||||
|
// incomplete descriptor, so no default
|
||||||
|
return nil, ErrMissingExtension
|
||||||
|
}
|
||||||
|
|
||||||
t := reflect.TypeOf(extension.ExtensionType)
|
t := reflect.TypeOf(extension.ExtensionType)
|
||||||
props := extensionProperties(extension)
|
props := extensionProperties(extension)
|
||||||
|
|
||||||
@ -530,31 +445,28 @@ func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) {
|
|||||||
|
|
||||||
// decodeExtension decodes an extension encoded in b.
|
// decodeExtension decodes an extension encoded in b.
|
||||||
func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) {
|
func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) {
|
||||||
o := NewBuffer(b)
|
|
||||||
|
|
||||||
t := reflect.TypeOf(extension.ExtensionType)
|
t := reflect.TypeOf(extension.ExtensionType)
|
||||||
|
unmarshal := typeUnmarshaler(t, extension.Tag)
|
||||||
props := extensionProperties(extension)
|
|
||||||
|
|
||||||
// t is a pointer to a struct, pointer to basic type or a slice.
|
// t is a pointer to a struct, pointer to basic type or a slice.
|
||||||
// Allocate a "field" to store the pointer/slice itself; the
|
// Allocate space to store the pointer/slice.
|
||||||
// pointer/slice will be stored here. We pass
|
|
||||||
// the address of this field to props.dec.
|
|
||||||
// This passes a zero field and a *t and lets props.dec
|
|
||||||
// interpret it as a *struct{ x t }.
|
|
||||||
value := reflect.New(t).Elem()
|
value := reflect.New(t).Elem()
|
||||||
|
|
||||||
|
var err error
|
||||||
for {
|
for {
|
||||||
// Discard wire type and field number varint. It isn't needed.
|
x, n := decodeVarint(b)
|
||||||
if _, err := o.DecodeVarint(); err != nil {
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
wire := int(x) & 7
|
||||||
|
|
||||||
|
b, err = unmarshal(b, valToPointer(value.Addr()), wire)
|
||||||
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := props.dec(o, props, toStructPointer(value.Addr())); err != nil {
|
if len(b) == 0 {
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if o.index >= len(o.buf) {
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -564,9 +476,13 @@ func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) {
|
|||||||
// GetExtensions returns a slice of the extensions present in pb that are also listed in es.
|
// GetExtensions returns a slice of the extensions present in pb that are also listed in es.
|
||||||
// The returned slice has the same length as es; missing extensions will appear as nil elements.
|
// The returned slice has the same length as es; missing extensions will appear as nil elements.
|
||||||
func GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interface{}, err error) {
|
func GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interface{}, err error) {
|
||||||
|
epb, err := extendable(pb)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
extensions = make([]interface{}, len(es))
|
extensions = make([]interface{}, len(es))
|
||||||
for i, e := range es {
|
for i, e := range es {
|
||||||
extensions[i], err = GetExtension(pb, e)
|
extensions[i], err = GetExtension(epb, e)
|
||||||
if err == ErrMissingExtension {
|
if err == ErrMissingExtension {
|
||||||
err = nil
|
err = nil
|
||||||
}
|
}
|
||||||
@ -581,9 +497,9 @@ func GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interface{}, e
|
|||||||
// For non-registered extensions, ExtensionDescs returns an incomplete descriptor containing
|
// For non-registered extensions, ExtensionDescs returns an incomplete descriptor containing
|
||||||
// just the Field field, which defines the extension's field number.
|
// just the Field field, which defines the extension's field number.
|
||||||
func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) {
|
func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) {
|
||||||
epb, ok := extendable(pb)
|
epb, err := extendable(pb)
|
||||||
if !ok {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("proto: %T is not an extendable proto.Message", pb)
|
return nil, err
|
||||||
}
|
}
|
||||||
registeredExtensions := RegisteredExtensions(pb)
|
registeredExtensions := RegisteredExtensions(pb)
|
||||||
|
|
||||||
@ -610,30 +526,25 @@ func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) {
|
|||||||
|
|
||||||
// SetExtension sets the specified extension of pb to the specified value.
|
// SetExtension sets the specified extension of pb to the specified value.
|
||||||
func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error {
|
func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error {
|
||||||
if epb, doki := pb.(extensionsBytes); doki {
|
if epb, ok := pb.(extensionsBytes); ok {
|
||||||
ClearExtension(pb, extension)
|
newb, err := encodeExtension(extension, value)
|
||||||
ext := epb.GetExtensions()
|
if err != nil {
|
||||||
et := reflect.TypeOf(extension.ExtensionType)
|
|
||||||
props := extensionProperties(extension)
|
|
||||||
p := NewBuffer(nil)
|
|
||||||
x := reflect.New(et)
|
|
||||||
x.Elem().Set(reflect.ValueOf(value))
|
|
||||||
if err := props.enc(p, props, toStructPointer(x)); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
*ext = append(*ext, p.buf...)
|
bb := epb.GetExtensions()
|
||||||
|
*bb = append(*bb, newb...)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
epb, ok := extendable(pb)
|
epb, err := extendable(pb)
|
||||||
if !ok {
|
if err != nil {
|
||||||
return errors.New("proto: not an extendable proto")
|
return err
|
||||||
}
|
}
|
||||||
if err := checkExtensionTypes(epb, extension); err != nil {
|
if err := checkExtensionTypes(epb, extension); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
typ := reflect.TypeOf(extension.ExtensionType)
|
typ := reflect.TypeOf(extension.ExtensionType)
|
||||||
if typ != reflect.TypeOf(value) {
|
if typ != reflect.TypeOf(value) {
|
||||||
return errors.New("proto: bad extension value type")
|
return fmt.Errorf("proto: bad extension value type. got: %T, want: %T", value, extension.ExtensionType)
|
||||||
}
|
}
|
||||||
// nil extension values need to be caught early, because the
|
// nil extension values need to be caught early, because the
|
||||||
// encoder can't distinguish an ErrNil due to a nil extension
|
// encoder can't distinguish an ErrNil due to a nil extension
|
||||||
@ -656,8 +567,8 @@ func ClearAllExtensions(pb Message) {
|
|||||||
*ext = []byte{}
|
*ext = []byte{}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
epb, ok := extendable(pb)
|
epb, err := extendable(pb)
|
||||||
if !ok {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
m := epb.extensionsWrite()
|
m := epb.extensionsWrite()
|
||||||
|
162
vendor/github.com/gogo/protobuf/proto/extensions_gogo.go
generated
vendored
162
vendor/github.com/gogo/protobuf/proto/extensions_gogo.go
generated
vendored
@ -32,12 +32,36 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"reflect"
|
"reflect"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type extensionsBytes interface {
|
||||||
|
Message
|
||||||
|
ExtensionRangeArray() []ExtensionRange
|
||||||
|
GetExtensions() *[]byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type slowExtensionAdapter struct {
|
||||||
|
extensionsBytes
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s slowExtensionAdapter) extensionsWrite() map[int32]Extension {
|
||||||
|
panic("Please report a bug to github.com/gogo/protobuf if you see this message: Writing extensions is not supported for extensions stored in a byte slice field.")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s slowExtensionAdapter) extensionsRead() (map[int32]Extension, sync.Locker) {
|
||||||
|
b := s.GetExtensions()
|
||||||
|
m, err := BytesToExtensionsMap(*b)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return m, notLocker{}
|
||||||
|
}
|
||||||
|
|
||||||
func GetBoolExtension(pb Message, extension *ExtensionDesc, ifnotset bool) bool {
|
func GetBoolExtension(pb Message, extension *ExtensionDesc, ifnotset bool) bool {
|
||||||
if reflect.ValueOf(pb).IsNil() {
|
if reflect.ValueOf(pb).IsNil() {
|
||||||
return ifnotset
|
return ifnotset
|
||||||
@ -56,19 +80,28 @@ func GetBoolExtension(pb Message, extension *ExtensionDesc, ifnotset bool) bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *Extension) Equal(that *Extension) bool {
|
func (this *Extension) Equal(that *Extension) bool {
|
||||||
|
if err := this.Encode(); err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if err := that.Encode(); err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return bytes.Equal(this.enc, that.enc)
|
return bytes.Equal(this.enc, that.enc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Extension) Compare(that *Extension) int {
|
func (this *Extension) Compare(that *Extension) int {
|
||||||
|
if err := this.Encode(); err != nil {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
if err := that.Encode(); err != nil {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
return bytes.Compare(this.enc, that.enc)
|
return bytes.Compare(this.enc, that.enc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SizeOfInternalExtension(m extendableProto) (n int) {
|
func SizeOfInternalExtension(m extendableProto) (n int) {
|
||||||
return SizeOfExtensionMap(m.extensionsWrite())
|
info := getMarshalInfo(reflect.TypeOf(m))
|
||||||
}
|
return info.sizeV1Extensions(m.extensionsWrite())
|
||||||
|
|
||||||
func SizeOfExtensionMap(m map[int32]Extension) (n int) {
|
|
||||||
return extensionsMapSize(m)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type sortableMapElem struct {
|
type sortableMapElem struct {
|
||||||
@ -122,28 +155,26 @@ func EncodeInternalExtension(m extendableProto, data []byte) (n int, err error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func EncodeExtensionMap(m map[int32]Extension, data []byte) (n int, err error) {
|
func EncodeExtensionMap(m map[int32]Extension, data []byte) (n int, err error) {
|
||||||
if err := encodeExtensionsMap(m); err != nil {
|
o := 0
|
||||||
return 0, err
|
for _, e := range m {
|
||||||
|
if err := e.Encode(); err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
n := copy(data[o:], e.enc)
|
||||||
|
if n != len(e.enc) {
|
||||||
|
return 0, io.ErrShortBuffer
|
||||||
|
}
|
||||||
|
o += n
|
||||||
}
|
}
|
||||||
keys := make([]int, 0, len(m))
|
return o, nil
|
||||||
for k := range m {
|
|
||||||
keys = append(keys, int(k))
|
|
||||||
}
|
|
||||||
sort.Ints(keys)
|
|
||||||
for _, k := range keys {
|
|
||||||
n += copy(data[n:], m[int32(k)].enc)
|
|
||||||
}
|
|
||||||
return n, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetRawExtension(m map[int32]Extension, id int32) ([]byte, error) {
|
func GetRawExtension(m map[int32]Extension, id int32) ([]byte, error) {
|
||||||
if m[id].value == nil || m[id].desc == nil {
|
e := m[id]
|
||||||
return m[id].enc, nil
|
if err := e.Encode(); err != nil {
|
||||||
}
|
|
||||||
if err := encodeExtensionsMap(m); err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return m[id].enc, nil
|
return e.enc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func size(buf []byte, wire int) (int, error) {
|
func size(buf []byte, wire int) (int, error) {
|
||||||
@ -218,35 +249,58 @@ func AppendExtension(e Message, tag int32, buf []byte) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func encodeExtension(e *Extension) error {
|
func encodeExtension(extension *ExtensionDesc, value interface{}) ([]byte, error) {
|
||||||
if e.value == nil || e.desc == nil {
|
u := getMarshalInfo(reflect.TypeOf(extension.ExtendedType))
|
||||||
// Extension is only in its encoded form.
|
ei := u.getExtElemInfo(extension)
|
||||||
return nil
|
v := value
|
||||||
}
|
p := toAddrPointer(&v, ei.isptr)
|
||||||
// We don't skip extensions that have an encoded form set,
|
siz := ei.sizer(p, SizeVarint(ei.wiretag))
|
||||||
// because the extension value may have been mutated after
|
buf := make([]byte, 0, siz)
|
||||||
// the last time this function was called.
|
return ei.marshaler(buf, p, ei.wiretag, false)
|
||||||
|
}
|
||||||
|
|
||||||
et := reflect.TypeOf(e.desc.ExtensionType)
|
func decodeExtensionFromBytes(extension *ExtensionDesc, buf []byte) (interface{}, error) {
|
||||||
props := extensionProperties(e.desc)
|
o := 0
|
||||||
|
for o < len(buf) {
|
||||||
p := NewBuffer(nil)
|
tag, n := DecodeVarint((buf)[o:])
|
||||||
// If e.value has type T, the encoder expects a *struct{ X T }.
|
fieldNum := int32(tag >> 3)
|
||||||
// Pass a *T with a zero field and hope it all works out.
|
wireType := int(tag & 0x7)
|
||||||
x := reflect.New(et)
|
if o+n > len(buf) {
|
||||||
x.Elem().Set(reflect.ValueOf(e.value))
|
return nil, fmt.Errorf("unable to decode extension")
|
||||||
if err := props.enc(p, props, toStructPointer(x)); err != nil {
|
}
|
||||||
return err
|
l, err := size((buf)[o+n:], wireType)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if int32(fieldNum) == extension.Field {
|
||||||
|
if o+n+l > len(buf) {
|
||||||
|
return nil, fmt.Errorf("unable to decode extension")
|
||||||
|
}
|
||||||
|
v, err := decodeExtension((buf)[o:o+n+l], extension)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return v, nil
|
||||||
|
}
|
||||||
|
o += n + l
|
||||||
|
}
|
||||||
|
return defaultExtensionValue(extension)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Extension) Encode() error {
|
||||||
|
if this.enc == nil {
|
||||||
|
var err error
|
||||||
|
this.enc, err = encodeExtension(this.desc, this.value)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
e.enc = p.buf
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this Extension) GoString() string {
|
func (this Extension) GoString() string {
|
||||||
if this.enc == nil {
|
if err := this.Encode(); err != nil {
|
||||||
if err := encodeExtension(&this); err != nil {
|
return fmt.Sprintf("error encoding extension: %v", err)
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("proto.NewExtension(%#v)", this.enc)
|
return fmt.Sprintf("proto.NewExtension(%#v)", this.enc)
|
||||||
}
|
}
|
||||||
@ -292,3 +346,23 @@ func GetUnsafeExtensionsMap(extendable Message) map[int32]Extension {
|
|||||||
pb := extendable.(extendableProto)
|
pb := extendable.(extendableProto)
|
||||||
return pb.extensionsWrite()
|
return pb.extensionsWrite()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func deleteExtension(pb extensionsBytes, theFieldNum int32, offset int) int {
|
||||||
|
ext := pb.GetExtensions()
|
||||||
|
for offset < len(*ext) {
|
||||||
|
tag, n1 := DecodeVarint((*ext)[offset:])
|
||||||
|
fieldNum := int32(tag >> 3)
|
||||||
|
wireType := int(tag & 0x7)
|
||||||
|
n2, err := size((*ext)[offset+n1:], wireType)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
newOffset := offset + n1 + n2
|
||||||
|
if fieldNum == theFieldNum {
|
||||||
|
*ext = append((*ext)[:offset], (*ext)[newOffset:]...)
|
||||||
|
return offset
|
||||||
|
}
|
||||||
|
offset = newOffset
|
||||||
|
}
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
166
vendor/github.com/gogo/protobuf/proto/lib.go
generated
vendored
166
vendor/github.com/gogo/protobuf/proto/lib.go
generated
vendored
@ -273,6 +273,67 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// RequiredNotSetError is an error type returned by either Marshal or Unmarshal.
|
||||||
|
// Marshal reports this when a required field is not initialized.
|
||||||
|
// Unmarshal reports this when a required field is missing from the wire data.
|
||||||
|
type RequiredNotSetError struct{ field string }
|
||||||
|
|
||||||
|
func (e *RequiredNotSetError) Error() string {
|
||||||
|
if e.field == "" {
|
||||||
|
return fmt.Sprintf("proto: required field not set")
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("proto: required field %q not set", e.field)
|
||||||
|
}
|
||||||
|
func (e *RequiredNotSetError) RequiredNotSet() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
type invalidUTF8Error struct{ field string }
|
||||||
|
|
||||||
|
func (e *invalidUTF8Error) Error() string {
|
||||||
|
if e.field == "" {
|
||||||
|
return "proto: invalid UTF-8 detected"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("proto: field %q contains invalid UTF-8", e.field)
|
||||||
|
}
|
||||||
|
func (e *invalidUTF8Error) InvalidUTF8() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// errInvalidUTF8 is a sentinel error to identify fields with invalid UTF-8.
|
||||||
|
// This error should not be exposed to the external API as such errors should
|
||||||
|
// be recreated with the field information.
|
||||||
|
var errInvalidUTF8 = &invalidUTF8Error{}
|
||||||
|
|
||||||
|
// isNonFatal reports whether the error is either a RequiredNotSet error
|
||||||
|
// or a InvalidUTF8 error.
|
||||||
|
func isNonFatal(err error) bool {
|
||||||
|
if re, ok := err.(interface{ RequiredNotSet() bool }); ok && re.RequiredNotSet() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if re, ok := err.(interface{ InvalidUTF8() bool }); ok && re.InvalidUTF8() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
type nonFatal struct{ E error }
|
||||||
|
|
||||||
|
// Merge merges err into nf and reports whether it was successful.
|
||||||
|
// Otherwise it returns false for any fatal non-nil errors.
|
||||||
|
func (nf *nonFatal) Merge(err error) (ok bool) {
|
||||||
|
if err == nil {
|
||||||
|
return true // not an error
|
||||||
|
}
|
||||||
|
if !isNonFatal(err) {
|
||||||
|
return false // fatal error
|
||||||
|
}
|
||||||
|
if nf.E == nil {
|
||||||
|
nf.E = err // store first instance of non-fatal error
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
// Message is implemented by generated protocol buffer messages.
|
// Message is implemented by generated protocol buffer messages.
|
||||||
type Message interface {
|
type Message interface {
|
||||||
Reset()
|
Reset()
|
||||||
@ -280,26 +341,6 @@ type Message interface {
|
|||||||
ProtoMessage()
|
ProtoMessage()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stats records allocation details about the protocol buffer encoders
|
|
||||||
// and decoders. Useful for tuning the library itself.
|
|
||||||
type Stats struct {
|
|
||||||
Emalloc uint64 // mallocs in encode
|
|
||||||
Dmalloc uint64 // mallocs in decode
|
|
||||||
Encode uint64 // number of encodes
|
|
||||||
Decode uint64 // number of decodes
|
|
||||||
Chit uint64 // number of cache hits
|
|
||||||
Cmiss uint64 // number of cache misses
|
|
||||||
Size uint64 // number of sizes
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set to true to enable stats collection.
|
|
||||||
const collectStats = false
|
|
||||||
|
|
||||||
var stats Stats
|
|
||||||
|
|
||||||
// GetStats returns a copy of the global Stats structure.
|
|
||||||
func GetStats() Stats { return stats }
|
|
||||||
|
|
||||||
// A Buffer is a buffer manager for marshaling and unmarshaling
|
// A Buffer is a buffer manager for marshaling and unmarshaling
|
||||||
// protocol buffers. It may be reused between invocations to
|
// protocol buffers. It may be reused between invocations to
|
||||||
// reduce memory usage. It is not necessary to use a Buffer;
|
// reduce memory usage. It is not necessary to use a Buffer;
|
||||||
@ -309,16 +350,7 @@ type Buffer struct {
|
|||||||
buf []byte // encode/decode byte stream
|
buf []byte // encode/decode byte stream
|
||||||
index int // read point
|
index int // read point
|
||||||
|
|
||||||
// pools of basic types to amortize allocation.
|
deterministic bool
|
||||||
bools []bool
|
|
||||||
uint32s []uint32
|
|
||||||
uint64s []uint64
|
|
||||||
|
|
||||||
// extra pools, only used with pointer_reflect.go
|
|
||||||
int32s []int32
|
|
||||||
int64s []int64
|
|
||||||
float32s []float32
|
|
||||||
float64s []float64
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBuffer allocates a new Buffer and initializes its internal data to
|
// NewBuffer allocates a new Buffer and initializes its internal data to
|
||||||
@ -343,6 +375,30 @@ func (p *Buffer) SetBuf(s []byte) {
|
|||||||
// Bytes returns the contents of the Buffer.
|
// Bytes returns the contents of the Buffer.
|
||||||
func (p *Buffer) Bytes() []byte { return p.buf }
|
func (p *Buffer) Bytes() []byte { return p.buf }
|
||||||
|
|
||||||
|
// SetDeterministic sets whether to use deterministic serialization.
|
||||||
|
//
|
||||||
|
// Deterministic serialization guarantees that for a given binary, equal
|
||||||
|
// messages will always be serialized to the same bytes. This implies:
|
||||||
|
//
|
||||||
|
// - Repeated serialization of a message will return the same bytes.
|
||||||
|
// - Different processes of the same binary (which may be executing on
|
||||||
|
// different machines) will serialize equal messages to the same bytes.
|
||||||
|
//
|
||||||
|
// Note that the deterministic serialization is NOT canonical across
|
||||||
|
// languages. It is not guaranteed to remain stable over time. It is unstable
|
||||||
|
// across different builds with schema changes due to unknown fields.
|
||||||
|
// Users who need canonical serialization (e.g., persistent storage in a
|
||||||
|
// canonical form, fingerprinting, etc.) should define their own
|
||||||
|
// canonicalization specification and implement their own serializer rather
|
||||||
|
// than relying on this API.
|
||||||
|
//
|
||||||
|
// If deterministic serialization is requested, map entries will be sorted
|
||||||
|
// by keys in lexographical order. This is an implementation detail and
|
||||||
|
// subject to change.
|
||||||
|
func (p *Buffer) SetDeterministic(deterministic bool) {
|
||||||
|
p.deterministic = deterministic
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Helper routines for simplifying the creation of optional fields of basic type.
|
* Helper routines for simplifying the creation of optional fields of basic type.
|
||||||
*/
|
*/
|
||||||
@ -552,9 +608,11 @@ func SetDefaults(pb Message) {
|
|||||||
setDefaults(reflect.ValueOf(pb), true, false)
|
setDefaults(reflect.ValueOf(pb), true, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// v is a pointer to a struct.
|
// v is a struct.
|
||||||
func setDefaults(v reflect.Value, recur, zeros bool) {
|
func setDefaults(v reflect.Value, recur, zeros bool) {
|
||||||
v = v.Elem()
|
if v.Kind() == reflect.Ptr {
|
||||||
|
v = v.Elem()
|
||||||
|
}
|
||||||
|
|
||||||
defaultMu.RLock()
|
defaultMu.RLock()
|
||||||
dm, ok := defaults[v.Type()]
|
dm, ok := defaults[v.Type()]
|
||||||
@ -656,8 +714,11 @@ func setDefaults(v reflect.Value, recur, zeros bool) {
|
|||||||
|
|
||||||
for _, ni := range dm.nested {
|
for _, ni := range dm.nested {
|
||||||
f := v.Field(ni)
|
f := v.Field(ni)
|
||||||
// f is *T or []*T or map[T]*T
|
// f is *T or T or []*T or []T
|
||||||
switch f.Kind() {
|
switch f.Kind() {
|
||||||
|
case reflect.Struct:
|
||||||
|
setDefaults(f, recur, zeros)
|
||||||
|
|
||||||
case reflect.Ptr:
|
case reflect.Ptr:
|
||||||
if f.IsNil() {
|
if f.IsNil() {
|
||||||
continue
|
continue
|
||||||
@ -667,7 +728,7 @@ func setDefaults(v reflect.Value, recur, zeros bool) {
|
|||||||
case reflect.Slice:
|
case reflect.Slice:
|
||||||
for i := 0; i < f.Len(); i++ {
|
for i := 0; i < f.Len(); i++ {
|
||||||
e := f.Index(i)
|
e := f.Index(i)
|
||||||
if e.IsNil() {
|
if e.Kind() == reflect.Ptr && e.IsNil() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
setDefaults(e, recur, zeros)
|
setDefaults(e, recur, zeros)
|
||||||
@ -739,6 +800,9 @@ func buildDefaultMessage(t reflect.Type) (dm defaultMessage) {
|
|||||||
func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, nestedMessage bool, err error) {
|
func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, nestedMessage bool, err error) {
|
||||||
var canHaveDefault bool
|
var canHaveDefault bool
|
||||||
switch ft.Kind() {
|
switch ft.Kind() {
|
||||||
|
case reflect.Struct:
|
||||||
|
nestedMessage = true // non-nullable
|
||||||
|
|
||||||
case reflect.Ptr:
|
case reflect.Ptr:
|
||||||
if ft.Elem().Kind() == reflect.Struct {
|
if ft.Elem().Kind() == reflect.Struct {
|
||||||
nestedMessage = true
|
nestedMessage = true
|
||||||
@ -748,7 +812,7 @@ func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, nestedMes
|
|||||||
|
|
||||||
case reflect.Slice:
|
case reflect.Slice:
|
||||||
switch ft.Elem().Kind() {
|
switch ft.Elem().Kind() {
|
||||||
case reflect.Ptr:
|
case reflect.Ptr, reflect.Struct:
|
||||||
nestedMessage = true // repeated message
|
nestedMessage = true // repeated message
|
||||||
case reflect.Uint8:
|
case reflect.Uint8:
|
||||||
canHaveDefault = true // bytes field
|
canHaveDefault = true // bytes field
|
||||||
@ -831,22 +895,12 @@ func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, nestedMes
|
|||||||
return sf, false, nil
|
return sf, false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mapKeys returns a sort.Interface to be used for sorting the map keys.
|
||||||
// Map fields may have key types of non-float scalars, strings and enums.
|
// Map fields may have key types of non-float scalars, strings and enums.
|
||||||
// The easiest way to sort them in some deterministic order is to use fmt.
|
|
||||||
// If this turns out to be inefficient we can always consider other options,
|
|
||||||
// such as doing a Schwartzian transform.
|
|
||||||
|
|
||||||
func mapKeys(vs []reflect.Value) sort.Interface {
|
func mapKeys(vs []reflect.Value) sort.Interface {
|
||||||
s := mapKeySorter{
|
s := mapKeySorter{vs: vs}
|
||||||
vs: vs,
|
|
||||||
// default Less function: textual comparison
|
|
||||||
less: func(a, b reflect.Value) bool {
|
|
||||||
return fmt.Sprint(a.Interface()) < fmt.Sprint(b.Interface())
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
// Type specialization per https://developers.google.com/protocol-buffers/docs/proto#maps;
|
// Type specialization per https://developers.google.com/protocol-buffers/docs/proto#maps.
|
||||||
// numeric keys are sorted numerically.
|
|
||||||
if len(vs) == 0 {
|
if len(vs) == 0 {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
@ -855,6 +909,12 @@ func mapKeys(vs []reflect.Value) sort.Interface {
|
|||||||
s.less = func(a, b reflect.Value) bool { return a.Int() < b.Int() }
|
s.less = func(a, b reflect.Value) bool { return a.Int() < b.Int() }
|
||||||
case reflect.Uint32, reflect.Uint64:
|
case reflect.Uint32, reflect.Uint64:
|
||||||
s.less = func(a, b reflect.Value) bool { return a.Uint() < b.Uint() }
|
s.less = func(a, b reflect.Value) bool { return a.Uint() < b.Uint() }
|
||||||
|
case reflect.Bool:
|
||||||
|
s.less = func(a, b reflect.Value) bool { return !a.Bool() && b.Bool() } // false < true
|
||||||
|
case reflect.String:
|
||||||
|
s.less = func(a, b reflect.Value) bool { return a.String() < b.String() }
|
||||||
|
default:
|
||||||
|
panic(fmt.Sprintf("unsupported map key type: %v", vs[0].Kind()))
|
||||||
}
|
}
|
||||||
|
|
||||||
return s
|
return s
|
||||||
@ -895,3 +955,13 @@ const GoGoProtoPackageIsVersion2 = true
|
|||||||
// ProtoPackageIsVersion1 is referenced from generated protocol buffer files
|
// ProtoPackageIsVersion1 is referenced from generated protocol buffer files
|
||||||
// to assert that that code is compatible with this version of the proto package.
|
// to assert that that code is compatible with this version of the proto package.
|
||||||
const GoGoProtoPackageIsVersion1 = true
|
const 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.
|
||||||
|
// This type is not subject to any compatibility guarantee.
|
||||||
|
type InternalMessageInfo struct {
|
||||||
|
marshal *marshalInfo
|
||||||
|
unmarshal *unmarshalInfo
|
||||||
|
merge *mergeInfo
|
||||||
|
discard *discardInfo
|
||||||
|
}
|
||||||
|
8
vendor/github.com/gogo/protobuf/proto/lib_gogo.go
generated
vendored
8
vendor/github.com/gogo/protobuf/proto/lib_gogo.go
generated
vendored
@ -33,6 +33,14 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Sizer interface {
|
||||||
|
Size() int
|
||||||
|
}
|
||||||
|
|
||||||
|
type ProtoSizer interface {
|
||||||
|
ProtoSize() int
|
||||||
|
}
|
||||||
|
|
||||||
func MarshalJSONEnum(m map[int32]string, value int32) ([]byte, error) {
|
func MarshalJSONEnum(m map[int32]string, value int32) ([]byte, error) {
|
||||||
s, ok := m[value]
|
s, ok := m[value]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
138
vendor/github.com/gogo/protobuf/proto/message_set.go
generated
vendored
138
vendor/github.com/gogo/protobuf/proto/message_set.go
generated
vendored
@ -36,12 +36,7 @@ package proto
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"reflect"
|
|
||||||
"sort"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// errNoMessageTypeID occurs when a protocol buffer does not have a message type ID.
|
// errNoMessageTypeID occurs when a protocol buffer does not have a message type ID.
|
||||||
@ -94,10 +89,7 @@ func (ms *messageSet) find(pb Message) *_MessageSet_Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ms *messageSet) Has(pb Message) bool {
|
func (ms *messageSet) Has(pb Message) bool {
|
||||||
if ms.find(pb) != nil {
|
return ms.find(pb) != nil
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ms *messageSet) Unmarshal(pb Message) error {
|
func (ms *messageSet) Unmarshal(pb Message) error {
|
||||||
@ -147,50 +139,9 @@ func skipVarint(buf []byte) []byte {
|
|||||||
return buf[i+1:]
|
return buf[i+1:]
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalMessageSet encodes the extension map represented by m in the message set wire format.
|
// unmarshalMessageSet decodes the extension map encoded in buf in the message set wire format.
|
||||||
// It is called by generated Marshal methods on protocol buffer messages with the message_set_wire_format option.
|
// It is called by Unmarshal methods on protocol buffer messages with the message_set_wire_format option.
|
||||||
func MarshalMessageSet(exts interface{}) ([]byte, error) {
|
func unmarshalMessageSet(buf []byte, exts interface{}) error {
|
||||||
var m map[int32]Extension
|
|
||||||
switch exts := exts.(type) {
|
|
||||||
case *XXX_InternalExtensions:
|
|
||||||
if err := encodeExtensions(exts); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
m, _ = exts.extensionsRead()
|
|
||||||
case map[int32]Extension:
|
|
||||||
if err := encodeExtensionsMap(exts); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
m = exts
|
|
||||||
default:
|
|
||||||
return nil, errors.New("proto: not an extension map")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sort extension IDs to provide a deterministic encoding.
|
|
||||||
// See also enc_map in encode.go.
|
|
||||||
ids := make([]int, 0, len(m))
|
|
||||||
for id := range m {
|
|
||||||
ids = append(ids, int(id))
|
|
||||||
}
|
|
||||||
sort.Ints(ids)
|
|
||||||
|
|
||||||
ms := &messageSet{Item: make([]*_MessageSet_Item, 0, len(m))}
|
|
||||||
for _, id := range ids {
|
|
||||||
e := m[int32(id)]
|
|
||||||
// Remove the wire type and field number varint, as well as the length varint.
|
|
||||||
msg := skipVarint(skipVarint(e.enc))
|
|
||||||
|
|
||||||
ms.Item = append(ms.Item, &_MessageSet_Item{
|
|
||||||
TypeId: Int32(int32(id)),
|
|
||||||
Message: msg,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return Marshal(ms)
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalMessageSet decodes the extension map encoded in buf in the message set wire format.
|
|
||||||
// It is called by generated Unmarshal methods on protocol buffer messages with the message_set_wire_format option.
|
|
||||||
func UnmarshalMessageSet(buf []byte, exts interface{}) error {
|
|
||||||
var m map[int32]Extension
|
var m map[int32]Extension
|
||||||
switch exts := exts.(type) {
|
switch exts := exts.(type) {
|
||||||
case *XXX_InternalExtensions:
|
case *XXX_InternalExtensions:
|
||||||
@ -228,84 +179,3 @@ func UnmarshalMessageSet(buf []byte, exts interface{}) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalMessageSetJSON encodes the extension map represented by m in JSON format.
|
|
||||||
// It is called by generated MarshalJSON methods on protocol buffer messages with the message_set_wire_format option.
|
|
||||||
func MarshalMessageSetJSON(exts interface{}) ([]byte, error) {
|
|
||||||
var m map[int32]Extension
|
|
||||||
switch exts := exts.(type) {
|
|
||||||
case *XXX_InternalExtensions:
|
|
||||||
m, _ = exts.extensionsRead()
|
|
||||||
case map[int32]Extension:
|
|
||||||
m = exts
|
|
||||||
default:
|
|
||||||
return nil, errors.New("proto: not an extension map")
|
|
||||||
}
|
|
||||||
var b bytes.Buffer
|
|
||||||
b.WriteByte('{')
|
|
||||||
|
|
||||||
// Process the map in key order for deterministic output.
|
|
||||||
ids := make([]int32, 0, len(m))
|
|
||||||
for id := range m {
|
|
||||||
ids = append(ids, id)
|
|
||||||
}
|
|
||||||
sort.Sort(int32Slice(ids)) // int32Slice defined in text.go
|
|
||||||
|
|
||||||
for i, id := range ids {
|
|
||||||
ext := m[id]
|
|
||||||
if i > 0 {
|
|
||||||
b.WriteByte(',')
|
|
||||||
}
|
|
||||||
|
|
||||||
msd, ok := messageSetMap[id]
|
|
||||||
if !ok {
|
|
||||||
// Unknown type; we can't render it, so skip it.
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
fmt.Fprintf(&b, `"[%s]":`, msd.name)
|
|
||||||
|
|
||||||
x := ext.value
|
|
||||||
if x == nil {
|
|
||||||
x = reflect.New(msd.t.Elem()).Interface()
|
|
||||||
if err := Unmarshal(ext.enc, x.(Message)); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
d, err := json.Marshal(x)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
b.Write(d)
|
|
||||||
}
|
|
||||||
b.WriteByte('}')
|
|
||||||
return b.Bytes(), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalMessageSetJSON decodes the extension map encoded in buf in JSON format.
|
|
||||||
// It is called by generated UnmarshalJSON methods on protocol buffer messages with the message_set_wire_format option.
|
|
||||||
func UnmarshalMessageSetJSON(buf []byte, exts interface{}) error {
|
|
||||||
// Common-case fast path.
|
|
||||||
if len(buf) == 0 || bytes.Equal(buf, []byte("{}")) {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// This is fairly tricky, and it's not clear that it is needed.
|
|
||||||
return errors.New("TODO: UnmarshalMessageSetJSON not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
// A global registry of types that can be used in a MessageSet.
|
|
||||||
|
|
||||||
var messageSetMap = make(map[int32]messageSetDesc)
|
|
||||||
|
|
||||||
type messageSetDesc struct {
|
|
||||||
t reflect.Type // pointer to struct
|
|
||||||
name string
|
|
||||||
}
|
|
||||||
|
|
||||||
// RegisterMessageSetType is called from the generated code.
|
|
||||||
func RegisterMessageSetType(m Message, fieldNum int32, name string) {
|
|
||||||
messageSetMap[fieldNum] = messageSetDesc{
|
|
||||||
t: reflect.TypeOf(m),
|
|
||||||
name: name,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
645
vendor/github.com/gogo/protobuf/proto/pointer_reflect.go
generated
vendored
645
vendor/github.com/gogo/protobuf/proto/pointer_reflect.go
generated
vendored
@ -29,7 +29,7 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
// +build appengine js
|
// +build purego appengine js
|
||||||
|
|
||||||
// This file contains an implementation of proto field accesses using package reflect.
|
// This file contains an implementation of proto field accesses using package reflect.
|
||||||
// It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can
|
// It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can
|
||||||
@ -38,32 +38,13 @@
|
|||||||
package proto
|
package proto
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A structPointer is a pointer to a struct.
|
const unsafeAllowed = false
|
||||||
type structPointer struct {
|
|
||||||
v reflect.Value
|
|
||||||
}
|
|
||||||
|
|
||||||
// toStructPointer returns a structPointer equivalent to the given reflect value.
|
// A field identifies a field in a struct, accessible from a pointer.
|
||||||
// The reflect value must itself be a pointer to a struct.
|
|
||||||
func toStructPointer(v reflect.Value) structPointer {
|
|
||||||
return structPointer{v}
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsNil reports whether p is nil.
|
|
||||||
func structPointer_IsNil(p structPointer) bool {
|
|
||||||
return p.v.IsNil()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Interface returns the struct pointer as an interface value.
|
|
||||||
func structPointer_Interface(p structPointer, _ reflect.Type) interface{} {
|
|
||||||
return p.v.Interface()
|
|
||||||
}
|
|
||||||
|
|
||||||
// A field identifies a field in a struct, accessible from a structPointer.
|
|
||||||
// In this implementation, a field is identified by the sequence of field indices
|
// In this implementation, a field is identified by the sequence of field indices
|
||||||
// passed to reflect's FieldByIndex.
|
// passed to reflect's FieldByIndex.
|
||||||
type field []int
|
type field []int
|
||||||
@ -76,409 +57,301 @@ func toField(f *reflect.StructField) field {
|
|||||||
// invalidField is an invalid field identifier.
|
// invalidField is an invalid field identifier.
|
||||||
var invalidField = field(nil)
|
var invalidField = field(nil)
|
||||||
|
|
||||||
|
// zeroField is a noop when calling pointer.offset.
|
||||||
|
var zeroField = field([]int{})
|
||||||
|
|
||||||
// IsValid reports whether the field identifier is valid.
|
// IsValid reports whether the field identifier is valid.
|
||||||
func (f field) IsValid() bool { return f != nil }
|
func (f field) IsValid() bool { return f != nil }
|
||||||
|
|
||||||
// field returns the given field in the struct as a reflect value.
|
// The pointer type is for the table-driven decoder.
|
||||||
func structPointer_field(p structPointer, f field) reflect.Value {
|
// The implementation here uses a reflect.Value of pointer type to
|
||||||
// Special case: an extension map entry with a value of type T
|
// create a generic pointer. In pointer_unsafe.go we use unsafe
|
||||||
// passes a *T to the struct-handling code with a zero field,
|
// instead of reflect to implement the same (but faster) interface.
|
||||||
// expecting that it will be treated as equivalent to *struct{ X T },
|
type pointer struct {
|
||||||
// which has the same memory layout. We have to handle that case
|
|
||||||
// specially, because reflect will panic if we call FieldByIndex on a
|
|
||||||
// non-struct.
|
|
||||||
if f == nil {
|
|
||||||
return p.v.Elem()
|
|
||||||
}
|
|
||||||
|
|
||||||
return p.v.Elem().FieldByIndex(f)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ifield returns the given field in the struct as an interface value.
|
|
||||||
func structPointer_ifield(p structPointer, f field) interface{} {
|
|
||||||
return structPointer_field(p, f).Addr().Interface()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bytes returns the address of a []byte field in the struct.
|
|
||||||
func structPointer_Bytes(p structPointer, f field) *[]byte {
|
|
||||||
return structPointer_ifield(p, f).(*[]byte)
|
|
||||||
}
|
|
||||||
|
|
||||||
// BytesSlice returns the address of a [][]byte field in the struct.
|
|
||||||
func structPointer_BytesSlice(p structPointer, f field) *[][]byte {
|
|
||||||
return structPointer_ifield(p, f).(*[][]byte)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bool returns the address of a *bool field in the struct.
|
|
||||||
func structPointer_Bool(p structPointer, f field) **bool {
|
|
||||||
return structPointer_ifield(p, f).(**bool)
|
|
||||||
}
|
|
||||||
|
|
||||||
// BoolVal returns the address of a bool field in the struct.
|
|
||||||
func structPointer_BoolVal(p structPointer, f field) *bool {
|
|
||||||
return structPointer_ifield(p, f).(*bool)
|
|
||||||
}
|
|
||||||
|
|
||||||
// BoolSlice returns the address of a []bool field in the struct.
|
|
||||||
func structPointer_BoolSlice(p structPointer, f field) *[]bool {
|
|
||||||
return structPointer_ifield(p, f).(*[]bool)
|
|
||||||
}
|
|
||||||
|
|
||||||
// String returns the address of a *string field in the struct.
|
|
||||||
func structPointer_String(p structPointer, f field) **string {
|
|
||||||
return structPointer_ifield(p, f).(**string)
|
|
||||||
}
|
|
||||||
|
|
||||||
// StringVal returns the address of a string field in the struct.
|
|
||||||
func structPointer_StringVal(p structPointer, f field) *string {
|
|
||||||
return structPointer_ifield(p, f).(*string)
|
|
||||||
}
|
|
||||||
|
|
||||||
// StringSlice returns the address of a []string field in the struct.
|
|
||||||
func structPointer_StringSlice(p structPointer, f field) *[]string {
|
|
||||||
return structPointer_ifield(p, f).(*[]string)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extensions returns the address of an extension map field in the struct.
|
|
||||||
func structPointer_Extensions(p structPointer, f field) *XXX_InternalExtensions {
|
|
||||||
return structPointer_ifield(p, f).(*XXX_InternalExtensions)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ExtMap returns the address of an extension map field in the struct.
|
|
||||||
func structPointer_ExtMap(p structPointer, f field) *map[int32]Extension {
|
|
||||||
return structPointer_ifield(p, f).(*map[int32]Extension)
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewAt returns the reflect.Value for a pointer to a field in the struct.
|
|
||||||
func structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value {
|
|
||||||
return structPointer_field(p, f).Addr()
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetStructPointer writes a *struct field in the struct.
|
|
||||||
func structPointer_SetStructPointer(p structPointer, f field, q structPointer) {
|
|
||||||
structPointer_field(p, f).Set(q.v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetStructPointer reads a *struct field in the struct.
|
|
||||||
func structPointer_GetStructPointer(p structPointer, f field) structPointer {
|
|
||||||
return structPointer{structPointer_field(p, f)}
|
|
||||||
}
|
|
||||||
|
|
||||||
// StructPointerSlice the address of a []*struct field in the struct.
|
|
||||||
func structPointer_StructPointerSlice(p structPointer, f field) structPointerSlice {
|
|
||||||
return structPointerSlice{structPointer_field(p, f)}
|
|
||||||
}
|
|
||||||
|
|
||||||
// A structPointerSlice represents the address of a slice of pointers to structs
|
|
||||||
// (themselves messages or groups). That is, v.Type() is *[]*struct{...}.
|
|
||||||
type structPointerSlice struct {
|
|
||||||
v reflect.Value
|
v reflect.Value
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p structPointerSlice) Len() int { return p.v.Len() }
|
// toPointer converts an interface of pointer type to a pointer
|
||||||
func (p structPointerSlice) Index(i int) structPointer { return structPointer{p.v.Index(i)} }
|
// that points to the same target.
|
||||||
func (p structPointerSlice) Append(q structPointer) {
|
func toPointer(i *Message) pointer {
|
||||||
p.v.Set(reflect.Append(p.v, q.v))
|
return pointer{v: reflect.ValueOf(*i)}
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
// toAddrPointer converts an interface to a pointer that points to
|
||||||
int32Type = reflect.TypeOf(int32(0))
|
// the interface data.
|
||||||
uint32Type = reflect.TypeOf(uint32(0))
|
func toAddrPointer(i *interface{}, isptr bool) pointer {
|
||||||
float32Type = reflect.TypeOf(float32(0))
|
v := reflect.ValueOf(*i)
|
||||||
int64Type = reflect.TypeOf(int64(0))
|
u := reflect.New(v.Type())
|
||||||
uint64Type = reflect.TypeOf(uint64(0))
|
u.Elem().Set(v)
|
||||||
float64Type = reflect.TypeOf(float64(0))
|
return pointer{v: u}
|
||||||
)
|
|
||||||
|
|
||||||
// A word32 represents a field of type *int32, *uint32, *float32, or *enum.
|
|
||||||
// That is, v.Type() is *int32, *uint32, *float32, or *enum and v is assignable.
|
|
||||||
type word32 struct {
|
|
||||||
v reflect.Value
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsNil reports whether p is nil.
|
// valToPointer converts v to a pointer. v must be of pointer type.
|
||||||
func word32_IsNil(p word32) bool {
|
func valToPointer(v reflect.Value) pointer {
|
||||||
|
return pointer{v: v}
|
||||||
|
}
|
||||||
|
|
||||||
|
// offset converts from a pointer to a structure to a pointer to
|
||||||
|
// one of its fields.
|
||||||
|
func (p pointer) offset(f field) pointer {
|
||||||
|
return pointer{v: p.v.Elem().FieldByIndex(f).Addr()}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p pointer) isNil() bool {
|
||||||
return p.v.IsNil()
|
return p.v.IsNil()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set sets p to point at a newly allocated word with bits set to x.
|
// grow updates the slice s in place to make it one element longer.
|
||||||
func word32_Set(p word32, o *Buffer, x uint32) {
|
// s must be addressable.
|
||||||
t := p.v.Type().Elem()
|
// Returns the (addressable) new element.
|
||||||
switch t {
|
func grow(s reflect.Value) reflect.Value {
|
||||||
case int32Type:
|
n, m := s.Len(), s.Cap()
|
||||||
if len(o.int32s) == 0 {
|
|
||||||
o.int32s = make([]int32, uint32PoolSize)
|
|
||||||
}
|
|
||||||
o.int32s[0] = int32(x)
|
|
||||||
p.v.Set(reflect.ValueOf(&o.int32s[0]))
|
|
||||||
o.int32s = o.int32s[1:]
|
|
||||||
return
|
|
||||||
case uint32Type:
|
|
||||||
if len(o.uint32s) == 0 {
|
|
||||||
o.uint32s = make([]uint32, uint32PoolSize)
|
|
||||||
}
|
|
||||||
o.uint32s[0] = x
|
|
||||||
p.v.Set(reflect.ValueOf(&o.uint32s[0]))
|
|
||||||
o.uint32s = o.uint32s[1:]
|
|
||||||
return
|
|
||||||
case float32Type:
|
|
||||||
if len(o.float32s) == 0 {
|
|
||||||
o.float32s = make([]float32, uint32PoolSize)
|
|
||||||
}
|
|
||||||
o.float32s[0] = math.Float32frombits(x)
|
|
||||||
p.v.Set(reflect.ValueOf(&o.float32s[0]))
|
|
||||||
o.float32s = o.float32s[1:]
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// must be enum
|
|
||||||
p.v.Set(reflect.New(t))
|
|
||||||
p.v.Elem().SetInt(int64(int32(x)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get gets the bits pointed at by p, as a uint32.
|
|
||||||
func word32_Get(p word32) uint32 {
|
|
||||||
elem := p.v.Elem()
|
|
||||||
switch elem.Kind() {
|
|
||||||
case reflect.Int32:
|
|
||||||
return uint32(elem.Int())
|
|
||||||
case reflect.Uint32:
|
|
||||||
return uint32(elem.Uint())
|
|
||||||
case reflect.Float32:
|
|
||||||
return math.Float32bits(float32(elem.Float()))
|
|
||||||
}
|
|
||||||
panic("unreachable")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Word32 returns a reference to a *int32, *uint32, *float32, or *enum field in the struct.
|
|
||||||
func structPointer_Word32(p structPointer, f field) word32 {
|
|
||||||
return word32{structPointer_field(p, f)}
|
|
||||||
}
|
|
||||||
|
|
||||||
// A word32Val represents a field of type int32, uint32, float32, or enum.
|
|
||||||
// That is, v.Type() is int32, uint32, float32, or enum and v is assignable.
|
|
||||||
type word32Val struct {
|
|
||||||
v reflect.Value
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set sets *p to x.
|
|
||||||
func word32Val_Set(p word32Val, x uint32) {
|
|
||||||
switch p.v.Type() {
|
|
||||||
case int32Type:
|
|
||||||
p.v.SetInt(int64(x))
|
|
||||||
return
|
|
||||||
case uint32Type:
|
|
||||||
p.v.SetUint(uint64(x))
|
|
||||||
return
|
|
||||||
case float32Type:
|
|
||||||
p.v.SetFloat(float64(math.Float32frombits(x)))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// must be enum
|
|
||||||
p.v.SetInt(int64(int32(x)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get gets the bits pointed at by p, as a uint32.
|
|
||||||
func word32Val_Get(p word32Val) uint32 {
|
|
||||||
elem := p.v
|
|
||||||
switch elem.Kind() {
|
|
||||||
case reflect.Int32:
|
|
||||||
return uint32(elem.Int())
|
|
||||||
case reflect.Uint32:
|
|
||||||
return uint32(elem.Uint())
|
|
||||||
case reflect.Float32:
|
|
||||||
return math.Float32bits(float32(elem.Float()))
|
|
||||||
}
|
|
||||||
panic("unreachable")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Word32Val returns a reference to a int32, uint32, float32, or enum field in the struct.
|
|
||||||
func structPointer_Word32Val(p structPointer, f field) word32Val {
|
|
||||||
return word32Val{structPointer_field(p, f)}
|
|
||||||
}
|
|
||||||
|
|
||||||
// A word32Slice is a slice of 32-bit values.
|
|
||||||
// That is, v.Type() is []int32, []uint32, []float32, or []enum.
|
|
||||||
type word32Slice struct {
|
|
||||||
v reflect.Value
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p word32Slice) Append(x uint32) {
|
|
||||||
n, m := p.v.Len(), p.v.Cap()
|
|
||||||
if n < m {
|
if n < m {
|
||||||
p.v.SetLen(n + 1)
|
s.SetLen(n + 1)
|
||||||
} else {
|
} else {
|
||||||
t := p.v.Type().Elem()
|
s.Set(reflect.Append(s, reflect.Zero(s.Type().Elem())))
|
||||||
p.v.Set(reflect.Append(p.v, reflect.Zero(t)))
|
|
||||||
}
|
}
|
||||||
elem := p.v.Index(n)
|
return s.Index(n)
|
||||||
switch elem.Kind() {
|
}
|
||||||
case reflect.Int32:
|
|
||||||
elem.SetInt(int64(int32(x)))
|
func (p pointer) toInt64() *int64 {
|
||||||
case reflect.Uint32:
|
return p.v.Interface().(*int64)
|
||||||
elem.SetUint(uint64(x))
|
}
|
||||||
case reflect.Float32:
|
func (p pointer) toInt64Ptr() **int64 {
|
||||||
elem.SetFloat(float64(math.Float32frombits(x)))
|
return p.v.Interface().(**int64)
|
||||||
|
}
|
||||||
|
func (p pointer) toInt64Slice() *[]int64 {
|
||||||
|
return p.v.Interface().(*[]int64)
|
||||||
|
}
|
||||||
|
|
||||||
|
var int32ptr = reflect.TypeOf((*int32)(nil))
|
||||||
|
|
||||||
|
func (p pointer) toInt32() *int32 {
|
||||||
|
return p.v.Convert(int32ptr).Interface().(*int32)
|
||||||
|
}
|
||||||
|
|
||||||
|
// The toInt32Ptr/Slice methods don't work because of enums.
|
||||||
|
// Instead, we must use set/get methods for the int32ptr/slice case.
|
||||||
|
/*
|
||||||
|
func (p pointer) toInt32Ptr() **int32 {
|
||||||
|
return p.v.Interface().(**int32)
|
||||||
|
}
|
||||||
|
func (p pointer) toInt32Slice() *[]int32 {
|
||||||
|
return p.v.Interface().(*[]int32)
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
func (p pointer) getInt32Ptr() *int32 {
|
||||||
|
if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) {
|
||||||
|
// raw int32 type
|
||||||
|
return p.v.Elem().Interface().(*int32)
|
||||||
}
|
}
|
||||||
|
// an enum
|
||||||
|
return p.v.Elem().Convert(int32PtrType).Interface().(*int32)
|
||||||
|
}
|
||||||
|
func (p pointer) setInt32Ptr(v int32) {
|
||||||
|
// Allocate value in a *int32. Possibly convert that to a *enum.
|
||||||
|
// Then assign it to a **int32 or **enum.
|
||||||
|
// Note: we can convert *int32 to *enum, but we can't convert
|
||||||
|
// **int32 to **enum!
|
||||||
|
p.v.Elem().Set(reflect.ValueOf(&v).Convert(p.v.Type().Elem()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p word32Slice) Len() int {
|
// getInt32Slice copies []int32 from p as a new slice.
|
||||||
return p.v.Len()
|
// This behavior differs from the implementation in pointer_unsafe.go.
|
||||||
}
|
func (p pointer) getInt32Slice() []int32 {
|
||||||
|
if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) {
|
||||||
func (p word32Slice) Index(i int) uint32 {
|
// raw int32 type
|
||||||
elem := p.v.Index(i)
|
return p.v.Elem().Interface().([]int32)
|
||||||
switch elem.Kind() {
|
|
||||||
case reflect.Int32:
|
|
||||||
return uint32(elem.Int())
|
|
||||||
case reflect.Uint32:
|
|
||||||
return uint32(elem.Uint())
|
|
||||||
case reflect.Float32:
|
|
||||||
return math.Float32bits(float32(elem.Float()))
|
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
// an enum
|
||||||
|
// Allocate a []int32, then assign []enum's values into it.
|
||||||
|
// Note: we can't convert []enum to []int32.
|
||||||
|
slice := p.v.Elem()
|
||||||
|
s := make([]int32, slice.Len())
|
||||||
|
for i := 0; i < slice.Len(); i++ {
|
||||||
|
s[i] = int32(slice.Index(i).Int())
|
||||||
|
}
|
||||||
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// Word32Slice returns a reference to a []int32, []uint32, []float32, or []enum field in the struct.
|
// setInt32Slice copies []int32 into p as a new slice.
|
||||||
func structPointer_Word32Slice(p structPointer, f field) word32Slice {
|
// This behavior differs from the implementation in pointer_unsafe.go.
|
||||||
return word32Slice{structPointer_field(p, f)}
|
func (p pointer) setInt32Slice(v []int32) {
|
||||||
}
|
if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) {
|
||||||
|
// raw int32 type
|
||||||
// word64 is like word32 but for 64-bit values.
|
p.v.Elem().Set(reflect.ValueOf(v))
|
||||||
type word64 struct {
|
|
||||||
v reflect.Value
|
|
||||||
}
|
|
||||||
|
|
||||||
func word64_Set(p word64, o *Buffer, x uint64) {
|
|
||||||
t := p.v.Type().Elem()
|
|
||||||
switch t {
|
|
||||||
case int64Type:
|
|
||||||
if len(o.int64s) == 0 {
|
|
||||||
o.int64s = make([]int64, uint64PoolSize)
|
|
||||||
}
|
|
||||||
o.int64s[0] = int64(x)
|
|
||||||
p.v.Set(reflect.ValueOf(&o.int64s[0]))
|
|
||||||
o.int64s = o.int64s[1:]
|
|
||||||
return
|
|
||||||
case uint64Type:
|
|
||||||
if len(o.uint64s) == 0 {
|
|
||||||
o.uint64s = make([]uint64, uint64PoolSize)
|
|
||||||
}
|
|
||||||
o.uint64s[0] = x
|
|
||||||
p.v.Set(reflect.ValueOf(&o.uint64s[0]))
|
|
||||||
o.uint64s = o.uint64s[1:]
|
|
||||||
return
|
|
||||||
case float64Type:
|
|
||||||
if len(o.float64s) == 0 {
|
|
||||||
o.float64s = make([]float64, uint64PoolSize)
|
|
||||||
}
|
|
||||||
o.float64s[0] = math.Float64frombits(x)
|
|
||||||
p.v.Set(reflect.ValueOf(&o.float64s[0]))
|
|
||||||
o.float64s = o.float64s[1:]
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
// an enum
|
||||||
}
|
// Allocate a []enum, then assign []int32's values into it.
|
||||||
|
// Note: we can't convert []enum to []int32.
|
||||||
func word64_IsNil(p word64) bool {
|
slice := reflect.MakeSlice(p.v.Type().Elem(), len(v), cap(v))
|
||||||
return p.v.IsNil()
|
for i, x := range v {
|
||||||
}
|
slice.Index(i).SetInt(int64(x))
|
||||||
|
|
||||||
func word64_Get(p word64) uint64 {
|
|
||||||
elem := p.v.Elem()
|
|
||||||
switch elem.Kind() {
|
|
||||||
case reflect.Int64:
|
|
||||||
return uint64(elem.Int())
|
|
||||||
case reflect.Uint64:
|
|
||||||
return elem.Uint()
|
|
||||||
case reflect.Float64:
|
|
||||||
return math.Float64bits(elem.Float())
|
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
p.v.Elem().Set(slice)
|
||||||
|
}
|
||||||
|
func (p pointer) appendInt32Slice(v int32) {
|
||||||
|
grow(p.v.Elem()).SetInt(int64(v))
|
||||||
}
|
}
|
||||||
|
|
||||||
func structPointer_Word64(p structPointer, f field) word64 {
|
func (p pointer) toUint64() *uint64 {
|
||||||
return word64{structPointer_field(p, f)}
|
return p.v.Interface().(*uint64)
|
||||||
|
}
|
||||||
|
func (p pointer) toUint64Ptr() **uint64 {
|
||||||
|
return p.v.Interface().(**uint64)
|
||||||
|
}
|
||||||
|
func (p pointer) toUint64Slice() *[]uint64 {
|
||||||
|
return p.v.Interface().(*[]uint64)
|
||||||
|
}
|
||||||
|
func (p pointer) toUint32() *uint32 {
|
||||||
|
return p.v.Interface().(*uint32)
|
||||||
|
}
|
||||||
|
func (p pointer) toUint32Ptr() **uint32 {
|
||||||
|
return p.v.Interface().(**uint32)
|
||||||
|
}
|
||||||
|
func (p pointer) toUint32Slice() *[]uint32 {
|
||||||
|
return p.v.Interface().(*[]uint32)
|
||||||
|
}
|
||||||
|
func (p pointer) toBool() *bool {
|
||||||
|
return p.v.Interface().(*bool)
|
||||||
|
}
|
||||||
|
func (p pointer) toBoolPtr() **bool {
|
||||||
|
return p.v.Interface().(**bool)
|
||||||
|
}
|
||||||
|
func (p pointer) toBoolSlice() *[]bool {
|
||||||
|
return p.v.Interface().(*[]bool)
|
||||||
|
}
|
||||||
|
func (p pointer) toFloat64() *float64 {
|
||||||
|
return p.v.Interface().(*float64)
|
||||||
|
}
|
||||||
|
func (p pointer) toFloat64Ptr() **float64 {
|
||||||
|
return p.v.Interface().(**float64)
|
||||||
|
}
|
||||||
|
func (p pointer) toFloat64Slice() *[]float64 {
|
||||||
|
return p.v.Interface().(*[]float64)
|
||||||
|
}
|
||||||
|
func (p pointer) toFloat32() *float32 {
|
||||||
|
return p.v.Interface().(*float32)
|
||||||
|
}
|
||||||
|
func (p pointer) toFloat32Ptr() **float32 {
|
||||||
|
return p.v.Interface().(**float32)
|
||||||
|
}
|
||||||
|
func (p pointer) toFloat32Slice() *[]float32 {
|
||||||
|
return p.v.Interface().(*[]float32)
|
||||||
|
}
|
||||||
|
func (p pointer) toString() *string {
|
||||||
|
return p.v.Interface().(*string)
|
||||||
|
}
|
||||||
|
func (p pointer) toStringPtr() **string {
|
||||||
|
return p.v.Interface().(**string)
|
||||||
|
}
|
||||||
|
func (p pointer) toStringSlice() *[]string {
|
||||||
|
return p.v.Interface().(*[]string)
|
||||||
|
}
|
||||||
|
func (p pointer) toBytes() *[]byte {
|
||||||
|
return p.v.Interface().(*[]byte)
|
||||||
|
}
|
||||||
|
func (p pointer) toBytesSlice() *[][]byte {
|
||||||
|
return p.v.Interface().(*[][]byte)
|
||||||
|
}
|
||||||
|
func (p pointer) toExtensions() *XXX_InternalExtensions {
|
||||||
|
return p.v.Interface().(*XXX_InternalExtensions)
|
||||||
|
}
|
||||||
|
func (p pointer) toOldExtensions() *map[int32]Extension {
|
||||||
|
return p.v.Interface().(*map[int32]Extension)
|
||||||
|
}
|
||||||
|
func (p pointer) getPointer() pointer {
|
||||||
|
return pointer{v: p.v.Elem()}
|
||||||
|
}
|
||||||
|
func (p pointer) setPointer(q pointer) {
|
||||||
|
p.v.Elem().Set(q.v)
|
||||||
|
}
|
||||||
|
func (p pointer) appendPointer(q pointer) {
|
||||||
|
grow(p.v.Elem()).Set(q.v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// word64Val is like word32Val but for 64-bit values.
|
// getPointerSlice copies []*T from p as a new []pointer.
|
||||||
type word64Val struct {
|
// This behavior differs from the implementation in pointer_unsafe.go.
|
||||||
v reflect.Value
|
func (p pointer) getPointerSlice() []pointer {
|
||||||
|
if p.v.IsNil() {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
n := p.v.Elem().Len()
|
||||||
|
s := make([]pointer, n)
|
||||||
|
for i := 0; i < n; i++ {
|
||||||
|
s[i] = pointer{v: p.v.Elem().Index(i)}
|
||||||
|
}
|
||||||
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
func word64Val_Set(p word64Val, o *Buffer, x uint64) {
|
// setPointerSlice copies []pointer into p as a new []*T.
|
||||||
switch p.v.Type() {
|
// This behavior differs from the implementation in pointer_unsafe.go.
|
||||||
case int64Type:
|
func (p pointer) setPointerSlice(v []pointer) {
|
||||||
p.v.SetInt(int64(x))
|
if v == nil {
|
||||||
return
|
p.v.Elem().Set(reflect.New(p.v.Elem().Type()).Elem())
|
||||||
case uint64Type:
|
|
||||||
p.v.SetUint(x)
|
|
||||||
return
|
|
||||||
case float64Type:
|
|
||||||
p.v.SetFloat(math.Float64frombits(x))
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
s := reflect.MakeSlice(p.v.Elem().Type(), 0, len(v))
|
||||||
}
|
for _, p := range v {
|
||||||
|
s = reflect.Append(s, p.v)
|
||||||
func word64Val_Get(p word64Val) uint64 {
|
|
||||||
elem := p.v
|
|
||||||
switch elem.Kind() {
|
|
||||||
case reflect.Int64:
|
|
||||||
return uint64(elem.Int())
|
|
||||||
case reflect.Uint64:
|
|
||||||
return elem.Uint()
|
|
||||||
case reflect.Float64:
|
|
||||||
return math.Float64bits(elem.Float())
|
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
p.v.Elem().Set(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
func structPointer_Word64Val(p structPointer, f field) word64Val {
|
// getInterfacePointer returns a pointer that points to the
|
||||||
return word64Val{structPointer_field(p, f)}
|
// interface data of the interface pointed by p.
|
||||||
}
|
func (p pointer) getInterfacePointer() pointer {
|
||||||
|
if p.v.Elem().IsNil() {
|
||||||
type word64Slice struct {
|
return pointer{v: p.v.Elem()}
|
||||||
v reflect.Value
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p word64Slice) Append(x uint64) {
|
|
||||||
n, m := p.v.Len(), p.v.Cap()
|
|
||||||
if n < m {
|
|
||||||
p.v.SetLen(n + 1)
|
|
||||||
} else {
|
|
||||||
t := p.v.Type().Elem()
|
|
||||||
p.v.Set(reflect.Append(p.v, reflect.Zero(t)))
|
|
||||||
}
|
|
||||||
elem := p.v.Index(n)
|
|
||||||
switch elem.Kind() {
|
|
||||||
case reflect.Int64:
|
|
||||||
elem.SetInt(int64(int64(x)))
|
|
||||||
case reflect.Uint64:
|
|
||||||
elem.SetUint(uint64(x))
|
|
||||||
case reflect.Float64:
|
|
||||||
elem.SetFloat(float64(math.Float64frombits(x)))
|
|
||||||
}
|
}
|
||||||
|
return pointer{v: p.v.Elem().Elem().Elem().Field(0).Addr()} // *interface -> interface -> *struct -> struct
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p word64Slice) Len() int {
|
func (p pointer) asPointerTo(t reflect.Type) reflect.Value {
|
||||||
return p.v.Len()
|
// TODO: check that p.v.Type().Elem() == t?
|
||||||
|
return p.v
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p word64Slice) Index(i int) uint64 {
|
func atomicLoadUnmarshalInfo(p **unmarshalInfo) *unmarshalInfo {
|
||||||
elem := p.v.Index(i)
|
atomicLock.Lock()
|
||||||
switch elem.Kind() {
|
defer atomicLock.Unlock()
|
||||||
case reflect.Int64:
|
return *p
|
||||||
return uint64(elem.Int())
|
}
|
||||||
case reflect.Uint64:
|
func atomicStoreUnmarshalInfo(p **unmarshalInfo, v *unmarshalInfo) {
|
||||||
return uint64(elem.Uint())
|
atomicLock.Lock()
|
||||||
case reflect.Float64:
|
defer atomicLock.Unlock()
|
||||||
return math.Float64bits(float64(elem.Float()))
|
*p = v
|
||||||
}
|
}
|
||||||
panic("unreachable")
|
func atomicLoadMarshalInfo(p **marshalInfo) *marshalInfo {
|
||||||
|
atomicLock.Lock()
|
||||||
|
defer atomicLock.Unlock()
|
||||||
|
return *p
|
||||||
|
}
|
||||||
|
func atomicStoreMarshalInfo(p **marshalInfo, v *marshalInfo) {
|
||||||
|
atomicLock.Lock()
|
||||||
|
defer atomicLock.Unlock()
|
||||||
|
*p = v
|
||||||
|
}
|
||||||
|
func atomicLoadMergeInfo(p **mergeInfo) *mergeInfo {
|
||||||
|
atomicLock.Lock()
|
||||||
|
defer atomicLock.Unlock()
|
||||||
|
return *p
|
||||||
|
}
|
||||||
|
func atomicStoreMergeInfo(p **mergeInfo, v *mergeInfo) {
|
||||||
|
atomicLock.Lock()
|
||||||
|
defer atomicLock.Unlock()
|
||||||
|
*p = v
|
||||||
|
}
|
||||||
|
func atomicLoadDiscardInfo(p **discardInfo) *discardInfo {
|
||||||
|
atomicLock.Lock()
|
||||||
|
defer atomicLock.Unlock()
|
||||||
|
return *p
|
||||||
|
}
|
||||||
|
func atomicStoreDiscardInfo(p **discardInfo, v *discardInfo) {
|
||||||
|
atomicLock.Lock()
|
||||||
|
defer atomicLock.Unlock()
|
||||||
|
*p = v
|
||||||
}
|
}
|
||||||
|
|
||||||
func structPointer_Word64Slice(p structPointer, f field) word64Slice {
|
var atomicLock sync.Mutex
|
||||||
return word64Slice{structPointer_field(p, f)}
|
|
||||||
}
|
|
||||||
|
66
vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go
generated
vendored
66
vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
// Protocol Buffers for Go with Gadgets
|
// Protocol Buffers for Go with Gadgets
|
||||||
//
|
//
|
||||||
// Copyright (c) 2016, The GoGo Authors. All rights reserved.
|
// Copyright (c) 2018, The GoGo Authors. All rights reserved.
|
||||||
// http://github.com/gogo/protobuf
|
// http://github.com/gogo/protobuf
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
@ -26,7 +26,11 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
// +build appengine js
|
// +build purego appengine js
|
||||||
|
|
||||||
|
// This file contains an implementation of proto field accesses using package reflect.
|
||||||
|
// It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can
|
||||||
|
// be used on App Engine.
|
||||||
|
|
||||||
package proto
|
package proto
|
||||||
|
|
||||||
@ -34,52 +38,22 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
)
|
)
|
||||||
|
|
||||||
func structPointer_FieldPointer(p structPointer, f field) structPointer {
|
// TODO: untested, so probably incorrect.
|
||||||
panic("not implemented")
|
|
||||||
|
func (p pointer) getRef() pointer {
|
||||||
|
return pointer{v: p.v.Addr()}
|
||||||
}
|
}
|
||||||
|
|
||||||
func appendStructPointer(base structPointer, f field, typ reflect.Type) structPointer {
|
func (p pointer) appendRef(v pointer, typ reflect.Type) {
|
||||||
panic("not implemented")
|
slice := p.getSlice(typ)
|
||||||
|
elem := v.asPointerTo(typ).Elem()
|
||||||
|
newSlice := reflect.Append(slice, elem)
|
||||||
|
slice.Set(newSlice)
|
||||||
}
|
}
|
||||||
|
|
||||||
func structPointer_InterfaceAt(p structPointer, f field, t reflect.Type) interface{} {
|
func (p pointer) getSlice(typ reflect.Type) reflect.Value {
|
||||||
panic("not implemented")
|
sliceTyp := reflect.SliceOf(typ)
|
||||||
}
|
slice := p.asPointerTo(sliceTyp)
|
||||||
|
slice = slice.Elem()
|
||||||
func structPointer_InterfaceRef(p structPointer, f field, t reflect.Type) interface{} {
|
return slice
|
||||||
panic("not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func structPointer_GetRefStructPointer(p structPointer, f field) structPointer {
|
|
||||||
panic("not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func structPointer_Add(p structPointer, size field) structPointer {
|
|
||||||
panic("not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func structPointer_Len(p structPointer, f field) int {
|
|
||||||
panic("not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func structPointer_GetSliceHeader(p structPointer, f field) *reflect.SliceHeader {
|
|
||||||
panic("not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func structPointer_Copy(oldptr structPointer, newptr structPointer, size int) {
|
|
||||||
panic("not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func structPointer_StructRefSlice(p structPointer, f field, size uintptr) *structRefSlice {
|
|
||||||
panic("not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
type structRefSlice struct{}
|
|
||||||
|
|
||||||
func (v *structRefSlice) Len() int {
|
|
||||||
panic("not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
func (v *structRefSlice) Index(i int) structPointer {
|
|
||||||
panic("not implemented")
|
|
||||||
}
|
}
|
||||||
|
402
vendor/github.com/gogo/protobuf/proto/pointer_unsafe.go
generated
vendored
402
vendor/github.com/gogo/protobuf/proto/pointer_unsafe.go
generated
vendored
@ -29,7 +29,7 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
// +build !appengine,!js
|
// +build !purego,!appengine,!js
|
||||||
|
|
||||||
// This file contains the implementation of the proto field accesses using package unsafe.
|
// This file contains the implementation of the proto field accesses using package unsafe.
|
||||||
|
|
||||||
@ -37,38 +37,13 @@ package proto
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"sync/atomic"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NOTE: These type_Foo functions would more idiomatically be methods,
|
const unsafeAllowed = true
|
||||||
// but Go does not allow methods on pointer types, and we must preserve
|
|
||||||
// some pointer type for the garbage collector. We use these
|
|
||||||
// funcs with clunky names as our poor approximation to methods.
|
|
||||||
//
|
|
||||||
// An alternative would be
|
|
||||||
// type structPointer struct { p unsafe.Pointer }
|
|
||||||
// but that does not registerize as well.
|
|
||||||
|
|
||||||
// A structPointer is a pointer to a struct.
|
// A field identifies a field in a struct, accessible from a pointer.
|
||||||
type structPointer unsafe.Pointer
|
|
||||||
|
|
||||||
// toStructPointer returns a structPointer equivalent to the given reflect value.
|
|
||||||
func toStructPointer(v reflect.Value) structPointer {
|
|
||||||
return structPointer(unsafe.Pointer(v.Pointer()))
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsNil reports whether p is nil.
|
|
||||||
func structPointer_IsNil(p structPointer) bool {
|
|
||||||
return p == nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Interface returns the struct pointer, assumed to have element type t,
|
|
||||||
// as an interface value.
|
|
||||||
func structPointer_Interface(p structPointer, t reflect.Type) interface{} {
|
|
||||||
return reflect.NewAt(t, unsafe.Pointer(p)).Interface()
|
|
||||||
}
|
|
||||||
|
|
||||||
// A field identifies a field in a struct, accessible from a structPointer.
|
|
||||||
// In this implementation, a field is identified by its byte offset from the start of the struct.
|
// In this implementation, a field is identified by its byte offset from the start of the struct.
|
||||||
type field uintptr
|
type field uintptr
|
||||||
|
|
||||||
@ -80,191 +55,254 @@ func toField(f *reflect.StructField) field {
|
|||||||
// invalidField is an invalid field identifier.
|
// invalidField is an invalid field identifier.
|
||||||
const invalidField = ^field(0)
|
const invalidField = ^field(0)
|
||||||
|
|
||||||
|
// zeroField is a noop when calling pointer.offset.
|
||||||
|
const zeroField = field(0)
|
||||||
|
|
||||||
// IsValid reports whether the field identifier is valid.
|
// IsValid reports whether the field identifier is valid.
|
||||||
func (f field) IsValid() bool {
|
func (f field) IsValid() bool {
|
||||||
return f != ^field(0)
|
return f != invalidField
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bytes returns the address of a []byte field in the struct.
|
// The pointer type below is for the new table-driven encoder/decoder.
|
||||||
func structPointer_Bytes(p structPointer, f field) *[]byte {
|
// The implementation here uses unsafe.Pointer to create a generic pointer.
|
||||||
return (*[]byte)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
// In pointer_reflect.go we use reflect instead of unsafe to implement
|
||||||
|
// the same (but slower) interface.
|
||||||
|
type pointer struct {
|
||||||
|
p unsafe.Pointer
|
||||||
}
|
}
|
||||||
|
|
||||||
// BytesSlice returns the address of a [][]byte field in the struct.
|
// size of pointer
|
||||||
func structPointer_BytesSlice(p structPointer, f field) *[][]byte {
|
var ptrSize = unsafe.Sizeof(uintptr(0))
|
||||||
return (*[][]byte)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
|
||||||
|
// toPointer converts an interface of pointer type to a pointer
|
||||||
|
// that points to the same target.
|
||||||
|
func toPointer(i *Message) pointer {
|
||||||
|
// Super-tricky - read pointer out of data word of interface value.
|
||||||
|
// Saves ~25ns over the equivalent:
|
||||||
|
// return valToPointer(reflect.ValueOf(*i))
|
||||||
|
return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bool returns the address of a *bool field in the struct.
|
// toAddrPointer converts an interface to a pointer that points to
|
||||||
func structPointer_Bool(p structPointer, f field) **bool {
|
// the interface data.
|
||||||
return (**bool)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
func toAddrPointer(i *interface{}, isptr bool) pointer {
|
||||||
}
|
// Super-tricky - read or get the address of data word of interface value.
|
||||||
|
if isptr {
|
||||||
// BoolVal returns the address of a bool field in the struct.
|
// The interface is of pointer type, thus it is a direct interface.
|
||||||
func structPointer_BoolVal(p structPointer, f field) *bool {
|
// The data word is the pointer data itself. We take its address.
|
||||||
return (*bool)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
return pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)}
|
||||||
}
|
|
||||||
|
|
||||||
// BoolSlice returns the address of a []bool field in the struct.
|
|
||||||
func structPointer_BoolSlice(p structPointer, f field) *[]bool {
|
|
||||||
return (*[]bool)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// String returns the address of a *string field in the struct.
|
|
||||||
func structPointer_String(p structPointer, f field) **string {
|
|
||||||
return (**string)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// StringVal returns the address of a string field in the struct.
|
|
||||||
func structPointer_StringVal(p structPointer, f field) *string {
|
|
||||||
return (*string)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// StringSlice returns the address of a []string field in the struct.
|
|
||||||
func structPointer_StringSlice(p structPointer, f field) *[]string {
|
|
||||||
return (*[]string)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// ExtMap returns the address of an extension map field in the struct.
|
|
||||||
func structPointer_Extensions(p structPointer, f field) *XXX_InternalExtensions {
|
|
||||||
return (*XXX_InternalExtensions)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
|
||||||
}
|
|
||||||
|
|
||||||
func structPointer_ExtMap(p structPointer, f field) *map[int32]Extension {
|
|
||||||
return (*map[int32]Extension)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewAt returns the reflect.Value for a pointer to a field in the struct.
|
|
||||||
func structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value {
|
|
||||||
return reflect.NewAt(typ, unsafe.Pointer(uintptr(p)+uintptr(f)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetStructPointer writes a *struct field in the struct.
|
|
||||||
func structPointer_SetStructPointer(p structPointer, f field, q structPointer) {
|
|
||||||
*(*structPointer)(unsafe.Pointer(uintptr(p) + uintptr(f))) = q
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetStructPointer reads a *struct field in the struct.
|
|
||||||
func structPointer_GetStructPointer(p structPointer, f field) structPointer {
|
|
||||||
return *(*structPointer)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// StructPointerSlice the address of a []*struct field in the struct.
|
|
||||||
func structPointer_StructPointerSlice(p structPointer, f field) *structPointerSlice {
|
|
||||||
return (*structPointerSlice)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// A structPointerSlice represents a slice of pointers to structs (themselves submessages or groups).
|
|
||||||
type structPointerSlice []structPointer
|
|
||||||
|
|
||||||
func (v *structPointerSlice) Len() int { return len(*v) }
|
|
||||||
func (v *structPointerSlice) Index(i int) structPointer { return (*v)[i] }
|
|
||||||
func (v *structPointerSlice) Append(p structPointer) { *v = append(*v, p) }
|
|
||||||
|
|
||||||
// A word32 is the address of a "pointer to 32-bit value" field.
|
|
||||||
type word32 **uint32
|
|
||||||
|
|
||||||
// IsNil reports whether *v is nil.
|
|
||||||
func word32_IsNil(p word32) bool {
|
|
||||||
return *p == nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set sets *v to point at a newly allocated word set to x.
|
|
||||||
func word32_Set(p word32, o *Buffer, x uint32) {
|
|
||||||
if len(o.uint32s) == 0 {
|
|
||||||
o.uint32s = make([]uint32, uint32PoolSize)
|
|
||||||
}
|
}
|
||||||
o.uint32s[0] = x
|
// The interface is not of pointer type. The data word is the pointer
|
||||||
*p = &o.uint32s[0]
|
// to the data.
|
||||||
o.uint32s = o.uint32s[1:]
|
return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get gets the value pointed at by *v.
|
// valToPointer converts v to a pointer. v must be of pointer type.
|
||||||
func word32_Get(p word32) uint32 {
|
func valToPointer(v reflect.Value) pointer {
|
||||||
return **p
|
return pointer{p: unsafe.Pointer(v.Pointer())}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Word32 returns the address of a *int32, *uint32, *float32, or *enum field in the struct.
|
// offset converts from a pointer to a structure to a pointer to
|
||||||
func structPointer_Word32(p structPointer, f field) word32 {
|
// one of its fields.
|
||||||
return word32((**uint32)(unsafe.Pointer(uintptr(p) + uintptr(f))))
|
func (p pointer) offset(f field) pointer {
|
||||||
|
// For safety, we should panic if !f.IsValid, however calling panic causes
|
||||||
|
// this to no longer be inlineable, which is a serious performance cost.
|
||||||
|
/*
|
||||||
|
if !f.IsValid() {
|
||||||
|
panic("invalid field")
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
return pointer{p: unsafe.Pointer(uintptr(p.p) + uintptr(f))}
|
||||||
}
|
}
|
||||||
|
|
||||||
// A word32Val is the address of a 32-bit value field.
|
func (p pointer) isNil() bool {
|
||||||
type word32Val *uint32
|
return p.p == nil
|
||||||
|
|
||||||
// Set sets *p to x.
|
|
||||||
func word32Val_Set(p word32Val, x uint32) {
|
|
||||||
*p = x
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get gets the value pointed at by p.
|
func (p pointer) toInt64() *int64 {
|
||||||
func word32Val_Get(p word32Val) uint32 {
|
return (*int64)(p.p)
|
||||||
return *p
|
}
|
||||||
|
func (p pointer) toInt64Ptr() **int64 {
|
||||||
|
return (**int64)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toInt64Slice() *[]int64 {
|
||||||
|
return (*[]int64)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toInt32() *int32 {
|
||||||
|
return (*int32)(p.p)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Word32Val returns the address of a *int32, *uint32, *float32, or *enum field in the struct.
|
// See pointer_reflect.go for why toInt32Ptr/Slice doesn't exist.
|
||||||
func structPointer_Word32Val(p structPointer, f field) word32Val {
|
/*
|
||||||
return word32Val((*uint32)(unsafe.Pointer(uintptr(p) + uintptr(f))))
|
func (p pointer) toInt32Ptr() **int32 {
|
||||||
}
|
return (**int32)(p.p)
|
||||||
|
|
||||||
// A word32Slice is a slice of 32-bit values.
|
|
||||||
type word32Slice []uint32
|
|
||||||
|
|
||||||
func (v *word32Slice) Append(x uint32) { *v = append(*v, x) }
|
|
||||||
func (v *word32Slice) Len() int { return len(*v) }
|
|
||||||
func (v *word32Slice) Index(i int) uint32 { return (*v)[i] }
|
|
||||||
|
|
||||||
// Word32Slice returns the address of a []int32, []uint32, []float32, or []enum field in the struct.
|
|
||||||
func structPointer_Word32Slice(p structPointer, f field) *word32Slice {
|
|
||||||
return (*word32Slice)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// word64 is like word32 but for 64-bit values.
|
|
||||||
type word64 **uint64
|
|
||||||
|
|
||||||
func word64_Set(p word64, o *Buffer, x uint64) {
|
|
||||||
if len(o.uint64s) == 0 {
|
|
||||||
o.uint64s = make([]uint64, uint64PoolSize)
|
|
||||||
}
|
}
|
||||||
o.uint64s[0] = x
|
func (p pointer) toInt32Slice() *[]int32 {
|
||||||
*p = &o.uint64s[0]
|
return (*[]int32)(p.p)
|
||||||
o.uint64s = o.uint64s[1:]
|
}
|
||||||
|
*/
|
||||||
|
func (p pointer) getInt32Ptr() *int32 {
|
||||||
|
return *(**int32)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) setInt32Ptr(v int32) {
|
||||||
|
*(**int32)(p.p) = &v
|
||||||
}
|
}
|
||||||
|
|
||||||
func word64_IsNil(p word64) bool {
|
// getInt32Slice loads a []int32 from p.
|
||||||
return *p == nil
|
// The value returned is aliased with the original slice.
|
||||||
|
// This behavior differs from the implementation in pointer_reflect.go.
|
||||||
|
func (p pointer) getInt32Slice() []int32 {
|
||||||
|
return *(*[]int32)(p.p)
|
||||||
}
|
}
|
||||||
|
|
||||||
func word64_Get(p word64) uint64 {
|
// setInt32Slice stores a []int32 to p.
|
||||||
return **p
|
// The value set is aliased with the input slice.
|
||||||
|
// This behavior differs from the implementation in pointer_reflect.go.
|
||||||
|
func (p pointer) setInt32Slice(v []int32) {
|
||||||
|
*(*[]int32)(p.p) = v
|
||||||
}
|
}
|
||||||
|
|
||||||
func structPointer_Word64(p structPointer, f field) word64 {
|
// TODO: Can we get rid of appendInt32Slice and use setInt32Slice instead?
|
||||||
return word64((**uint64)(unsafe.Pointer(uintptr(p) + uintptr(f))))
|
func (p pointer) appendInt32Slice(v int32) {
|
||||||
|
s := (*[]int32)(p.p)
|
||||||
|
*s = append(*s, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// word64Val is like word32Val but for 64-bit values.
|
func (p pointer) toUint64() *uint64 {
|
||||||
type word64Val *uint64
|
return (*uint64)(p.p)
|
||||||
|
}
|
||||||
func word64Val_Set(p word64Val, o *Buffer, x uint64) {
|
func (p pointer) toUint64Ptr() **uint64 {
|
||||||
*p = x
|
return (**uint64)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toUint64Slice() *[]uint64 {
|
||||||
|
return (*[]uint64)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toUint32() *uint32 {
|
||||||
|
return (*uint32)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toUint32Ptr() **uint32 {
|
||||||
|
return (**uint32)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toUint32Slice() *[]uint32 {
|
||||||
|
return (*[]uint32)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toBool() *bool {
|
||||||
|
return (*bool)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toBoolPtr() **bool {
|
||||||
|
return (**bool)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toBoolSlice() *[]bool {
|
||||||
|
return (*[]bool)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toFloat64() *float64 {
|
||||||
|
return (*float64)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toFloat64Ptr() **float64 {
|
||||||
|
return (**float64)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toFloat64Slice() *[]float64 {
|
||||||
|
return (*[]float64)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toFloat32() *float32 {
|
||||||
|
return (*float32)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toFloat32Ptr() **float32 {
|
||||||
|
return (**float32)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toFloat32Slice() *[]float32 {
|
||||||
|
return (*[]float32)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toString() *string {
|
||||||
|
return (*string)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toStringPtr() **string {
|
||||||
|
return (**string)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toStringSlice() *[]string {
|
||||||
|
return (*[]string)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toBytes() *[]byte {
|
||||||
|
return (*[]byte)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toBytesSlice() *[][]byte {
|
||||||
|
return (*[][]byte)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toExtensions() *XXX_InternalExtensions {
|
||||||
|
return (*XXX_InternalExtensions)(p.p)
|
||||||
|
}
|
||||||
|
func (p pointer) toOldExtensions() *map[int32]Extension {
|
||||||
|
return (*map[int32]Extension)(p.p)
|
||||||
}
|
}
|
||||||
|
|
||||||
func word64Val_Get(p word64Val) uint64 {
|
// getPointerSlice loads []*T from p as a []pointer.
|
||||||
return *p
|
// The value returned is aliased with the original slice.
|
||||||
|
// This behavior differs from the implementation in pointer_reflect.go.
|
||||||
|
func (p pointer) getPointerSlice() []pointer {
|
||||||
|
// Super-tricky - p should point to a []*T where T is a
|
||||||
|
// message type. We load it as []pointer.
|
||||||
|
return *(*[]pointer)(p.p)
|
||||||
}
|
}
|
||||||
|
|
||||||
func structPointer_Word64Val(p structPointer, f field) word64Val {
|
// setPointerSlice stores []pointer into p as a []*T.
|
||||||
return word64Val((*uint64)(unsafe.Pointer(uintptr(p) + uintptr(f))))
|
// The value set is aliased with the input slice.
|
||||||
|
// This behavior differs from the implementation in pointer_reflect.go.
|
||||||
|
func (p pointer) setPointerSlice(v []pointer) {
|
||||||
|
// Super-tricky - p should point to a []*T where T is a
|
||||||
|
// message type. We store it as []pointer.
|
||||||
|
*(*[]pointer)(p.p) = v
|
||||||
}
|
}
|
||||||
|
|
||||||
// word64Slice is like word32Slice but for 64-bit values.
|
// getPointer loads the pointer at p and returns it.
|
||||||
type word64Slice []uint64
|
func (p pointer) getPointer() pointer {
|
||||||
|
return pointer{p: *(*unsafe.Pointer)(p.p)}
|
||||||
func (v *word64Slice) Append(x uint64) { *v = append(*v, x) }
|
}
|
||||||
func (v *word64Slice) Len() int { return len(*v) }
|
|
||||||
func (v *word64Slice) Index(i int) uint64 { return (*v)[i] }
|
// setPointer stores the pointer q at p.
|
||||||
|
func (p pointer) setPointer(q pointer) {
|
||||||
func structPointer_Word64Slice(p structPointer, f field) *word64Slice {
|
*(*unsafe.Pointer)(p.p) = q.p
|
||||||
return (*word64Slice)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
}
|
||||||
|
|
||||||
|
// append q to the slice pointed to by p.
|
||||||
|
func (p pointer) appendPointer(q pointer) {
|
||||||
|
s := (*[]unsafe.Pointer)(p.p)
|
||||||
|
*s = append(*s, q.p)
|
||||||
|
}
|
||||||
|
|
||||||
|
// getInterfacePointer returns a pointer that points to the
|
||||||
|
// interface data of the interface pointed by p.
|
||||||
|
func (p pointer) getInterfacePointer() pointer {
|
||||||
|
// Super-tricky - read pointer out of data word of interface value.
|
||||||
|
return pointer{p: (*(*[2]unsafe.Pointer)(p.p))[1]}
|
||||||
|
}
|
||||||
|
|
||||||
|
// asPointerTo returns a reflect.Value that is a pointer to an
|
||||||
|
// object of type t stored at p.
|
||||||
|
func (p pointer) asPointerTo(t reflect.Type) reflect.Value {
|
||||||
|
return reflect.NewAt(t, p.p)
|
||||||
|
}
|
||||||
|
|
||||||
|
func atomicLoadUnmarshalInfo(p **unmarshalInfo) *unmarshalInfo {
|
||||||
|
return (*unmarshalInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p))))
|
||||||
|
}
|
||||||
|
func atomicStoreUnmarshalInfo(p **unmarshalInfo, v *unmarshalInfo) {
|
||||||
|
atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v))
|
||||||
|
}
|
||||||
|
func atomicLoadMarshalInfo(p **marshalInfo) *marshalInfo {
|
||||||
|
return (*marshalInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p))))
|
||||||
|
}
|
||||||
|
func atomicStoreMarshalInfo(p **marshalInfo, v *marshalInfo) {
|
||||||
|
atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v))
|
||||||
|
}
|
||||||
|
func atomicLoadMergeInfo(p **mergeInfo) *mergeInfo {
|
||||||
|
return (*mergeInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p))))
|
||||||
|
}
|
||||||
|
func atomicStoreMergeInfo(p **mergeInfo, v *mergeInfo) {
|
||||||
|
atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v))
|
||||||
|
}
|
||||||
|
func atomicLoadDiscardInfo(p **discardInfo) *discardInfo {
|
||||||
|
return (*discardInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p))))
|
||||||
|
}
|
||||||
|
func atomicStoreDiscardInfo(p **discardInfo, v *discardInfo) {
|
||||||
|
atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v))
|
||||||
}
|
}
|
||||||
|
100
vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go
generated
vendored
100
vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
// Protocol Buffers for Go with Gadgets
|
// Protocol Buffers for Go with Gadgets
|
||||||
//
|
//
|
||||||
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
|
// Copyright (c) 2018, The GoGo Authors. All rights reserved.
|
||||||
// http://github.com/gogo/protobuf
|
// http://github.com/gogo/protobuf
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
@ -26,7 +26,7 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
// +build !appengine,!js
|
// +build !purego,!appengine,!js
|
||||||
|
|
||||||
// This file contains the implementation of the proto field accesses using package unsafe.
|
// This file contains the implementation of the proto field accesses using package unsafe.
|
||||||
|
|
||||||
@ -37,92 +37,20 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func structPointer_InterfaceAt(p structPointer, f field, t reflect.Type) interface{} {
|
func (p pointer) getRef() pointer {
|
||||||
point := unsafe.Pointer(uintptr(p) + uintptr(f))
|
return pointer{p: (unsafe.Pointer)(&p.p)}
|
||||||
r := reflect.NewAt(t, point)
|
|
||||||
return r.Interface()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func structPointer_InterfaceRef(p structPointer, f field, t reflect.Type) interface{} {
|
func (p pointer) appendRef(v pointer, typ reflect.Type) {
|
||||||
point := unsafe.Pointer(uintptr(p) + uintptr(f))
|
slice := p.getSlice(typ)
|
||||||
r := reflect.NewAt(t, point)
|
elem := v.asPointerTo(typ).Elem()
|
||||||
if r.Elem().IsNil() {
|
newSlice := reflect.Append(slice, elem)
|
||||||
return nil
|
slice.Set(newSlice)
|
||||||
}
|
|
||||||
return r.Elem().Interface()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func copyUintPtr(oldptr, newptr uintptr, size int) {
|
func (p pointer) getSlice(typ reflect.Type) reflect.Value {
|
||||||
oldbytes := make([]byte, 0)
|
sliceTyp := reflect.SliceOf(typ)
|
||||||
oldslice := (*reflect.SliceHeader)(unsafe.Pointer(&oldbytes))
|
slice := p.asPointerTo(sliceTyp)
|
||||||
oldslice.Data = oldptr
|
slice = slice.Elem()
|
||||||
oldslice.Len = size
|
return slice
|
||||||
oldslice.Cap = size
|
|
||||||
newbytes := make([]byte, 0)
|
|
||||||
newslice := (*reflect.SliceHeader)(unsafe.Pointer(&newbytes))
|
|
||||||
newslice.Data = newptr
|
|
||||||
newslice.Len = size
|
|
||||||
newslice.Cap = size
|
|
||||||
copy(newbytes, oldbytes)
|
|
||||||
}
|
|
||||||
|
|
||||||
func structPointer_Copy(oldptr structPointer, newptr structPointer, size int) {
|
|
||||||
copyUintPtr(uintptr(oldptr), uintptr(newptr), size)
|
|
||||||
}
|
|
||||||
|
|
||||||
func appendStructPointer(base structPointer, f field, typ reflect.Type) structPointer {
|
|
||||||
size := typ.Elem().Size()
|
|
||||||
|
|
||||||
oldHeader := structPointer_GetSliceHeader(base, f)
|
|
||||||
oldSlice := reflect.NewAt(typ, unsafe.Pointer(oldHeader)).Elem()
|
|
||||||
newLen := oldHeader.Len + 1
|
|
||||||
newSlice := reflect.MakeSlice(typ, newLen, newLen)
|
|
||||||
reflect.Copy(newSlice, oldSlice)
|
|
||||||
bas := toStructPointer(newSlice)
|
|
||||||
oldHeader.Data = uintptr(bas)
|
|
||||||
oldHeader.Len = newLen
|
|
||||||
oldHeader.Cap = newLen
|
|
||||||
|
|
||||||
return structPointer(unsafe.Pointer(uintptr(unsafe.Pointer(bas)) + uintptr(uintptr(newLen-1)*size)))
|
|
||||||
}
|
|
||||||
|
|
||||||
func structPointer_FieldPointer(p structPointer, f field) structPointer {
|
|
||||||
return structPointer(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
|
||||||
}
|
|
||||||
|
|
||||||
func structPointer_GetRefStructPointer(p structPointer, f field) structPointer {
|
|
||||||
return structPointer((*structPointer)(unsafe.Pointer(uintptr(p) + uintptr(f))))
|
|
||||||
}
|
|
||||||
|
|
||||||
func structPointer_GetSliceHeader(p structPointer, f field) *reflect.SliceHeader {
|
|
||||||
return (*reflect.SliceHeader)(unsafe.Pointer(uintptr(p) + uintptr(f)))
|
|
||||||
}
|
|
||||||
|
|
||||||
func structPointer_Add(p structPointer, size field) structPointer {
|
|
||||||
return structPointer(unsafe.Pointer(uintptr(p) + uintptr(size)))
|
|
||||||
}
|
|
||||||
|
|
||||||
func structPointer_Len(p structPointer, f field) int {
|
|
||||||
return len(*(*[]interface{})(unsafe.Pointer(structPointer_GetRefStructPointer(p, f))))
|
|
||||||
}
|
|
||||||
|
|
||||||
func structPointer_StructRefSlice(p structPointer, f field, size uintptr) *structRefSlice {
|
|
||||||
return &structRefSlice{p: p, f: f, size: size}
|
|
||||||
}
|
|
||||||
|
|
||||||
// A structRefSlice represents a slice of structs (themselves submessages or groups).
|
|
||||||
type structRefSlice struct {
|
|
||||||
p structPointer
|
|
||||||
f field
|
|
||||||
size uintptr
|
|
||||||
}
|
|
||||||
|
|
||||||
func (v *structRefSlice) Len() int {
|
|
||||||
return structPointer_Len(v.p, v.f)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (v *structRefSlice) Index(i int) structPointer {
|
|
||||||
ss := structPointer_GetStructPointer(v.p, v.f)
|
|
||||||
ss1 := structPointer_GetRefStructPointer(ss, 0)
|
|
||||||
return structPointer_Add(ss1, field(uintptr(i)*v.size))
|
|
||||||
}
|
}
|
||||||
|
508
vendor/github.com/gogo/protobuf/proto/properties.go
generated
vendored
508
vendor/github.com/gogo/protobuf/proto/properties.go
generated
vendored
@ -63,42 +63,6 @@ const (
|
|||||||
WireFixed32 = 5
|
WireFixed32 = 5
|
||||||
)
|
)
|
||||||
|
|
||||||
const startSize = 10 // initial slice/string sizes
|
|
||||||
|
|
||||||
// Encoders are defined in encode.go
|
|
||||||
// An encoder outputs the full representation of a field, including its
|
|
||||||
// tag and encoder type.
|
|
||||||
type encoder func(p *Buffer, prop *Properties, base structPointer) error
|
|
||||||
|
|
||||||
// A valueEncoder encodes a single integer in a particular encoding.
|
|
||||||
type valueEncoder func(o *Buffer, x uint64) error
|
|
||||||
|
|
||||||
// Sizers are defined in encode.go
|
|
||||||
// A sizer returns the encoded size of a field, including its tag and encoder
|
|
||||||
// type.
|
|
||||||
type sizer func(prop *Properties, base structPointer) int
|
|
||||||
|
|
||||||
// A valueSizer returns the encoded size of a single integer in a particular
|
|
||||||
// encoding.
|
|
||||||
type valueSizer func(x uint64) int
|
|
||||||
|
|
||||||
// Decoders are defined in decode.go
|
|
||||||
// A decoder creates a value from its wire representation.
|
|
||||||
// Unrecognized subelements are saved in unrec.
|
|
||||||
type decoder func(p *Buffer, prop *Properties, base structPointer) error
|
|
||||||
|
|
||||||
// A valueDecoder decodes a single integer in a particular encoding.
|
|
||||||
type valueDecoder func(o *Buffer) (x uint64, err error)
|
|
||||||
|
|
||||||
// A oneofMarshaler does the marshaling for all oneof fields in a message.
|
|
||||||
type oneofMarshaler func(Message, *Buffer) error
|
|
||||||
|
|
||||||
// A oneofUnmarshaler does the unmarshaling for a oneof field in a message.
|
|
||||||
type oneofUnmarshaler func(Message, int, int, *Buffer) (bool, error)
|
|
||||||
|
|
||||||
// A oneofSizer does the sizing for all oneof fields in a message.
|
|
||||||
type oneofSizer func(Message) int
|
|
||||||
|
|
||||||
// tagMap is an optimization over map[int]int for typical protocol buffer
|
// tagMap is an optimization over map[int]int for typical protocol buffer
|
||||||
// use-cases. Encoded protocol buffers are often in tag order with small tag
|
// use-cases. Encoded protocol buffers are often in tag order with small tag
|
||||||
// numbers.
|
// numbers.
|
||||||
@ -145,13 +109,6 @@ type StructProperties struct {
|
|||||||
decoderTags tagMap // map from proto tag to struct field number
|
decoderTags tagMap // map from proto tag to struct field number
|
||||||
decoderOrigNames map[string]int // map from original name to struct field number
|
decoderOrigNames map[string]int // map from original name to struct field number
|
||||||
order []int // list of struct field numbers in tag order
|
order []int // list of struct field numbers in tag order
|
||||||
unrecField field // field id of the XXX_unrecognized []byte field
|
|
||||||
extendable bool // is this an extendable proto
|
|
||||||
|
|
||||||
oneofMarshaler oneofMarshaler
|
|
||||||
oneofUnmarshaler oneofUnmarshaler
|
|
||||||
oneofSizer oneofSizer
|
|
||||||
stype reflect.Type
|
|
||||||
|
|
||||||
// OneofTypes contains information about the oneof fields in this message.
|
// OneofTypes contains information about the oneof fields in this message.
|
||||||
// It is keyed by the original name of a field.
|
// It is keyed by the original name of a field.
|
||||||
@ -187,7 +144,7 @@ type Properties struct {
|
|||||||
Repeated bool
|
Repeated bool
|
||||||
Packed bool // relevant for repeated primitives only
|
Packed bool // relevant for repeated primitives only
|
||||||
Enum string // set for enum types only
|
Enum string // set for enum types only
|
||||||
proto3 bool // whether this is known to be a proto3 field; set for []byte only
|
proto3 bool // whether this is known to be a proto3 field
|
||||||
oneof bool // whether this is a oneof field
|
oneof bool // whether this is a oneof field
|
||||||
|
|
||||||
Default string // default value
|
Default string // default value
|
||||||
@ -196,37 +153,21 @@ type Properties struct {
|
|||||||
CastType string
|
CastType string
|
||||||
StdTime bool
|
StdTime bool
|
||||||
StdDuration bool
|
StdDuration bool
|
||||||
|
WktPointer bool
|
||||||
|
|
||||||
enc encoder
|
stype reflect.Type // set for struct types only
|
||||||
valEnc valueEncoder // set for bool and numeric types only
|
ctype reflect.Type // set for custom types only
|
||||||
field field
|
sprop *StructProperties // set for struct types only
|
||||||
tagcode []byte // encoding of EncodeVarint((Tag<<3)|WireType)
|
|
||||||
tagbuf [8]byte
|
|
||||||
stype reflect.Type // set for struct types only
|
|
||||||
sstype reflect.Type // set for slices of structs types only
|
|
||||||
ctype reflect.Type // set for custom types only
|
|
||||||
sprop *StructProperties // set for struct types only
|
|
||||||
isMarshaler bool
|
|
||||||
isUnmarshaler bool
|
|
||||||
|
|
||||||
mtype reflect.Type // set for map types only
|
mtype reflect.Type // set for map types only
|
||||||
mkeyprop *Properties // set for map types only
|
MapKeyProp *Properties // set for map types only
|
||||||
mvalprop *Properties // set for map types only
|
MapValProp *Properties // set for map types only
|
||||||
|
|
||||||
size sizer
|
|
||||||
valSize valueSizer // set for bool and numeric types only
|
|
||||||
|
|
||||||
dec decoder
|
|
||||||
valDec valueDecoder // set for bool and numeric types only
|
|
||||||
|
|
||||||
// If this is a packable field, this will be the decoder for the packed version of the field.
|
|
||||||
packedDec decoder
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// String formats the properties in the protobuf struct field tag style.
|
// String formats the properties in the protobuf struct field tag style.
|
||||||
func (p *Properties) String() string {
|
func (p *Properties) String() string {
|
||||||
s := p.Wire
|
s := p.Wire
|
||||||
s = ","
|
s += ","
|
||||||
s += strconv.Itoa(p.Tag)
|
s += strconv.Itoa(p.Tag)
|
||||||
if p.Required {
|
if p.Required {
|
||||||
s += ",req"
|
s += ",req"
|
||||||
@ -272,29 +213,14 @@ func (p *Properties) Parse(s string) {
|
|||||||
switch p.Wire {
|
switch p.Wire {
|
||||||
case "varint":
|
case "varint":
|
||||||
p.WireType = WireVarint
|
p.WireType = WireVarint
|
||||||
p.valEnc = (*Buffer).EncodeVarint
|
|
||||||
p.valDec = (*Buffer).DecodeVarint
|
|
||||||
p.valSize = sizeVarint
|
|
||||||
case "fixed32":
|
case "fixed32":
|
||||||
p.WireType = WireFixed32
|
p.WireType = WireFixed32
|
||||||
p.valEnc = (*Buffer).EncodeFixed32
|
|
||||||
p.valDec = (*Buffer).DecodeFixed32
|
|
||||||
p.valSize = sizeFixed32
|
|
||||||
case "fixed64":
|
case "fixed64":
|
||||||
p.WireType = WireFixed64
|
p.WireType = WireFixed64
|
||||||
p.valEnc = (*Buffer).EncodeFixed64
|
|
||||||
p.valDec = (*Buffer).DecodeFixed64
|
|
||||||
p.valSize = sizeFixed64
|
|
||||||
case "zigzag32":
|
case "zigzag32":
|
||||||
p.WireType = WireVarint
|
p.WireType = WireVarint
|
||||||
p.valEnc = (*Buffer).EncodeZigzag32
|
|
||||||
p.valDec = (*Buffer).DecodeZigzag32
|
|
||||||
p.valSize = sizeZigzag32
|
|
||||||
case "zigzag64":
|
case "zigzag64":
|
||||||
p.WireType = WireVarint
|
p.WireType = WireVarint
|
||||||
p.valEnc = (*Buffer).EncodeZigzag64
|
|
||||||
p.valDec = (*Buffer).DecodeZigzag64
|
|
||||||
p.valSize = sizeZigzag64
|
|
||||||
case "bytes", "group":
|
case "bytes", "group":
|
||||||
p.WireType = WireBytes
|
p.WireType = WireBytes
|
||||||
// no numeric converter for non-numeric types
|
// no numeric converter for non-numeric types
|
||||||
@ -309,6 +235,7 @@ func (p *Properties) Parse(s string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
outer:
|
||||||
for i := 2; i < len(fields); i++ {
|
for i := 2; i < len(fields); i++ {
|
||||||
f := fields[i]
|
f := fields[i]
|
||||||
switch {
|
switch {
|
||||||
@ -336,7 +263,7 @@ func (p *Properties) Parse(s string) {
|
|||||||
if i+1 < len(fields) {
|
if i+1 < len(fields) {
|
||||||
// Commas aren't escaped, and def is always last.
|
// Commas aren't escaped, and def is always last.
|
||||||
p.Default += "," + strings.Join(fields[i+1:], ",")
|
p.Default += "," + strings.Join(fields[i+1:], ",")
|
||||||
break
|
break outer
|
||||||
}
|
}
|
||||||
case strings.HasPrefix(f, "embedded="):
|
case strings.HasPrefix(f, "embedded="):
|
||||||
p.OrigName = strings.Split(f, "=")[1]
|
p.OrigName = strings.Split(f, "=")[1]
|
||||||
@ -348,301 +275,58 @@ func (p *Properties) Parse(s string) {
|
|||||||
p.StdTime = true
|
p.StdTime = true
|
||||||
case f == "stdduration":
|
case f == "stdduration":
|
||||||
p.StdDuration = true
|
p.StdDuration = true
|
||||||
|
case f == "wktptr":
|
||||||
|
p.WktPointer = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func logNoSliceEnc(t1, t2 reflect.Type) {
|
|
||||||
fmt.Fprintf(os.Stderr, "proto: no slice oenc for %T = []%T\n", t1, t2)
|
|
||||||
}
|
|
||||||
|
|
||||||
var protoMessageType = reflect.TypeOf((*Message)(nil)).Elem()
|
var protoMessageType = reflect.TypeOf((*Message)(nil)).Elem()
|
||||||
|
|
||||||
// Initialize the fields for encoding and decoding.
|
// setFieldProps initializes the field properties for submessages and maps.
|
||||||
func (p *Properties) setEncAndDec(typ reflect.Type, f *reflect.StructField, lockGetProp bool) {
|
func (p *Properties) setFieldProps(typ reflect.Type, f *reflect.StructField, lockGetProp bool) {
|
||||||
p.enc = nil
|
|
||||||
p.dec = nil
|
|
||||||
p.size = nil
|
|
||||||
isMap := typ.Kind() == reflect.Map
|
isMap := typ.Kind() == reflect.Map
|
||||||
if len(p.CustomType) > 0 && !isMap {
|
if len(p.CustomType) > 0 && !isMap {
|
||||||
p.setCustomEncAndDec(typ)
|
p.ctype = typ
|
||||||
p.setTag(lockGetProp)
|
p.setTag(lockGetProp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if p.StdTime && !isMap {
|
if p.StdTime && !isMap {
|
||||||
p.setTimeEncAndDec(typ)
|
|
||||||
p.setTag(lockGetProp)
|
p.setTag(lockGetProp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if p.StdDuration && !isMap {
|
if p.StdDuration && !isMap {
|
||||||
p.setDurationEncAndDec(typ)
|
p.setTag(lockGetProp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if p.WktPointer && !isMap {
|
||||||
p.setTag(lockGetProp)
|
p.setTag(lockGetProp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
switch t1 := typ; t1.Kind() {
|
switch t1 := typ; t1.Kind() {
|
||||||
default:
|
|
||||||
fmt.Fprintf(os.Stderr, "proto: no coders for %v\n", t1)
|
|
||||||
|
|
||||||
// proto3 scalar types
|
|
||||||
|
|
||||||
case reflect.Bool:
|
|
||||||
if p.proto3 {
|
|
||||||
p.enc = (*Buffer).enc_proto3_bool
|
|
||||||
p.dec = (*Buffer).dec_proto3_bool
|
|
||||||
p.size = size_proto3_bool
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_ref_bool
|
|
||||||
p.dec = (*Buffer).dec_proto3_bool
|
|
||||||
p.size = size_ref_bool
|
|
||||||
}
|
|
||||||
case reflect.Int32:
|
|
||||||
if p.proto3 {
|
|
||||||
p.enc = (*Buffer).enc_proto3_int32
|
|
||||||
p.dec = (*Buffer).dec_proto3_int32
|
|
||||||
p.size = size_proto3_int32
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_ref_int32
|
|
||||||
p.dec = (*Buffer).dec_proto3_int32
|
|
||||||
p.size = size_ref_int32
|
|
||||||
}
|
|
||||||
case reflect.Uint32:
|
|
||||||
if p.proto3 {
|
|
||||||
p.enc = (*Buffer).enc_proto3_uint32
|
|
||||||
p.dec = (*Buffer).dec_proto3_int32 // can reuse
|
|
||||||
p.size = size_proto3_uint32
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_ref_uint32
|
|
||||||
p.dec = (*Buffer).dec_proto3_int32 // can reuse
|
|
||||||
p.size = size_ref_uint32
|
|
||||||
}
|
|
||||||
case reflect.Int64, reflect.Uint64:
|
|
||||||
if p.proto3 {
|
|
||||||
p.enc = (*Buffer).enc_proto3_int64
|
|
||||||
p.dec = (*Buffer).dec_proto3_int64
|
|
||||||
p.size = size_proto3_int64
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_ref_int64
|
|
||||||
p.dec = (*Buffer).dec_proto3_int64
|
|
||||||
p.size = size_ref_int64
|
|
||||||
}
|
|
||||||
case reflect.Float32:
|
|
||||||
if p.proto3 {
|
|
||||||
p.enc = (*Buffer).enc_proto3_uint32 // can just treat them as bits
|
|
||||||
p.dec = (*Buffer).dec_proto3_int32
|
|
||||||
p.size = size_proto3_uint32
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_ref_uint32 // can just treat them as bits
|
|
||||||
p.dec = (*Buffer).dec_proto3_int32
|
|
||||||
p.size = size_ref_uint32
|
|
||||||
}
|
|
||||||
case reflect.Float64:
|
|
||||||
if p.proto3 {
|
|
||||||
p.enc = (*Buffer).enc_proto3_int64 // can just treat them as bits
|
|
||||||
p.dec = (*Buffer).dec_proto3_int64
|
|
||||||
p.size = size_proto3_int64
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_ref_int64 // can just treat them as bits
|
|
||||||
p.dec = (*Buffer).dec_proto3_int64
|
|
||||||
p.size = size_ref_int64
|
|
||||||
}
|
|
||||||
case reflect.String:
|
|
||||||
if p.proto3 {
|
|
||||||
p.enc = (*Buffer).enc_proto3_string
|
|
||||||
p.dec = (*Buffer).dec_proto3_string
|
|
||||||
p.size = size_proto3_string
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_ref_string
|
|
||||||
p.dec = (*Buffer).dec_proto3_string
|
|
||||||
p.size = size_ref_string
|
|
||||||
}
|
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
p.stype = typ
|
p.stype = typ
|
||||||
p.isMarshaler = isMarshaler(typ)
|
|
||||||
p.isUnmarshaler = isUnmarshaler(typ)
|
|
||||||
if p.Wire == "bytes" {
|
|
||||||
p.enc = (*Buffer).enc_ref_struct_message
|
|
||||||
p.dec = (*Buffer).dec_ref_struct_message
|
|
||||||
p.size = size_ref_struct_message
|
|
||||||
} else {
|
|
||||||
fmt.Fprintf(os.Stderr, "proto: no coders for struct %T\n", typ)
|
|
||||||
}
|
|
||||||
|
|
||||||
case reflect.Ptr:
|
case reflect.Ptr:
|
||||||
switch t2 := t1.Elem(); t2.Kind() {
|
if t1.Elem().Kind() == reflect.Struct {
|
||||||
default:
|
|
||||||
fmt.Fprintf(os.Stderr, "proto: no encoder function for %v -> %v\n", t1, t2)
|
|
||||||
break
|
|
||||||
case reflect.Bool:
|
|
||||||
p.enc = (*Buffer).enc_bool
|
|
||||||
p.dec = (*Buffer).dec_bool
|
|
||||||
p.size = size_bool
|
|
||||||
case reflect.Int32:
|
|
||||||
p.enc = (*Buffer).enc_int32
|
|
||||||
p.dec = (*Buffer).dec_int32
|
|
||||||
p.size = size_int32
|
|
||||||
case reflect.Uint32:
|
|
||||||
p.enc = (*Buffer).enc_uint32
|
|
||||||
p.dec = (*Buffer).dec_int32 // can reuse
|
|
||||||
p.size = size_uint32
|
|
||||||
case reflect.Int64, reflect.Uint64:
|
|
||||||
p.enc = (*Buffer).enc_int64
|
|
||||||
p.dec = (*Buffer).dec_int64
|
|
||||||
p.size = size_int64
|
|
||||||
case reflect.Float32:
|
|
||||||
p.enc = (*Buffer).enc_uint32 // can just treat them as bits
|
|
||||||
p.dec = (*Buffer).dec_int32
|
|
||||||
p.size = size_uint32
|
|
||||||
case reflect.Float64:
|
|
||||||
p.enc = (*Buffer).enc_int64 // can just treat them as bits
|
|
||||||
p.dec = (*Buffer).dec_int64
|
|
||||||
p.size = size_int64
|
|
||||||
case reflect.String:
|
|
||||||
p.enc = (*Buffer).enc_string
|
|
||||||
p.dec = (*Buffer).dec_string
|
|
||||||
p.size = size_string
|
|
||||||
case reflect.Struct:
|
|
||||||
p.stype = t1.Elem()
|
p.stype = t1.Elem()
|
||||||
p.isMarshaler = isMarshaler(t1)
|
|
||||||
p.isUnmarshaler = isUnmarshaler(t1)
|
|
||||||
if p.Wire == "bytes" {
|
|
||||||
p.enc = (*Buffer).enc_struct_message
|
|
||||||
p.dec = (*Buffer).dec_struct_message
|
|
||||||
p.size = size_struct_message
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_struct_group
|
|
||||||
p.dec = (*Buffer).dec_struct_group
|
|
||||||
p.size = size_struct_group
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case reflect.Slice:
|
case reflect.Slice:
|
||||||
switch t2 := t1.Elem(); t2.Kind() {
|
switch t2 := t1.Elem(); t2.Kind() {
|
||||||
default:
|
|
||||||
logNoSliceEnc(t1, t2)
|
|
||||||
break
|
|
||||||
case reflect.Bool:
|
|
||||||
if p.Packed {
|
|
||||||
p.enc = (*Buffer).enc_slice_packed_bool
|
|
||||||
p.size = size_slice_packed_bool
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_slice_bool
|
|
||||||
p.size = size_slice_bool
|
|
||||||
}
|
|
||||||
p.dec = (*Buffer).dec_slice_bool
|
|
||||||
p.packedDec = (*Buffer).dec_slice_packed_bool
|
|
||||||
case reflect.Int32:
|
|
||||||
if p.Packed {
|
|
||||||
p.enc = (*Buffer).enc_slice_packed_int32
|
|
||||||
p.size = size_slice_packed_int32
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_slice_int32
|
|
||||||
p.size = size_slice_int32
|
|
||||||
}
|
|
||||||
p.dec = (*Buffer).dec_slice_int32
|
|
||||||
p.packedDec = (*Buffer).dec_slice_packed_int32
|
|
||||||
case reflect.Uint32:
|
|
||||||
if p.Packed {
|
|
||||||
p.enc = (*Buffer).enc_slice_packed_uint32
|
|
||||||
p.size = size_slice_packed_uint32
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_slice_uint32
|
|
||||||
p.size = size_slice_uint32
|
|
||||||
}
|
|
||||||
p.dec = (*Buffer).dec_slice_int32
|
|
||||||
p.packedDec = (*Buffer).dec_slice_packed_int32
|
|
||||||
case reflect.Int64, reflect.Uint64:
|
|
||||||
if p.Packed {
|
|
||||||
p.enc = (*Buffer).enc_slice_packed_int64
|
|
||||||
p.size = size_slice_packed_int64
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_slice_int64
|
|
||||||
p.size = size_slice_int64
|
|
||||||
}
|
|
||||||
p.dec = (*Buffer).dec_slice_int64
|
|
||||||
p.packedDec = (*Buffer).dec_slice_packed_int64
|
|
||||||
case reflect.Uint8:
|
|
||||||
p.dec = (*Buffer).dec_slice_byte
|
|
||||||
if p.proto3 {
|
|
||||||
p.enc = (*Buffer).enc_proto3_slice_byte
|
|
||||||
p.size = size_proto3_slice_byte
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_slice_byte
|
|
||||||
p.size = size_slice_byte
|
|
||||||
}
|
|
||||||
case reflect.Float32, reflect.Float64:
|
|
||||||
switch t2.Bits() {
|
|
||||||
case 32:
|
|
||||||
// can just treat them as bits
|
|
||||||
if p.Packed {
|
|
||||||
p.enc = (*Buffer).enc_slice_packed_uint32
|
|
||||||
p.size = size_slice_packed_uint32
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_slice_uint32
|
|
||||||
p.size = size_slice_uint32
|
|
||||||
}
|
|
||||||
p.dec = (*Buffer).dec_slice_int32
|
|
||||||
p.packedDec = (*Buffer).dec_slice_packed_int32
|
|
||||||
case 64:
|
|
||||||
// can just treat them as bits
|
|
||||||
if p.Packed {
|
|
||||||
p.enc = (*Buffer).enc_slice_packed_int64
|
|
||||||
p.size = size_slice_packed_int64
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_slice_int64
|
|
||||||
p.size = size_slice_int64
|
|
||||||
}
|
|
||||||
p.dec = (*Buffer).dec_slice_int64
|
|
||||||
p.packedDec = (*Buffer).dec_slice_packed_int64
|
|
||||||
default:
|
|
||||||
logNoSliceEnc(t1, t2)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
case reflect.String:
|
|
||||||
p.enc = (*Buffer).enc_slice_string
|
|
||||||
p.dec = (*Buffer).dec_slice_string
|
|
||||||
p.size = size_slice_string
|
|
||||||
case reflect.Ptr:
|
case reflect.Ptr:
|
||||||
switch t3 := t2.Elem(); t3.Kind() {
|
switch t3 := t2.Elem(); t3.Kind() {
|
||||||
default:
|
|
||||||
fmt.Fprintf(os.Stderr, "proto: no ptr oenc for %T -> %T -> %T\n", t1, t2, t3)
|
|
||||||
break
|
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
p.stype = t2.Elem()
|
p.stype = t3
|
||||||
p.isMarshaler = isMarshaler(t2)
|
|
||||||
p.isUnmarshaler = isUnmarshaler(t2)
|
|
||||||
if p.Wire == "bytes" {
|
|
||||||
p.enc = (*Buffer).enc_slice_struct_message
|
|
||||||
p.dec = (*Buffer).dec_slice_struct_message
|
|
||||||
p.size = size_slice_struct_message
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_slice_struct_group
|
|
||||||
p.dec = (*Buffer).dec_slice_struct_group
|
|
||||||
p.size = size_slice_struct_group
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case reflect.Slice:
|
|
||||||
switch t2.Elem().Kind() {
|
|
||||||
default:
|
|
||||||
fmt.Fprintf(os.Stderr, "proto: no slice elem oenc for %T -> %T -> %T\n", t1, t2, t2.Elem())
|
|
||||||
break
|
|
||||||
case reflect.Uint8:
|
|
||||||
p.enc = (*Buffer).enc_slice_slice_byte
|
|
||||||
p.dec = (*Buffer).dec_slice_slice_byte
|
|
||||||
p.size = size_slice_slice_byte
|
|
||||||
}
|
}
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
p.setSliceOfNonPointerStructs(t1)
|
p.stype = t2
|
||||||
}
|
}
|
||||||
|
|
||||||
case reflect.Map:
|
case reflect.Map:
|
||||||
p.enc = (*Buffer).enc_new_map
|
|
||||||
p.dec = (*Buffer).dec_new_map
|
|
||||||
p.size = size_new_map
|
|
||||||
|
|
||||||
p.mtype = t1
|
p.mtype = t1
|
||||||
p.mkeyprop = &Properties{}
|
p.MapKeyProp = &Properties{}
|
||||||
p.mkeyprop.init(reflect.PtrTo(p.mtype.Key()), "Key", f.Tag.Get("protobuf_key"), nil, lockGetProp)
|
p.MapKeyProp.init(reflect.PtrTo(p.mtype.Key()), "Key", f.Tag.Get("protobuf_key"), nil, lockGetProp)
|
||||||
p.mvalprop = &Properties{}
|
p.MapValProp = &Properties{}
|
||||||
vtype := p.mtype.Elem()
|
vtype := p.mtype.Elem()
|
||||||
if vtype.Kind() != reflect.Ptr && vtype.Kind() != reflect.Slice {
|
if vtype.Kind() != reflect.Ptr && vtype.Kind() != reflect.Slice {
|
||||||
// The value type is not a message (*T) or bytes ([]byte),
|
// The value type is not a message (*T) or bytes ([]byte),
|
||||||
@ -650,29 +334,16 @@ func (p *Properties) setEncAndDec(typ reflect.Type, f *reflect.StructField, lock
|
|||||||
vtype = reflect.PtrTo(vtype)
|
vtype = reflect.PtrTo(vtype)
|
||||||
}
|
}
|
||||||
|
|
||||||
p.mvalprop.CustomType = p.CustomType
|
p.MapValProp.CustomType = p.CustomType
|
||||||
p.mvalprop.StdDuration = p.StdDuration
|
p.MapValProp.StdDuration = p.StdDuration
|
||||||
p.mvalprop.StdTime = p.StdTime
|
p.MapValProp.StdTime = p.StdTime
|
||||||
p.mvalprop.init(vtype, "Value", f.Tag.Get("protobuf_val"), nil, lockGetProp)
|
p.MapValProp.WktPointer = p.WktPointer
|
||||||
|
p.MapValProp.init(vtype, "Value", f.Tag.Get("protobuf_val"), nil, lockGetProp)
|
||||||
}
|
}
|
||||||
p.setTag(lockGetProp)
|
p.setTag(lockGetProp)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Properties) setTag(lockGetProp bool) {
|
func (p *Properties) setTag(lockGetProp bool) {
|
||||||
// precalculate tag code
|
|
||||||
wire := p.WireType
|
|
||||||
if p.Packed {
|
|
||||||
wire = WireBytes
|
|
||||||
}
|
|
||||||
x := uint32(p.Tag)<<3 | uint32(wire)
|
|
||||||
i := 0
|
|
||||||
for i = 0; x > 127; i++ {
|
|
||||||
p.tagbuf[i] = 0x80 | uint8(x&0x7F)
|
|
||||||
x >>= 7
|
|
||||||
}
|
|
||||||
p.tagbuf[i] = uint8(x)
|
|
||||||
p.tagcode = p.tagbuf[0 : i+1]
|
|
||||||
|
|
||||||
if p.stype != nil {
|
if p.stype != nil {
|
||||||
if lockGetProp {
|
if lockGetProp {
|
||||||
p.sprop = GetProperties(p.stype)
|
p.sprop = GetProperties(p.stype)
|
||||||
@ -683,20 +354,9 @@ func (p *Properties) setTag(lockGetProp bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem()
|
marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem()
|
||||||
unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem()
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// isMarshaler reports whether type t implements Marshaler.
|
|
||||||
func isMarshaler(t reflect.Type) bool {
|
|
||||||
return t.Implements(marshalerType)
|
|
||||||
}
|
|
||||||
|
|
||||||
// isUnmarshaler reports whether type t implements Unmarshaler.
|
|
||||||
func isUnmarshaler(t reflect.Type) bool {
|
|
||||||
return t.Implements(unmarshalerType)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Init populates the properties from a protocol buffer struct tag.
|
// Init populates the properties from a protocol buffer struct tag.
|
||||||
func (p *Properties) Init(typ reflect.Type, name, tag string, f *reflect.StructField) {
|
func (p *Properties) Init(typ reflect.Type, name, tag string, f *reflect.StructField) {
|
||||||
p.init(typ, name, tag, f, true)
|
p.init(typ, name, tag, f, true)
|
||||||
@ -706,14 +366,11 @@ func (p *Properties) init(typ reflect.Type, name, tag string, f *reflect.StructF
|
|||||||
// "bytes,49,opt,def=hello!"
|
// "bytes,49,opt,def=hello!"
|
||||||
p.Name = name
|
p.Name = name
|
||||||
p.OrigName = name
|
p.OrigName = name
|
||||||
if f != nil {
|
|
||||||
p.field = toField(f)
|
|
||||||
}
|
|
||||||
if tag == "" {
|
if tag == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
p.Parse(tag)
|
p.Parse(tag)
|
||||||
p.setEncAndDec(typ, f, lockGetProp)
|
p.setFieldProps(typ, f, lockGetProp)
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -734,9 +391,6 @@ func GetProperties(t reflect.Type) *StructProperties {
|
|||||||
sprop, ok := propertiesMap[t]
|
sprop, ok := propertiesMap[t]
|
||||||
propertiesMu.RUnlock()
|
propertiesMu.RUnlock()
|
||||||
if ok {
|
if ok {
|
||||||
if collectStats {
|
|
||||||
stats.Chit++
|
|
||||||
}
|
|
||||||
return sprop
|
return sprop
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -749,24 +403,14 @@ func GetProperties(t reflect.Type) *StructProperties {
|
|||||||
// getPropertiesLocked requires that propertiesMu is held.
|
// getPropertiesLocked requires that propertiesMu is held.
|
||||||
func getPropertiesLocked(t reflect.Type) *StructProperties {
|
func getPropertiesLocked(t reflect.Type) *StructProperties {
|
||||||
if prop, ok := propertiesMap[t]; ok {
|
if prop, ok := propertiesMap[t]; ok {
|
||||||
if collectStats {
|
|
||||||
stats.Chit++
|
|
||||||
}
|
|
||||||
return prop
|
return prop
|
||||||
}
|
}
|
||||||
if collectStats {
|
|
||||||
stats.Cmiss++
|
|
||||||
}
|
|
||||||
|
|
||||||
prop := new(StructProperties)
|
prop := new(StructProperties)
|
||||||
// in case of recursive protos, fill this in now.
|
// in case of recursive protos, fill this in now.
|
||||||
propertiesMap[t] = prop
|
propertiesMap[t] = prop
|
||||||
|
|
||||||
// build properties
|
// build properties
|
||||||
prop.extendable = reflect.PtrTo(t).Implements(extendableProtoType) ||
|
|
||||||
reflect.PtrTo(t).Implements(extendableProtoV1Type) ||
|
|
||||||
reflect.PtrTo(t).Implements(extendableBytesType)
|
|
||||||
prop.unrecField = invalidField
|
|
||||||
prop.Prop = make([]*Properties, t.NumField())
|
prop.Prop = make([]*Properties, t.NumField())
|
||||||
prop.order = make([]int, t.NumField())
|
prop.order = make([]int, t.NumField())
|
||||||
|
|
||||||
@ -777,23 +421,6 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
|
|||||||
name := f.Name
|
name := f.Name
|
||||||
p.init(f.Type, name, f.Tag.Get("protobuf"), &f, false)
|
p.init(f.Type, name, f.Tag.Get("protobuf"), &f, false)
|
||||||
|
|
||||||
if f.Name == "XXX_InternalExtensions" { // special case
|
|
||||||
p.enc = (*Buffer).enc_exts
|
|
||||||
p.dec = nil // not needed
|
|
||||||
p.size = size_exts
|
|
||||||
} else if f.Name == "XXX_extensions" { // special case
|
|
||||||
if len(f.Tag.Get("protobuf")) > 0 {
|
|
||||||
p.enc = (*Buffer).enc_ext_slice_byte
|
|
||||||
p.dec = nil // not needed
|
|
||||||
p.size = size_ext_slice_byte
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_map
|
|
||||||
p.dec = nil // not needed
|
|
||||||
p.size = size_map
|
|
||||||
}
|
|
||||||
} else if f.Name == "XXX_unrecognized" { // special case
|
|
||||||
prop.unrecField = toField(&f)
|
|
||||||
}
|
|
||||||
oneof := f.Tag.Get("protobuf_oneof") // special case
|
oneof := f.Tag.Get("protobuf_oneof") // special case
|
||||||
if oneof != "" {
|
if oneof != "" {
|
||||||
isOneofMessage = true
|
isOneofMessage = true
|
||||||
@ -809,9 +436,6 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
|
|||||||
}
|
}
|
||||||
print("\n")
|
print("\n")
|
||||||
}
|
}
|
||||||
if p.enc == nil && !strings.HasPrefix(f.Name, "XXX_") && oneof == "" {
|
|
||||||
fmt.Fprintln(os.Stderr, "proto: no encoder for", f.Name, f.Type.String(), "[GetProperties]")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-order prop.order.
|
// Re-order prop.order.
|
||||||
@ -822,8 +446,7 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
|
|||||||
}
|
}
|
||||||
if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); isOneofMessage && ok {
|
if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); isOneofMessage && ok {
|
||||||
var oots []interface{}
|
var oots []interface{}
|
||||||
prop.oneofMarshaler, prop.oneofUnmarshaler, prop.oneofSizer, oots = om.XXX_OneofFuncs()
|
_, _, _, oots = om.XXX_OneofFuncs()
|
||||||
prop.stype = t
|
|
||||||
|
|
||||||
// Interpret oneof metadata.
|
// Interpret oneof metadata.
|
||||||
prop.OneofTypes = make(map[string]*OneofProperties)
|
prop.OneofTypes = make(map[string]*OneofProperties)
|
||||||
@ -873,30 +496,6 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
|
|||||||
return prop
|
return prop
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the Properties object for the x[0]'th field of the structure.
|
|
||||||
func propByIndex(t reflect.Type, x []int) *Properties {
|
|
||||||
if len(x) != 1 {
|
|
||||||
fmt.Fprintf(os.Stderr, "proto: field index dimension %d (not 1) for type %s\n", len(x), t)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
prop := GetProperties(t)
|
|
||||||
return prop.Prop[x[0]]
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the address and type of a pointer to a struct from an interface.
|
|
||||||
func getbase(pb Message) (t reflect.Type, b structPointer, err error) {
|
|
||||||
if pb == nil {
|
|
||||||
err = ErrNil
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// get the reflect type of the pointer to the struct.
|
|
||||||
t = reflect.TypeOf(pb)
|
|
||||||
// get the address of the struct.
|
|
||||||
value := reflect.ValueOf(pb)
|
|
||||||
b = toStructPointer(value)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// A global registry of enum types.
|
// A global registry of enum types.
|
||||||
// The generated code will register the generated maps by calling RegisterEnum.
|
// The generated code will register the generated maps by calling RegisterEnum.
|
||||||
|
|
||||||
@ -925,20 +524,42 @@ func EnumValueMap(enumType string) map[string]int32 {
|
|||||||
// A registry of all linked message types.
|
// A registry of all linked message types.
|
||||||
// The string is a fully-qualified proto name ("pkg.Message").
|
// The string is a fully-qualified proto name ("pkg.Message").
|
||||||
var (
|
var (
|
||||||
protoTypes = make(map[string]reflect.Type)
|
protoTypedNils = make(map[string]Message) // a map from proto names to typed nil pointers
|
||||||
revProtoTypes = make(map[reflect.Type]string)
|
protoMapTypes = make(map[string]reflect.Type) // a map from proto names to map types
|
||||||
|
revProtoTypes = make(map[reflect.Type]string)
|
||||||
)
|
)
|
||||||
|
|
||||||
// RegisterType is called from generated code and maps from the fully qualified
|
// RegisterType is called from generated code and maps from the fully qualified
|
||||||
// proto name to the type (pointer to struct) of the protocol buffer.
|
// proto name to the type (pointer to struct) of the protocol buffer.
|
||||||
func RegisterType(x Message, name string) {
|
func RegisterType(x Message, name string) {
|
||||||
if _, ok := protoTypes[name]; ok {
|
if _, ok := protoTypedNils[name]; ok {
|
||||||
// TODO: Some day, make this a panic.
|
// TODO: Some day, make this a panic.
|
||||||
log.Printf("proto: duplicate proto type registered: %s", name)
|
log.Printf("proto: duplicate proto type registered: %s", name)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
t := reflect.TypeOf(x)
|
t := reflect.TypeOf(x)
|
||||||
protoTypes[name] = t
|
if v := reflect.ValueOf(x); v.Kind() == reflect.Ptr && v.Pointer() == 0 {
|
||||||
|
// Generated code always calls RegisterType with nil x.
|
||||||
|
// This check is just for extra safety.
|
||||||
|
protoTypedNils[name] = x
|
||||||
|
} else {
|
||||||
|
protoTypedNils[name] = reflect.Zero(t).Interface().(Message)
|
||||||
|
}
|
||||||
|
revProtoTypes[t] = name
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterMapType is called from generated code and maps from the fully qualified
|
||||||
|
// proto name to the native map type of the proto map definition.
|
||||||
|
func RegisterMapType(x interface{}, name string) {
|
||||||
|
if reflect.TypeOf(x).Kind() != reflect.Map {
|
||||||
|
panic(fmt.Sprintf("RegisterMapType(%T, %q); want map", x, name))
|
||||||
|
}
|
||||||
|
if _, ok := protoMapTypes[name]; ok {
|
||||||
|
log.Printf("proto: duplicate proto type registered: %s", name)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
t := reflect.TypeOf(x)
|
||||||
|
protoMapTypes[name] = t
|
||||||
revProtoTypes[t] = name
|
revProtoTypes[t] = name
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -954,7 +575,14 @@ func MessageName(x Message) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MessageType returns the message type (pointer to struct) for a named message.
|
// MessageType returns the message type (pointer to struct) for a named message.
|
||||||
func MessageType(name string) reflect.Type { return protoTypes[name] }
|
// The type is not guaranteed to implement proto.Message if the name refers to a
|
||||||
|
// map entry.
|
||||||
|
func MessageType(name string) reflect.Type {
|
||||||
|
if t, ok := protoTypedNils[name]; ok {
|
||||||
|
return reflect.TypeOf(t)
|
||||||
|
}
|
||||||
|
return protoMapTypes[name]
|
||||||
|
}
|
||||||
|
|
||||||
// A registry of all linked proto files.
|
// A registry of all linked proto files.
|
||||||
var (
|
var (
|
||||||
|
81
vendor/github.com/gogo/protobuf/proto/properties_gogo.go
generated
vendored
81
vendor/github.com/gogo/protobuf/proto/properties_gogo.go
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
// Protocol Buffers for Go with Gadgets
|
// Protocol Buffers for Go with Gadgets
|
||||||
//
|
//
|
||||||
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
|
// Copyright (c) 2018, The GoGo Authors. All rights reserved.
|
||||||
// http://github.com/gogo/protobuf
|
// http://github.com/gogo/protobuf
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
@ -29,83 +29,8 @@
|
|||||||
package proto
|
package proto
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (p *Properties) setCustomEncAndDec(typ reflect.Type) {
|
var sizerType = reflect.TypeOf((*Sizer)(nil)).Elem()
|
||||||
p.ctype = typ
|
var protosizerType = reflect.TypeOf((*ProtoSizer)(nil)).Elem()
|
||||||
if p.Repeated {
|
|
||||||
p.enc = (*Buffer).enc_custom_slice_bytes
|
|
||||||
p.dec = (*Buffer).dec_custom_slice_bytes
|
|
||||||
p.size = size_custom_slice_bytes
|
|
||||||
} else if typ.Kind() == reflect.Ptr {
|
|
||||||
p.enc = (*Buffer).enc_custom_bytes
|
|
||||||
p.dec = (*Buffer).dec_custom_bytes
|
|
||||||
p.size = size_custom_bytes
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_custom_ref_bytes
|
|
||||||
p.dec = (*Buffer).dec_custom_ref_bytes
|
|
||||||
p.size = size_custom_ref_bytes
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *Properties) setDurationEncAndDec(typ reflect.Type) {
|
|
||||||
if p.Repeated {
|
|
||||||
if typ.Elem().Kind() == reflect.Ptr {
|
|
||||||
p.enc = (*Buffer).enc_slice_duration
|
|
||||||
p.dec = (*Buffer).dec_slice_duration
|
|
||||||
p.size = size_slice_duration
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_slice_ref_duration
|
|
||||||
p.dec = (*Buffer).dec_slice_ref_duration
|
|
||||||
p.size = size_slice_ref_duration
|
|
||||||
}
|
|
||||||
} else if typ.Kind() == reflect.Ptr {
|
|
||||||
p.enc = (*Buffer).enc_duration
|
|
||||||
p.dec = (*Buffer).dec_duration
|
|
||||||
p.size = size_duration
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_ref_duration
|
|
||||||
p.dec = (*Buffer).dec_ref_duration
|
|
||||||
p.size = size_ref_duration
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *Properties) setTimeEncAndDec(typ reflect.Type) {
|
|
||||||
if p.Repeated {
|
|
||||||
if typ.Elem().Kind() == reflect.Ptr {
|
|
||||||
p.enc = (*Buffer).enc_slice_time
|
|
||||||
p.dec = (*Buffer).dec_slice_time
|
|
||||||
p.size = size_slice_time
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_slice_ref_time
|
|
||||||
p.dec = (*Buffer).dec_slice_ref_time
|
|
||||||
p.size = size_slice_ref_time
|
|
||||||
}
|
|
||||||
} else if typ.Kind() == reflect.Ptr {
|
|
||||||
p.enc = (*Buffer).enc_time
|
|
||||||
p.dec = (*Buffer).dec_time
|
|
||||||
p.size = size_time
|
|
||||||
} else {
|
|
||||||
p.enc = (*Buffer).enc_ref_time
|
|
||||||
p.dec = (*Buffer).dec_ref_time
|
|
||||||
p.size = size_ref_time
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *Properties) setSliceOfNonPointerStructs(typ reflect.Type) {
|
|
||||||
t2 := typ.Elem()
|
|
||||||
p.sstype = typ
|
|
||||||
p.stype = t2
|
|
||||||
p.isMarshaler = isMarshaler(t2)
|
|
||||||
p.isUnmarshaler = isUnmarshaler(t2)
|
|
||||||
p.enc = (*Buffer).enc_slice_ref_struct_message
|
|
||||||
p.dec = (*Buffer).dec_slice_ref_struct_message
|
|
||||||
p.size = size_slice_ref_struct_message
|
|
||||||
if p.Wire != "bytes" {
|
|
||||||
fmt.Fprintf(os.Stderr, "proto: no ptr oenc for %T -> %T \n", typ, t2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
3006
vendor/github.com/gogo/protobuf/proto/table_marshal.go
generated
vendored
Normal file
3006
vendor/github.com/gogo/protobuf/proto/table_marshal.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
388
vendor/github.com/gogo/protobuf/proto/table_marshal_gogo.go
generated
vendored
Normal file
388
vendor/github.com/gogo/protobuf/proto/table_marshal_gogo.go
generated
vendored
Normal file
@ -0,0 +1,388 @@
|
|||||||
|
// Protocol Buffers for Go with Gadgets
|
||||||
|
//
|
||||||
|
// Copyright (c) 2018, The GoGo Authors. All rights reserved.
|
||||||
|
// http://github.com/gogo/protobuf
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
package proto
|
||||||
|
|
||||||
|
import (
|
||||||
|
"reflect"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// makeMessageRefMarshaler differs a bit from makeMessageMarshaler
|
||||||
|
// It marshal a message T instead of a *T
|
||||||
|
func makeMessageRefMarshaler(u *marshalInfo) (sizer, marshaler) {
|
||||||
|
return func(ptr pointer, tagsize int) int {
|
||||||
|
siz := u.size(ptr)
|
||||||
|
return siz + SizeVarint(uint64(siz)) + tagsize
|
||||||
|
},
|
||||||
|
func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
siz := u.cachedsize(ptr)
|
||||||
|
b = appendVarint(b, uint64(siz))
|
||||||
|
return u.marshal(b, ptr, deterministic)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// makeMessageRefSliceMarshaler differs quite a lot from makeMessageSliceMarshaler
|
||||||
|
// It marshals a slice of messages []T instead of []*T
|
||||||
|
func makeMessageRefSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
|
||||||
|
return func(ptr pointer, tagsize int) int {
|
||||||
|
s := ptr.getSlice(u.typ)
|
||||||
|
n := 0
|
||||||
|
for i := 0; i < s.Len(); i++ {
|
||||||
|
elem := s.Index(i)
|
||||||
|
e := elem.Interface()
|
||||||
|
v := toAddrPointer(&e, false)
|
||||||
|
siz := u.size(v)
|
||||||
|
n += siz + SizeVarint(uint64(siz)) + tagsize
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
},
|
||||||
|
func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
||||||
|
s := ptr.getSlice(u.typ)
|
||||||
|
var err, errreq error
|
||||||
|
for i := 0; i < s.Len(); i++ {
|
||||||
|
elem := s.Index(i)
|
||||||
|
e := elem.Interface()
|
||||||
|
v := toAddrPointer(&e, false)
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
siz := u.size(v)
|
||||||
|
b = appendVarint(b, uint64(siz))
|
||||||
|
b, err = u.marshal(b, v, deterministic)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
if _, ok := err.(*RequiredNotSetError); ok {
|
||||||
|
// Required field in submessage is not set.
|
||||||
|
// We record the error but keep going, to give a complete marshaling.
|
||||||
|
if errreq == nil {
|
||||||
|
errreq = err
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if err == ErrNil {
|
||||||
|
err = errRepeatedHasNil
|
||||||
|
}
|
||||||
|
return b, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return b, errreq
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeCustomPtrMarshaler(u *marshalInfo) (sizer, marshaler) {
|
||||||
|
return func(ptr pointer, tagsize int) int {
|
||||||
|
if ptr.isNil() {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
m := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(custom)
|
||||||
|
siz := m.Size()
|
||||||
|
return tagsize + SizeVarint(uint64(siz)) + siz
|
||||||
|
}, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
||||||
|
if ptr.isNil() {
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
m := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(custom)
|
||||||
|
siz := m.Size()
|
||||||
|
buf, err := m.Marshal()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
b = appendVarint(b, uint64(siz))
|
||||||
|
b = append(b, buf...)
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeCustomMarshaler(u *marshalInfo) (sizer, marshaler) {
|
||||||
|
return func(ptr pointer, tagsize int) int {
|
||||||
|
m := ptr.asPointerTo(u.typ).Interface().(custom)
|
||||||
|
siz := m.Size()
|
||||||
|
return tagsize + SizeVarint(uint64(siz)) + siz
|
||||||
|
}, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
||||||
|
m := ptr.asPointerTo(u.typ).Interface().(custom)
|
||||||
|
siz := m.Size()
|
||||||
|
buf, err := m.Marshal()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
b = appendVarint(b, uint64(siz))
|
||||||
|
b = append(b, buf...)
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeTimeMarshaler(u *marshalInfo) (sizer, marshaler) {
|
||||||
|
return func(ptr pointer, tagsize int) int {
|
||||||
|
t := ptr.asPointerTo(u.typ).Interface().(*time.Time)
|
||||||
|
ts, err := timestampProto(*t)
|
||||||
|
if err != nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
siz := Size(ts)
|
||||||
|
return tagsize + SizeVarint(uint64(siz)) + siz
|
||||||
|
}, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
||||||
|
t := ptr.asPointerTo(u.typ).Interface().(*time.Time)
|
||||||
|
ts, err := timestampProto(*t)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
buf, err := Marshal(ts)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
b = appendVarint(b, uint64(len(buf)))
|
||||||
|
b = append(b, buf...)
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeTimePtrMarshaler(u *marshalInfo) (sizer, marshaler) {
|
||||||
|
return func(ptr pointer, tagsize int) int {
|
||||||
|
if ptr.isNil() {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*time.Time)
|
||||||
|
ts, err := timestampProto(*t)
|
||||||
|
if err != nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
siz := Size(ts)
|
||||||
|
return tagsize + SizeVarint(uint64(siz)) + siz
|
||||||
|
}, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
||||||
|
if ptr.isNil() {
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*time.Time)
|
||||||
|
ts, err := timestampProto(*t)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
buf, err := Marshal(ts)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
b = appendVarint(b, uint64(len(buf)))
|
||||||
|
b = append(b, buf...)
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeTimeSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
|
||||||
|
return func(ptr pointer, tagsize int) int {
|
||||||
|
s := ptr.getSlice(u.typ)
|
||||||
|
n := 0
|
||||||
|
for i := 0; i < s.Len(); i++ {
|
||||||
|
elem := s.Index(i)
|
||||||
|
t := elem.Interface().(time.Time)
|
||||||
|
ts, err := timestampProto(t)
|
||||||
|
if err != nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
siz := Size(ts)
|
||||||
|
n += siz + SizeVarint(uint64(siz)) + tagsize
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
},
|
||||||
|
func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
||||||
|
s := ptr.getSlice(u.typ)
|
||||||
|
for i := 0; i < s.Len(); i++ {
|
||||||
|
elem := s.Index(i)
|
||||||
|
t := elem.Interface().(time.Time)
|
||||||
|
ts, err := timestampProto(t)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
siz := Size(ts)
|
||||||
|
buf, err := Marshal(ts)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
b = appendVarint(b, uint64(siz))
|
||||||
|
b = append(b, buf...)
|
||||||
|
}
|
||||||
|
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeTimePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
|
||||||
|
return func(ptr pointer, tagsize int) int {
|
||||||
|
s := ptr.getSlice(reflect.PtrTo(u.typ))
|
||||||
|
n := 0
|
||||||
|
for i := 0; i < s.Len(); i++ {
|
||||||
|
elem := s.Index(i)
|
||||||
|
t := elem.Interface().(*time.Time)
|
||||||
|
ts, err := timestampProto(*t)
|
||||||
|
if err != nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
siz := Size(ts)
|
||||||
|
n += siz + SizeVarint(uint64(siz)) + tagsize
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
},
|
||||||
|
func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
||||||
|
s := ptr.getSlice(reflect.PtrTo(u.typ))
|
||||||
|
for i := 0; i < s.Len(); i++ {
|
||||||
|
elem := s.Index(i)
|
||||||
|
t := elem.Interface().(*time.Time)
|
||||||
|
ts, err := timestampProto(*t)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
siz := Size(ts)
|
||||||
|
buf, err := Marshal(ts)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
b = appendVarint(b, uint64(siz))
|
||||||
|
b = append(b, buf...)
|
||||||
|
}
|
||||||
|
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeDurationMarshaler(u *marshalInfo) (sizer, marshaler) {
|
||||||
|
return func(ptr pointer, tagsize int) int {
|
||||||
|
d := ptr.asPointerTo(u.typ).Interface().(*time.Duration)
|
||||||
|
dur := durationProto(*d)
|
||||||
|
siz := Size(dur)
|
||||||
|
return tagsize + SizeVarint(uint64(siz)) + siz
|
||||||
|
}, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
||||||
|
d := ptr.asPointerTo(u.typ).Interface().(*time.Duration)
|
||||||
|
dur := durationProto(*d)
|
||||||
|
buf, err := Marshal(dur)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
b = appendVarint(b, uint64(len(buf)))
|
||||||
|
b = append(b, buf...)
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeDurationPtrMarshaler(u *marshalInfo) (sizer, marshaler) {
|
||||||
|
return func(ptr pointer, tagsize int) int {
|
||||||
|
if ptr.isNil() {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
d := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*time.Duration)
|
||||||
|
dur := durationProto(*d)
|
||||||
|
siz := Size(dur)
|
||||||
|
return tagsize + SizeVarint(uint64(siz)) + siz
|
||||||
|
}, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
||||||
|
if ptr.isNil() {
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
d := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*time.Duration)
|
||||||
|
dur := durationProto(*d)
|
||||||
|
buf, err := Marshal(dur)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
b = appendVarint(b, uint64(len(buf)))
|
||||||
|
b = append(b, buf...)
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeDurationSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
|
||||||
|
return func(ptr pointer, tagsize int) int {
|
||||||
|
s := ptr.getSlice(u.typ)
|
||||||
|
n := 0
|
||||||
|
for i := 0; i < s.Len(); i++ {
|
||||||
|
elem := s.Index(i)
|
||||||
|
d := elem.Interface().(time.Duration)
|
||||||
|
dur := durationProto(d)
|
||||||
|
siz := Size(dur)
|
||||||
|
n += siz + SizeVarint(uint64(siz)) + tagsize
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
},
|
||||||
|
func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
||||||
|
s := ptr.getSlice(u.typ)
|
||||||
|
for i := 0; i < s.Len(); i++ {
|
||||||
|
elem := s.Index(i)
|
||||||
|
d := elem.Interface().(time.Duration)
|
||||||
|
dur := durationProto(d)
|
||||||
|
siz := Size(dur)
|
||||||
|
buf, err := Marshal(dur)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
b = appendVarint(b, uint64(siz))
|
||||||
|
b = append(b, buf...)
|
||||||
|
}
|
||||||
|
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeDurationPtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
|
||||||
|
return func(ptr pointer, tagsize int) int {
|
||||||
|
s := ptr.getSlice(reflect.PtrTo(u.typ))
|
||||||
|
n := 0
|
||||||
|
for i := 0; i < s.Len(); i++ {
|
||||||
|
elem := s.Index(i)
|
||||||
|
d := elem.Interface().(*time.Duration)
|
||||||
|
dur := durationProto(*d)
|
||||||
|
siz := Size(dur)
|
||||||
|
n += siz + SizeVarint(uint64(siz)) + tagsize
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
},
|
||||||
|
func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
||||||
|
s := ptr.getSlice(reflect.PtrTo(u.typ))
|
||||||
|
for i := 0; i < s.Len(); i++ {
|
||||||
|
elem := s.Index(i)
|
||||||
|
d := elem.Interface().(*time.Duration)
|
||||||
|
dur := durationProto(*d)
|
||||||
|
siz := Size(dur)
|
||||||
|
buf, err := Marshal(dur)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
b = appendVarint(b, uint64(siz))
|
||||||
|
b = append(b, buf...)
|
||||||
|
}
|
||||||
|
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
}
|
657
vendor/github.com/gogo/protobuf/proto/table_merge.go
generated
vendored
Normal file
657
vendor/github.com/gogo/protobuf/proto/table_merge.go
generated
vendored
Normal file
@ -0,0 +1,657 @@
|
|||||||
|
// Go support for Protocol Buffers - Google's data interchange format
|
||||||
|
//
|
||||||
|
// Copyright 2016 The Go Authors. All rights reserved.
|
||||||
|
// https://github.com/golang/protobuf
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
// * Neither the name of Google Inc. nor the names of its
|
||||||
|
// contributors may be used to endorse or promote products derived from
|
||||||
|
// this software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
package proto
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"reflect"
|
||||||
|
"strings"
|
||||||
|
"sync"
|
||||||
|
"sync/atomic"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Merge merges the src message into dst.
|
||||||
|
// This assumes that dst and src of the same type and are non-nil.
|
||||||
|
func (a *InternalMessageInfo) Merge(dst, src Message) {
|
||||||
|
mi := atomicLoadMergeInfo(&a.merge)
|
||||||
|
if mi == nil {
|
||||||
|
mi = getMergeInfo(reflect.TypeOf(dst).Elem())
|
||||||
|
atomicStoreMergeInfo(&a.merge, mi)
|
||||||
|
}
|
||||||
|
mi.merge(toPointer(&dst), toPointer(&src))
|
||||||
|
}
|
||||||
|
|
||||||
|
type mergeInfo struct {
|
||||||
|
typ reflect.Type
|
||||||
|
|
||||||
|
initialized int32 // 0: only typ is valid, 1: everything is valid
|
||||||
|
lock sync.Mutex
|
||||||
|
|
||||||
|
fields []mergeFieldInfo
|
||||||
|
unrecognized field // Offset of XXX_unrecognized
|
||||||
|
}
|
||||||
|
|
||||||
|
type mergeFieldInfo struct {
|
||||||
|
field field // Offset of field, guaranteed to be valid
|
||||||
|
|
||||||
|
// isPointer reports whether the value in the field is a pointer.
|
||||||
|
// This is true for the following situations:
|
||||||
|
// * Pointer to struct
|
||||||
|
// * Pointer to basic type (proto2 only)
|
||||||
|
// * Slice (first value in slice header is a pointer)
|
||||||
|
// * String (first value in string header is a pointer)
|
||||||
|
isPointer bool
|
||||||
|
|
||||||
|
// basicWidth reports the width of the field assuming that it is directly
|
||||||
|
// embedded in the struct (as is the case for basic types in proto3).
|
||||||
|
// The possible values are:
|
||||||
|
// 0: invalid
|
||||||
|
// 1: bool
|
||||||
|
// 4: int32, uint32, float32
|
||||||
|
// 8: int64, uint64, float64
|
||||||
|
basicWidth int
|
||||||
|
|
||||||
|
// Where dst and src are pointers to the types being merged.
|
||||||
|
merge func(dst, src pointer)
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
mergeInfoMap = map[reflect.Type]*mergeInfo{}
|
||||||
|
mergeInfoLock sync.Mutex
|
||||||
|
)
|
||||||
|
|
||||||
|
func getMergeInfo(t reflect.Type) *mergeInfo {
|
||||||
|
mergeInfoLock.Lock()
|
||||||
|
defer mergeInfoLock.Unlock()
|
||||||
|
mi := mergeInfoMap[t]
|
||||||
|
if mi == nil {
|
||||||
|
mi = &mergeInfo{typ: t}
|
||||||
|
mergeInfoMap[t] = mi
|
||||||
|
}
|
||||||
|
return mi
|
||||||
|
}
|
||||||
|
|
||||||
|
// merge merges src into dst assuming they are both of type *mi.typ.
|
||||||
|
func (mi *mergeInfo) merge(dst, src pointer) {
|
||||||
|
if dst.isNil() {
|
||||||
|
panic("proto: nil destination")
|
||||||
|
}
|
||||||
|
if src.isNil() {
|
||||||
|
return // Nothing to do.
|
||||||
|
}
|
||||||
|
|
||||||
|
if atomic.LoadInt32(&mi.initialized) == 0 {
|
||||||
|
mi.computeMergeInfo()
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, fi := range mi.fields {
|
||||||
|
sfp := src.offset(fi.field)
|
||||||
|
|
||||||
|
// As an optimization, we can avoid the merge function call cost
|
||||||
|
// if we know for sure that the source will have no effect
|
||||||
|
// by checking if it is the zero value.
|
||||||
|
if unsafeAllowed {
|
||||||
|
if fi.isPointer && sfp.getPointer().isNil() { // Could be slice or string
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if fi.basicWidth > 0 {
|
||||||
|
switch {
|
||||||
|
case fi.basicWidth == 1 && !*sfp.toBool():
|
||||||
|
continue
|
||||||
|
case fi.basicWidth == 4 && *sfp.toUint32() == 0:
|
||||||
|
continue
|
||||||
|
case fi.basicWidth == 8 && *sfp.toUint64() == 0:
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dfp := dst.offset(fi.field)
|
||||||
|
fi.merge(dfp, sfp)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Make this faster?
|
||||||
|
out := dst.asPointerTo(mi.typ).Elem()
|
||||||
|
in := src.asPointerTo(mi.typ).Elem()
|
||||||
|
if emIn, err := extendable(in.Addr().Interface()); err == nil {
|
||||||
|
emOut, _ := extendable(out.Addr().Interface())
|
||||||
|
mIn, muIn := emIn.extensionsRead()
|
||||||
|
if mIn != nil {
|
||||||
|
mOut := emOut.extensionsWrite()
|
||||||
|
muIn.Lock()
|
||||||
|
mergeExtension(mOut, mIn)
|
||||||
|
muIn.Unlock()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if mi.unrecognized.IsValid() {
|
||||||
|
if b := *src.offset(mi.unrecognized).toBytes(); len(b) > 0 {
|
||||||
|
*dst.offset(mi.unrecognized).toBytes() = append([]byte(nil), b...)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mi *mergeInfo) computeMergeInfo() {
|
||||||
|
mi.lock.Lock()
|
||||||
|
defer mi.lock.Unlock()
|
||||||
|
if mi.initialized != 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
t := mi.typ
|
||||||
|
n := t.NumField()
|
||||||
|
|
||||||
|
props := GetProperties(t)
|
||||||
|
for i := 0; i < n; i++ {
|
||||||
|
f := t.Field(i)
|
||||||
|
if strings.HasPrefix(f.Name, "XXX_") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
mfi := mergeFieldInfo{field: toField(&f)}
|
||||||
|
tf := f.Type
|
||||||
|
|
||||||
|
// As an optimization, we can avoid the merge function call cost
|
||||||
|
// if we know for sure that the source will have no effect
|
||||||
|
// by checking if it is the zero value.
|
||||||
|
if unsafeAllowed {
|
||||||
|
switch tf.Kind() {
|
||||||
|
case reflect.Ptr, reflect.Slice, reflect.String:
|
||||||
|
// As a special case, we assume slices and strings are pointers
|
||||||
|
// since we know that the first field in the SliceSlice or
|
||||||
|
// StringHeader is a data pointer.
|
||||||
|
mfi.isPointer = true
|
||||||
|
case reflect.Bool:
|
||||||
|
mfi.basicWidth = 1
|
||||||
|
case reflect.Int32, reflect.Uint32, reflect.Float32:
|
||||||
|
mfi.basicWidth = 4
|
||||||
|
case reflect.Int64, reflect.Uint64, reflect.Float64:
|
||||||
|
mfi.basicWidth = 8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unwrap tf to get at its most basic type.
|
||||||
|
var isPointer, isSlice bool
|
||||||
|
if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 {
|
||||||
|
isSlice = true
|
||||||
|
tf = tf.Elem()
|
||||||
|
}
|
||||||
|
if tf.Kind() == reflect.Ptr {
|
||||||
|
isPointer = true
|
||||||
|
tf = tf.Elem()
|
||||||
|
}
|
||||||
|
if isPointer && isSlice && tf.Kind() != reflect.Struct {
|
||||||
|
panic("both pointer and slice for basic type in " + tf.Name())
|
||||||
|
}
|
||||||
|
|
||||||
|
switch tf.Kind() {
|
||||||
|
case reflect.Int32:
|
||||||
|
switch {
|
||||||
|
case isSlice: // E.g., []int32
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
// NOTE: toInt32Slice is not defined (see pointer_reflect.go).
|
||||||
|
/*
|
||||||
|
sfsp := src.toInt32Slice()
|
||||||
|
if *sfsp != nil {
|
||||||
|
dfsp := dst.toInt32Slice()
|
||||||
|
*dfsp = append(*dfsp, *sfsp...)
|
||||||
|
if *dfsp == nil {
|
||||||
|
*dfsp = []int64{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
sfs := src.getInt32Slice()
|
||||||
|
if sfs != nil {
|
||||||
|
dfs := dst.getInt32Slice()
|
||||||
|
dfs = append(dfs, sfs...)
|
||||||
|
if dfs == nil {
|
||||||
|
dfs = []int32{}
|
||||||
|
}
|
||||||
|
dst.setInt32Slice(dfs)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case isPointer: // E.g., *int32
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
// NOTE: toInt32Ptr is not defined (see pointer_reflect.go).
|
||||||
|
/*
|
||||||
|
sfpp := src.toInt32Ptr()
|
||||||
|
if *sfpp != nil {
|
||||||
|
dfpp := dst.toInt32Ptr()
|
||||||
|
if *dfpp == nil {
|
||||||
|
*dfpp = Int32(**sfpp)
|
||||||
|
} else {
|
||||||
|
**dfpp = **sfpp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
sfp := src.getInt32Ptr()
|
||||||
|
if sfp != nil {
|
||||||
|
dfp := dst.getInt32Ptr()
|
||||||
|
if dfp == nil {
|
||||||
|
dst.setInt32Ptr(*sfp)
|
||||||
|
} else {
|
||||||
|
*dfp = *sfp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: // E.g., int32
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
if v := *src.toInt32(); v != 0 {
|
||||||
|
*dst.toInt32() = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case reflect.Int64:
|
||||||
|
switch {
|
||||||
|
case isSlice: // E.g., []int64
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sfsp := src.toInt64Slice()
|
||||||
|
if *sfsp != nil {
|
||||||
|
dfsp := dst.toInt64Slice()
|
||||||
|
*dfsp = append(*dfsp, *sfsp...)
|
||||||
|
if *dfsp == nil {
|
||||||
|
*dfsp = []int64{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case isPointer: // E.g., *int64
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sfpp := src.toInt64Ptr()
|
||||||
|
if *sfpp != nil {
|
||||||
|
dfpp := dst.toInt64Ptr()
|
||||||
|
if *dfpp == nil {
|
||||||
|
*dfpp = Int64(**sfpp)
|
||||||
|
} else {
|
||||||
|
**dfpp = **sfpp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: // E.g., int64
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
if v := *src.toInt64(); v != 0 {
|
||||||
|
*dst.toInt64() = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case reflect.Uint32:
|
||||||
|
switch {
|
||||||
|
case isSlice: // E.g., []uint32
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sfsp := src.toUint32Slice()
|
||||||
|
if *sfsp != nil {
|
||||||
|
dfsp := dst.toUint32Slice()
|
||||||
|
*dfsp = append(*dfsp, *sfsp...)
|
||||||
|
if *dfsp == nil {
|
||||||
|
*dfsp = []uint32{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case isPointer: // E.g., *uint32
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sfpp := src.toUint32Ptr()
|
||||||
|
if *sfpp != nil {
|
||||||
|
dfpp := dst.toUint32Ptr()
|
||||||
|
if *dfpp == nil {
|
||||||
|
*dfpp = Uint32(**sfpp)
|
||||||
|
} else {
|
||||||
|
**dfpp = **sfpp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: // E.g., uint32
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
if v := *src.toUint32(); v != 0 {
|
||||||
|
*dst.toUint32() = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case reflect.Uint64:
|
||||||
|
switch {
|
||||||
|
case isSlice: // E.g., []uint64
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sfsp := src.toUint64Slice()
|
||||||
|
if *sfsp != nil {
|
||||||
|
dfsp := dst.toUint64Slice()
|
||||||
|
*dfsp = append(*dfsp, *sfsp...)
|
||||||
|
if *dfsp == nil {
|
||||||
|
*dfsp = []uint64{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case isPointer: // E.g., *uint64
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sfpp := src.toUint64Ptr()
|
||||||
|
if *sfpp != nil {
|
||||||
|
dfpp := dst.toUint64Ptr()
|
||||||
|
if *dfpp == nil {
|
||||||
|
*dfpp = Uint64(**sfpp)
|
||||||
|
} else {
|
||||||
|
**dfpp = **sfpp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: // E.g., uint64
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
if v := *src.toUint64(); v != 0 {
|
||||||
|
*dst.toUint64() = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case reflect.Float32:
|
||||||
|
switch {
|
||||||
|
case isSlice: // E.g., []float32
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sfsp := src.toFloat32Slice()
|
||||||
|
if *sfsp != nil {
|
||||||
|
dfsp := dst.toFloat32Slice()
|
||||||
|
*dfsp = append(*dfsp, *sfsp...)
|
||||||
|
if *dfsp == nil {
|
||||||
|
*dfsp = []float32{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case isPointer: // E.g., *float32
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sfpp := src.toFloat32Ptr()
|
||||||
|
if *sfpp != nil {
|
||||||
|
dfpp := dst.toFloat32Ptr()
|
||||||
|
if *dfpp == nil {
|
||||||
|
*dfpp = Float32(**sfpp)
|
||||||
|
} else {
|
||||||
|
**dfpp = **sfpp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: // E.g., float32
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
if v := *src.toFloat32(); v != 0 {
|
||||||
|
*dst.toFloat32() = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case reflect.Float64:
|
||||||
|
switch {
|
||||||
|
case isSlice: // E.g., []float64
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sfsp := src.toFloat64Slice()
|
||||||
|
if *sfsp != nil {
|
||||||
|
dfsp := dst.toFloat64Slice()
|
||||||
|
*dfsp = append(*dfsp, *sfsp...)
|
||||||
|
if *dfsp == nil {
|
||||||
|
*dfsp = []float64{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case isPointer: // E.g., *float64
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sfpp := src.toFloat64Ptr()
|
||||||
|
if *sfpp != nil {
|
||||||
|
dfpp := dst.toFloat64Ptr()
|
||||||
|
if *dfpp == nil {
|
||||||
|
*dfpp = Float64(**sfpp)
|
||||||
|
} else {
|
||||||
|
**dfpp = **sfpp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: // E.g., float64
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
if v := *src.toFloat64(); v != 0 {
|
||||||
|
*dst.toFloat64() = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case reflect.Bool:
|
||||||
|
switch {
|
||||||
|
case isSlice: // E.g., []bool
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sfsp := src.toBoolSlice()
|
||||||
|
if *sfsp != nil {
|
||||||
|
dfsp := dst.toBoolSlice()
|
||||||
|
*dfsp = append(*dfsp, *sfsp...)
|
||||||
|
if *dfsp == nil {
|
||||||
|
*dfsp = []bool{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case isPointer: // E.g., *bool
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sfpp := src.toBoolPtr()
|
||||||
|
if *sfpp != nil {
|
||||||
|
dfpp := dst.toBoolPtr()
|
||||||
|
if *dfpp == nil {
|
||||||
|
*dfpp = Bool(**sfpp)
|
||||||
|
} else {
|
||||||
|
**dfpp = **sfpp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: // E.g., bool
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
if v := *src.toBool(); v {
|
||||||
|
*dst.toBool() = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case reflect.String:
|
||||||
|
switch {
|
||||||
|
case isSlice: // E.g., []string
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sfsp := src.toStringSlice()
|
||||||
|
if *sfsp != nil {
|
||||||
|
dfsp := dst.toStringSlice()
|
||||||
|
*dfsp = append(*dfsp, *sfsp...)
|
||||||
|
if *dfsp == nil {
|
||||||
|
*dfsp = []string{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case isPointer: // E.g., *string
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sfpp := src.toStringPtr()
|
||||||
|
if *sfpp != nil {
|
||||||
|
dfpp := dst.toStringPtr()
|
||||||
|
if *dfpp == nil {
|
||||||
|
*dfpp = String(**sfpp)
|
||||||
|
} else {
|
||||||
|
**dfpp = **sfpp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: // E.g., string
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
if v := *src.toString(); v != "" {
|
||||||
|
*dst.toString() = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case reflect.Slice:
|
||||||
|
isProto3 := props.Prop[i].proto3
|
||||||
|
switch {
|
||||||
|
case isPointer:
|
||||||
|
panic("bad pointer in byte slice case in " + tf.Name())
|
||||||
|
case tf.Elem().Kind() != reflect.Uint8:
|
||||||
|
panic("bad element kind in byte slice case in " + tf.Name())
|
||||||
|
case isSlice: // E.g., [][]byte
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sbsp := src.toBytesSlice()
|
||||||
|
if *sbsp != nil {
|
||||||
|
dbsp := dst.toBytesSlice()
|
||||||
|
for _, sb := range *sbsp {
|
||||||
|
if sb == nil {
|
||||||
|
*dbsp = append(*dbsp, nil)
|
||||||
|
} else {
|
||||||
|
*dbsp = append(*dbsp, append([]byte{}, sb...))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if *dbsp == nil {
|
||||||
|
*dbsp = [][]byte{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: // E.g., []byte
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sbp := src.toBytes()
|
||||||
|
if *sbp != nil {
|
||||||
|
dbp := dst.toBytes()
|
||||||
|
if !isProto3 || len(*sbp) > 0 {
|
||||||
|
*dbp = append([]byte{}, *sbp...)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case reflect.Struct:
|
||||||
|
switch {
|
||||||
|
case !isPointer:
|
||||||
|
mergeInfo := getMergeInfo(tf)
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
mergeInfo.merge(dst, src)
|
||||||
|
}
|
||||||
|
case isSlice: // E.g., []*pb.T
|
||||||
|
mergeInfo := getMergeInfo(tf)
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sps := src.getPointerSlice()
|
||||||
|
if sps != nil {
|
||||||
|
dps := dst.getPointerSlice()
|
||||||
|
for _, sp := range sps {
|
||||||
|
var dp pointer
|
||||||
|
if !sp.isNil() {
|
||||||
|
dp = valToPointer(reflect.New(tf))
|
||||||
|
mergeInfo.merge(dp, sp)
|
||||||
|
}
|
||||||
|
dps = append(dps, dp)
|
||||||
|
}
|
||||||
|
if dps == nil {
|
||||||
|
dps = []pointer{}
|
||||||
|
}
|
||||||
|
dst.setPointerSlice(dps)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: // E.g., *pb.T
|
||||||
|
mergeInfo := getMergeInfo(tf)
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sp := src.getPointer()
|
||||||
|
if !sp.isNil() {
|
||||||
|
dp := dst.getPointer()
|
||||||
|
if dp.isNil() {
|
||||||
|
dp = valToPointer(reflect.New(tf))
|
||||||
|
dst.setPointer(dp)
|
||||||
|
}
|
||||||
|
mergeInfo.merge(dp, sp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case reflect.Map:
|
||||||
|
switch {
|
||||||
|
case isPointer || isSlice:
|
||||||
|
panic("bad pointer or slice in map case in " + tf.Name())
|
||||||
|
default: // E.g., map[K]V
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
sm := src.asPointerTo(tf).Elem()
|
||||||
|
if sm.Len() == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dm := dst.asPointerTo(tf).Elem()
|
||||||
|
if dm.IsNil() {
|
||||||
|
dm.Set(reflect.MakeMap(tf))
|
||||||
|
}
|
||||||
|
|
||||||
|
switch tf.Elem().Kind() {
|
||||||
|
case reflect.Ptr: // Proto struct (e.g., *T)
|
||||||
|
for _, key := range sm.MapKeys() {
|
||||||
|
val := sm.MapIndex(key)
|
||||||
|
val = reflect.ValueOf(Clone(val.Interface().(Message)))
|
||||||
|
dm.SetMapIndex(key, val)
|
||||||
|
}
|
||||||
|
case reflect.Slice: // E.g. Bytes type (e.g., []byte)
|
||||||
|
for _, key := range sm.MapKeys() {
|
||||||
|
val := sm.MapIndex(key)
|
||||||
|
val = reflect.ValueOf(append([]byte{}, val.Bytes()...))
|
||||||
|
dm.SetMapIndex(key, val)
|
||||||
|
}
|
||||||
|
default: // Basic type (e.g., string)
|
||||||
|
for _, key := range sm.MapKeys() {
|
||||||
|
val := sm.MapIndex(key)
|
||||||
|
dm.SetMapIndex(key, val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case reflect.Interface:
|
||||||
|
// Must be oneof field.
|
||||||
|
switch {
|
||||||
|
case isPointer || isSlice:
|
||||||
|
panic("bad pointer or slice in interface case in " + tf.Name())
|
||||||
|
default: // E.g., interface{}
|
||||||
|
// TODO: Make this faster?
|
||||||
|
mfi.merge = func(dst, src pointer) {
|
||||||
|
su := src.asPointerTo(tf).Elem()
|
||||||
|
if !su.IsNil() {
|
||||||
|
du := dst.asPointerTo(tf).Elem()
|
||||||
|
typ := su.Elem().Type()
|
||||||
|
if du.IsNil() || du.Elem().Type() != typ {
|
||||||
|
du.Set(reflect.New(typ.Elem())) // Initialize interface if empty
|
||||||
|
}
|
||||||
|
sv := su.Elem().Elem().Field(0)
|
||||||
|
if sv.Kind() == reflect.Ptr && sv.IsNil() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dv := du.Elem().Elem().Field(0)
|
||||||
|
if dv.Kind() == reflect.Ptr && dv.IsNil() {
|
||||||
|
dv.Set(reflect.New(sv.Type().Elem())) // Initialize proto message if empty
|
||||||
|
}
|
||||||
|
switch sv.Type().Kind() {
|
||||||
|
case reflect.Ptr: // Proto struct (e.g., *T)
|
||||||
|
Merge(dv.Interface().(Message), sv.Interface().(Message))
|
||||||
|
case reflect.Slice: // E.g. Bytes type (e.g., []byte)
|
||||||
|
dv.Set(reflect.ValueOf(append([]byte{}, sv.Bytes()...)))
|
||||||
|
default: // Basic type (e.g., string)
|
||||||
|
dv.Set(sv)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
panic(fmt.Sprintf("merger not found for type:%s", tf))
|
||||||
|
}
|
||||||
|
mi.fields = append(mi.fields, mfi)
|
||||||
|
}
|
||||||
|
|
||||||
|
mi.unrecognized = invalidField
|
||||||
|
if f, ok := t.FieldByName("XXX_unrecognized"); ok {
|
||||||
|
if f.Type != reflect.TypeOf([]byte{}) {
|
||||||
|
panic("expected XXX_unrecognized to be of type []byte")
|
||||||
|
}
|
||||||
|
mi.unrecognized = toField(&f)
|
||||||
|
}
|
||||||
|
|
||||||
|
atomic.StoreInt32(&mi.initialized, 1)
|
||||||
|
}
|
2245
vendor/github.com/gogo/protobuf/proto/table_unmarshal.go
generated
vendored
Normal file
2245
vendor/github.com/gogo/protobuf/proto/table_unmarshal.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
385
vendor/github.com/gogo/protobuf/proto/table_unmarshal_gogo.go
generated
vendored
Normal file
385
vendor/github.com/gogo/protobuf/proto/table_unmarshal_gogo.go
generated
vendored
Normal file
@ -0,0 +1,385 @@
|
|||||||
|
// Protocol Buffers for Go with Gadgets
|
||||||
|
//
|
||||||
|
// Copyright (c) 2018, The GoGo Authors. All rights reserved.
|
||||||
|
// http://github.com/gogo/protobuf
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
package proto
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"reflect"
|
||||||
|
)
|
||||||
|
|
||||||
|
func makeUnmarshalMessage(sub *unmarshalInfo, name string) unmarshaler {
|
||||||
|
return func(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return nil, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
// First read the message field to see if something is there.
|
||||||
|
// The semantics of multiple submessages are weird. Instead of
|
||||||
|
// the last one winning (as it is for all other fields), multiple
|
||||||
|
// submessages are merged.
|
||||||
|
v := f // gogo: changed from v := f.getPointer()
|
||||||
|
if v.isNil() {
|
||||||
|
v = valToPointer(reflect.New(sub.typ))
|
||||||
|
f.setPointer(v)
|
||||||
|
}
|
||||||
|
err := sub.unmarshal(v, b[:x])
|
||||||
|
if err != nil {
|
||||||
|
if r, ok := err.(*RequiredNotSetError); ok {
|
||||||
|
r.field = name + "." + r.field
|
||||||
|
} else {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return b[x:], err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeUnmarshalMessageSlice(sub *unmarshalInfo, name string) unmarshaler {
|
||||||
|
return func(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return nil, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
v := valToPointer(reflect.New(sub.typ))
|
||||||
|
err := sub.unmarshal(v, b[:x])
|
||||||
|
if err != nil {
|
||||||
|
if r, ok := err.(*RequiredNotSetError); ok {
|
||||||
|
r.field = name + "." + r.field
|
||||||
|
} else {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
f.appendRef(v, sub.typ) // gogo: changed from f.appendPointer(v)
|
||||||
|
return b[x:], err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeUnmarshalCustomPtr(sub *unmarshalInfo, name string) unmarshaler {
|
||||||
|
return func(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return nil, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
|
||||||
|
s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
|
||||||
|
s.Set(reflect.New(sub.typ))
|
||||||
|
m := s.Interface().(custom)
|
||||||
|
if err := m.Unmarshal(b[:x]); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[x:], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeUnmarshalCustomSlice(sub *unmarshalInfo, name string) unmarshaler {
|
||||||
|
return func(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return nil, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m := reflect.New(sub.typ)
|
||||||
|
c := m.Interface().(custom)
|
||||||
|
if err := c.Unmarshal(b[:x]); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
v := valToPointer(m)
|
||||||
|
f.appendRef(v, sub.typ)
|
||||||
|
return b[x:], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeUnmarshalCustom(sub *unmarshalInfo, name string) unmarshaler {
|
||||||
|
return func(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return nil, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
|
||||||
|
m := f.asPointerTo(sub.typ).Interface().(custom)
|
||||||
|
if err := m.Unmarshal(b[:x]); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[x:], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeUnmarshalTime(sub *unmarshalInfo, name string) unmarshaler {
|
||||||
|
return func(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return nil, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m := ×tamp{}
|
||||||
|
if err := Unmarshal(b[:x], m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
t, err := timestampFromProto(m)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
s := f.asPointerTo(sub.typ).Elem()
|
||||||
|
s.Set(reflect.ValueOf(t))
|
||||||
|
return b[x:], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeUnmarshalTimePtr(sub *unmarshalInfo, name string) unmarshaler {
|
||||||
|
return func(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return nil, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m := ×tamp{}
|
||||||
|
if err := Unmarshal(b[:x], m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
t, err := timestampFromProto(m)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
|
||||||
|
s.Set(reflect.ValueOf(&t))
|
||||||
|
return b[x:], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeUnmarshalTimePtrSlice(sub *unmarshalInfo, name string) unmarshaler {
|
||||||
|
return func(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return nil, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m := ×tamp{}
|
||||||
|
if err := Unmarshal(b[:x], m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
t, err := timestampFromProto(m)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
slice := f.getSlice(reflect.PtrTo(sub.typ))
|
||||||
|
newSlice := reflect.Append(slice, reflect.ValueOf(&t))
|
||||||
|
slice.Set(newSlice)
|
||||||
|
return b[x:], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeUnmarshalTimeSlice(sub *unmarshalInfo, name string) unmarshaler {
|
||||||
|
return func(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return nil, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m := ×tamp{}
|
||||||
|
if err := Unmarshal(b[:x], m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
t, err := timestampFromProto(m)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
slice := f.getSlice(sub.typ)
|
||||||
|
newSlice := reflect.Append(slice, reflect.ValueOf(t))
|
||||||
|
slice.Set(newSlice)
|
||||||
|
return b[x:], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeUnmarshalDurationPtr(sub *unmarshalInfo, name string) unmarshaler {
|
||||||
|
return func(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return nil, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m := &duration{}
|
||||||
|
if err := Unmarshal(b[:x], m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
d, err := durationFromProto(m)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem()
|
||||||
|
s.Set(reflect.ValueOf(&d))
|
||||||
|
return b[x:], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeUnmarshalDuration(sub *unmarshalInfo, name string) unmarshaler {
|
||||||
|
return func(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return nil, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m := &duration{}
|
||||||
|
if err := Unmarshal(b[:x], m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
d, err := durationFromProto(m)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
s := f.asPointerTo(sub.typ).Elem()
|
||||||
|
s.Set(reflect.ValueOf(d))
|
||||||
|
return b[x:], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeUnmarshalDurationPtrSlice(sub *unmarshalInfo, name string) unmarshaler {
|
||||||
|
return func(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return nil, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m := &duration{}
|
||||||
|
if err := Unmarshal(b[:x], m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
d, err := durationFromProto(m)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
slice := f.getSlice(reflect.PtrTo(sub.typ))
|
||||||
|
newSlice := reflect.Append(slice, reflect.ValueOf(&d))
|
||||||
|
slice.Set(newSlice)
|
||||||
|
return b[x:], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeUnmarshalDurationSlice(sub *unmarshalInfo, name string) unmarshaler {
|
||||||
|
return func(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return nil, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m := &duration{}
|
||||||
|
if err := Unmarshal(b[:x], m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
d, err := durationFromProto(m)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
slice := f.getSlice(sub.typ)
|
||||||
|
newSlice := reflect.Append(slice, reflect.ValueOf(d))
|
||||||
|
slice.Set(newSlice)
|
||||||
|
return b[x:], nil
|
||||||
|
}
|
||||||
|
}
|
65
vendor/github.com/gogo/protobuf/proto/text.go
generated
vendored
65
vendor/github.com/gogo/protobuf/proto/text.go
generated
vendored
@ -57,7 +57,6 @@ import (
|
|||||||
var (
|
var (
|
||||||
newline = []byte("\n")
|
newline = []byte("\n")
|
||||||
spaces = []byte(" ")
|
spaces = []byte(" ")
|
||||||
gtNewline = []byte(">\n")
|
|
||||||
endBraceNewline = []byte("}\n")
|
endBraceNewline = []byte("}\n")
|
||||||
backslashN = []byte{'\\', 'n'}
|
backslashN = []byte{'\\', 'n'}
|
||||||
backslashR = []byte{'\\', 'r'}
|
backslashR = []byte{'\\', 'r'}
|
||||||
@ -177,11 +176,6 @@ func writeName(w *textWriter, props *Properties) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// raw is the interface satisfied by RawMessage.
|
|
||||||
type raw interface {
|
|
||||||
Bytes() []byte
|
|
||||||
}
|
|
||||||
|
|
||||||
func requiresQuotes(u string) bool {
|
func requiresQuotes(u string) bool {
|
||||||
// When type URL contains any characters except [0-9A-Za-z./\-]*, it must be quoted.
|
// When type URL contains any characters except [0-9A-Za-z./\-]*, it must be quoted.
|
||||||
for _, ch := range u {
|
for _, ch := range u {
|
||||||
@ -276,6 +270,10 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
|
|||||||
props := sprops.Prop[i]
|
props := sprops.Prop[i]
|
||||||
name := st.Field(i).Name
|
name := st.Field(i).Name
|
||||||
|
|
||||||
|
if name == "XXX_NoUnkeyedLiteral" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(name, "XXX_") {
|
if strings.HasPrefix(name, "XXX_") {
|
||||||
// There are two XXX_ fields:
|
// There are two XXX_ fields:
|
||||||
// XXX_unrecognized []byte
|
// XXX_unrecognized []byte
|
||||||
@ -366,7 +364,7 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := tm.writeAny(w, key, props.mkeyprop); err != nil {
|
if err := tm.writeAny(w, key, props.MapKeyProp); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := w.WriteByte('\n'); err != nil {
|
if err := w.WriteByte('\n'); err != nil {
|
||||||
@ -383,7 +381,7 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := tm.writeAny(w, val, props.mvalprop); err != nil {
|
if err := tm.writeAny(w, val, props.MapValProp); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := w.WriteByte('\n'); err != nil {
|
if err := w.WriteByte('\n'); err != nil {
|
||||||
@ -447,12 +445,6 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if b, ok := fv.Interface().(raw); ok {
|
|
||||||
if err := writeRaw(w, b.Bytes()); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(props.Enum) > 0 {
|
if len(props.Enum) > 0 {
|
||||||
if err := tm.writeEnum(w, fv, props); err != nil {
|
if err := tm.writeEnum(w, fv, props); err != nil {
|
||||||
@ -475,7 +467,7 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
|
|||||||
pv = reflect.New(sv.Type())
|
pv = reflect.New(sv.Type())
|
||||||
pv.Elem().Set(sv)
|
pv.Elem().Set(sv)
|
||||||
}
|
}
|
||||||
if pv.Type().Implements(extensionRangeType) {
|
if _, err := extendable(pv.Interface()); err == nil {
|
||||||
if err := tm.writeExtensions(w, pv); err != nil {
|
if err := tm.writeExtensions(w, pv); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -484,27 +476,6 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// writeRaw writes an uninterpreted raw message.
|
|
||||||
func writeRaw(w *textWriter, b []byte) error {
|
|
||||||
if err := w.WriteByte('<'); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if !w.compact {
|
|
||||||
if err := w.WriteByte('\n'); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
w.indent()
|
|
||||||
if err := writeUnknownStruct(w, b); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
w.unindent()
|
|
||||||
if err := w.WriteByte('>'); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// writeAny writes an arbitrary field.
|
// writeAny writes an arbitrary field.
|
||||||
func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error {
|
func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error {
|
||||||
v = reflect.Indirect(v)
|
v = reflect.Indirect(v)
|
||||||
@ -605,6 +576,19 @@ func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Propert
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
w.indent()
|
w.indent()
|
||||||
|
if v.CanAddr() {
|
||||||
|
// Calling v.Interface on a struct causes the reflect package to
|
||||||
|
// copy the entire struct. This is racy with the new Marshaler
|
||||||
|
// since we atomically update the XXX_sizecache.
|
||||||
|
//
|
||||||
|
// Thus, we retrieve a pointer to the struct if possible to avoid
|
||||||
|
// a race since v.Interface on the pointer doesn't copy the struct.
|
||||||
|
//
|
||||||
|
// If v is not addressable, then we are not worried about a race
|
||||||
|
// since it implies that the binary Marshaler cannot possibly be
|
||||||
|
// mutating this value.
|
||||||
|
v = v.Addr()
|
||||||
|
}
|
||||||
if etm, ok := v.Interface().(encoding.TextMarshaler); ok {
|
if etm, ok := v.Interface().(encoding.TextMarshaler); ok {
|
||||||
text, err := etm.MarshalText()
|
text, err := etm.MarshalText()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -613,8 +597,13 @@ func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Propert
|
|||||||
if _, err = w.Write(text); err != nil {
|
if _, err = w.Write(text); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else if err := tm.writeStruct(w, v); err != nil {
|
} else {
|
||||||
return err
|
if v.Kind() == reflect.Ptr {
|
||||||
|
v = v.Elem()
|
||||||
|
}
|
||||||
|
if err := tm.writeStruct(w, v); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
w.unindent()
|
w.unindent()
|
||||||
if err := w.WriteByte(ket); err != nil {
|
if err := w.WriteByte(ket); err != nil {
|
||||||
|
103
vendor/github.com/gogo/protobuf/proto/text_parser.go
generated
vendored
103
vendor/github.com/gogo/protobuf/proto/text_parser.go
generated
vendored
@ -212,7 +212,6 @@ func (p *textParser) advance() {
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
errBadUTF8 = errors.New("proto: bad UTF-8")
|
errBadUTF8 = errors.New("proto: bad UTF-8")
|
||||||
errBadHex = errors.New("proto: bad hexadecimal")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func unquoteC(s string, quote rune) (string, error) {
|
func unquoteC(s string, quote rune) (string, error) {
|
||||||
@ -283,60 +282,47 @@ func unescape(s string) (ch string, tail string, err error) {
|
|||||||
return "?", s, nil // trigraph workaround
|
return "?", s, nil // trigraph workaround
|
||||||
case '\'', '"', '\\':
|
case '\'', '"', '\\':
|
||||||
return string(r), s, nil
|
return string(r), s, nil
|
||||||
case '0', '1', '2', '3', '4', '5', '6', '7', 'x', 'X':
|
case '0', '1', '2', '3', '4', '5', '6', '7':
|
||||||
if len(s) < 2 {
|
if len(s) < 2 {
|
||||||
return "", "", fmt.Errorf(`\%c requires 2 following digits`, r)
|
return "", "", fmt.Errorf(`\%c requires 2 following digits`, r)
|
||||||
}
|
}
|
||||||
base := 8
|
ss := string(r) + s[:2]
|
||||||
ss := s[:2]
|
|
||||||
s = s[2:]
|
s = s[2:]
|
||||||
if r == 'x' || r == 'X' {
|
i, err := strconv.ParseUint(ss, 8, 8)
|
||||||
base = 16
|
|
||||||
} else {
|
|
||||||
ss = string(r) + ss
|
|
||||||
}
|
|
||||||
i, err := strconv.ParseUint(ss, base, 8)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", err
|
return "", "", fmt.Errorf(`\%s contains non-octal digits`, ss)
|
||||||
}
|
}
|
||||||
return string([]byte{byte(i)}), s, nil
|
return string([]byte{byte(i)}), s, nil
|
||||||
case 'u', 'U':
|
case 'x', 'X', 'u', 'U':
|
||||||
n := 4
|
var n int
|
||||||
if r == 'U' {
|
switch r {
|
||||||
|
case 'x', 'X':
|
||||||
|
n = 2
|
||||||
|
case 'u':
|
||||||
|
n = 4
|
||||||
|
case 'U':
|
||||||
n = 8
|
n = 8
|
||||||
}
|
}
|
||||||
if len(s) < n {
|
if len(s) < n {
|
||||||
return "", "", fmt.Errorf(`\%c requires %d digits`, r, n)
|
return "", "", fmt.Errorf(`\%c requires %d following digits`, r, n)
|
||||||
}
|
|
||||||
|
|
||||||
bs := make([]byte, n/2)
|
|
||||||
for i := 0; i < n; i += 2 {
|
|
||||||
a, ok1 := unhex(s[i])
|
|
||||||
b, ok2 := unhex(s[i+1])
|
|
||||||
if !ok1 || !ok2 {
|
|
||||||
return "", "", errBadHex
|
|
||||||
}
|
|
||||||
bs[i/2] = a<<4 | b
|
|
||||||
}
|
}
|
||||||
|
ss := s[:n]
|
||||||
s = s[n:]
|
s = s[n:]
|
||||||
return string(bs), s, nil
|
i, err := strconv.ParseUint(ss, 16, 64)
|
||||||
|
if err != nil {
|
||||||
|
return "", "", fmt.Errorf(`\%c%s contains non-hexadecimal digits`, r, ss)
|
||||||
|
}
|
||||||
|
if r == 'x' || r == 'X' {
|
||||||
|
return string([]byte{byte(i)}), s, nil
|
||||||
|
}
|
||||||
|
if i > utf8.MaxRune {
|
||||||
|
return "", "", fmt.Errorf(`\%c%s is not a valid Unicode code point`, r, ss)
|
||||||
|
}
|
||||||
|
return string(i), s, nil
|
||||||
}
|
}
|
||||||
return "", "", fmt.Errorf(`unknown escape \%c`, r)
|
return "", "", fmt.Errorf(`unknown escape \%c`, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adapted from src/pkg/strconv/quote.go.
|
|
||||||
func unhex(b byte) (v byte, ok bool) {
|
|
||||||
switch {
|
|
||||||
case '0' <= b && b <= '9':
|
|
||||||
return b - '0', true
|
|
||||||
case 'a' <= b && b <= 'f':
|
|
||||||
return b - 'a' + 10, true
|
|
||||||
case 'A' <= b && b <= 'F':
|
|
||||||
return b - 'A' + 10, true
|
|
||||||
}
|
|
||||||
return 0, false
|
|
||||||
}
|
|
||||||
|
|
||||||
// Back off the parser by one token. Can only be done between calls to next().
|
// Back off the parser by one token. Can only be done between calls to next().
|
||||||
// It makes the next advance() a no-op.
|
// It makes the next advance() a no-op.
|
||||||
func (p *textParser) back() { p.backed = true }
|
func (p *textParser) back() { p.backed = true }
|
||||||
@ -650,17 +636,17 @@ func (p *textParser) readStruct(sv reflect.Value, terminator string) error {
|
|||||||
if err := p.consumeToken(":"); err != nil {
|
if err := p.consumeToken(":"); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := p.readAny(key, props.mkeyprop); err != nil {
|
if err := p.readAny(key, props.MapKeyProp); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := p.consumeOptionalSeparator(); err != nil {
|
if err := p.consumeOptionalSeparator(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
case "value":
|
case "value":
|
||||||
if err := p.checkForColon(props.mvalprop, dst.Type().Elem()); err != nil {
|
if err := p.checkForColon(props.MapValProp, dst.Type().Elem()); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := p.readAny(val, props.mvalprop); err != nil {
|
if err := p.readAny(val, props.MapValProp); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := p.consumeOptionalSeparator(); err != nil {
|
if err := p.consumeOptionalSeparator(); err != nil {
|
||||||
@ -734,6 +720,9 @@ func (p *textParser) consumeExtName() (string, error) {
|
|||||||
if tok.err != nil {
|
if tok.err != nil {
|
||||||
return "", p.errorf("unrecognized type_url or extension name: %s", tok.err)
|
return "", p.errorf("unrecognized type_url or extension name: %s", tok.err)
|
||||||
}
|
}
|
||||||
|
if p.done && tok.value != "]" {
|
||||||
|
return "", p.errorf("unclosed type_url or extension name")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return strings.Join(parts, ""), nil
|
return strings.Join(parts, ""), nil
|
||||||
}
|
}
|
||||||
@ -934,6 +923,16 @@ func (p *textParser) readAny(v reflect.Value, props *Properties) error {
|
|||||||
fv.SetFloat(f)
|
fv.SetFloat(f)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
case reflect.Int8:
|
||||||
|
if x, err := strconv.ParseInt(tok.value, 0, 8); err == nil {
|
||||||
|
fv.SetInt(x)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
case reflect.Int16:
|
||||||
|
if x, err := strconv.ParseInt(tok.value, 0, 16); err == nil {
|
||||||
|
fv.SetInt(x)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
case reflect.Int32:
|
case reflect.Int32:
|
||||||
if x, err := strconv.ParseInt(tok.value, 0, 32); err == nil {
|
if x, err := strconv.ParseInt(tok.value, 0, 32); err == nil {
|
||||||
fv.SetInt(x)
|
fv.SetInt(x)
|
||||||
@ -981,9 +980,19 @@ func (p *textParser) readAny(v reflect.Value, props *Properties) error {
|
|||||||
}
|
}
|
||||||
// TODO: Handle nested messages which implement encoding.TextUnmarshaler.
|
// TODO: Handle nested messages which implement encoding.TextUnmarshaler.
|
||||||
return p.readStruct(fv, terminator)
|
return p.readStruct(fv, terminator)
|
||||||
|
case reflect.Uint8:
|
||||||
|
if x, err := strconv.ParseUint(tok.value, 0, 8); err == nil {
|
||||||
|
fv.SetUint(x)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
case reflect.Uint16:
|
||||||
|
if x, err := strconv.ParseUint(tok.value, 0, 16); err == nil {
|
||||||
|
fv.SetUint(x)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
case reflect.Uint32:
|
case reflect.Uint32:
|
||||||
if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil {
|
if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil {
|
||||||
fv.SetUint(x)
|
fv.SetUint(uint64(x))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
case reflect.Uint64:
|
case reflect.Uint64:
|
||||||
@ -1001,13 +1010,9 @@ func (p *textParser) readAny(v reflect.Value, props *Properties) error {
|
|||||||
// UnmarshalText returns *RequiredNotSetError.
|
// UnmarshalText returns *RequiredNotSetError.
|
||||||
func UnmarshalText(s string, pb Message) error {
|
func UnmarshalText(s string, pb Message) error {
|
||||||
if um, ok := pb.(encoding.TextUnmarshaler); ok {
|
if um, ok := pb.(encoding.TextUnmarshaler); ok {
|
||||||
err := um.UnmarshalText([]byte(s))
|
return um.UnmarshalText([]byte(s))
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
pb.Reset()
|
pb.Reset()
|
||||||
v := reflect.ValueOf(pb)
|
v := reflect.ValueOf(pb)
|
||||||
if pe := newTextParser(s).readStruct(v.Elem(), ""); pe != nil {
|
return newTextParser(s).readStruct(v.Elem(), "")
|
||||||
return pe
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
180
vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go
generated
vendored
180
vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go
generated
vendored
@ -47,183 +47,3 @@ func (*timestamp) String() string { return "timestamp<string>" }
|
|||||||
func init() {
|
func init() {
|
||||||
RegisterType((*timestamp)(nil), "gogo.protobuf.proto.timestamp")
|
RegisterType((*timestamp)(nil), "gogo.protobuf.proto.timestamp")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Buffer) decTimestamp() (time.Time, error) {
|
|
||||||
b, err := o.DecodeRawBytes(true)
|
|
||||||
if err != nil {
|
|
||||||
return time.Time{}, err
|
|
||||||
}
|
|
||||||
tproto := ×tamp{}
|
|
||||||
if err := Unmarshal(b, tproto); err != nil {
|
|
||||||
return time.Time{}, err
|
|
||||||
}
|
|
||||||
return timestampFromProto(tproto)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) dec_time(p *Properties, base structPointer) error {
|
|
||||||
t, err := o.decTimestamp()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
setPtrCustomType(base, p.field, &t)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) dec_ref_time(p *Properties, base structPointer) error {
|
|
||||||
t, err := o.decTimestamp()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
setCustomType(base, p.field, &t)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) dec_slice_time(p *Properties, base structPointer) error {
|
|
||||||
t, err := o.decTimestamp()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
newBas := appendStructPointer(base, p.field, reflect.SliceOf(reflect.PtrTo(timeType)))
|
|
||||||
var zero field
|
|
||||||
setPtrCustomType(newBas, zero, &t)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) dec_slice_ref_time(p *Properties, base structPointer) error {
|
|
||||||
t, err := o.decTimestamp()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
newBas := appendStructPointer(base, p.field, reflect.SliceOf(timeType))
|
|
||||||
var zero field
|
|
||||||
setCustomType(newBas, zero, &t)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_time(p *Properties, base structPointer) (n int) {
|
|
||||||
structp := structPointer_GetStructPointer(base, p.field)
|
|
||||||
if structPointer_IsNil(structp) {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
tim := structPointer_Interface(structp, timeType).(*time.Time)
|
|
||||||
t, err := timestampProto(*tim)
|
|
||||||
if err != nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
size := Size(t)
|
|
||||||
return size + sizeVarint(uint64(size)) + len(p.tagcode)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) enc_time(p *Properties, base structPointer) error {
|
|
||||||
structp := structPointer_GetStructPointer(base, p.field)
|
|
||||||
if structPointer_IsNil(structp) {
|
|
||||||
return ErrNil
|
|
||||||
}
|
|
||||||
tim := structPointer_Interface(structp, timeType).(*time.Time)
|
|
||||||
t, err := timestampProto(*tim)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
data, err := Marshal(t)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
o.EncodeRawBytes(data)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_ref_time(p *Properties, base structPointer) (n int) {
|
|
||||||
tim := structPointer_InterfaceAt(base, p.field, timeType).(*time.Time)
|
|
||||||
t, err := timestampProto(*tim)
|
|
||||||
if err != nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
size := Size(t)
|
|
||||||
return size + sizeVarint(uint64(size)) + len(p.tagcode)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) enc_ref_time(p *Properties, base structPointer) error {
|
|
||||||
tim := structPointer_InterfaceAt(base, p.field, timeType).(*time.Time)
|
|
||||||
t, err := timestampProto(*tim)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
data, err := Marshal(t)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
o.EncodeRawBytes(data)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_slice_time(p *Properties, base structPointer) (n int) {
|
|
||||||
ptims := structPointer_InterfaceAt(base, p.field, reflect.SliceOf(reflect.PtrTo(timeType))).(*[]*time.Time)
|
|
||||||
tims := *ptims
|
|
||||||
for i := 0; i < len(tims); i++ {
|
|
||||||
if tims[i] == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
tproto, err := timestampProto(*tims[i])
|
|
||||||
if err != nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
size := Size(tproto)
|
|
||||||
n += len(p.tagcode) + size + sizeVarint(uint64(size))
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) enc_slice_time(p *Properties, base structPointer) error {
|
|
||||||
ptims := structPointer_InterfaceAt(base, p.field, reflect.SliceOf(reflect.PtrTo(timeType))).(*[]*time.Time)
|
|
||||||
tims := *ptims
|
|
||||||
for i := 0; i < len(tims); i++ {
|
|
||||||
if tims[i] == nil {
|
|
||||||
return errRepeatedHasNil
|
|
||||||
}
|
|
||||||
tproto, err := timestampProto(*tims[i])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
data, err := Marshal(tproto)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
o.EncodeRawBytes(data)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func size_slice_ref_time(p *Properties, base structPointer) (n int) {
|
|
||||||
ptims := structPointer_InterfaceAt(base, p.field, reflect.SliceOf(timeType)).(*[]time.Time)
|
|
||||||
tims := *ptims
|
|
||||||
for i := 0; i < len(tims); i++ {
|
|
||||||
tproto, err := timestampProto(tims[i])
|
|
||||||
if err != nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
size := Size(tproto)
|
|
||||||
n += len(p.tagcode) + size + sizeVarint(uint64(size))
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func (o *Buffer) enc_slice_ref_time(p *Properties, base structPointer) error {
|
|
||||||
ptims := structPointer_InterfaceAt(base, p.field, reflect.SliceOf(timeType)).(*[]time.Time)
|
|
||||||
tims := *ptims
|
|
||||||
for i := 0; i < len(tims); i++ {
|
|
||||||
tproto, err := timestampProto(tims[i])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
data, err := Marshal(tproto)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
o.buf = append(o.buf, p.tagcode...)
|
|
||||||
o.EncodeRawBytes(data)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
1888
vendor/github.com/gogo/protobuf/proto/wrappers.go
generated
vendored
Normal file
1888
vendor/github.com/gogo/protobuf/proto/wrappers.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
113
vendor/github.com/gogo/protobuf/proto/wrappers_gogo.go
generated
vendored
Normal file
113
vendor/github.com/gogo/protobuf/proto/wrappers_gogo.go
generated
vendored
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
// Protocol Buffers for Go with Gadgets
|
||||||
|
//
|
||||||
|
// Copyright (c) 2018, The GoGo Authors. All rights reserved.
|
||||||
|
// http://github.com/gogo/protobuf
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
package proto
|
||||||
|
|
||||||
|
type float64Value struct {
|
||||||
|
Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *float64Value) Reset() { *m = float64Value{} }
|
||||||
|
func (*float64Value) ProtoMessage() {}
|
||||||
|
func (*float64Value) String() string { return "float64<string>" }
|
||||||
|
|
||||||
|
type float32Value struct {
|
||||||
|
Value float32 `protobuf:"fixed32,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *float32Value) Reset() { *m = float32Value{} }
|
||||||
|
func (*float32Value) ProtoMessage() {}
|
||||||
|
func (*float32Value) String() string { return "float32<string>" }
|
||||||
|
|
||||||
|
type int64Value struct {
|
||||||
|
Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *int64Value) Reset() { *m = int64Value{} }
|
||||||
|
func (*int64Value) ProtoMessage() {}
|
||||||
|
func (*int64Value) String() string { return "int64<string>" }
|
||||||
|
|
||||||
|
type uint64Value struct {
|
||||||
|
Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *uint64Value) Reset() { *m = uint64Value{} }
|
||||||
|
func (*uint64Value) ProtoMessage() {}
|
||||||
|
func (*uint64Value) String() string { return "uint64<string>" }
|
||||||
|
|
||||||
|
type int32Value struct {
|
||||||
|
Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *int32Value) Reset() { *m = int32Value{} }
|
||||||
|
func (*int32Value) ProtoMessage() {}
|
||||||
|
func (*int32Value) String() string { return "int32<string>" }
|
||||||
|
|
||||||
|
type uint32Value struct {
|
||||||
|
Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *uint32Value) Reset() { *m = uint32Value{} }
|
||||||
|
func (*uint32Value) ProtoMessage() {}
|
||||||
|
func (*uint32Value) String() string { return "uint32<string>" }
|
||||||
|
|
||||||
|
type boolValue struct {
|
||||||
|
Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *boolValue) Reset() { *m = boolValue{} }
|
||||||
|
func (*boolValue) ProtoMessage() {}
|
||||||
|
func (*boolValue) String() string { return "bool<string>" }
|
||||||
|
|
||||||
|
type stringValue struct {
|
||||||
|
Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *stringValue) Reset() { *m = stringValue{} }
|
||||||
|
func (*stringValue) ProtoMessage() {}
|
||||||
|
func (*stringValue) String() string { return "string<string>" }
|
||||||
|
|
||||||
|
type bytesValue struct {
|
||||||
|
Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *bytesValue) Reset() { *m = bytesValue{} }
|
||||||
|
func (*bytesValue) ProtoMessage() {}
|
||||||
|
func (*bytesValue) String() string { return "[]byte<string>" }
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
RegisterType((*float64Value)(nil), "gogo.protobuf.proto.DoubleValue")
|
||||||
|
RegisterType((*float32Value)(nil), "gogo.protobuf.proto.FloatValue")
|
||||||
|
RegisterType((*int64Value)(nil), "gogo.protobuf.proto.Int64Value")
|
||||||
|
RegisterType((*uint64Value)(nil), "gogo.protobuf.proto.UInt64Value")
|
||||||
|
RegisterType((*int32Value)(nil), "gogo.protobuf.proto.Int32Value")
|
||||||
|
RegisterType((*uint32Value)(nil), "gogo.protobuf.proto.UInt32Value")
|
||||||
|
RegisterType((*boolValue)(nil), "gogo.protobuf.proto.BoolValue")
|
||||||
|
RegisterType((*stringValue)(nil), "gogo.protobuf.proto.StringValue")
|
||||||
|
RegisterType((*bytesValue)(nil), "gogo.protobuf.proto.BytesValue")
|
||||||
|
}
|
22
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/any.proto
generated
vendored
22
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/any.proto
generated
vendored
@ -120,17 +120,19 @@ option objc_class_prefix = "GPB";
|
|||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
message Any {
|
message Any {
|
||||||
// A URL/resource name whose content describes the type of the
|
// A URL/resource name that uniquely identifies the type of the serialized
|
||||||
// serialized protocol buffer message.
|
// protocol buffer message. This string must contain at least
|
||||||
|
// one "/" character. The last segment of the URL's path must represent
|
||||||
|
// the fully qualified name of the type (as in
|
||||||
|
// `path/google.protobuf.Duration`). The name should be in a canonical form
|
||||||
|
// (e.g., leading "." is not accepted).
|
||||||
//
|
//
|
||||||
// For URLs which use the scheme `http`, `https`, or no scheme, the
|
// In practice, teams usually precompile into the binary all types that they
|
||||||
// following restrictions and interpretations apply:
|
// expect it to use in the context of Any. However, for URLs which use the
|
||||||
|
// scheme `http`, `https`, or no scheme, one can optionally set up a type
|
||||||
|
// server that maps type URLs to message definitions as follows:
|
||||||
//
|
//
|
||||||
// * If no scheme is provided, `https` is assumed.
|
// * If no scheme is provided, `https` is assumed.
|
||||||
// * The last segment of the URL's path must represent the fully
|
|
||||||
// qualified name of the type (as in `path/google.protobuf.Duration`).
|
|
||||||
// The name should be in a canonical form (e.g., leading "." is
|
|
||||||
// not accepted).
|
|
||||||
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
||||||
// value in binary format, or produce an error.
|
// value in binary format, or produce an error.
|
||||||
// * Applications are allowed to cache lookup results based on the
|
// * Applications are allowed to cache lookup results based on the
|
||||||
@ -139,6 +141,10 @@ message Any {
|
|||||||
// on changes to types. (Use versioned type names to manage
|
// on changes to types. (Use versioned type names to manage
|
||||||
// breaking changes.)
|
// breaking changes.)
|
||||||
//
|
//
|
||||||
|
// Note: this functionality is not currently available in the official
|
||||||
|
// protobuf release, and it is not used for type URLs beginning with
|
||||||
|
// type.googleapis.com.
|
||||||
|
//
|
||||||
// Schemes other than `http`, `https` (or the empty scheme) might be
|
// Schemes other than `http`, `https` (or the empty scheme) might be
|
||||||
// used with implementation specific semantics.
|
// used with implementation specific semantics.
|
||||||
//
|
//
|
||||||
|
210
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/api.proto
generated
vendored
Normal file
210
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/api.proto
generated
vendored
Normal file
@ -0,0 +1,210 @@
|
|||||||
|
// Protocol Buffers - Google's data interchange format
|
||||||
|
// Copyright 2008 Google Inc. All rights reserved.
|
||||||
|
// https://developers.google.com/protocol-buffers/
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
// * Neither the name of Google Inc. nor the names of its
|
||||||
|
// contributors may be used to endorse or promote products derived from
|
||||||
|
// this software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package google.protobuf;
|
||||||
|
|
||||||
|
import "google/protobuf/source_context.proto";
|
||||||
|
import "google/protobuf/type.proto";
|
||||||
|
|
||||||
|
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||||
|
option java_package = "com.google.protobuf";
|
||||||
|
option java_outer_classname = "ApiProto";
|
||||||
|
option java_multiple_files = true;
|
||||||
|
option objc_class_prefix = "GPB";
|
||||||
|
option go_package = "types";
|
||||||
|
|
||||||
|
// Api is a light-weight descriptor for an API Interface.
|
||||||
|
//
|
||||||
|
// Interfaces are also described as "protocol buffer services" in some contexts,
|
||||||
|
// such as by the "service" keyword in a .proto file, but they are different
|
||||||
|
// from API Services, which represent a concrete implementation of an interface
|
||||||
|
// as opposed to simply a description of methods and bindings. They are also
|
||||||
|
// sometimes simply referred to as "APIs" in other contexts, such as the name of
|
||||||
|
// this message itself. See https://cloud.google.com/apis/design/glossary for
|
||||||
|
// detailed terminology.
|
||||||
|
message Api {
|
||||||
|
|
||||||
|
// The fully qualified name of this interface, including package name
|
||||||
|
// followed by the interface's simple name.
|
||||||
|
string name = 1;
|
||||||
|
|
||||||
|
// The methods of this interface, in unspecified order.
|
||||||
|
repeated Method methods = 2;
|
||||||
|
|
||||||
|
// Any metadata attached to the interface.
|
||||||
|
repeated Option options = 3;
|
||||||
|
|
||||||
|
// A version string for this interface. If specified, must have the form
|
||||||
|
// `major-version.minor-version`, as in `1.10`. If the minor version is
|
||||||
|
// omitted, it defaults to zero. If the entire version field is empty, the
|
||||||
|
// major version is derived from the package name, as outlined below. If the
|
||||||
|
// field is not empty, the version in the package name will be verified to be
|
||||||
|
// consistent with what is provided here.
|
||||||
|
//
|
||||||
|
// The versioning schema uses [semantic
|
||||||
|
// versioning](http://semver.org) where the major version number
|
||||||
|
// indicates a breaking change and the minor version an additive,
|
||||||
|
// non-breaking change. Both version numbers are signals to users
|
||||||
|
// what to expect from different versions, and should be carefully
|
||||||
|
// chosen based on the product plan.
|
||||||
|
//
|
||||||
|
// The major version is also reflected in the package name of the
|
||||||
|
// interface, which must end in `v<major-version>`, as in
|
||||||
|
// `google.feature.v1`. For major versions 0 and 1, the suffix can
|
||||||
|
// be omitted. Zero major versions must only be used for
|
||||||
|
// experimental, non-GA interfaces.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
string version = 4;
|
||||||
|
|
||||||
|
// Source context for the protocol buffer service represented by this
|
||||||
|
// message.
|
||||||
|
SourceContext source_context = 5;
|
||||||
|
|
||||||
|
// Included interfaces. See [Mixin][].
|
||||||
|
repeated Mixin mixins = 6;
|
||||||
|
|
||||||
|
// The source syntax of the service.
|
||||||
|
Syntax syntax = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Method represents a method of an API interface.
|
||||||
|
message Method {
|
||||||
|
|
||||||
|
// The simple name of this method.
|
||||||
|
string name = 1;
|
||||||
|
|
||||||
|
// A URL of the input message type.
|
||||||
|
string request_type_url = 2;
|
||||||
|
|
||||||
|
// If true, the request is streamed.
|
||||||
|
bool request_streaming = 3;
|
||||||
|
|
||||||
|
// The URL of the output message type.
|
||||||
|
string response_type_url = 4;
|
||||||
|
|
||||||
|
// If true, the response is streamed.
|
||||||
|
bool response_streaming = 5;
|
||||||
|
|
||||||
|
// Any metadata attached to the method.
|
||||||
|
repeated Option options = 6;
|
||||||
|
|
||||||
|
// The source syntax of this method.
|
||||||
|
Syntax syntax = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Declares an API Interface to be included in this interface. The including
|
||||||
|
// interface must redeclare all the methods from the included interface, but
|
||||||
|
// documentation and options are inherited as follows:
|
||||||
|
//
|
||||||
|
// - If after comment and whitespace stripping, the documentation
|
||||||
|
// string of the redeclared method is empty, it will be inherited
|
||||||
|
// from the original method.
|
||||||
|
//
|
||||||
|
// - Each annotation belonging to the service config (http,
|
||||||
|
// visibility) which is not set in the redeclared method will be
|
||||||
|
// inherited.
|
||||||
|
//
|
||||||
|
// - If an http annotation is inherited, the path pattern will be
|
||||||
|
// modified as follows. Any version prefix will be replaced by the
|
||||||
|
// version of the including interface plus the [root][] path if
|
||||||
|
// specified.
|
||||||
|
//
|
||||||
|
// Example of a simple mixin:
|
||||||
|
//
|
||||||
|
// package google.acl.v1;
|
||||||
|
// service AccessControl {
|
||||||
|
// // Get the underlying ACL object.
|
||||||
|
// rpc GetAcl(GetAclRequest) returns (Acl) {
|
||||||
|
// option (google.api.http).get = "/v1/{resource=**}:getAcl";
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// package google.storage.v2;
|
||||||
|
// service Storage {
|
||||||
|
// rpc GetAcl(GetAclRequest) returns (Acl);
|
||||||
|
//
|
||||||
|
// // Get a data record.
|
||||||
|
// rpc GetData(GetDataRequest) returns (Data) {
|
||||||
|
// option (google.api.http).get = "/v2/{resource=**}";
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Example of a mixin configuration:
|
||||||
|
//
|
||||||
|
// apis:
|
||||||
|
// - name: google.storage.v2.Storage
|
||||||
|
// mixins:
|
||||||
|
// - name: google.acl.v1.AccessControl
|
||||||
|
//
|
||||||
|
// The mixin construct implies that all methods in `AccessControl` are
|
||||||
|
// also declared with same name and request/response types in
|
||||||
|
// `Storage`. A documentation generator or annotation processor will
|
||||||
|
// see the effective `Storage.GetAcl` method after inherting
|
||||||
|
// documentation and annotations as follows:
|
||||||
|
//
|
||||||
|
// service Storage {
|
||||||
|
// // Get the underlying ACL object.
|
||||||
|
// rpc GetAcl(GetAclRequest) returns (Acl) {
|
||||||
|
// option (google.api.http).get = "/v2/{resource=**}:getAcl";
|
||||||
|
// }
|
||||||
|
// ...
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Note how the version in the path pattern changed from `v1` to `v2`.
|
||||||
|
//
|
||||||
|
// If the `root` field in the mixin is specified, it should be a
|
||||||
|
// relative path under which inherited HTTP paths are placed. Example:
|
||||||
|
//
|
||||||
|
// apis:
|
||||||
|
// - name: google.storage.v2.Storage
|
||||||
|
// mixins:
|
||||||
|
// - name: google.acl.v1.AccessControl
|
||||||
|
// root: acls
|
||||||
|
//
|
||||||
|
// This implies the following inherited HTTP annotation:
|
||||||
|
//
|
||||||
|
// service Storage {
|
||||||
|
// // Get the underlying ACL object.
|
||||||
|
// rpc GetAcl(GetAclRequest) returns (Acl) {
|
||||||
|
// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
|
||||||
|
// }
|
||||||
|
// ...
|
||||||
|
// }
|
||||||
|
message Mixin {
|
||||||
|
// The fully qualified name of the interface which is included.
|
||||||
|
string name = 1;
|
||||||
|
|
||||||
|
// If non-empty specifies a path under which inherited HTTP paths
|
||||||
|
// are rooted.
|
||||||
|
string root = 2;
|
||||||
|
}
|
17
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/descriptor.proto
generated
vendored
17
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/descriptor.proto
generated
vendored
@ -417,10 +417,23 @@ message FileOptions {
|
|||||||
// determining the namespace.
|
// determining the namespace.
|
||||||
optional string php_namespace = 41;
|
optional string php_namespace = 41;
|
||||||
|
|
||||||
// The parser stores options it doesn't recognize here. See above.
|
|
||||||
|
// 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.
|
||||||
|
optional string php_metadata_namespace = 44;
|
||||||
|
|
||||||
|
// 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
|
||||||
|
// 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;
|
repeated UninterpretedOption uninterpreted_option = 999;
|
||||||
|
|
||||||
// Clients can define custom options in extensions of this message. See above.
|
// Clients can define custom options in extensions of this message.
|
||||||
|
// See the documentation for the "Options" section above.
|
||||||
extensions 1000 to max;
|
extensions 1000 to max;
|
||||||
|
|
||||||
//reserved 38;
|
//reserved 38;
|
||||||
|
51
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/field_mask.proto
generated
vendored
51
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/field_mask.proto
generated
vendored
@ -38,6 +38,7 @@ option java_outer_classname = "FieldMaskProto";
|
|||||||
option java_multiple_files = true;
|
option java_multiple_files = true;
|
||||||
option objc_class_prefix = "GPB";
|
option objc_class_prefix = "GPB";
|
||||||
option go_package = "types";
|
option go_package = "types";
|
||||||
|
option cc_enable_arenas = true;
|
||||||
|
|
||||||
// `FieldMask` represents a set of symbolic field paths, for example:
|
// `FieldMask` represents a set of symbolic field paths, for example:
|
||||||
//
|
//
|
||||||
@ -107,57 +108,49 @@ option go_package = "types";
|
|||||||
// describe the updated values, the API ignores the values of all
|
// describe the updated values, the API ignores the values of all
|
||||||
// fields not covered by the mask.
|
// fields not covered by the mask.
|
||||||
//
|
//
|
||||||
// If a repeated field is specified for an update operation, the existing
|
// If a repeated field is specified for an update operation, new values will
|
||||||
// repeated values in the target resource will be overwritten by the new values.
|
// be appended to the existing repeated field in the target resource. Note that
|
||||||
// Note that a repeated field is only allowed in the last position of a `paths`
|
// a repeated field is only allowed in the last position of a `paths` string.
|
||||||
// string.
|
|
||||||
//
|
//
|
||||||
// If a sub-message is specified in the last position of the field mask for an
|
// If a sub-message is specified in the last position of the field mask for an
|
||||||
// update operation, then the existing sub-message in the target resource is
|
// update operation, then new value will be merged into the existing sub-message
|
||||||
// overwritten. Given the target message:
|
// in the target resource.
|
||||||
|
//
|
||||||
|
// For example, given the target message:
|
||||||
//
|
//
|
||||||
// f {
|
// f {
|
||||||
// b {
|
// b {
|
||||||
// d : 1
|
// d: 1
|
||||||
// x : 2
|
// x: 2
|
||||||
// }
|
// }
|
||||||
// c : 1
|
// c: [1]
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// And an update message:
|
// And an update message:
|
||||||
//
|
//
|
||||||
// f {
|
// f {
|
||||||
// b {
|
// b {
|
||||||
// d : 10
|
// d: 10
|
||||||
// }
|
// }
|
||||||
|
// c: [2]
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// then if the field mask is:
|
// then if the field mask is:
|
||||||
//
|
//
|
||||||
// paths: "f.b"
|
// paths: ["f.b", "f.c"]
|
||||||
//
|
//
|
||||||
// then the result will be:
|
// then the result will be:
|
||||||
//
|
//
|
||||||
// f {
|
// f {
|
||||||
// b {
|
// b {
|
||||||
// d : 10
|
// d: 10
|
||||||
|
// x: 2
|
||||||
// }
|
// }
|
||||||
// c : 1
|
// c: [1, 2]
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// However, if the update mask was:
|
// An implementation may provide options to override this default behavior for
|
||||||
//
|
// repeated and message fields.
|
||||||
// paths: "f.b.d"
|
|
||||||
//
|
|
||||||
// then the result would be:
|
|
||||||
//
|
|
||||||
// f {
|
|
||||||
// b {
|
|
||||||
// d : 10
|
|
||||||
// x : 2
|
|
||||||
// }
|
|
||||||
// c : 1
|
|
||||||
// }
|
|
||||||
//
|
//
|
||||||
// In order to reset a field's value to the default, the field must
|
// In order to reset a field's value to the default, the field must
|
||||||
// be in the mask and set to the default value in the provided resource.
|
// be in the mask and set to the default value in the provided resource.
|
||||||
@ -240,6 +233,12 @@ option go_package = "types";
|
|||||||
//
|
//
|
||||||
// Note that oneof type names ("test_oneof" in this case) cannot be used in
|
// Note that oneof type names ("test_oneof" in this case) cannot be used in
|
||||||
// paths.
|
// paths.
|
||||||
|
//
|
||||||
|
// ## Field Mask Verification
|
||||||
|
//
|
||||||
|
// The implementation of any API method which has a FieldMask type field in the
|
||||||
|
// request should verify the included field paths, and return an
|
||||||
|
// `INVALID_ARGUMENT` error if any path is duplicated or unmappable.
|
||||||
message FieldMask {
|
message FieldMask {
|
||||||
// The set of field mask paths.
|
// The set of field mask paths.
|
||||||
repeated string paths = 1;
|
repeated string paths = 1;
|
||||||
|
48
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/source_context.proto
generated
vendored
Normal file
48
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/source_context.proto
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// Protocol Buffers - Google's data interchange format
|
||||||
|
// Copyright 2008 Google Inc. All rights reserved.
|
||||||
|
// https://developers.google.com/protocol-buffers/
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
// * Neither the name of Google Inc. nor the names of its
|
||||||
|
// contributors may be used to endorse or promote products derived from
|
||||||
|
// this software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package google.protobuf;
|
||||||
|
|
||||||
|
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||||
|
option java_package = "com.google.protobuf";
|
||||||
|
option java_outer_classname = "SourceContextProto";
|
||||||
|
option java_multiple_files = true;
|
||||||
|
option objc_class_prefix = "GPB";
|
||||||
|
option go_package = "types";
|
||||||
|
|
||||||
|
// `SourceContext` represents information about the source of a
|
||||||
|
// protobuf element, like the file in which it is defined.
|
||||||
|
message SourceContext {
|
||||||
|
// The path-qualified name of the .proto file that contained the associated
|
||||||
|
// protobuf element. For example: `"google/protobuf/source_context.proto"`.
|
||||||
|
string file_name = 1;
|
||||||
|
}
|
34
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/timestamp.proto
generated
vendored
34
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/timestamp.proto
generated
vendored
@ -40,17 +40,19 @@ option java_outer_classname = "TimestampProto";
|
|||||||
option java_multiple_files = true;
|
option java_multiple_files = true;
|
||||||
option objc_class_prefix = "GPB";
|
option objc_class_prefix = "GPB";
|
||||||
|
|
||||||
// A Timestamp represents a point in time independent of any time zone
|
// A Timestamp represents a point in time independent of any time zone or local
|
||||||
// or calendar, represented as seconds and fractions of seconds at
|
// calendar, encoded as a count of seconds and fractions of seconds at
|
||||||
// nanosecond resolution in UTC Epoch time. It is encoded using the
|
// nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
||||||
// Proleptic Gregorian Calendar which extends the Gregorian calendar
|
// January 1, 1970, in the proleptic Gregorian calendar which extends the
|
||||||
// backwards to year one. It is encoded assuming all minutes are 60
|
// Gregorian calendar backwards to year one.
|
||||||
// seconds long, i.e. leap seconds are "smeared" so that no leap second
|
//
|
||||||
// table is needed for interpretation. Range is from
|
// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
||||||
// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
|
// second table is needed for interpretation, using a [24-hour linear
|
||||||
// By restricting to that range, we ensure that we can convert to
|
// smear](https://developers.google.com/time/smear).
|
||||||
// and from RFC 3339 date strings.
|
//
|
||||||
// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
|
// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
||||||
|
// restricting to that range, we ensure that we can convert to and from [RFC
|
||||||
|
// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
||||||
//
|
//
|
||||||
// # Examples
|
// # Examples
|
||||||
//
|
//
|
||||||
@ -103,19 +105,21 @@ option objc_class_prefix = "GPB";
|
|||||||
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
||||||
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
||||||
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
||||||
// is required, though only UTC (as indicated by "Z") is presently supported.
|
// is required. A proto3 JSON serializer should always use UTC (as indicated by
|
||||||
|
// "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
||||||
|
// able to accept both UTC and other timezones (as indicated by an offset).
|
||||||
//
|
//
|
||||||
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
||||||
// 01:30 UTC on January 15, 2017.
|
// 01:30 UTC on January 15, 2017.
|
||||||
//
|
//
|
||||||
// In JavaScript, one can convert a Date object to this format using the
|
// 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
|
// 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)
|
// 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
|
// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
||||||
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||||
// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#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.
|
// ) to obtain a formatter capable of generating timestamps in this format.
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
message Timestamp {
|
message Timestamp {
|
||||||
|
187
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/type.proto
generated
vendored
Normal file
187
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/type.proto
generated
vendored
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
// Protocol Buffers - Google's data interchange format
|
||||||
|
// Copyright 2008 Google Inc. All rights reserved.
|
||||||
|
// https://developers.google.com/protocol-buffers/
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
// * Neither the name of Google Inc. nor the names of its
|
||||||
|
// contributors may be used to endorse or promote products derived from
|
||||||
|
// this software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package google.protobuf;
|
||||||
|
|
||||||
|
import "google/protobuf/any.proto";
|
||||||
|
import "google/protobuf/source_context.proto";
|
||||||
|
|
||||||
|
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||||
|
option cc_enable_arenas = true;
|
||||||
|
option java_package = "com.google.protobuf";
|
||||||
|
option java_outer_classname = "TypeProto";
|
||||||
|
option java_multiple_files = true;
|
||||||
|
option objc_class_prefix = "GPB";
|
||||||
|
option go_package = "types";
|
||||||
|
|
||||||
|
// A protocol buffer message type.
|
||||||
|
message Type {
|
||||||
|
// The fully qualified message name.
|
||||||
|
string name = 1;
|
||||||
|
// The list of fields.
|
||||||
|
repeated Field fields = 2;
|
||||||
|
// The list of types appearing in `oneof` definitions in this type.
|
||||||
|
repeated string oneofs = 3;
|
||||||
|
// The protocol buffer options.
|
||||||
|
repeated Option options = 4;
|
||||||
|
// The source context.
|
||||||
|
SourceContext source_context = 5;
|
||||||
|
// The source syntax.
|
||||||
|
Syntax syntax = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
// A single field of a message type.
|
||||||
|
message Field {
|
||||||
|
// Basic field types.
|
||||||
|
enum Kind {
|
||||||
|
// Field type unknown.
|
||||||
|
TYPE_UNKNOWN = 0;
|
||||||
|
// Field type double.
|
||||||
|
TYPE_DOUBLE = 1;
|
||||||
|
// Field type float.
|
||||||
|
TYPE_FLOAT = 2;
|
||||||
|
// Field type int64.
|
||||||
|
TYPE_INT64 = 3;
|
||||||
|
// Field type uint64.
|
||||||
|
TYPE_UINT64 = 4;
|
||||||
|
// Field type int32.
|
||||||
|
TYPE_INT32 = 5;
|
||||||
|
// Field type fixed64.
|
||||||
|
TYPE_FIXED64 = 6;
|
||||||
|
// Field type fixed32.
|
||||||
|
TYPE_FIXED32 = 7;
|
||||||
|
// Field type bool.
|
||||||
|
TYPE_BOOL = 8;
|
||||||
|
// Field type string.
|
||||||
|
TYPE_STRING = 9;
|
||||||
|
// Field type group. Proto2 syntax only, and deprecated.
|
||||||
|
TYPE_GROUP = 10;
|
||||||
|
// Field type message.
|
||||||
|
TYPE_MESSAGE = 11;
|
||||||
|
// Field type bytes.
|
||||||
|
TYPE_BYTES = 12;
|
||||||
|
// Field type uint32.
|
||||||
|
TYPE_UINT32 = 13;
|
||||||
|
// Field type enum.
|
||||||
|
TYPE_ENUM = 14;
|
||||||
|
// Field type sfixed32.
|
||||||
|
TYPE_SFIXED32 = 15;
|
||||||
|
// Field type sfixed64.
|
||||||
|
TYPE_SFIXED64 = 16;
|
||||||
|
// Field type sint32.
|
||||||
|
TYPE_SINT32 = 17;
|
||||||
|
// Field type sint64.
|
||||||
|
TYPE_SINT64 = 18;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Whether a field is optional, required, or repeated.
|
||||||
|
enum Cardinality {
|
||||||
|
// For fields with unknown cardinality.
|
||||||
|
CARDINALITY_UNKNOWN = 0;
|
||||||
|
// For optional fields.
|
||||||
|
CARDINALITY_OPTIONAL = 1;
|
||||||
|
// For required fields. Proto2 syntax only.
|
||||||
|
CARDINALITY_REQUIRED = 2;
|
||||||
|
// For repeated fields.
|
||||||
|
CARDINALITY_REPEATED = 3;
|
||||||
|
};
|
||||||
|
|
||||||
|
// The field type.
|
||||||
|
Kind kind = 1;
|
||||||
|
// The field cardinality.
|
||||||
|
Cardinality cardinality = 2;
|
||||||
|
// The field number.
|
||||||
|
int32 number = 3;
|
||||||
|
// The field name.
|
||||||
|
string name = 4;
|
||||||
|
// The field type URL, without the scheme, for message or enumeration
|
||||||
|
// types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
|
||||||
|
string type_url = 6;
|
||||||
|
// The index of the field type in `Type.oneofs`, for message or enumeration
|
||||||
|
// types. The first type has index 1; zero means the type is not in the list.
|
||||||
|
int32 oneof_index = 7;
|
||||||
|
// Whether to use alternative packed wire representation.
|
||||||
|
bool packed = 8;
|
||||||
|
// The protocol buffer options.
|
||||||
|
repeated Option options = 9;
|
||||||
|
// The field JSON name.
|
||||||
|
string json_name = 10;
|
||||||
|
// The string value of the default value of this field. Proto2 syntax only.
|
||||||
|
string default_value = 11;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enum type definition.
|
||||||
|
message Enum {
|
||||||
|
// Enum type name.
|
||||||
|
string name = 1;
|
||||||
|
// Enum value definitions.
|
||||||
|
repeated EnumValue enumvalue = 2;
|
||||||
|
// Protocol buffer options.
|
||||||
|
repeated Option options = 3;
|
||||||
|
// The source context.
|
||||||
|
SourceContext source_context = 4;
|
||||||
|
// The source syntax.
|
||||||
|
Syntax syntax = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enum value definition.
|
||||||
|
message EnumValue {
|
||||||
|
// Enum value name.
|
||||||
|
string name = 1;
|
||||||
|
// Enum value number.
|
||||||
|
int32 number = 2;
|
||||||
|
// Protocol buffer options.
|
||||||
|
repeated Option options = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// A protocol buffer option, which can be attached to a message, field,
|
||||||
|
// enumeration, etc.
|
||||||
|
message Option {
|
||||||
|
// The option's name. For protobuf built-in options (options defined in
|
||||||
|
// descriptor.proto), this is the short name. For example, `"map_entry"`.
|
||||||
|
// For custom options, it should be the fully-qualified name. For example,
|
||||||
|
// `"google.api.http"`.
|
||||||
|
string name = 1;
|
||||||
|
// The option's value packed in an Any message. If the value is a primitive,
|
||||||
|
// the corresponding wrapper type defined in google/protobuf/wrappers.proto
|
||||||
|
// should be used. If the value is an enum, it should be stored as an int32
|
||||||
|
// value using the google.protobuf.Int32Value type.
|
||||||
|
Any value = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The syntax in which a protocol buffer element is defined.
|
||||||
|
enum Syntax {
|
||||||
|
// Syntax `proto2`.
|
||||||
|
SYNTAX_PROTO2 = 0;
|
||||||
|
// Syntax `proto3`.
|
||||||
|
SYNTAX_PROTO3 = 1;
|
||||||
|
}
|
5
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/wrappers.proto
generated
vendored
5
vendor/github.com/gogo/protobuf/protobuf/google/protobuf/wrappers.proto
generated
vendored
@ -32,6 +32,11 @@
|
|||||||
// for embedding primitives in the `google.protobuf.Any` type and for places
|
// for embedding primitives in the `google.protobuf.Any` type and for places
|
||||||
// where we need to distinguish between the absence of a primitive
|
// where we need to distinguish between the absence of a primitive
|
||||||
// typed field and its default value.
|
// typed field and its default value.
|
||||||
|
//
|
||||||
|
// These wrappers have no meaningful use within repeated fields as they lack
|
||||||
|
// the ability to detect presence on individual elements.
|
||||||
|
// These wrappers have no meaningful use within a map or a oneof since
|
||||||
|
// individual entries of a map or fields of a oneof can already detect presence.
|
||||||
|
|
||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
|
|
||||||
|
1265
vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go
generated
vendored
1265
vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
58
vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go
generated
vendored
58
vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go
generated
vendored
@ -1,44 +1,18 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
// source: descriptor.proto
|
// source: descriptor.proto
|
||||||
|
|
||||||
/*
|
|
||||||
Package descriptor is a generated protocol buffer package.
|
|
||||||
|
|
||||||
It is generated from these files:
|
|
||||||
descriptor.proto
|
|
||||||
|
|
||||||
It has these top-level messages:
|
|
||||||
FileDescriptorSet
|
|
||||||
FileDescriptorProto
|
|
||||||
DescriptorProto
|
|
||||||
ExtensionRangeOptions
|
|
||||||
FieldDescriptorProto
|
|
||||||
OneofDescriptorProto
|
|
||||||
EnumDescriptorProto
|
|
||||||
EnumValueDescriptorProto
|
|
||||||
ServiceDescriptorProto
|
|
||||||
MethodDescriptorProto
|
|
||||||
FileOptions
|
|
||||||
MessageOptions
|
|
||||||
FieldOptions
|
|
||||||
OneofOptions
|
|
||||||
EnumOptions
|
|
||||||
EnumValueOptions
|
|
||||||
ServiceOptions
|
|
||||||
MethodOptions
|
|
||||||
UninterpretedOption
|
|
||||||
SourceCodeInfo
|
|
||||||
GeneratedCodeInfo
|
|
||||||
*/
|
|
||||||
package descriptor
|
package descriptor
|
||||||
|
|
||||||
import fmt "fmt"
|
import (
|
||||||
import strings "strings"
|
fmt "fmt"
|
||||||
import proto "github.com/gogo/protobuf/proto"
|
github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
|
||||||
import sort "sort"
|
proto "github.com/gogo/protobuf/proto"
|
||||||
import strconv "strconv"
|
math "math"
|
||||||
import reflect "reflect"
|
reflect "reflect"
|
||||||
import math "math"
|
sort "sort"
|
||||||
|
strconv "strconv"
|
||||||
|
strings "strings"
|
||||||
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -386,7 +360,7 @@ func (this *FileOptions) GoString() string {
|
|||||||
if this == nil {
|
if this == nil {
|
||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
s := make([]string, 0, 23)
|
s := make([]string, 0, 25)
|
||||||
s = append(s, "&descriptor.FileOptions{")
|
s = append(s, "&descriptor.FileOptions{")
|
||||||
if this.JavaPackage != nil {
|
if this.JavaPackage != nil {
|
||||||
s = append(s, "JavaPackage: "+valueToGoStringDescriptor(this.JavaPackage, "string")+",\n")
|
s = append(s, "JavaPackage: "+valueToGoStringDescriptor(this.JavaPackage, "string")+",\n")
|
||||||
@ -442,6 +416,12 @@ func (this *FileOptions) GoString() string {
|
|||||||
if this.PhpNamespace != nil {
|
if this.PhpNamespace != nil {
|
||||||
s = append(s, "PhpNamespace: "+valueToGoStringDescriptor(this.PhpNamespace, "string")+",\n")
|
s = append(s, "PhpNamespace: "+valueToGoStringDescriptor(this.PhpNamespace, "string")+",\n")
|
||||||
}
|
}
|
||||||
|
if this.PhpMetadataNamespace != nil {
|
||||||
|
s = append(s, "PhpMetadataNamespace: "+valueToGoStringDescriptor(this.PhpMetadataNamespace, "string")+",\n")
|
||||||
|
}
|
||||||
|
if this.RubyPackage != nil {
|
||||||
|
s = append(s, "RubyPackage: "+valueToGoStringDescriptor(this.RubyPackage, "string")+",\n")
|
||||||
|
}
|
||||||
if this.UninterpretedOption != nil {
|
if this.UninterpretedOption != nil {
|
||||||
s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
|
s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n")
|
||||||
}
|
}
|
||||||
@ -752,8 +732,8 @@ func valueToGoStringDescriptor(v interface{}, typ string) string {
|
|||||||
pv := reflect.Indirect(rv).Interface()
|
pv := reflect.Indirect(rv).Interface()
|
||||||
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
|
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
|
||||||
}
|
}
|
||||||
func extensionToGoStringDescriptor(m proto.Message) string {
|
func extensionToGoStringDescriptor(m github_com_gogo_protobuf_proto.Message) string {
|
||||||
e := proto.GetUnsafeExtensionsMap(m)
|
e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m)
|
||||||
if e == nil {
|
if e == nil {
|
||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
|
3464
vendor/github.com/gogo/protobuf/protoc-gen-gogo/generator/generator.go
generated
vendored
3464
vendor/github.com/gogo/protobuf/protoc-gen-gogo/generator/generator.go
generated
vendored
File diff suppressed because it is too large
Load Diff
35
vendor/github.com/gogo/protobuf/protoc-gen-gogo/generator/helper.go
generated
vendored
35
vendor/github.com/gogo/protobuf/protoc-gen-gogo/generator/helper.go
generated
vendored
@ -118,7 +118,7 @@ func (this *pluginImports) NewImport(pkg string) Single {
|
|||||||
func (this *pluginImports) GenerateImports(file *FileDescriptor) {
|
func (this *pluginImports) GenerateImports(file *FileDescriptor) {
|
||||||
for _, s := range this.singles {
|
for _, s := range this.singles {
|
||||||
if s.IsUsed() {
|
if s.IsUsed() {
|
||||||
this.generator.PrintImport(s.Name(), s.Location())
|
this.generator.PrintImport(GoPackageName(s.Name()), GoImportPath(s.Location()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@ type importedPackage struct {
|
|||||||
importPrefix string
|
importPrefix string
|
||||||
}
|
}
|
||||||
|
|
||||||
func newImportedPackage(importPrefix, pkg string) *importedPackage {
|
func newImportedPackage(importPrefix string, pkg string) *importedPackage {
|
||||||
return &importedPackage{
|
return &importedPackage{
|
||||||
pkg: pkg,
|
pkg: pkg,
|
||||||
importPrefix: importPrefix,
|
importPrefix: importPrefix,
|
||||||
@ -146,7 +146,7 @@ func newImportedPackage(importPrefix, pkg string) *importedPackage {
|
|||||||
|
|
||||||
func (this *importedPackage) Use() string {
|
func (this *importedPackage) Use() string {
|
||||||
if !this.used {
|
if !this.used {
|
||||||
this.name = RegisterUniquePackageName(this.pkg, nil)
|
this.name = string(cleanPackageName(this.pkg))
|
||||||
this.used = true
|
this.used = true
|
||||||
}
|
}
|
||||||
return this.name
|
return this.name
|
||||||
@ -182,7 +182,7 @@ func (g *Generator) GetFieldName(message *Descriptor, field *descriptor.FieldDes
|
|||||||
return fieldname + "_"
|
return fieldname + "_"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !gogoproto.IsProtoSizer(message.file, message.DescriptorProto) {
|
if !gogoproto.IsProtoSizer(message.file.FileDescriptorProto, message.DescriptorProto) {
|
||||||
if fieldname == "Size" {
|
if fieldname == "Size" {
|
||||||
return fieldname + "_"
|
return fieldname + "_"
|
||||||
}
|
}
|
||||||
@ -204,7 +204,7 @@ func (g *Generator) GetOneOfFieldName(message *Descriptor, field *descriptor.Fie
|
|||||||
return fieldname + "_"
|
return fieldname + "_"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !gogoproto.IsProtoSizer(message.file, message.DescriptorProto) {
|
if !gogoproto.IsProtoSizer(message.file.FileDescriptorProto, message.DescriptorProto) {
|
||||||
if fieldname == "Size" {
|
if fieldname == "Size" {
|
||||||
return fieldname + "_"
|
return fieldname + "_"
|
||||||
}
|
}
|
||||||
@ -262,6 +262,13 @@ func (g *Generator) GetMapValueField(field, valField *descriptor.FieldDescriptor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wktptr := gogoproto.IsWktPtr(field)
|
||||||
|
if wktptr {
|
||||||
|
if err := proto.SetExtension(valField.Options, gogoproto.E_Wktpointer, &wktptr); err != nil {
|
||||||
|
g.Fail(err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if valType := gogoproto.GetCastValue(field); len(valType) > 0 {
|
if valType := gogoproto.GetCastValue(field); len(valType) > 0 {
|
||||||
if err := proto.SetExtension(valField.Options, gogoproto.E_Casttype, &valType); err != nil {
|
if err := proto.SetExtension(valField.Options, gogoproto.E_Casttype, &valType); err != nil {
|
||||||
g.Fail(err.Error())
|
g.Fail(err.Error())
|
||||||
@ -333,20 +340,22 @@ func (g *Generator) GeneratePlugin(p Plugin) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
g.Response.File = append(g.Response.File, &plugin.CodeGeneratorResponse_File{
|
g.Response.File = append(g.Response.File, &plugin.CodeGeneratorResponse_File{
|
||||||
Name: proto.String(file.goFileName()),
|
Name: proto.String(file.goFileName(g.pathType)),
|
||||||
Content: proto.String(g.String()),
|
Content: proto.String(g.String()),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Generator) SetFile(file *descriptor.FileDescriptorProto) {
|
func (g *Generator) SetFile(filename string) {
|
||||||
g.file = g.FileOf(file)
|
g.file = g.fileByName(filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Generator) generatePlugin(file *FileDescriptor, p Plugin) {
|
func (g *Generator) generatePlugin(file *FileDescriptor, p Plugin) {
|
||||||
g.writtenImports = make(map[string]bool)
|
g.writtenImports = make(map[string]bool)
|
||||||
g.file = g.FileOf(file.FileDescriptorProto)
|
g.usedPackages = make(map[GoImportPath]bool)
|
||||||
g.usedPackages = make(map[string]bool)
|
g.packageNames = make(map[GoImportPath]GoPackageName)
|
||||||
|
g.usedPackageNames = make(map[GoPackageName]bool)
|
||||||
|
g.file = file
|
||||||
|
|
||||||
// Run the plugins before the imports so we know which imports are necessary.
|
// Run the plugins before the imports so we know which imports are necessary.
|
||||||
p.Generate(file)
|
p.Generate(file)
|
||||||
@ -355,7 +364,7 @@ func (g *Generator) generatePlugin(file *FileDescriptor, p Plugin) {
|
|||||||
rem := g.Buffer
|
rem := g.Buffer
|
||||||
g.Buffer = new(bytes.Buffer)
|
g.Buffer = new(bytes.Buffer)
|
||||||
g.generateHeader()
|
g.generateHeader()
|
||||||
p.GenerateImports(g.file)
|
// p.GenerateImports(g.file)
|
||||||
g.generateImports()
|
g.generateImports()
|
||||||
if !g.writeOutput {
|
if !g.writeOutput {
|
||||||
return
|
return
|
||||||
@ -445,3 +454,7 @@ func (g *Generator) useTypes() string {
|
|||||||
g.customImports = append(g.customImports, "github.com/gogo/protobuf/types")
|
g.customImports = append(g.customImports, "github.com/gogo/protobuf/types")
|
||||||
return pkg
|
return pkg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *FileDescriptor) GoPackageName() string {
|
||||||
|
return string(d.packageName)
|
||||||
|
}
|
||||||
|
117
vendor/github.com/gogo/protobuf/protoc-gen-gogo/generator/internal/remap/remap.go
generated
vendored
Normal file
117
vendor/github.com/gogo/protobuf/protoc-gen-gogo/generator/internal/remap/remap.go
generated
vendored
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
// Go support for Protocol Buffers - Google's data interchange format
|
||||||
|
//
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// https://github.com/golang/protobuf
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
// * Neither the name of Google Inc. nor the names of its
|
||||||
|
// contributors may be used to endorse or promote products derived from
|
||||||
|
// this software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
/*
|
||||||
|
Package remap handles tracking the locations of Go tokens in a source text
|
||||||
|
across a rewrite by the Go formatter.
|
||||||
|
*/
|
||||||
|
package remap
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"go/scanner"
|
||||||
|
"go/token"
|
||||||
|
)
|
||||||
|
|
||||||
|
// A Location represents a span of byte offsets in the source text.
|
||||||
|
type Location struct {
|
||||||
|
Pos, End int // End is exclusive
|
||||||
|
}
|
||||||
|
|
||||||
|
// A Map represents a mapping between token locations in an input source text
|
||||||
|
// and locations in the correspnding output text.
|
||||||
|
type Map map[Location]Location
|
||||||
|
|
||||||
|
// Find reports whether the specified span is recorded by m, and if so returns
|
||||||
|
// the new location it was mapped to. If the input span was not found, the
|
||||||
|
// returned location is the same as the input.
|
||||||
|
func (m Map) Find(pos, end int) (Location, bool) {
|
||||||
|
key := Location{
|
||||||
|
Pos: pos,
|
||||||
|
End: end,
|
||||||
|
}
|
||||||
|
if loc, ok := m[key]; ok {
|
||||||
|
return loc, true
|
||||||
|
}
|
||||||
|
return key, false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m Map) add(opos, oend, npos, nend int) {
|
||||||
|
m[Location{Pos: opos, End: oend}] = Location{Pos: npos, End: nend}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compute constructs a location mapping from input to output. An error is
|
||||||
|
// reported if any of the tokens of output cannot be mapped.
|
||||||
|
func Compute(input, output []byte) (Map, error) {
|
||||||
|
itok := tokenize(input)
|
||||||
|
otok := tokenize(output)
|
||||||
|
if len(itok) != len(otok) {
|
||||||
|
return nil, fmt.Errorf("wrong number of tokens, %d ≠ %d", len(itok), len(otok))
|
||||||
|
}
|
||||||
|
m := make(Map)
|
||||||
|
for i, ti := range itok {
|
||||||
|
to := otok[i]
|
||||||
|
if ti.Token != to.Token {
|
||||||
|
return nil, fmt.Errorf("token %d type mismatch: %s ≠ %s", i+1, ti, to)
|
||||||
|
}
|
||||||
|
m.add(ti.pos, ti.end, to.pos, to.end)
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// tokinfo records the span and type of a source token.
|
||||||
|
type tokinfo struct {
|
||||||
|
pos, end int
|
||||||
|
token.Token
|
||||||
|
}
|
||||||
|
|
||||||
|
func tokenize(src []byte) []tokinfo {
|
||||||
|
fs := token.NewFileSet()
|
||||||
|
var s scanner.Scanner
|
||||||
|
s.Init(fs.AddFile("src", fs.Base(), len(src)), src, nil, scanner.ScanComments)
|
||||||
|
var info []tokinfo
|
||||||
|
for {
|
||||||
|
pos, next, lit := s.Scan()
|
||||||
|
switch next {
|
||||||
|
case token.SEMICOLON:
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
info = append(info, tokinfo{
|
||||||
|
pos: int(pos - 1),
|
||||||
|
end: int(pos + token.Pos(len(lit)) - 1),
|
||||||
|
Token: next,
|
||||||
|
})
|
||||||
|
if next == token.EOF {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return info
|
||||||
|
}
|
55
vendor/github.com/gogo/protobuf/protoc-gen-gogo/grpc/grpc.go
generated
vendored
55
vendor/github.com/gogo/protobuf/protoc-gen-gogo/grpc/grpc.go
generated
vendored
@ -52,7 +52,7 @@ const generatedCodeVersion = 4
|
|||||||
// Paths for packages used by code generated in this file,
|
// Paths for packages used by code generated in this file,
|
||||||
// relative to the import_prefix of the generator.Generator.
|
// relative to the import_prefix of the generator.Generator.
|
||||||
const (
|
const (
|
||||||
contextPkgPath = "golang.org/x/net/context"
|
contextPkgPath = "context"
|
||||||
grpcPkgPath = "google.golang.org/grpc"
|
grpcPkgPath = "google.golang.org/grpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -82,8 +82,6 @@ var (
|
|||||||
// Init initializes the plugin.
|
// Init initializes the plugin.
|
||||||
func (g *grpc) Init(gen *generator.Generator) {
|
func (g *grpc) Init(gen *generator.Generator) {
|
||||||
g.gen = gen
|
g.gen = gen
|
||||||
contextPkg = generator.RegisterUniquePackageName("context", nil)
|
|
||||||
grpcPkg = generator.RegisterUniquePackageName("grpc", nil)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Given a type name defined in a .proto, return its object.
|
// Given a type name defined in a .proto, return its object.
|
||||||
@ -107,6 +105,9 @@ func (g *grpc) Generate(file *generator.FileDescriptor) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
contextPkg = string(g.gen.AddImport(contextPkgPath))
|
||||||
|
grpcPkg = string(g.gen.AddImport(grpcPkgPath))
|
||||||
|
|
||||||
g.P("// Reference imports to suppress errors if they are not otherwise used.")
|
g.P("// Reference imports to suppress errors if they are not otherwise used.")
|
||||||
g.P("var _ ", contextPkg, ".Context")
|
g.P("var _ ", contextPkg, ".Context")
|
||||||
g.P("var _ ", grpcPkg, ".ClientConn")
|
g.P("var _ ", grpcPkg, ".ClientConn")
|
||||||
@ -124,24 +125,19 @@ func (g *grpc) Generate(file *generator.FileDescriptor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GenerateImports generates the import declaration for this file.
|
// GenerateImports generates the import declaration for this file.
|
||||||
func (g *grpc) GenerateImports(file *generator.FileDescriptor) {
|
func (g *grpc) GenerateImports(file *generator.FileDescriptor) {}
|
||||||
if len(file.FileDescriptorProto.Service) == 0 {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
imports := generator.NewPluginImports(g.gen)
|
|
||||||
for _, i := range []string{contextPkgPath, grpcPkgPath} {
|
|
||||||
imports.NewImport(i).Use()
|
|
||||||
}
|
|
||||||
imports.GenerateImports(file)
|
|
||||||
}
|
|
||||||
|
|
||||||
// reservedClientName records whether a client name is reserved on the client side.
|
// reservedClientName records whether a client name is reserved on the client side.
|
||||||
var reservedClientName = map[string]bool{
|
var reservedClientName = map[string]bool{
|
||||||
// TODO: do we need any in gRPC?
|
// TODO: do we need any in gRPC?
|
||||||
}
|
}
|
||||||
|
|
||||||
func unexport(s string) string { return strings.ToLower(s[:1]) + s[1:] }
|
func unexport(s string) string { return strings.ToLower(s[:1]) + s[1:] }
|
||||||
|
|
||||||
|
// deprecationComment is the standard comment added to deprecated
|
||||||
|
// messages, fields, enums, and enum values.
|
||||||
|
var deprecationComment = "// Deprecated: Do not use."
|
||||||
|
|
||||||
// generateService generates all the code for the named service.
|
// generateService generates all the code for the named service.
|
||||||
func (g *grpc) generateService(file *generator.FileDescriptor, service *pb.ServiceDescriptorProto, index int) {
|
func (g *grpc) generateService(file *generator.FileDescriptor, service *pb.ServiceDescriptorProto, index int) {
|
||||||
path := fmt.Sprintf("6,%d", index) // 6 means service.
|
path := fmt.Sprintf("6,%d", index) // 6 means service.
|
||||||
@ -152,12 +148,18 @@ func (g *grpc) generateService(file *generator.FileDescriptor, service *pb.Servi
|
|||||||
fullServName = pkg + "." + fullServName
|
fullServName = pkg + "." + fullServName
|
||||||
}
|
}
|
||||||
servName := generator.CamelCase(origServName)
|
servName := generator.CamelCase(origServName)
|
||||||
|
deprecated := service.GetOptions().GetDeprecated()
|
||||||
|
|
||||||
g.P()
|
g.P()
|
||||||
g.P("// Client API for ", servName, " service")
|
g.P(fmt.Sprintf(`// %sClient is the client API for %s service.
|
||||||
g.P()
|
//
|
||||||
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.`, servName, servName))
|
||||||
|
|
||||||
// Client interface.
|
// Client interface.
|
||||||
|
if deprecated {
|
||||||
|
g.P("//")
|
||||||
|
g.P(deprecationComment)
|
||||||
|
}
|
||||||
g.P("type ", servName, "Client interface {")
|
g.P("type ", servName, "Client interface {")
|
||||||
for i, method := range service.Method {
|
for i, method := range service.Method {
|
||||||
g.gen.PrintComments(fmt.Sprintf("%s,2,%d", path, i)) // 2 means method in a service.
|
g.gen.PrintComments(fmt.Sprintf("%s,2,%d", path, i)) // 2 means method in a service.
|
||||||
@ -173,6 +175,9 @@ func (g *grpc) generateService(file *generator.FileDescriptor, service *pb.Servi
|
|||||||
g.P()
|
g.P()
|
||||||
|
|
||||||
// NewClient factory.
|
// NewClient factory.
|
||||||
|
if deprecated {
|
||||||
|
g.P(deprecationComment)
|
||||||
|
}
|
||||||
g.P("func New", servName, "Client (cc *", grpcPkg, ".ClientConn) ", servName, "Client {")
|
g.P("func New", servName, "Client (cc *", grpcPkg, ".ClientConn) ", servName, "Client {")
|
||||||
g.P("return &", unexport(servName), "Client{cc}")
|
g.P("return &", unexport(servName), "Client{cc}")
|
||||||
g.P("}")
|
g.P("}")
|
||||||
@ -195,11 +200,13 @@ func (g *grpc) generateService(file *generator.FileDescriptor, service *pb.Servi
|
|||||||
g.generateClientMethod(servName, fullServName, serviceDescVar, method, descExpr)
|
g.generateClientMethod(servName, fullServName, serviceDescVar, method, descExpr)
|
||||||
}
|
}
|
||||||
|
|
||||||
g.P("// Server API for ", servName, " service")
|
|
||||||
g.P()
|
|
||||||
|
|
||||||
// Server interface.
|
// Server interface.
|
||||||
serverType := servName + "Server"
|
serverType := servName + "Server"
|
||||||
|
g.P("// ", serverType, " is the server API for ", servName, " service.")
|
||||||
|
if deprecated {
|
||||||
|
g.P("//")
|
||||||
|
g.P(deprecationComment)
|
||||||
|
}
|
||||||
g.P("type ", serverType, " interface {")
|
g.P("type ", serverType, " interface {")
|
||||||
for i, method := range service.Method {
|
for i, method := range service.Method {
|
||||||
g.gen.PrintComments(fmt.Sprintf("%s,2,%d", path, i)) // 2 means method in a service.
|
g.gen.PrintComments(fmt.Sprintf("%s,2,%d", path, i)) // 2 means method in a service.
|
||||||
@ -209,6 +216,9 @@ func (g *grpc) generateService(file *generator.FileDescriptor, service *pb.Servi
|
|||||||
g.P()
|
g.P()
|
||||||
|
|
||||||
// Server registration.
|
// Server registration.
|
||||||
|
if deprecated {
|
||||||
|
g.P(deprecationComment)
|
||||||
|
}
|
||||||
g.P("func Register", servName, "Server(s *", grpcPkg, ".Server, srv ", serverType, ") {")
|
g.P("func Register", servName, "Server(s *", grpcPkg, ".Server, srv ", serverType, ") {")
|
||||||
g.P("s.RegisterService(&", serviceDescVar, `, srv)`)
|
g.P("s.RegisterService(&", serviceDescVar, `, srv)`)
|
||||||
g.P("}")
|
g.P("}")
|
||||||
@ -282,11 +292,14 @@ func (g *grpc) generateClientMethod(servName, fullServName, serviceDescVar strin
|
|||||||
inType := g.typeName(method.GetInputType())
|
inType := g.typeName(method.GetInputType())
|
||||||
outType := g.typeName(method.GetOutputType())
|
outType := g.typeName(method.GetOutputType())
|
||||||
|
|
||||||
|
if method.GetOptions().GetDeprecated() {
|
||||||
|
g.P(deprecationComment)
|
||||||
|
}
|
||||||
g.P("func (c *", unexport(servName), "Client) ", g.generateClientSignature(servName, method), "{")
|
g.P("func (c *", unexport(servName), "Client) ", g.generateClientSignature(servName, method), "{")
|
||||||
if !method.GetServerStreaming() && !method.GetClientStreaming() {
|
if !method.GetServerStreaming() && !method.GetClientStreaming() {
|
||||||
g.P("out := new(", outType, ")")
|
g.P("out := new(", outType, ")")
|
||||||
// TODO: Pass descExpr to Invoke.
|
// TODO: Pass descExpr to Invoke.
|
||||||
g.P("err := ", grpcPkg, `.Invoke(ctx, "`, sname, `", in, out, c.cc, opts...)`)
|
g.P(`err := c.cc.Invoke(ctx, "`, sname, `", in, out, opts...)`)
|
||||||
g.P("if err != nil { return nil, err }")
|
g.P("if err != nil { return nil, err }")
|
||||||
g.P("return out, nil")
|
g.P("return out, nil")
|
||||||
g.P("}")
|
g.P("}")
|
||||||
@ -294,7 +307,7 @@ func (g *grpc) generateClientMethod(servName, fullServName, serviceDescVar strin
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
streamType := unexport(servName) + methName + "Client"
|
streamType := unexport(servName) + methName + "Client"
|
||||||
g.P("stream, err := ", grpcPkg, ".NewClientStream(ctx, ", descExpr, `, c.cc, "`, sname, `", opts...)`)
|
g.P("stream, err := c.cc.NewStream(ctx, ", descExpr, `, "`, sname, `", opts...)`)
|
||||||
g.P("if err != nil { return nil, err }")
|
g.P("if err != nil { return nil, err }")
|
||||||
g.P("x := &", streamType, "{stream}")
|
g.P("x := &", streamType, "{stream}")
|
||||||
if !method.GetClientStreaming() {
|
if !method.GetClientStreaming() {
|
||||||
|
155
vendor/github.com/gogo/protobuf/protoc-gen-gogo/plugin/plugin.pb.go
generated
vendored
155
vendor/github.com/gogo/protobuf/protoc-gen-gogo/plugin/plugin.pb.go
generated
vendored
@ -1,23 +1,14 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
// source: plugin.proto
|
// source: plugin.proto
|
||||||
|
|
||||||
/*
|
|
||||||
Package plugin_go is a generated protocol buffer package.
|
|
||||||
|
|
||||||
It is generated from these files:
|
|
||||||
plugin.proto
|
|
||||||
|
|
||||||
It has these top-level messages:
|
|
||||||
Version
|
|
||||||
CodeGeneratorRequest
|
|
||||||
CodeGeneratorResponse
|
|
||||||
*/
|
|
||||||
package plugin_go
|
package plugin_go
|
||||||
|
|
||||||
import proto "github.com/gogo/protobuf/proto"
|
import (
|
||||||
import fmt "fmt"
|
fmt "fmt"
|
||||||
import math "math"
|
proto "github.com/gogo/protobuf/proto"
|
||||||
import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
|
||||||
|
math "math"
|
||||||
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -37,14 +28,35 @@ type Version struct {
|
|||||||
Patch *int32 `protobuf:"varint,3,opt,name=patch" json:"patch,omitempty"`
|
Patch *int32 `protobuf:"varint,3,opt,name=patch" json:"patch,omitempty"`
|
||||||
// A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
|
// A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
|
||||||
// be empty for mainline stable releases.
|
// be empty for mainline stable releases.
|
||||||
Suffix *string `protobuf:"bytes,4,opt,name=suffix" json:"suffix,omitempty"`
|
Suffix *string `protobuf:"bytes,4,opt,name=suffix" json:"suffix,omitempty"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Version) Reset() { *m = Version{} }
|
func (m *Version) Reset() { *m = Version{} }
|
||||||
func (m *Version) String() string { return proto.CompactTextString(m) }
|
func (m *Version) String() string { return proto.CompactTextString(m) }
|
||||||
func (*Version) ProtoMessage() {}
|
func (*Version) ProtoMessage() {}
|
||||||
func (*Version) Descriptor() ([]byte, []int) { return fileDescriptorPlugin, []int{0} }
|
func (*Version) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_22a625af4bc1cc87, []int{0}
|
||||||
|
}
|
||||||
|
func (m *Version) XXX_Unmarshal(b []byte) error {
|
||||||
|
return xxx_messageInfo_Version.Unmarshal(m, b)
|
||||||
|
}
|
||||||
|
func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
return xxx_messageInfo_Version.Marshal(b, m, deterministic)
|
||||||
|
}
|
||||||
|
func (m *Version) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Version.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Version) XXX_Size() int {
|
||||||
|
return xxx_messageInfo_Version.Size(m)
|
||||||
|
}
|
||||||
|
func (m *Version) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Version.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Version proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *Version) GetMajor() int32 {
|
func (m *Version) GetMajor() int32 {
|
||||||
if m != nil && m.Major != nil {
|
if m != nil && m.Major != nil {
|
||||||
@ -96,16 +108,37 @@ type CodeGeneratorRequest struct {
|
|||||||
//
|
//
|
||||||
// Type names of fields and extensions in the FileDescriptorProto are always
|
// Type names of fields and extensions in the FileDescriptorProto are always
|
||||||
// fully qualified.
|
// fully qualified.
|
||||||
ProtoFile []*google_protobuf.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file,json=protoFile" json:"proto_file,omitempty"`
|
ProtoFile []*descriptor.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file,json=protoFile" json:"proto_file,omitempty"`
|
||||||
// The version number of protocol compiler.
|
// The version number of protocol compiler.
|
||||||
CompilerVersion *Version `protobuf:"bytes,3,opt,name=compiler_version,json=compilerVersion" json:"compiler_version,omitempty"`
|
CompilerVersion *Version `protobuf:"bytes,3,opt,name=compiler_version,json=compilerVersion" json:"compiler_version,omitempty"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *CodeGeneratorRequest) Reset() { *m = CodeGeneratorRequest{} }
|
func (m *CodeGeneratorRequest) Reset() { *m = CodeGeneratorRequest{} }
|
||||||
func (m *CodeGeneratorRequest) String() string { return proto.CompactTextString(m) }
|
func (m *CodeGeneratorRequest) String() string { return proto.CompactTextString(m) }
|
||||||
func (*CodeGeneratorRequest) ProtoMessage() {}
|
func (*CodeGeneratorRequest) ProtoMessage() {}
|
||||||
func (*CodeGeneratorRequest) Descriptor() ([]byte, []int) { return fileDescriptorPlugin, []int{1} }
|
func (*CodeGeneratorRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_22a625af4bc1cc87, []int{1}
|
||||||
|
}
|
||||||
|
func (m *CodeGeneratorRequest) XXX_Unmarshal(b []byte) error {
|
||||||
|
return xxx_messageInfo_CodeGeneratorRequest.Unmarshal(m, b)
|
||||||
|
}
|
||||||
|
func (m *CodeGeneratorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
return xxx_messageInfo_CodeGeneratorRequest.Marshal(b, m, deterministic)
|
||||||
|
}
|
||||||
|
func (m *CodeGeneratorRequest) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_CodeGeneratorRequest.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *CodeGeneratorRequest) XXX_Size() int {
|
||||||
|
return xxx_messageInfo_CodeGeneratorRequest.Size(m)
|
||||||
|
}
|
||||||
|
func (m *CodeGeneratorRequest) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_CodeGeneratorRequest.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_CodeGeneratorRequest proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *CodeGeneratorRequest) GetFileToGenerate() []string {
|
func (m *CodeGeneratorRequest) GetFileToGenerate() []string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
@ -121,7 +154,7 @@ func (m *CodeGeneratorRequest) GetParameter() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *CodeGeneratorRequest) GetProtoFile() []*google_protobuf.FileDescriptorProto {
|
func (m *CodeGeneratorRequest) GetProtoFile() []*descriptor.FileDescriptorProto {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.ProtoFile
|
return m.ProtoFile
|
||||||
}
|
}
|
||||||
@ -145,15 +178,36 @@ type CodeGeneratorResponse struct {
|
|||||||
// problem in protoc itself -- such as the input CodeGeneratorRequest being
|
// problem in protoc itself -- such as the input CodeGeneratorRequest being
|
||||||
// unparseable -- should be reported by writing a message to stderr and
|
// unparseable -- should be reported by writing a message to stderr and
|
||||||
// exiting with a non-zero status code.
|
// exiting with a non-zero status code.
|
||||||
Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
|
Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
|
||||||
File []*CodeGeneratorResponse_File `protobuf:"bytes,15,rep,name=file" json:"file,omitempty"`
|
File []*CodeGeneratorResponse_File `protobuf:"bytes,15,rep,name=file" json:"file,omitempty"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *CodeGeneratorResponse) Reset() { *m = CodeGeneratorResponse{} }
|
func (m *CodeGeneratorResponse) Reset() { *m = CodeGeneratorResponse{} }
|
||||||
func (m *CodeGeneratorResponse) String() string { return proto.CompactTextString(m) }
|
func (m *CodeGeneratorResponse) String() string { return proto.CompactTextString(m) }
|
||||||
func (*CodeGeneratorResponse) ProtoMessage() {}
|
func (*CodeGeneratorResponse) ProtoMessage() {}
|
||||||
func (*CodeGeneratorResponse) Descriptor() ([]byte, []int) { return fileDescriptorPlugin, []int{2} }
|
func (*CodeGeneratorResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_22a625af4bc1cc87, []int{2}
|
||||||
|
}
|
||||||
|
func (m *CodeGeneratorResponse) XXX_Unmarshal(b []byte) error {
|
||||||
|
return xxx_messageInfo_CodeGeneratorResponse.Unmarshal(m, b)
|
||||||
|
}
|
||||||
|
func (m *CodeGeneratorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
return xxx_messageInfo_CodeGeneratorResponse.Marshal(b, m, deterministic)
|
||||||
|
}
|
||||||
|
func (m *CodeGeneratorResponse) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_CodeGeneratorResponse.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *CodeGeneratorResponse) XXX_Size() int {
|
||||||
|
return xxx_messageInfo_CodeGeneratorResponse.Size(m)
|
||||||
|
}
|
||||||
|
func (m *CodeGeneratorResponse) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_CodeGeneratorResponse.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_CodeGeneratorResponse proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *CodeGeneratorResponse) GetError() string {
|
func (m *CodeGeneratorResponse) GetError() string {
|
||||||
if m != nil && m.Error != nil {
|
if m != nil && m.Error != nil {
|
||||||
@ -222,16 +276,35 @@ type CodeGeneratorResponse_File struct {
|
|||||||
// If |insertion_point| is present, |name| must also be present.
|
// If |insertion_point| is present, |name| must also be present.
|
||||||
InsertionPoint *string `protobuf:"bytes,2,opt,name=insertion_point,json=insertionPoint" json:"insertion_point,omitempty"`
|
InsertionPoint *string `protobuf:"bytes,2,opt,name=insertion_point,json=insertionPoint" json:"insertion_point,omitempty"`
|
||||||
// The file contents.
|
// The file contents.
|
||||||
Content *string `protobuf:"bytes,15,opt,name=content" json:"content,omitempty"`
|
Content *string `protobuf:"bytes,15,opt,name=content" json:"content,omitempty"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *CodeGeneratorResponse_File) Reset() { *m = CodeGeneratorResponse_File{} }
|
func (m *CodeGeneratorResponse_File) Reset() { *m = CodeGeneratorResponse_File{} }
|
||||||
func (m *CodeGeneratorResponse_File) String() string { return proto.CompactTextString(m) }
|
func (m *CodeGeneratorResponse_File) String() string { return proto.CompactTextString(m) }
|
||||||
func (*CodeGeneratorResponse_File) ProtoMessage() {}
|
func (*CodeGeneratorResponse_File) ProtoMessage() {}
|
||||||
func (*CodeGeneratorResponse_File) Descriptor() ([]byte, []int) {
|
func (*CodeGeneratorResponse_File) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptorPlugin, []int{2, 0}
|
return fileDescriptor_22a625af4bc1cc87, []int{2, 0}
|
||||||
}
|
}
|
||||||
|
func (m *CodeGeneratorResponse_File) XXX_Unmarshal(b []byte) error {
|
||||||
|
return xxx_messageInfo_CodeGeneratorResponse_File.Unmarshal(m, b)
|
||||||
|
}
|
||||||
|
func (m *CodeGeneratorResponse_File) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
return xxx_messageInfo_CodeGeneratorResponse_File.Marshal(b, m, deterministic)
|
||||||
|
}
|
||||||
|
func (m *CodeGeneratorResponse_File) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_CodeGeneratorResponse_File.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *CodeGeneratorResponse_File) XXX_Size() int {
|
||||||
|
return xxx_messageInfo_CodeGeneratorResponse_File.Size(m)
|
||||||
|
}
|
||||||
|
func (m *CodeGeneratorResponse_File) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_CodeGeneratorResponse_File.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_CodeGeneratorResponse_File proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *CodeGeneratorResponse_File) GetName() string {
|
func (m *CodeGeneratorResponse_File) GetName() string {
|
||||||
if m != nil && m.Name != nil {
|
if m != nil && m.Name != nil {
|
||||||
@ -261,9 +334,9 @@ func init() {
|
|||||||
proto.RegisterType((*CodeGeneratorResponse_File)(nil), "google.protobuf.compiler.CodeGeneratorResponse.File")
|
proto.RegisterType((*CodeGeneratorResponse_File)(nil), "google.protobuf.compiler.CodeGeneratorResponse.File")
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { proto.RegisterFile("plugin.proto", fileDescriptorPlugin) }
|
func init() { proto.RegisterFile("plugin.proto", fileDescriptor_22a625af4bc1cc87) }
|
||||||
|
|
||||||
var fileDescriptorPlugin = []byte{
|
var fileDescriptor_22a625af4bc1cc87 = []byte{
|
||||||
// 383 bytes of a gzipped FileDescriptorProto
|
// 383 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcd, 0x6a, 0xd5, 0x40,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcd, 0x6a, 0xd5, 0x40,
|
||||||
0x14, 0xc7, 0x89, 0x37, 0xb5, 0xe4, 0xb4, 0x34, 0x65, 0xa8, 0x32, 0x94, 0x2e, 0xe2, 0x45, 0x30,
|
0x14, 0xc7, 0x89, 0x37, 0xb5, 0xe4, 0xb4, 0x34, 0x65, 0xa8, 0x32, 0x94, 0x2e, 0xe2, 0x45, 0x30,
|
||||||
|
10
vendor/github.com/gogo/protobuf/types/any.go
generated
vendored
10
vendor/github.com/gogo/protobuf/types/any.go
generated
vendored
@ -129,10 +129,12 @@ func UnmarshalAny(any *Any, pb proto.Message) error {
|
|||||||
|
|
||||||
// Is returns true if any value contains a given message type.
|
// Is returns true if any value contains a given message type.
|
||||||
func Is(any *Any, pb proto.Message) bool {
|
func Is(any *Any, pb proto.Message) bool {
|
||||||
aname, err := AnyMessageName(any)
|
// The following is equivalent to AnyMessageName(any) == proto.MessageName(pb),
|
||||||
if err != nil {
|
// but it avoids scanning TypeUrl for the slash.
|
||||||
|
if any == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
name := proto.MessageName(pb)
|
||||||
return aname == proto.MessageName(pb)
|
prefix := len(any.TypeUrl) - len(name)
|
||||||
|
return prefix >= 1 && any.TypeUrl[prefix-1] == '/' && any.TypeUrl[prefix:] == name
|
||||||
}
|
}
|
||||||
|
180
vendor/github.com/gogo/protobuf/types/any.pb.go
generated
vendored
180
vendor/github.com/gogo/protobuf/types/any.pb.go
generated
vendored
@ -1,27 +1,17 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
// source: any.proto
|
// source: google/protobuf/any.proto
|
||||||
|
|
||||||
/*
|
|
||||||
Package types is a generated protocol buffer package.
|
|
||||||
|
|
||||||
It is generated from these files:
|
|
||||||
any.proto
|
|
||||||
|
|
||||||
It has these top-level messages:
|
|
||||||
Any
|
|
||||||
*/
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import proto "github.com/gogo/protobuf/proto"
|
import (
|
||||||
import fmt "fmt"
|
bytes "bytes"
|
||||||
import math "math"
|
fmt "fmt"
|
||||||
|
proto "github.com/gogo/protobuf/proto"
|
||||||
import bytes "bytes"
|
io "io"
|
||||||
|
math "math"
|
||||||
import strings "strings"
|
reflect "reflect"
|
||||||
import reflect "reflect"
|
strings "strings"
|
||||||
|
)
|
||||||
import io "io"
|
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -115,17 +105,19 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
|||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
type Any struct {
|
type Any struct {
|
||||||
// A URL/resource name whose content describes the type of the
|
// A URL/resource name that uniquely identifies the type of the serialized
|
||||||
// serialized protocol buffer message.
|
// protocol buffer message. This string must contain at least
|
||||||
|
// one "/" character. The last segment of the URL's path must represent
|
||||||
|
// the fully qualified name of the type (as in
|
||||||
|
// `path/google.protobuf.Duration`). The name should be in a canonical form
|
||||||
|
// (e.g., leading "." is not accepted).
|
||||||
//
|
//
|
||||||
// For URLs which use the scheme `http`, `https`, or no scheme, the
|
// In practice, teams usually precompile into the binary all types that they
|
||||||
// following restrictions and interpretations apply:
|
// expect it to use in the context of Any. However, for URLs which use the
|
||||||
|
// scheme `http`, `https`, or no scheme, one can optionally set up a type
|
||||||
|
// server that maps type URLs to message definitions as follows:
|
||||||
//
|
//
|
||||||
// * If no scheme is provided, `https` is assumed.
|
// * If no scheme is provided, `https` is assumed.
|
||||||
// * The last segment of the URL's path must represent the fully
|
|
||||||
// qualified name of the type (as in `path/google.protobuf.Duration`).
|
|
||||||
// The name should be in a canonical form (e.g., leading "." is
|
|
||||||
// not accepted).
|
|
||||||
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
||||||
// value in binary format, or produce an error.
|
// value in binary format, or produce an error.
|
||||||
// * Applications are allowed to cache lookup results based on the
|
// * Applications are allowed to cache lookup results based on the
|
||||||
@ -134,18 +126,53 @@ type Any struct {
|
|||||||
// on changes to types. (Use versioned type names to manage
|
// on changes to types. (Use versioned type names to manage
|
||||||
// breaking changes.)
|
// breaking changes.)
|
||||||
//
|
//
|
||||||
|
// Note: this functionality is not currently available in the official
|
||||||
|
// protobuf release, and it is not used for type URLs beginning with
|
||||||
|
// type.googleapis.com.
|
||||||
|
//
|
||||||
// Schemes other than `http`, `https` (or the empty scheme) might be
|
// Schemes other than `http`, `https` (or the empty scheme) might be
|
||||||
// used with implementation specific semantics.
|
// used with implementation specific semantics.
|
||||||
//
|
//
|
||||||
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
|
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
|
||||||
// Must be a valid serialized protocol buffer of the above specified type.
|
// Must be a valid serialized protocol buffer of the above specified type.
|
||||||
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Any) Reset() { *m = Any{} }
|
func (m *Any) Reset() { *m = Any{} }
|
||||||
func (*Any) ProtoMessage() {}
|
func (*Any) ProtoMessage() {}
|
||||||
func (*Any) Descriptor() ([]byte, []int) { return fileDescriptorAny, []int{0} }
|
func (*Any) Descriptor() ([]byte, []int) {
|
||||||
func (*Any) XXX_WellKnownType() string { return "Any" }
|
return fileDescriptor_b53526c13ae22eb4, []int{0}
|
||||||
|
}
|
||||||
|
func (*Any) XXX_WellKnownType() string { return "Any" }
|
||||||
|
func (m *Any) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_Any.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalTo(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *Any) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Any.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Any) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *Any) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Any.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Any proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *Any) GetTypeUrl() string {
|
func (m *Any) GetTypeUrl() string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
@ -161,9 +188,33 @@ func (m *Any) GetValue() []byte {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (*Any) XXX_MessageName() string {
|
||||||
|
return "google.protobuf.Any"
|
||||||
|
}
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*Any)(nil), "google.protobuf.Any")
|
proto.RegisterType((*Any)(nil), "google.protobuf.Any")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_b53526c13ae22eb4) }
|
||||||
|
|
||||||
|
var fileDescriptor_b53526c13ae22eb4 = []byte{
|
||||||
|
// 211 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f,
|
||||||
|
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0xd4,
|
||||||
|
0x03, 0x73, 0x84, 0xf8, 0x21, 0x52, 0x7a, 0x30, 0x29, 0x25, 0x33, 0x2e, 0x66, 0xc7, 0xbc, 0x4a,
|
||||||
|
0x21, 0x49, 0x2e, 0x8e, 0x92, 0xca, 0x82, 0xd4, 0xf8, 0xd2, 0xa2, 0x1c, 0x09, 0x46, 0x05, 0x46,
|
||||||
|
0x0d, 0xce, 0x20, 0x76, 0x10, 0x3f, 0xb4, 0x28, 0x47, 0x48, 0x84, 0x8b, 0xb5, 0x2c, 0x31, 0xa7,
|
||||||
|
0x34, 0x55, 0x82, 0x49, 0x81, 0x51, 0x83, 0x27, 0x08, 0xc2, 0x71, 0xaa, 0xbf, 0xf1, 0x50, 0x8e,
|
||||||
|
0xe1, 0xc3, 0x43, 0x39, 0xc6, 0x1f, 0x0f, 0xe5, 0x18, 0x1b, 0x1e, 0xc9, 0x31, 0xae, 0x78, 0x24,
|
||||||
|
0xc7, 0x78, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0xbe, 0x78,
|
||||||
|
0x24, 0xc7, 0xf0, 0x01, 0x24, 0xfe, 0x58, 0x8e, 0xf1, 0xc4, 0x63, 0x39, 0x46, 0x2e, 0xe1, 0xe4,
|
||||||
|
0xfc, 0x5c, 0x3d, 0x34, 0xeb, 0x9d, 0x38, 0x1c, 0xf3, 0x2a, 0x03, 0x40, 0x9c, 0x00, 0xc6, 0x28,
|
||||||
|
0x56, 0x90, 0x8d, 0xc5, 0x8b, 0x98, 0x98, 0xdd, 0x03, 0x9c, 0x56, 0x31, 0xc9, 0xb9, 0x43, 0x94,
|
||||||
|
0x06, 0x40, 0x95, 0xea, 0x85, 0xa7, 0xe6, 0xe4, 0x78, 0xe7, 0xe5, 0x97, 0xe7, 0x85, 0x80, 0x94,
|
||||||
|
0x25, 0xb1, 0x81, 0xcd, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x81, 0x82, 0xd3, 0xed,
|
||||||
|
0x00, 0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
func (this *Any) Compare(that interface{}) int {
|
func (this *Any) Compare(that interface{}) int {
|
||||||
if that == nil {
|
if that == nil {
|
||||||
if this == nil {
|
if this == nil {
|
||||||
@ -198,6 +249,9 @@ func (this *Any) Compare(that interface{}) int {
|
|||||||
if c := bytes.Compare(this.Value, that1.Value); c != 0 {
|
if c := bytes.Compare(this.Value, that1.Value); c != 0 {
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
|
||||||
|
return c
|
||||||
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
func (this *Any) Equal(that interface{}) bool {
|
func (this *Any) Equal(that interface{}) bool {
|
||||||
@ -225,6 +279,9 @@ func (this *Any) Equal(that interface{}) bool {
|
|||||||
if !bytes.Equal(this.Value, that1.Value) {
|
if !bytes.Equal(this.Value, that1.Value) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
func (this *Any) GoString() string {
|
func (this *Any) GoString() string {
|
||||||
@ -235,6 +292,9 @@ func (this *Any) GoString() string {
|
|||||||
s = append(s, "&types.Any{")
|
s = append(s, "&types.Any{")
|
||||||
s = append(s, "TypeUrl: "+fmt.Sprintf("%#v", this.TypeUrl)+",\n")
|
s = append(s, "TypeUrl: "+fmt.Sprintf("%#v", this.TypeUrl)+",\n")
|
||||||
s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n")
|
s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n")
|
||||||
|
if this.XXX_unrecognized != nil {
|
||||||
|
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
||||||
|
}
|
||||||
s = append(s, "}")
|
s = append(s, "}")
|
||||||
return strings.Join(s, "")
|
return strings.Join(s, "")
|
||||||
}
|
}
|
||||||
@ -273,6 +333,9 @@ func (m *Any) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
i = encodeVarintAny(dAtA, i, uint64(len(m.Value)))
|
i = encodeVarintAny(dAtA, i, uint64(len(m.Value)))
|
||||||
i += copy(dAtA[i:], m.Value)
|
i += copy(dAtA[i:], m.Value)
|
||||||
}
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,6 +357,7 @@ func NewPopulatedAny(r randyAny, easy bool) *Any {
|
|||||||
this.Value[i] = byte(r.Intn(256))
|
this.Value[i] = byte(r.Intn(256))
|
||||||
}
|
}
|
||||||
if !easy && r.Intn(10) != 0 {
|
if !easy && r.Intn(10) != 0 {
|
||||||
|
this.XXX_unrecognized = randUnrecognizedAny(r, 3)
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
@ -371,6 +435,9 @@ func encodeVarintPopulateAny(dAtA []byte, v uint64) []byte {
|
|||||||
return dAtA
|
return dAtA
|
||||||
}
|
}
|
||||||
func (m *Any) Size() (n int) {
|
func (m *Any) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
l = len(m.TypeUrl)
|
l = len(m.TypeUrl)
|
||||||
@ -381,6 +448,9 @@ func (m *Any) Size() (n int) {
|
|||||||
if l > 0 {
|
if l > 0 {
|
||||||
n += 1 + l + sovAny(uint64(l))
|
n += 1 + l + sovAny(uint64(l))
|
||||||
}
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
n += len(m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,6 +474,7 @@ func (this *Any) String() string {
|
|||||||
s := strings.Join([]string{`&Any{`,
|
s := strings.Join([]string{`&Any{`,
|
||||||
`TypeUrl:` + fmt.Sprintf("%v", this.TypeUrl) + `,`,
|
`TypeUrl:` + fmt.Sprintf("%v", this.TypeUrl) + `,`,
|
||||||
`Value:` + fmt.Sprintf("%v", this.Value) + `,`,
|
`Value:` + fmt.Sprintf("%v", this.Value) + `,`,
|
||||||
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
@ -431,7 +502,7 @@ func (m *Any) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
wire |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -459,7 +530,7 @@ func (m *Any) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
stringLen |= (uint64(b) & 0x7F) << shift
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -469,6 +540,9 @@ func (m *Any) Unmarshal(dAtA []byte) error {
|
|||||||
return ErrInvalidLengthAny
|
return ErrInvalidLengthAny
|
||||||
}
|
}
|
||||||
postIndex := iNdEx + intStringLen
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthAny
|
||||||
|
}
|
||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
@ -488,7 +562,7 @@ func (m *Any) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
byteLen |= (int(b) & 0x7F) << shift
|
byteLen |= int(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -497,6 +571,9 @@ func (m *Any) Unmarshal(dAtA []byte) error {
|
|||||||
return ErrInvalidLengthAny
|
return ErrInvalidLengthAny
|
||||||
}
|
}
|
||||||
postIndex := iNdEx + byteLen
|
postIndex := iNdEx + byteLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthAny
|
||||||
|
}
|
||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
@ -514,9 +591,13 @@ func (m *Any) Unmarshal(dAtA []byte) error {
|
|||||||
if skippy < 0 {
|
if skippy < 0 {
|
||||||
return ErrInvalidLengthAny
|
return ErrInvalidLengthAny
|
||||||
}
|
}
|
||||||
|
if (iNdEx + skippy) < 0 {
|
||||||
|
return ErrInvalidLengthAny
|
||||||
|
}
|
||||||
if (iNdEx + skippy) > l {
|
if (iNdEx + skippy) > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||||
iNdEx += skippy
|
iNdEx += skippy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -580,10 +661,13 @@ func skipAny(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iNdEx += length
|
|
||||||
if length < 0 {
|
if length < 0 {
|
||||||
return 0, ErrInvalidLengthAny
|
return 0, ErrInvalidLengthAny
|
||||||
}
|
}
|
||||||
|
iNdEx += length
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthAny
|
||||||
|
}
|
||||||
return iNdEx, nil
|
return iNdEx, nil
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
for {
|
||||||
@ -612,6 +696,9 @@ func skipAny(dAtA []byte) (n int, err error) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
iNdEx = start + next
|
iNdEx = start + next
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthAny
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
return iNdEx, nil
|
||||||
case 4:
|
case 4:
|
||||||
@ -630,22 +717,3 @@ var (
|
|||||||
ErrInvalidLengthAny = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthAny = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowAny = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowAny = fmt.Errorf("proto: integer overflow")
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() { proto.RegisterFile("any.proto", fileDescriptorAny) }
|
|
||||||
|
|
||||||
var fileDescriptorAny = []byte{
|
|
||||||
// 204 bytes of a gzipped FileDescriptorProto
|
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0xcc, 0xab, 0xd4,
|
|
||||||
0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4f, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0x85, 0xf0, 0x92,
|
|
||||||
0x4a, 0xd3, 0x94, 0xcc, 0xb8, 0x98, 0x1d, 0xf3, 0x2a, 0x85, 0x24, 0xb9, 0x38, 0x4a, 0x2a, 0x0b,
|
|
||||||
0x52, 0xe3, 0x4b, 0x8b, 0x72, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0xd8, 0x41, 0xfc, 0xd0,
|
|
||||||
0xa2, 0x1c, 0x21, 0x11, 0x2e, 0xd6, 0xb2, 0xc4, 0x9c, 0xd2, 0x54, 0x09, 0x26, 0x05, 0x46, 0x0d,
|
|
||||||
0x9e, 0x20, 0x08, 0xc7, 0xa9, 0xfe, 0xc2, 0x43, 0x39, 0x86, 0x1b, 0x0f, 0xe5, 0x18, 0x3e, 0x3c,
|
|
||||||
0x94, 0x63, 0xfc, 0xf1, 0x50, 0x8e, 0xb1, 0xe1, 0x91, 0x1c, 0xe3, 0x8a, 0x47, 0x72, 0x8c, 0x27,
|
|
||||||
0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x8b, 0x47, 0x72, 0x0c,
|
|
||||||
0x1f, 0x40, 0xe2, 0x8f, 0xe5, 0x18, 0xb9, 0x84, 0x93, 0xf3, 0x73, 0xf5, 0xd0, 0xac, 0x77, 0xe2,
|
|
||||||
0x70, 0xcc, 0xab, 0x0c, 0x00, 0x71, 0x02, 0x18, 0xa3, 0x58, 0x41, 0x36, 0x16, 0x2f, 0x62, 0x62,
|
|
||||||
0x76, 0x0f, 0x70, 0x5a, 0xc5, 0x24, 0xe7, 0x0e, 0x51, 0x1a, 0x00, 0x55, 0xaa, 0x17, 0x9e, 0x9a,
|
|
||||||
0x93, 0xe3, 0x9d, 0x97, 0x5f, 0x9e, 0x17, 0x02, 0x52, 0x96, 0xc4, 0x06, 0x36, 0xc3, 0x18, 0x10,
|
|
||||||
0x00, 0x00, 0xff, 0xff, 0xb7, 0x39, 0x2f, 0x89, 0xdd, 0x00, 0x00, 0x00,
|
|
||||||
}
|
|
||||||
|
2118
vendor/github.com/gogo/protobuf/types/api.pb.go
generated
vendored
Normal file
2118
vendor/github.com/gogo/protobuf/types/api.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
vendor/github.com/gogo/protobuf/types/duration.go
generated
vendored
2
vendor/github.com/gogo/protobuf/types/duration.go
generated
vendored
@ -80,7 +80,7 @@ func DurationFromProto(p *Duration) (time.Duration, error) {
|
|||||||
return 0, fmt.Errorf("duration: %#v is out of range for time.Duration", p)
|
return 0, fmt.Errorf("duration: %#v is out of range for time.Duration", p)
|
||||||
}
|
}
|
||||||
if p.Nanos != 0 {
|
if p.Nanos != 0 {
|
||||||
d += time.Duration(p.Nanos)
|
d += time.Duration(p.Nanos) * time.Nanosecond
|
||||||
if (d < 0) != (p.Nanos < 0) {
|
if (d < 0) != (p.Nanos < 0) {
|
||||||
return 0, fmt.Errorf("duration: %#v is out of range for time.Duration", p)
|
return 0, fmt.Errorf("duration: %#v is out of range for time.Duration", p)
|
||||||
}
|
}
|
||||||
|
148
vendor/github.com/gogo/protobuf/types/duration.pb.go
generated
vendored
148
vendor/github.com/gogo/protobuf/types/duration.pb.go
generated
vendored
@ -1,25 +1,17 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
// source: duration.proto
|
// source: google/protobuf/duration.proto
|
||||||
|
|
||||||
/*
|
|
||||||
Package types is a generated protocol buffer package.
|
|
||||||
|
|
||||||
It is generated from these files:
|
|
||||||
duration.proto
|
|
||||||
|
|
||||||
It has these top-level messages:
|
|
||||||
Duration
|
|
||||||
*/
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import proto "github.com/gogo/protobuf/proto"
|
import (
|
||||||
import fmt "fmt"
|
bytes "bytes"
|
||||||
import math "math"
|
fmt "fmt"
|
||||||
|
proto "github.com/gogo/protobuf/proto"
|
||||||
import strings "strings"
|
io "io"
|
||||||
import reflect "reflect"
|
math "math"
|
||||||
|
reflect "reflect"
|
||||||
import io "io"
|
strings "strings"
|
||||||
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -103,13 +95,44 @@ type Duration struct {
|
|||||||
// of one second or more, a non-zero value for the `nanos` field must be
|
// of one second or more, a non-zero value for the `nanos` field must be
|
||||||
// of the same sign as the `seconds` field. Must be from -999,999,999
|
// of the same sign as the `seconds` field. Must be from -999,999,999
|
||||||
// to +999,999,999 inclusive.
|
// to +999,999,999 inclusive.
|
||||||
Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
|
Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
|
||||||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Duration) Reset() { *m = Duration{} }
|
func (m *Duration) Reset() { *m = Duration{} }
|
||||||
func (*Duration) ProtoMessage() {}
|
func (*Duration) ProtoMessage() {}
|
||||||
func (*Duration) Descriptor() ([]byte, []int) { return fileDescriptorDuration, []int{0} }
|
func (*Duration) Descriptor() ([]byte, []int) {
|
||||||
func (*Duration) XXX_WellKnownType() string { return "Duration" }
|
return fileDescriptor_23597b2ebd7ac6c5, []int{0}
|
||||||
|
}
|
||||||
|
func (*Duration) XXX_WellKnownType() string { return "Duration" }
|
||||||
|
func (m *Duration) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_Duration.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalTo(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *Duration) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Duration.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Duration) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *Duration) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Duration.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Duration proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *Duration) GetSeconds() int64 {
|
func (m *Duration) GetSeconds() int64 {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
@ -125,9 +148,33 @@ func (m *Duration) GetNanos() int32 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (*Duration) XXX_MessageName() string {
|
||||||
|
return "google.protobuf.Duration"
|
||||||
|
}
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*Duration)(nil), "google.protobuf.Duration")
|
proto.RegisterType((*Duration)(nil), "google.protobuf.Duration")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("google/protobuf/duration.proto", fileDescriptor_23597b2ebd7ac6c5) }
|
||||||
|
|
||||||
|
var fileDescriptor_23597b2ebd7ac6c5 = []byte{
|
||||||
|
// 209 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f,
|
||||||
|
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0x29, 0x2d, 0x4a,
|
||||||
|
0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x03, 0x8b, 0x08, 0xf1, 0x43, 0xe4, 0xf5, 0x60, 0xf2, 0x4a, 0x56,
|
||||||
|
0x5c, 0x1c, 0x2e, 0x50, 0x25, 0x42, 0x12, 0x5c, 0xec, 0xc5, 0xa9, 0xc9, 0xf9, 0x79, 0x29, 0xc5,
|
||||||
|
0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0x30, 0xae, 0x90, 0x08, 0x17, 0x6b, 0x5e, 0x62, 0x5e,
|
||||||
|
0x7e, 0xb1, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x84, 0xe3, 0x54, 0x7f, 0xe3, 0xa1, 0x1c,
|
||||||
|
0xc3, 0x87, 0x87, 0x72, 0x8c, 0x2b, 0x1e, 0xc9, 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91,
|
||||||
|
0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x2f, 0x1e, 0xc9, 0x31, 0x7c, 0x78, 0x24, 0xc7, 0xb8, 0xe2,
|
||||||
|
0xb1, 0x1c, 0xe3, 0x89, 0xc7, 0x72, 0x8c, 0x5c, 0xc2, 0xc9, 0xf9, 0xb9, 0x7a, 0x68, 0x56, 0x3b,
|
||||||
|
0xf1, 0xc2, 0x2c, 0x0e, 0x00, 0x89, 0x04, 0x30, 0x46, 0xb1, 0x96, 0x54, 0x16, 0xa4, 0x16, 0xff,
|
||||||
|
0x60, 0x64, 0x5c, 0xc4, 0xc4, 0xec, 0x1e, 0xe0, 0xb4, 0x8a, 0x49, 0xce, 0x1d, 0xa2, 0x25, 0x00,
|
||||||
|
0xaa, 0x45, 0x2f, 0x3c, 0x35, 0x27, 0xc7, 0x3b, 0x2f, 0xbf, 0x3c, 0x2f, 0x04, 0xa4, 0x32, 0x89,
|
||||||
|
0x0d, 0x6c, 0x96, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x1c, 0x64, 0x4e, 0xf6, 0x00, 0x00,
|
||||||
|
0x00,
|
||||||
|
}
|
||||||
|
|
||||||
func (this *Duration) Compare(that interface{}) int {
|
func (this *Duration) Compare(that interface{}) int {
|
||||||
if that == nil {
|
if that == nil {
|
||||||
if this == nil {
|
if this == nil {
|
||||||
@ -165,6 +212,9 @@ func (this *Duration) Compare(that interface{}) int {
|
|||||||
}
|
}
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
|
||||||
|
return c
|
||||||
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
func (this *Duration) Equal(that interface{}) bool {
|
func (this *Duration) Equal(that interface{}) bool {
|
||||||
@ -192,6 +242,9 @@ func (this *Duration) Equal(that interface{}) bool {
|
|||||||
if this.Nanos != that1.Nanos {
|
if this.Nanos != that1.Nanos {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
func (this *Duration) GoString() string {
|
func (this *Duration) GoString() string {
|
||||||
@ -202,6 +255,9 @@ func (this *Duration) GoString() string {
|
|||||||
s = append(s, "&types.Duration{")
|
s = append(s, "&types.Duration{")
|
||||||
s = append(s, "Seconds: "+fmt.Sprintf("%#v", this.Seconds)+",\n")
|
s = append(s, "Seconds: "+fmt.Sprintf("%#v", this.Seconds)+",\n")
|
||||||
s = append(s, "Nanos: "+fmt.Sprintf("%#v", this.Nanos)+",\n")
|
s = append(s, "Nanos: "+fmt.Sprintf("%#v", this.Nanos)+",\n")
|
||||||
|
if this.XXX_unrecognized != nil {
|
||||||
|
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
||||||
|
}
|
||||||
s = append(s, "}")
|
s = append(s, "}")
|
||||||
return strings.Join(s, "")
|
return strings.Join(s, "")
|
||||||
}
|
}
|
||||||
@ -238,6 +294,9 @@ func (m *Duration) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
i++
|
i++
|
||||||
i = encodeVarintDuration(dAtA, i, uint64(m.Nanos))
|
i = encodeVarintDuration(dAtA, i, uint64(m.Nanos))
|
||||||
}
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,6 +310,9 @@ func encodeVarintDuration(dAtA []byte, offset int, v uint64) int {
|
|||||||
return offset + 1
|
return offset + 1
|
||||||
}
|
}
|
||||||
func (m *Duration) Size() (n int) {
|
func (m *Duration) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Seconds != 0 {
|
if m.Seconds != 0 {
|
||||||
@ -259,6 +321,9 @@ func (m *Duration) Size() (n int) {
|
|||||||
if m.Nanos != 0 {
|
if m.Nanos != 0 {
|
||||||
n += 1 + sovDuration(uint64(m.Nanos))
|
n += 1 + sovDuration(uint64(m.Nanos))
|
||||||
}
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
n += len(m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,7 +355,7 @@ func (m *Duration) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
wire |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -318,7 +383,7 @@ func (m *Duration) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
m.Seconds |= (int64(b) & 0x7F) << shift
|
m.Seconds |= int64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -337,7 +402,7 @@ func (m *Duration) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
m.Nanos |= (int32(b) & 0x7F) << shift
|
m.Nanos |= int32(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -351,9 +416,13 @@ func (m *Duration) Unmarshal(dAtA []byte) error {
|
|||||||
if skippy < 0 {
|
if skippy < 0 {
|
||||||
return ErrInvalidLengthDuration
|
return ErrInvalidLengthDuration
|
||||||
}
|
}
|
||||||
|
if (iNdEx + skippy) < 0 {
|
||||||
|
return ErrInvalidLengthDuration
|
||||||
|
}
|
||||||
if (iNdEx + skippy) > l {
|
if (iNdEx + skippy) > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||||
iNdEx += skippy
|
iNdEx += skippy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -417,10 +486,13 @@ func skipDuration(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iNdEx += length
|
|
||||||
if length < 0 {
|
if length < 0 {
|
||||||
return 0, ErrInvalidLengthDuration
|
return 0, ErrInvalidLengthDuration
|
||||||
}
|
}
|
||||||
|
iNdEx += length
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthDuration
|
||||||
|
}
|
||||||
return iNdEx, nil
|
return iNdEx, nil
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
for {
|
||||||
@ -449,6 +521,9 @@ func skipDuration(dAtA []byte) (n int, err error) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
iNdEx = start + next
|
iNdEx = start + next
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthDuration
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
return iNdEx, nil
|
||||||
case 4:
|
case 4:
|
||||||
@ -467,22 +542,3 @@ var (
|
|||||||
ErrInvalidLengthDuration = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthDuration = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowDuration = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowDuration = fmt.Errorf("proto: integer overflow")
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() { proto.RegisterFile("duration.proto", fileDescriptorDuration) }
|
|
||||||
|
|
||||||
var fileDescriptorDuration = []byte{
|
|
||||||
// 203 bytes of a gzipped FileDescriptorProto
|
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4b, 0x29, 0x2d, 0x4a,
|
|
||||||
0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4f, 0xcf, 0xcf, 0x4f,
|
|
||||||
0xcf, 0x49, 0x85, 0xf0, 0x92, 0x4a, 0xd3, 0x94, 0xac, 0xb8, 0x38, 0x5c, 0xa0, 0x4a, 0x84, 0x24,
|
|
||||||
0xb8, 0xd8, 0x8b, 0x53, 0x93, 0xf3, 0xf3, 0x52, 0x8a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x98, 0x83,
|
|
||||||
0x60, 0x5c, 0x21, 0x11, 0x2e, 0xd6, 0xbc, 0xc4, 0xbc, 0xfc, 0x62, 0x09, 0x26, 0x05, 0x46, 0x0d,
|
|
||||||
0xd6, 0x20, 0x08, 0xc7, 0xa9, 0xfe, 0xc2, 0x43, 0x39, 0x86, 0x1b, 0x0f, 0xe5, 0x18, 0x3e, 0x3c,
|
|
||||||
0x94, 0x63, 0x5c, 0xf1, 0x48, 0x8e, 0xf1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f,
|
|
||||||
0x3c, 0x92, 0x63, 0x7c, 0xf1, 0x48, 0x8e, 0xe1, 0xc3, 0x23, 0x39, 0xc6, 0x15, 0x8f, 0xe5, 0x18,
|
|
||||||
0xb9, 0x84, 0x93, 0xf3, 0x73, 0xf5, 0xd0, 0xac, 0x76, 0xe2, 0x85, 0x59, 0x1c, 0x00, 0x12, 0x09,
|
|
||||||
0x60, 0x8c, 0x62, 0x2d, 0xa9, 0x2c, 0x48, 0x2d, 0xfe, 0xc1, 0xc8, 0xb8, 0x88, 0x89, 0xd9, 0x3d,
|
|
||||||
0xc0, 0x69, 0x15, 0x93, 0x9c, 0x3b, 0x44, 0x4b, 0x00, 0x54, 0x8b, 0x5e, 0x78, 0x6a, 0x4e, 0x8e,
|
|
||||||
0x77, 0x5e, 0x7e, 0x79, 0x5e, 0x08, 0x48, 0x65, 0x12, 0x1b, 0xd8, 0x2c, 0x63, 0x40, 0x00, 0x00,
|
|
||||||
0x00, 0xff, 0xff, 0x9d, 0x5a, 0x25, 0xa5, 0xe6, 0x00, 0x00, 0x00,
|
|
||||||
}
|
|
||||||
|
139
vendor/github.com/gogo/protobuf/types/empty.pb.go
generated
vendored
139
vendor/github.com/gogo/protobuf/types/empty.pb.go
generated
vendored
@ -1,25 +1,17 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
// source: empty.proto
|
// source: google/protobuf/empty.proto
|
||||||
|
|
||||||
/*
|
|
||||||
Package types is a generated protocol buffer package.
|
|
||||||
|
|
||||||
It is generated from these files:
|
|
||||||
empty.proto
|
|
||||||
|
|
||||||
It has these top-level messages:
|
|
||||||
Empty
|
|
||||||
*/
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import proto "github.com/gogo/protobuf/proto"
|
import (
|
||||||
import fmt "fmt"
|
bytes "bytes"
|
||||||
import math "math"
|
fmt "fmt"
|
||||||
|
proto "github.com/gogo/protobuf/proto"
|
||||||
import strings "strings"
|
io "io"
|
||||||
import reflect "reflect"
|
math "math"
|
||||||
|
reflect "reflect"
|
||||||
import io "io"
|
strings "strings"
|
||||||
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -42,16 +34,68 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
|||||||
//
|
//
|
||||||
// The JSON representation for `Empty` is empty JSON object `{}`.
|
// The JSON representation for `Empty` is empty JSON object `{}`.
|
||||||
type Empty struct {
|
type Empty struct {
|
||||||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Empty) Reset() { *m = Empty{} }
|
func (m *Empty) Reset() { *m = Empty{} }
|
||||||
func (*Empty) ProtoMessage() {}
|
func (*Empty) ProtoMessage() {}
|
||||||
func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptorEmpty, []int{0} }
|
func (*Empty) Descriptor() ([]byte, []int) {
|
||||||
func (*Empty) XXX_WellKnownType() string { return "Empty" }
|
return fileDescriptor_900544acb223d5b8, []int{0}
|
||||||
|
}
|
||||||
|
func (*Empty) XXX_WellKnownType() string { return "Empty" }
|
||||||
|
func (m *Empty) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_Empty.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalTo(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *Empty) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Empty.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Empty) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *Empty) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Empty.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Empty proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (*Empty) XXX_MessageName() string {
|
||||||
|
return "google.protobuf.Empty"
|
||||||
|
}
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*Empty)(nil), "google.protobuf.Empty")
|
proto.RegisterType((*Empty)(nil), "google.protobuf.Empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("google/protobuf/empty.proto", fileDescriptor_900544acb223d5b8) }
|
||||||
|
|
||||||
|
var fileDescriptor_900544acb223d5b8 = []byte{
|
||||||
|
// 176 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xcf, 0xcf, 0x4f,
|
||||||
|
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcd, 0x2d, 0x28,
|
||||||
|
0xa9, 0xd4, 0x03, 0x73, 0x85, 0xf8, 0x21, 0x92, 0x7a, 0x30, 0x49, 0x25, 0x76, 0x2e, 0x56, 0x57,
|
||||||
|
0x90, 0xbc, 0x53, 0x0b, 0xe3, 0x8d, 0x87, 0x72, 0x0c, 0x1f, 0x1e, 0xca, 0x31, 0xfe, 0x78, 0x28,
|
||||||
|
0xc7, 0xd8, 0xf0, 0x48, 0x8e, 0x71, 0xc5, 0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c,
|
||||||
|
0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0xf1, 0xc5, 0x23, 0x39, 0x86, 0x0f, 0x20, 0xf1, 0xc7, 0x72,
|
||||||
|
0x8c, 0x27, 0x1e, 0xcb, 0x31, 0x72, 0x09, 0x27, 0xe7, 0xe7, 0xea, 0xa1, 0x19, 0xe8, 0xc4, 0x05,
|
||||||
|
0x36, 0x2e, 0x00, 0xc4, 0x0d, 0x60, 0x8c, 0x62, 0x2d, 0xa9, 0x2c, 0x48, 0x2d, 0xfe, 0xc1, 0xc8,
|
||||||
|
0xb8, 0x88, 0x89, 0xd9, 0x3d, 0xc0, 0x69, 0x15, 0x93, 0x9c, 0x3b, 0x44, 0x7d, 0x00, 0x54, 0xbd,
|
||||||
|
0x5e, 0x78, 0x6a, 0x4e, 0x8e, 0x77, 0x5e, 0x7e, 0x79, 0x5e, 0x08, 0x48, 0x65, 0x12, 0x1b, 0xd8,
|
||||||
|
0x20, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x21, 0xbe, 0xb6, 0x31, 0xc6, 0x00, 0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
func (this *Empty) Compare(that interface{}) int {
|
func (this *Empty) Compare(that interface{}) int {
|
||||||
if that == nil {
|
if that == nil {
|
||||||
if this == nil {
|
if this == nil {
|
||||||
@ -77,6 +121,9 @@ func (this *Empty) Compare(that interface{}) int {
|
|||||||
} else if this == nil {
|
} else if this == nil {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
|
||||||
|
return c
|
||||||
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
func (this *Empty) Equal(that interface{}) bool {
|
func (this *Empty) Equal(that interface{}) bool {
|
||||||
@ -98,6 +145,9 @@ func (this *Empty) Equal(that interface{}) bool {
|
|||||||
} else if this == nil {
|
} else if this == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
func (this *Empty) GoString() string {
|
func (this *Empty) GoString() string {
|
||||||
@ -106,6 +156,9 @@ func (this *Empty) GoString() string {
|
|||||||
}
|
}
|
||||||
s := make([]string, 0, 4)
|
s := make([]string, 0, 4)
|
||||||
s = append(s, "&types.Empty{")
|
s = append(s, "&types.Empty{")
|
||||||
|
if this.XXX_unrecognized != nil {
|
||||||
|
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
||||||
|
}
|
||||||
s = append(s, "}")
|
s = append(s, "}")
|
||||||
return strings.Join(s, "")
|
return strings.Join(s, "")
|
||||||
}
|
}
|
||||||
@ -132,6 +185,9 @@ func (m *Empty) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,6 +203,7 @@ func encodeVarintEmpty(dAtA []byte, offset int, v uint64) int {
|
|||||||
func NewPopulatedEmpty(r randyEmpty, easy bool) *Empty {
|
func NewPopulatedEmpty(r randyEmpty, easy bool) *Empty {
|
||||||
this := &Empty{}
|
this := &Empty{}
|
||||||
if !easy && r.Intn(10) != 0 {
|
if !easy && r.Intn(10) != 0 {
|
||||||
|
this.XXX_unrecognized = randUnrecognizedEmpty(r, 1)
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
@ -224,8 +281,14 @@ func encodeVarintPopulateEmpty(dAtA []byte, v uint64) []byte {
|
|||||||
return dAtA
|
return dAtA
|
||||||
}
|
}
|
||||||
func (m *Empty) Size() (n int) {
|
func (m *Empty) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
n += len(m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,6 +310,7 @@ func (this *Empty) String() string {
|
|||||||
return "nil"
|
return "nil"
|
||||||
}
|
}
|
||||||
s := strings.Join([]string{`&Empty{`,
|
s := strings.Join([]string{`&Empty{`,
|
||||||
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
@ -274,7 +338,7 @@ func (m *Empty) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
wire |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -297,9 +361,13 @@ func (m *Empty) Unmarshal(dAtA []byte) error {
|
|||||||
if skippy < 0 {
|
if skippy < 0 {
|
||||||
return ErrInvalidLengthEmpty
|
return ErrInvalidLengthEmpty
|
||||||
}
|
}
|
||||||
|
if (iNdEx + skippy) < 0 {
|
||||||
|
return ErrInvalidLengthEmpty
|
||||||
|
}
|
||||||
if (iNdEx + skippy) > l {
|
if (iNdEx + skippy) > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||||
iNdEx += skippy
|
iNdEx += skippy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -363,10 +431,13 @@ func skipEmpty(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iNdEx += length
|
|
||||||
if length < 0 {
|
if length < 0 {
|
||||||
return 0, ErrInvalidLengthEmpty
|
return 0, ErrInvalidLengthEmpty
|
||||||
}
|
}
|
||||||
|
iNdEx += length
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthEmpty
|
||||||
|
}
|
||||||
return iNdEx, nil
|
return iNdEx, nil
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
for {
|
||||||
@ -395,6 +466,9 @@ func skipEmpty(dAtA []byte) (n int, err error) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
iNdEx = start + next
|
iNdEx = start + next
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthEmpty
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
return iNdEx, nil
|
||||||
case 4:
|
case 4:
|
||||||
@ -413,20 +487,3 @@ var (
|
|||||||
ErrInvalidLengthEmpty = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthEmpty = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowEmpty = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowEmpty = fmt.Errorf("proto: integer overflow")
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() { proto.RegisterFile("empty.proto", fileDescriptorEmpty) }
|
|
||||||
|
|
||||||
var fileDescriptorEmpty = []byte{
|
|
||||||
// 169 bytes of a gzipped FileDescriptorProto
|
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4e, 0xcd, 0x2d, 0x28,
|
|
||||||
0xa9, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4f, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0x85,
|
|
||||||
0xf0, 0x92, 0x4a, 0xd3, 0x94, 0xd8, 0xb9, 0x58, 0x5d, 0x41, 0xf2, 0x4e, 0x2d, 0x8c, 0x17, 0x1e,
|
|
||||||
0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xf0, 0xe1, 0xa1, 0x1c, 0xe3, 0x8f, 0x87, 0x72, 0x8c, 0x0d,
|
|
||||||
0x8f, 0xe4, 0x18, 0x57, 0x3c, 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6,
|
|
||||||
0x07, 0x8f, 0xe4, 0x18, 0x5f, 0x3c, 0x92, 0x63, 0xf8, 0x00, 0x12, 0x7f, 0x2c, 0xc7, 0xc8, 0x25,
|
|
||||||
0x9c, 0x9c, 0x9f, 0xab, 0x87, 0x66, 0xa0, 0x13, 0x17, 0xd8, 0xb8, 0x00, 0x10, 0x37, 0x80, 0x31,
|
|
||||||
0x8a, 0xb5, 0xa4, 0xb2, 0x20, 0xb5, 0xf8, 0x07, 0x23, 0xe3, 0x22, 0x26, 0x66, 0xf7, 0x00, 0xa7,
|
|
||||||
0x55, 0x4c, 0x72, 0xee, 0x10, 0xf5, 0x01, 0x50, 0xf5, 0x7a, 0xe1, 0xa9, 0x39, 0x39, 0xde, 0x79,
|
|
||||||
0xf9, 0xe5, 0x79, 0x21, 0x20, 0x95, 0x49, 0x6c, 0x60, 0x83, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff,
|
|
||||||
0xff, 0x7c, 0xa8, 0xf0, 0xc4, 0xb6, 0x00, 0x00, 0x00,
|
|
||||||
}
|
|
||||||
|
198
vendor/github.com/gogo/protobuf/types/field_mask.pb.go
generated
vendored
198
vendor/github.com/gogo/protobuf/types/field_mask.pb.go
generated
vendored
@ -1,25 +1,17 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
// source: field_mask.proto
|
// source: google/protobuf/field_mask.proto
|
||||||
|
|
||||||
/*
|
|
||||||
Package types is a generated protocol buffer package.
|
|
||||||
|
|
||||||
It is generated from these files:
|
|
||||||
field_mask.proto
|
|
||||||
|
|
||||||
It has these top-level messages:
|
|
||||||
FieldMask
|
|
||||||
*/
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import proto "github.com/gogo/protobuf/proto"
|
import (
|
||||||
import fmt "fmt"
|
bytes "bytes"
|
||||||
import math "math"
|
fmt "fmt"
|
||||||
|
proto "github.com/gogo/protobuf/proto"
|
||||||
import strings "strings"
|
io "io"
|
||||||
import reflect "reflect"
|
math "math"
|
||||||
|
reflect "reflect"
|
||||||
import io "io"
|
strings "strings"
|
||||||
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -100,57 +92,49 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
|||||||
// describe the updated values, the API ignores the values of all
|
// describe the updated values, the API ignores the values of all
|
||||||
// fields not covered by the mask.
|
// fields not covered by the mask.
|
||||||
//
|
//
|
||||||
// If a repeated field is specified for an update operation, the existing
|
// If a repeated field is specified for an update operation, new values will
|
||||||
// repeated values in the target resource will be overwritten by the new values.
|
// be appended to the existing repeated field in the target resource. Note that
|
||||||
// Note that a repeated field is only allowed in the last position of a `paths`
|
// a repeated field is only allowed in the last position of a `paths` string.
|
||||||
// string.
|
|
||||||
//
|
//
|
||||||
// If a sub-message is specified in the last position of the field mask for an
|
// If a sub-message is specified in the last position of the field mask for an
|
||||||
// update operation, then the existing sub-message in the target resource is
|
// update operation, then new value will be merged into the existing sub-message
|
||||||
// overwritten. Given the target message:
|
// in the target resource.
|
||||||
|
//
|
||||||
|
// For example, given the target message:
|
||||||
//
|
//
|
||||||
// f {
|
// f {
|
||||||
// b {
|
// b {
|
||||||
// d : 1
|
// d: 1
|
||||||
// x : 2
|
// x: 2
|
||||||
// }
|
// }
|
||||||
// c : 1
|
// c: [1]
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// And an update message:
|
// And an update message:
|
||||||
//
|
//
|
||||||
// f {
|
// f {
|
||||||
// b {
|
// b {
|
||||||
// d : 10
|
// d: 10
|
||||||
// }
|
// }
|
||||||
|
// c: [2]
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// then if the field mask is:
|
// then if the field mask is:
|
||||||
//
|
//
|
||||||
// paths: "f.b"
|
// paths: ["f.b", "f.c"]
|
||||||
//
|
//
|
||||||
// then the result will be:
|
// then the result will be:
|
||||||
//
|
//
|
||||||
// f {
|
// f {
|
||||||
// b {
|
// b {
|
||||||
// d : 10
|
// d: 10
|
||||||
|
// x: 2
|
||||||
// }
|
// }
|
||||||
// c : 1
|
// c: [1, 2]
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// However, if the update mask was:
|
// An implementation may provide options to override this default behavior for
|
||||||
//
|
// repeated and message fields.
|
||||||
// paths: "f.b.d"
|
|
||||||
//
|
|
||||||
// then the result would be:
|
|
||||||
//
|
|
||||||
// f {
|
|
||||||
// b {
|
|
||||||
// d : 10
|
|
||||||
// x : 2
|
|
||||||
// }
|
|
||||||
// c : 1
|
|
||||||
// }
|
|
||||||
//
|
//
|
||||||
// In order to reset a field's value to the default, the field must
|
// In order to reset a field's value to the default, the field must
|
||||||
// be in the mask and set to the default value in the provided resource.
|
// be in the mask and set to the default value in the provided resource.
|
||||||
@ -233,14 +217,51 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
|||||||
//
|
//
|
||||||
// Note that oneof type names ("test_oneof" in this case) cannot be used in
|
// Note that oneof type names ("test_oneof" in this case) cannot be used in
|
||||||
// paths.
|
// paths.
|
||||||
|
//
|
||||||
|
// ## Field Mask Verification
|
||||||
|
//
|
||||||
|
// The implementation of any API method which has a FieldMask type field in the
|
||||||
|
// request should verify the included field paths, and return an
|
||||||
|
// `INVALID_ARGUMENT` error if any path is duplicated or unmappable.
|
||||||
type FieldMask struct {
|
type FieldMask struct {
|
||||||
// The set of field mask paths.
|
// The set of field mask paths.
|
||||||
Paths []string `protobuf:"bytes,1,rep,name=paths" json:"paths,omitempty"`
|
Paths []string `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"`
|
||||||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *FieldMask) Reset() { *m = FieldMask{} }
|
func (m *FieldMask) Reset() { *m = FieldMask{} }
|
||||||
func (*FieldMask) ProtoMessage() {}
|
func (*FieldMask) ProtoMessage() {}
|
||||||
func (*FieldMask) Descriptor() ([]byte, []int) { return fileDescriptorFieldMask, []int{0} }
|
func (*FieldMask) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_5158202634f0da48, []int{0}
|
||||||
|
}
|
||||||
|
func (m *FieldMask) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *FieldMask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_FieldMask.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalTo(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *FieldMask) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_FieldMask.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *FieldMask) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *FieldMask) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_FieldMask.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_FieldMask proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *FieldMask) GetPaths() []string {
|
func (m *FieldMask) GetPaths() []string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
@ -249,9 +270,32 @@ func (m *FieldMask) GetPaths() []string {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (*FieldMask) XXX_MessageName() string {
|
||||||
|
return "google.protobuf.FieldMask"
|
||||||
|
}
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*FieldMask)(nil), "google.protobuf.FieldMask")
|
proto.RegisterType((*FieldMask)(nil), "google.protobuf.FieldMask")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("google/protobuf/field_mask.proto", fileDescriptor_5158202634f0da48) }
|
||||||
|
|
||||||
|
var fileDescriptor_5158202634f0da48 = []byte{
|
||||||
|
// 203 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xcf, 0xcf, 0x4f,
|
||||||
|
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcb, 0x4c, 0xcd,
|
||||||
|
0x49, 0x89, 0xcf, 0x4d, 0x2c, 0xce, 0xd6, 0x03, 0x8b, 0x09, 0xf1, 0x43, 0x54, 0xe8, 0xc1, 0x54,
|
||||||
|
0x28, 0x29, 0x72, 0x71, 0xba, 0x81, 0x14, 0xf9, 0x26, 0x16, 0x67, 0x0b, 0x89, 0x70, 0xb1, 0x16,
|
||||||
|
0x24, 0x96, 0x64, 0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x06, 0x41, 0x38, 0x4e, 0x1d, 0x8c,
|
||||||
|
0x37, 0x1e, 0xca, 0x31, 0x7c, 0x78, 0x28, 0xc7, 0xf8, 0xe3, 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39,
|
||||||
|
0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23,
|
||||||
|
0x39, 0xc6, 0x17, 0x8f, 0xe4, 0x18, 0x3e, 0x80, 0xc4, 0x1f, 0xcb, 0x31, 0x9e, 0x78, 0x2c, 0xc7,
|
||||||
|
0xc8, 0x25, 0x9c, 0x9c, 0x9f, 0xab, 0x87, 0x66, 0x95, 0x13, 0x1f, 0xdc, 0xa2, 0x00, 0x90, 0x50,
|
||||||
|
0x00, 0x63, 0x14, 0x6b, 0x49, 0x65, 0x41, 0x6a, 0xf1, 0x0f, 0x46, 0xc6, 0x45, 0x4c, 0xcc, 0xee,
|
||||||
|
0x01, 0x4e, 0xab, 0x98, 0xe4, 0xdc, 0x21, 0x7a, 0x02, 0xa0, 0x7a, 0xf4, 0xc2, 0x53, 0x73, 0x72,
|
||||||
|
0xbc, 0xf3, 0xf2, 0xcb, 0xf3, 0x42, 0x40, 0x2a, 0x93, 0xd8, 0xc0, 0x86, 0x19, 0x03, 0x02, 0x00,
|
||||||
|
0x00, 0xff, 0xff, 0x43, 0xa0, 0x83, 0xd0, 0xe9, 0x00, 0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
func (this *FieldMask) Compare(that interface{}) int {
|
func (this *FieldMask) Compare(that interface{}) int {
|
||||||
if that == nil {
|
if that == nil {
|
||||||
if this == nil {
|
if this == nil {
|
||||||
@ -291,6 +335,9 @@ func (this *FieldMask) Compare(that interface{}) int {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
|
||||||
|
return c
|
||||||
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
func (this *FieldMask) Equal(that interface{}) bool {
|
func (this *FieldMask) Equal(that interface{}) bool {
|
||||||
@ -320,6 +367,9 @@ func (this *FieldMask) Equal(that interface{}) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
func (this *FieldMask) GoString() string {
|
func (this *FieldMask) GoString() string {
|
||||||
@ -329,6 +379,9 @@ func (this *FieldMask) GoString() string {
|
|||||||
s := make([]string, 0, 5)
|
s := make([]string, 0, 5)
|
||||||
s = append(s, "&types.FieldMask{")
|
s = append(s, "&types.FieldMask{")
|
||||||
s = append(s, "Paths: "+fmt.Sprintf("%#v", this.Paths)+",\n")
|
s = append(s, "Paths: "+fmt.Sprintf("%#v", this.Paths)+",\n")
|
||||||
|
if this.XXX_unrecognized != nil {
|
||||||
|
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
||||||
|
}
|
||||||
s = append(s, "}")
|
s = append(s, "}")
|
||||||
return strings.Join(s, "")
|
return strings.Join(s, "")
|
||||||
}
|
}
|
||||||
@ -370,6 +423,9 @@ func (m *FieldMask) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
i += copy(dAtA[i:], s)
|
i += copy(dAtA[i:], s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -390,6 +446,7 @@ func NewPopulatedFieldMask(r randyFieldMask, easy bool) *FieldMask {
|
|||||||
this.Paths[i] = string(randStringFieldMask(r))
|
this.Paths[i] = string(randStringFieldMask(r))
|
||||||
}
|
}
|
||||||
if !easy && r.Intn(10) != 0 {
|
if !easy && r.Intn(10) != 0 {
|
||||||
|
this.XXX_unrecognized = randUnrecognizedFieldMask(r, 2)
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
@ -467,6 +524,9 @@ func encodeVarintPopulateFieldMask(dAtA []byte, v uint64) []byte {
|
|||||||
return dAtA
|
return dAtA
|
||||||
}
|
}
|
||||||
func (m *FieldMask) Size() (n int) {
|
func (m *FieldMask) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.Paths) > 0 {
|
if len(m.Paths) > 0 {
|
||||||
@ -475,6 +535,9 @@ func (m *FieldMask) Size() (n int) {
|
|||||||
n += 1 + l + sovFieldMask(uint64(l))
|
n += 1 + l + sovFieldMask(uint64(l))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
n += len(m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -497,6 +560,7 @@ func (this *FieldMask) String() string {
|
|||||||
}
|
}
|
||||||
s := strings.Join([]string{`&FieldMask{`,
|
s := strings.Join([]string{`&FieldMask{`,
|
||||||
`Paths:` + fmt.Sprintf("%v", this.Paths) + `,`,
|
`Paths:` + fmt.Sprintf("%v", this.Paths) + `,`,
|
||||||
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
@ -524,7 +588,7 @@ func (m *FieldMask) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
wire |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -552,7 +616,7 @@ func (m *FieldMask) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
stringLen |= (uint64(b) & 0x7F) << shift
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -562,6 +626,9 @@ func (m *FieldMask) Unmarshal(dAtA []byte) error {
|
|||||||
return ErrInvalidLengthFieldMask
|
return ErrInvalidLengthFieldMask
|
||||||
}
|
}
|
||||||
postIndex := iNdEx + intStringLen
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthFieldMask
|
||||||
|
}
|
||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
@ -576,9 +643,13 @@ func (m *FieldMask) Unmarshal(dAtA []byte) error {
|
|||||||
if skippy < 0 {
|
if skippy < 0 {
|
||||||
return ErrInvalidLengthFieldMask
|
return ErrInvalidLengthFieldMask
|
||||||
}
|
}
|
||||||
|
if (iNdEx + skippy) < 0 {
|
||||||
|
return ErrInvalidLengthFieldMask
|
||||||
|
}
|
||||||
if (iNdEx + skippy) > l {
|
if (iNdEx + skippy) > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||||
iNdEx += skippy
|
iNdEx += skippy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -642,10 +713,13 @@ func skipFieldMask(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iNdEx += length
|
|
||||||
if length < 0 {
|
if length < 0 {
|
||||||
return 0, ErrInvalidLengthFieldMask
|
return 0, ErrInvalidLengthFieldMask
|
||||||
}
|
}
|
||||||
|
iNdEx += length
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthFieldMask
|
||||||
|
}
|
||||||
return iNdEx, nil
|
return iNdEx, nil
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
for {
|
||||||
@ -674,6 +748,9 @@ func skipFieldMask(dAtA []byte) (n int, err error) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
iNdEx = start + next
|
iNdEx = start + next
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthFieldMask
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
return iNdEx, nil
|
||||||
case 4:
|
case 4:
|
||||||
@ -692,22 +769,3 @@ var (
|
|||||||
ErrInvalidLengthFieldMask = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthFieldMask = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowFieldMask = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowFieldMask = fmt.Errorf("proto: integer overflow")
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() { proto.RegisterFile("field_mask.proto", fileDescriptorFieldMask) }
|
|
||||||
|
|
||||||
var fileDescriptorFieldMask = []byte{
|
|
||||||
// 193 bytes of a gzipped FileDescriptorProto
|
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x48, 0xcb, 0x4c, 0xcd,
|
|
||||||
0x49, 0x89, 0xcf, 0x4d, 0x2c, 0xce, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4f, 0xcf,
|
|
||||||
0xcf, 0x4f, 0xcf, 0x49, 0x85, 0xf0, 0x92, 0x4a, 0xd3, 0x94, 0x14, 0xb9, 0x38, 0xdd, 0x40, 0x8a,
|
|
||||||
0x7c, 0x13, 0x8b, 0xb3, 0x85, 0x44, 0xb8, 0x58, 0x0b, 0x12, 0x4b, 0x32, 0x8a, 0x25, 0x18, 0x15,
|
|
||||||
0x98, 0x35, 0x38, 0x83, 0x20, 0x1c, 0xa7, 0x56, 0xc6, 0x0b, 0x0f, 0xe5, 0x18, 0x6e, 0x3c, 0x94,
|
|
||||||
0x63, 0xf8, 0xf0, 0x50, 0x8e, 0xf1, 0xc7, 0x43, 0x39, 0xc6, 0x86, 0x47, 0x72, 0x8c, 0x2b, 0x1e,
|
|
||||||
0xc9, 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x2f,
|
|
||||||
0x1e, 0xc9, 0x31, 0x7c, 0x00, 0x89, 0x3f, 0x96, 0x63, 0xe4, 0x12, 0x4e, 0xce, 0xcf, 0xd5, 0x43,
|
|
||||||
0xb3, 0xca, 0x89, 0x0f, 0x6e, 0x51, 0x00, 0x48, 0x28, 0x80, 0x31, 0x8a, 0xb5, 0xa4, 0xb2, 0x20,
|
|
||||||
0xb5, 0x78, 0x11, 0x13, 0xb3, 0x7b, 0x80, 0xd3, 0x2a, 0x26, 0x39, 0x77, 0x88, 0x86, 0x00, 0xa8,
|
|
||||||
0x06, 0xbd, 0xf0, 0xd4, 0x9c, 0x1c, 0xef, 0xbc, 0xfc, 0xf2, 0xbc, 0x10, 0x90, 0xb2, 0x24, 0x36,
|
|
||||||
0xb0, 0x49, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x51, 0x31, 0x89, 0xb5, 0xd6, 0x00, 0x00,
|
|
||||||
0x00,
|
|
||||||
}
|
|
||||||
|
34
vendor/github.com/gogo/protobuf/types/protosize.go
generated
vendored
Normal file
34
vendor/github.com/gogo/protobuf/types/protosize.go
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
package types
|
||||||
|
|
||||||
|
func (m *Any) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Api) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Method) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Mixin) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Duration) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Empty) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *FieldMask) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *SourceContext) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Struct) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Value) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Value_NullValue) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Value_NumberValue) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Value_StringValue) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Value_BoolValue) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Value_StructValue) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Value_ListValue) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *ListValue) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Timestamp) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Type) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Field) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Enum) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *EnumValue) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Option) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *DoubleValue) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *FloatValue) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Int64Value) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *UInt64Value) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *Int32Value) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *UInt32Value) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *BoolValue) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *StringValue) ProtoSize() (n int) { return m.Size() }
|
||||||
|
func (m *BytesValue) ProtoSize() (n int) { return m.Size() }
|
550
vendor/github.com/gogo/protobuf/types/source_context.pb.go
generated
vendored
Normal file
550
vendor/github.com/gogo/protobuf/types/source_context.pb.go
generated
vendored
Normal file
@ -0,0 +1,550 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: google/protobuf/source_context.proto
|
||||||
|
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
bytes "bytes"
|
||||||
|
fmt "fmt"
|
||||||
|
proto "github.com/gogo/protobuf/proto"
|
||||||
|
io "io"
|
||||||
|
math "math"
|
||||||
|
reflect "reflect"
|
||||||
|
strings "strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the proto package it is being compiled against.
|
||||||
|
// A compilation error at this line likely means your copy of the
|
||||||
|
// proto package needs to be updated.
|
||||||
|
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||||
|
|
||||||
|
// `SourceContext` represents information about the source of a
|
||||||
|
// protobuf element, like the file in which it is defined.
|
||||||
|
type SourceContext struct {
|
||||||
|
// The path-qualified name of the .proto file that contained the associated
|
||||||
|
// protobuf element. For example: `"google/protobuf/source_context.proto"`.
|
||||||
|
FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
|
||||||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *SourceContext) Reset() { *m = SourceContext{} }
|
||||||
|
func (*SourceContext) ProtoMessage() {}
|
||||||
|
func (*SourceContext) Descriptor() ([]byte, []int) {
|
||||||
|
return fileDescriptor_b686cdb126d509db, []int{0}
|
||||||
|
}
|
||||||
|
func (m *SourceContext) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *SourceContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_SourceContext.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalTo(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *SourceContext) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_SourceContext.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *SourceContext) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *SourceContext) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_SourceContext.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_SourceContext proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *SourceContext) GetFileName() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.FileName
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*SourceContext) XXX_MessageName() string {
|
||||||
|
return "google.protobuf.SourceContext"
|
||||||
|
}
|
||||||
|
func init() {
|
||||||
|
proto.RegisterType((*SourceContext)(nil), "google.protobuf.SourceContext")
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterFile("google/protobuf/source_context.proto", fileDescriptor_b686cdb126d509db)
|
||||||
|
}
|
||||||
|
|
||||||
|
var fileDescriptor_b686cdb126d509db = []byte{
|
||||||
|
// 212 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xcf, 0xcf, 0x4f,
|
||||||
|
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0xce, 0x2f, 0x2d,
|
||||||
|
0x4a, 0x4e, 0x8d, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xad, 0x28, 0xd1, 0x03, 0x8b, 0x0b, 0xf1, 0x43,
|
||||||
|
0x54, 0xe9, 0xc1, 0x54, 0x29, 0xe9, 0x70, 0xf1, 0x06, 0x83, 0x15, 0x3a, 0x43, 0xd4, 0x09, 0x49,
|
||||||
|
0x73, 0x71, 0xa6, 0x65, 0xe6, 0xa4, 0xc6, 0xe7, 0x25, 0xe6, 0xa6, 0x4a, 0x30, 0x2a, 0x30, 0x6a,
|
||||||
|
0x70, 0x06, 0x71, 0x80, 0x04, 0xfc, 0x12, 0x73, 0x53, 0x9d, 0x3a, 0x19, 0x6f, 0x3c, 0x94, 0x63,
|
||||||
|
0xf8, 0xf0, 0x50, 0x8e, 0xf1, 0xc7, 0x43, 0x39, 0xc6, 0x86, 0x47, 0x72, 0x8c, 0x2b, 0x1e, 0xc9,
|
||||||
|
0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x2f, 0x1e,
|
||||||
|
0xc9, 0x31, 0x7c, 0x00, 0x89, 0x3f, 0x96, 0x63, 0x3c, 0xf1, 0x58, 0x8e, 0x91, 0x4b, 0x38, 0x39,
|
||||||
|
0x3f, 0x57, 0x0f, 0xcd, 0x56, 0x27, 0x21, 0x14, 0x3b, 0x03, 0x40, 0xc2, 0x01, 0x8c, 0x51, 0xac,
|
||||||
|
0x25, 0x95, 0x05, 0xa9, 0xc5, 0x8b, 0x98, 0x98, 0xdd, 0x03, 0x9c, 0x56, 0x31, 0xc9, 0xb9, 0x43,
|
||||||
|
0x34, 0x05, 0x40, 0x35, 0xe9, 0x85, 0xa7, 0xe6, 0xe4, 0x78, 0xe7, 0xe5, 0x97, 0xe7, 0x85, 0x80,
|
||||||
|
0x94, 0x25, 0xb1, 0x81, 0x4d, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x37, 0x2a, 0xa1,
|
||||||
|
0xf9, 0x00, 0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *SourceContext) Compare(that interface{}) int {
|
||||||
|
if that == nil {
|
||||||
|
if this == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
that1, ok := that.(*SourceContext)
|
||||||
|
if !ok {
|
||||||
|
that2, ok := that.(SourceContext)
|
||||||
|
if ok {
|
||||||
|
that1 = &that2
|
||||||
|
} else {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if that1 == nil {
|
||||||
|
if this == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
} else if this == nil {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
if this.FileName != that1.FileName {
|
||||||
|
if this.FileName < that1.FileName {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
func (this *SourceContext) Equal(that interface{}) bool {
|
||||||
|
if that == nil {
|
||||||
|
return this == nil
|
||||||
|
}
|
||||||
|
|
||||||
|
that1, ok := that.(*SourceContext)
|
||||||
|
if !ok {
|
||||||
|
that2, ok := that.(SourceContext)
|
||||||
|
if ok {
|
||||||
|
that1 = &that2
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if that1 == nil {
|
||||||
|
return this == nil
|
||||||
|
} else if this == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if this.FileName != that1.FileName {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
func (this *SourceContext) GoString() string {
|
||||||
|
if this == nil {
|
||||||
|
return "nil"
|
||||||
|
}
|
||||||
|
s := make([]string, 0, 5)
|
||||||
|
s = append(s, "&types.SourceContext{")
|
||||||
|
s = append(s, "FileName: "+fmt.Sprintf("%#v", this.FileName)+",\n")
|
||||||
|
if this.XXX_unrecognized != nil {
|
||||||
|
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
||||||
|
}
|
||||||
|
s = append(s, "}")
|
||||||
|
return strings.Join(s, "")
|
||||||
|
}
|
||||||
|
func valueToGoStringSourceContext(v interface{}, typ string) string {
|
||||||
|
rv := reflect.ValueOf(v)
|
||||||
|
if rv.IsNil() {
|
||||||
|
return "nil"
|
||||||
|
}
|
||||||
|
pv := reflect.Indirect(rv).Interface()
|
||||||
|
return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
|
||||||
|
}
|
||||||
|
func (m *SourceContext) Marshal() (dAtA []byte, err error) {
|
||||||
|
size := m.Size()
|
||||||
|
dAtA = make([]byte, size)
|
||||||
|
n, err := m.MarshalTo(dAtA)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return dAtA[:n], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *SourceContext) MarshalTo(dAtA []byte) (int, error) {
|
||||||
|
var i int
|
||||||
|
_ = 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)
|
||||||
|
}
|
||||||
|
return i, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeVarintSourceContext(dAtA []byte, offset int, v uint64) int {
|
||||||
|
for v >= 1<<7 {
|
||||||
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
||||||
|
v >>= 7
|
||||||
|
offset++
|
||||||
|
}
|
||||||
|
dAtA[offset] = uint8(v)
|
||||||
|
return offset + 1
|
||||||
|
}
|
||||||
|
func NewPopulatedSourceContext(r randySourceContext, easy bool) *SourceContext {
|
||||||
|
this := &SourceContext{}
|
||||||
|
this.FileName = string(randStringSourceContext(r))
|
||||||
|
if !easy && r.Intn(10) != 0 {
|
||||||
|
this.XXX_unrecognized = randUnrecognizedSourceContext(r, 2)
|
||||||
|
}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
type randySourceContext interface {
|
||||||
|
Float32() float32
|
||||||
|
Float64() float64
|
||||||
|
Int63() int64
|
||||||
|
Int31() int32
|
||||||
|
Uint32() uint32
|
||||||
|
Intn(n int) int
|
||||||
|
}
|
||||||
|
|
||||||
|
func randUTF8RuneSourceContext(r randySourceContext) rune {
|
||||||
|
ru := r.Intn(62)
|
||||||
|
if ru < 10 {
|
||||||
|
return rune(ru + 48)
|
||||||
|
} else if ru < 36 {
|
||||||
|
return rune(ru + 55)
|
||||||
|
}
|
||||||
|
return rune(ru + 61)
|
||||||
|
}
|
||||||
|
func randStringSourceContext(r randySourceContext) string {
|
||||||
|
v1 := r.Intn(100)
|
||||||
|
tmps := make([]rune, v1)
|
||||||
|
for i := 0; i < v1; i++ {
|
||||||
|
tmps[i] = randUTF8RuneSourceContext(r)
|
||||||
|
}
|
||||||
|
return string(tmps)
|
||||||
|
}
|
||||||
|
func randUnrecognizedSourceContext(r randySourceContext, maxFieldNumber int) (dAtA []byte) {
|
||||||
|
l := r.Intn(5)
|
||||||
|
for i := 0; i < l; i++ {
|
||||||
|
wire := r.Intn(4)
|
||||||
|
if wire == 3 {
|
||||||
|
wire = 5
|
||||||
|
}
|
||||||
|
fieldNumber := maxFieldNumber + r.Intn(100)
|
||||||
|
dAtA = randFieldSourceContext(dAtA, r, fieldNumber, wire)
|
||||||
|
}
|
||||||
|
return dAtA
|
||||||
|
}
|
||||||
|
func randFieldSourceContext(dAtA []byte, r randySourceContext, fieldNumber int, wire int) []byte {
|
||||||
|
key := uint32(fieldNumber)<<3 | uint32(wire)
|
||||||
|
switch wire {
|
||||||
|
case 0:
|
||||||
|
dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(key))
|
||||||
|
v2 := r.Int63()
|
||||||
|
if r.Intn(2) == 0 {
|
||||||
|
v2 *= -1
|
||||||
|
}
|
||||||
|
dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(v2))
|
||||||
|
case 1:
|
||||||
|
dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(key))
|
||||||
|
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
|
||||||
|
case 2:
|
||||||
|
dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(key))
|
||||||
|
ll := r.Intn(100)
|
||||||
|
dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(ll))
|
||||||
|
for j := 0; j < ll; j++ {
|
||||||
|
dAtA = append(dAtA, byte(r.Intn(256)))
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
dAtA = encodeVarintPopulateSourceContext(dAtA, uint64(key))
|
||||||
|
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
|
||||||
|
}
|
||||||
|
return dAtA
|
||||||
|
}
|
||||||
|
func encodeVarintPopulateSourceContext(dAtA []byte, v uint64) []byte {
|
||||||
|
for v >= 1<<7 {
|
||||||
|
dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
|
||||||
|
v >>= 7
|
||||||
|
}
|
||||||
|
dAtA = append(dAtA, uint8(v))
|
||||||
|
return dAtA
|
||||||
|
}
|
||||||
|
func (m *SourceContext) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
var l int
|
||||||
|
_ = l
|
||||||
|
l = len(m.FileName)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovSourceContext(uint64(l))
|
||||||
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
n += len(m.XXX_unrecognized)
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
|
func sovSourceContext(x uint64) (n int) {
|
||||||
|
for {
|
||||||
|
n++
|
||||||
|
x >>= 7
|
||||||
|
if x == 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
func sozSourceContext(x uint64) (n int) {
|
||||||
|
return sovSourceContext(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
||||||
|
}
|
||||||
|
func (this *SourceContext) String() string {
|
||||||
|
if this == nil {
|
||||||
|
return "nil"
|
||||||
|
}
|
||||||
|
s := strings.Join([]string{`&SourceContext{`,
|
||||||
|
`FileName:` + fmt.Sprintf("%v", this.FileName) + `,`,
|
||||||
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||||
|
`}`,
|
||||||
|
}, "")
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
func valueToStringSourceContext(v interface{}) string {
|
||||||
|
rv := reflect.ValueOf(v)
|
||||||
|
if rv.IsNil() {
|
||||||
|
return "nil"
|
||||||
|
}
|
||||||
|
pv := reflect.Indirect(rv).Interface()
|
||||||
|
return fmt.Sprintf("*%v", pv)
|
||||||
|
}
|
||||||
|
func (m *SourceContext) Unmarshal(dAtA []byte) error {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
preIndex := iNdEx
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowSourceContext
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fieldNum := int32(wire >> 3)
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
if wireType == 4 {
|
||||||
|
return fmt.Errorf("proto: SourceContext: wiretype end group for non-group")
|
||||||
|
}
|
||||||
|
if fieldNum <= 0 {
|
||||||
|
return fmt.Errorf("proto: SourceContext: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
|
}
|
||||||
|
switch fieldNum {
|
||||||
|
case 1:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field FileName", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowSourceContext
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthSourceContext
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthSourceContext
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.FileName = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
|
default:
|
||||||
|
iNdEx = preIndex
|
||||||
|
skippy, err := skipSourceContext(dAtA[iNdEx:])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if skippy < 0 {
|
||||||
|
return ErrInvalidLengthSourceContext
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) < 0 {
|
||||||
|
return ErrInvalidLengthSourceContext
|
||||||
|
}
|
||||||
|
if (iNdEx + skippy) > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||||
|
iNdEx += skippy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if iNdEx > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func skipSourceContext(dAtA []byte) (n int, err error) {
|
||||||
|
l := len(dAtA)
|
||||||
|
iNdEx := 0
|
||||||
|
for iNdEx < l {
|
||||||
|
var wire uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowSourceContext
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
wire |= (uint64(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wireType := int(wire & 0x7)
|
||||||
|
switch wireType {
|
||||||
|
case 0:
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowSourceContext
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
iNdEx++
|
||||||
|
if dAtA[iNdEx-1] < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return iNdEx, nil
|
||||||
|
case 1:
|
||||||
|
iNdEx += 8
|
||||||
|
return iNdEx, nil
|
||||||
|
case 2:
|
||||||
|
var length int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return 0, ErrIntOverflowSourceContext
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return 0, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
length |= (int(b) & 0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if length < 0 {
|
||||||
|
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
|
||||||
|
case 4:
|
||||||
|
return iNdEx, nil
|
||||||
|
case 5:
|
||||||
|
iNdEx += 4
|
||||||
|
return iNdEx, nil
|
||||||
|
default:
|
||||||
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
panic("unreachable")
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrInvalidLengthSourceContext = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
|
ErrIntOverflowSourceContext = fmt.Errorf("proto: integer overflow")
|
||||||
|
)
|
414
vendor/github.com/gogo/protobuf/types/struct.pb.go
generated
vendored
414
vendor/github.com/gogo/protobuf/types/struct.pb.go
generated
vendored
@ -1,32 +1,20 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
// source: struct.proto
|
// source: google/protobuf/struct.proto
|
||||||
|
|
||||||
/*
|
|
||||||
Package types is a generated protocol buffer package.
|
|
||||||
|
|
||||||
It is generated from these files:
|
|
||||||
struct.proto
|
|
||||||
|
|
||||||
It has these top-level messages:
|
|
||||||
Struct
|
|
||||||
Value
|
|
||||||
ListValue
|
|
||||||
*/
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import proto "github.com/gogo/protobuf/proto"
|
import (
|
||||||
import fmt "fmt"
|
bytes "bytes"
|
||||||
import math "math"
|
encoding_binary "encoding/binary"
|
||||||
|
fmt "fmt"
|
||||||
import strconv "strconv"
|
proto "github.com/gogo/protobuf/proto"
|
||||||
|
github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
|
||||||
import strings "strings"
|
io "io"
|
||||||
import reflect "reflect"
|
math "math"
|
||||||
import sortkeys "github.com/gogo/protobuf/sortkeys"
|
reflect "reflect"
|
||||||
|
strconv "strconv"
|
||||||
import binary "encoding/binary"
|
strings "strings"
|
||||||
|
)
|
||||||
import io "io"
|
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -47,18 +35,22 @@ type NullValue int32
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
// Null value.
|
// Null value.
|
||||||
NULL_VALUE NullValue = 0
|
NullValue_NULL_VALUE NullValue = 0
|
||||||
)
|
)
|
||||||
|
|
||||||
var NullValue_name = map[int32]string{
|
var NullValue_name = map[int32]string{
|
||||||
0: "NULL_VALUE",
|
0: "NULL_VALUE",
|
||||||
}
|
}
|
||||||
|
|
||||||
var NullValue_value = map[string]int32{
|
var NullValue_value = map[string]int32{
|
||||||
"NULL_VALUE": 0,
|
"NULL_VALUE": 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (NullValue) EnumDescriptor() ([]byte, []int) { return fileDescriptorStruct, []int{0} }
|
func (NullValue) EnumDescriptor() ([]byte, []int) {
|
||||||
func (NullValue) XXX_WellKnownType() string { return "NullValue" }
|
return fileDescriptor_df322afd6c9fb402, []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (NullValue) XXX_WellKnownType() string { return "NullValue" }
|
||||||
|
|
||||||
// `Struct` represents a structured data value, consisting of fields
|
// `Struct` represents a structured data value, consisting of fields
|
||||||
// which map to dynamically typed values. In some languages, `Struct`
|
// which map to dynamically typed values. In some languages, `Struct`
|
||||||
@ -70,13 +62,44 @@ func (NullValue) XXX_WellKnownType() string { return "NullValue" }
|
|||||||
// The JSON representation for `Struct` is JSON object.
|
// The JSON representation for `Struct` is JSON object.
|
||||||
type Struct struct {
|
type Struct struct {
|
||||||
// Unordered map of dynamically typed values.
|
// Unordered map of dynamically typed values.
|
||||||
Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"`
|
Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Struct) Reset() { *m = Struct{} }
|
func (m *Struct) Reset() { *m = Struct{} }
|
||||||
func (*Struct) ProtoMessage() {}
|
func (*Struct) ProtoMessage() {}
|
||||||
func (*Struct) Descriptor() ([]byte, []int) { return fileDescriptorStruct, []int{0} }
|
func (*Struct) Descriptor() ([]byte, []int) {
|
||||||
func (*Struct) XXX_WellKnownType() string { return "Struct" }
|
return fileDescriptor_df322afd6c9fb402, []int{0}
|
||||||
|
}
|
||||||
|
func (*Struct) XXX_WellKnownType() string { return "Struct" }
|
||||||
|
func (m *Struct) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *Struct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_Struct.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalTo(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *Struct) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Struct.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Struct) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *Struct) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Struct.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Struct proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *Struct) GetFields() map[string]*Value {
|
func (m *Struct) GetFields() map[string]*Value {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
@ -85,6 +108,10 @@ func (m *Struct) GetFields() map[string]*Value {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (*Struct) XXX_MessageName() string {
|
||||||
|
return "google.protobuf.Struct"
|
||||||
|
}
|
||||||
|
|
||||||
// `Value` represents a dynamically typed value which can be either
|
// `Value` represents a dynamically typed value which can be either
|
||||||
// null, a number, a string, a boolean, a recursive struct value, or a
|
// null, a number, a string, a boolean, a recursive struct value, or a
|
||||||
// list of values. A producer of value is expected to set one of that
|
// list of values. A producer of value is expected to set one of that
|
||||||
@ -101,13 +128,44 @@ type Value struct {
|
|||||||
// *Value_BoolValue
|
// *Value_BoolValue
|
||||||
// *Value_StructValue
|
// *Value_StructValue
|
||||||
// *Value_ListValue
|
// *Value_ListValue
|
||||||
Kind isValue_Kind `protobuf_oneof:"kind"`
|
Kind isValue_Kind `protobuf_oneof:"kind"`
|
||||||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Value) Reset() { *m = Value{} }
|
func (m *Value) Reset() { *m = Value{} }
|
||||||
func (*Value) ProtoMessage() {}
|
func (*Value) ProtoMessage() {}
|
||||||
func (*Value) Descriptor() ([]byte, []int) { return fileDescriptorStruct, []int{1} }
|
func (*Value) Descriptor() ([]byte, []int) {
|
||||||
func (*Value) XXX_WellKnownType() string { return "Value" }
|
return fileDescriptor_df322afd6c9fb402, []int{1}
|
||||||
|
}
|
||||||
|
func (*Value) XXX_WellKnownType() string { return "Value" }
|
||||||
|
func (m *Value) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_Value.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalTo(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *Value) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Value.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Value) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *Value) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Value.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Value proto.InternalMessageInfo
|
||||||
|
|
||||||
type isValue_Kind interface {
|
type isValue_Kind interface {
|
||||||
isValue_Kind()
|
isValue_Kind()
|
||||||
@ -129,10 +187,10 @@ type Value_BoolValue struct {
|
|||||||
BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof"`
|
BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof"`
|
||||||
}
|
}
|
||||||
type Value_StructValue struct {
|
type Value_StructValue struct {
|
||||||
StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,oneof"`
|
StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,proto3,oneof"`
|
||||||
}
|
}
|
||||||
type Value_ListValue struct {
|
type Value_ListValue struct {
|
||||||
ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,oneof"`
|
ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,proto3,oneof"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*Value_NullValue) isValue_Kind() {}
|
func (*Value_NullValue) isValue_Kind() {}
|
||||||
@ -153,7 +211,7 @@ func (m *Value) GetNullValue() NullValue {
|
|||||||
if x, ok := m.GetKind().(*Value_NullValue); ok {
|
if x, ok := m.GetKind().(*Value_NullValue); ok {
|
||||||
return x.NullValue
|
return x.NullValue
|
||||||
}
|
}
|
||||||
return NULL_VALUE
|
return NullValue_NULL_VALUE
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Value) GetNumberValue() float64 {
|
func (m *Value) GetNumberValue() float64 {
|
||||||
@ -297,26 +355,26 @@ func _Value_OneofSizer(msg proto.Message) (n int) {
|
|||||||
// kind
|
// kind
|
||||||
switch x := m.Kind.(type) {
|
switch x := m.Kind.(type) {
|
||||||
case *Value_NullValue:
|
case *Value_NullValue:
|
||||||
n += proto.SizeVarint(1<<3 | proto.WireVarint)
|
n += 1 // tag and wire
|
||||||
n += proto.SizeVarint(uint64(x.NullValue))
|
n += proto.SizeVarint(uint64(x.NullValue))
|
||||||
case *Value_NumberValue:
|
case *Value_NumberValue:
|
||||||
n += proto.SizeVarint(2<<3 | proto.WireFixed64)
|
n += 1 // tag and wire
|
||||||
n += 8
|
n += 8
|
||||||
case *Value_StringValue:
|
case *Value_StringValue:
|
||||||
n += proto.SizeVarint(3<<3 | proto.WireBytes)
|
n += 1 // tag and wire
|
||||||
n += proto.SizeVarint(uint64(len(x.StringValue)))
|
n += proto.SizeVarint(uint64(len(x.StringValue)))
|
||||||
n += len(x.StringValue)
|
n += len(x.StringValue)
|
||||||
case *Value_BoolValue:
|
case *Value_BoolValue:
|
||||||
n += proto.SizeVarint(4<<3 | proto.WireVarint)
|
n += 1 // tag and wire
|
||||||
n += 1
|
n += 1
|
||||||
case *Value_StructValue:
|
case *Value_StructValue:
|
||||||
s := proto.Size(x.StructValue)
|
s := proto.Size(x.StructValue)
|
||||||
n += proto.SizeVarint(5<<3 | proto.WireBytes)
|
n += 1 // tag and wire
|
||||||
n += proto.SizeVarint(uint64(s))
|
n += proto.SizeVarint(uint64(s))
|
||||||
n += s
|
n += s
|
||||||
case *Value_ListValue:
|
case *Value_ListValue:
|
||||||
s := proto.Size(x.ListValue)
|
s := proto.Size(x.ListValue)
|
||||||
n += proto.SizeVarint(6<<3 | proto.WireBytes)
|
n += 1 // tag and wire
|
||||||
n += proto.SizeVarint(uint64(s))
|
n += proto.SizeVarint(uint64(s))
|
||||||
n += s
|
n += s
|
||||||
case nil:
|
case nil:
|
||||||
@ -326,18 +384,53 @@ func _Value_OneofSizer(msg proto.Message) (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (*Value) XXX_MessageName() string {
|
||||||
|
return "google.protobuf.Value"
|
||||||
|
}
|
||||||
|
|
||||||
// `ListValue` is a wrapper around a repeated field of values.
|
// `ListValue` is a wrapper around a repeated field of values.
|
||||||
//
|
//
|
||||||
// The JSON representation for `ListValue` is JSON array.
|
// The JSON representation for `ListValue` is JSON array.
|
||||||
type ListValue struct {
|
type ListValue struct {
|
||||||
// Repeated field of dynamically typed values.
|
// Repeated field of dynamically typed values.
|
||||||
Values []*Value `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"`
|
Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
|
||||||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ListValue) Reset() { *m = ListValue{} }
|
func (m *ListValue) Reset() { *m = ListValue{} }
|
||||||
func (*ListValue) ProtoMessage() {}
|
func (*ListValue) ProtoMessage() {}
|
||||||
func (*ListValue) Descriptor() ([]byte, []int) { return fileDescriptorStruct, []int{2} }
|
func (*ListValue) Descriptor() ([]byte, []int) {
|
||||||
func (*ListValue) XXX_WellKnownType() string { return "ListValue" }
|
return fileDescriptor_df322afd6c9fb402, []int{2}
|
||||||
|
}
|
||||||
|
func (*ListValue) XXX_WellKnownType() string { return "ListValue" }
|
||||||
|
func (m *ListValue) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *ListValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_ListValue.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalTo(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *ListValue) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_ListValue.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *ListValue) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *ListValue) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_ListValue.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_ListValue proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *ListValue) GetValues() []*Value {
|
func (m *ListValue) GetValues() []*Value {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
@ -346,12 +439,51 @@ func (m *ListValue) GetValues() []*Value {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (*ListValue) XXX_MessageName() string {
|
||||||
|
return "google.protobuf.ListValue"
|
||||||
|
}
|
||||||
func init() {
|
func init() {
|
||||||
|
proto.RegisterEnum("google.protobuf.NullValue", NullValue_name, NullValue_value)
|
||||||
proto.RegisterType((*Struct)(nil), "google.protobuf.Struct")
|
proto.RegisterType((*Struct)(nil), "google.protobuf.Struct")
|
||||||
|
proto.RegisterMapType((map[string]*Value)(nil), "google.protobuf.Struct.FieldsEntry")
|
||||||
proto.RegisterType((*Value)(nil), "google.protobuf.Value")
|
proto.RegisterType((*Value)(nil), "google.protobuf.Value")
|
||||||
proto.RegisterType((*ListValue)(nil), "google.protobuf.ListValue")
|
proto.RegisterType((*ListValue)(nil), "google.protobuf.ListValue")
|
||||||
proto.RegisterEnum("google.protobuf.NullValue", NullValue_name, NullValue_value)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("google/protobuf/struct.proto", fileDescriptor_df322afd6c9fb402) }
|
||||||
|
|
||||||
|
var fileDescriptor_df322afd6c9fb402 = []byte{
|
||||||
|
// 439 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xc1, 0x6b, 0xd4, 0x40,
|
||||||
|
0x14, 0xc6, 0xf3, 0xb2, 0xdd, 0xe0, 0xbe, 0x48, 0x2d, 0x23, 0xe8, 0x52, 0x65, 0x5c, 0xb6, 0x97,
|
||||||
|
0x45, 0x24, 0x85, 0xf5, 0x22, 0xae, 0x17, 0x17, 0x6a, 0x0b, 0x86, 0x12, 0xa3, 0xad, 0xe0, 0x65,
|
||||||
|
0x31, 0x69, 0xba, 0x84, 0x4e, 0x67, 0x4a, 0x32, 0xa3, 0xec, 0x4d, 0xff, 0x0b, 0xcf, 0x9e, 0xc4,
|
||||||
|
0xa3, 0x7f, 0x85, 0x47, 0x8f, 0x1e, 0xdd, 0x78, 0xf1, 0xd8, 0x63, 0x8f, 0x32, 0x33, 0x49, 0x94,
|
||||||
|
0x2e, 0xbd, 0xe5, 0x7d, 0xf3, 0x7b, 0xdf, 0x7b, 0xdf, 0x0b, 0xde, 0x9d, 0x0b, 0x31, 0x67, 0xd9,
|
||||||
|
0xf6, 0x59, 0x21, 0xa4, 0x48, 0xd4, 0xf1, 0x76, 0x29, 0x0b, 0x95, 0xca, 0xc0, 0xd4, 0xe4, 0x86,
|
||||||
|
0x7d, 0x0d, 0x9a, 0xd7, 0xe1, 0x27, 0x40, 0xef, 0xa5, 0x21, 0xc8, 0x04, 0xbd, 0xe3, 0x3c, 0x63,
|
||||||
|
0x47, 0x65, 0x1f, 0x06, 0x9d, 0x91, 0x3f, 0xde, 0x0a, 0x2e, 0xc1, 0x81, 0x05, 0x83, 0x67, 0x86,
|
||||||
|
0xda, 0xe1, 0xb2, 0x58, 0xc4, 0x75, 0xcb, 0xe6, 0x0b, 0xf4, 0xff, 0x93, 0xc9, 0x06, 0x76, 0x4e,
|
||||||
|
0xb2, 0x45, 0x1f, 0x06, 0x30, 0xea, 0xc5, 0xfa, 0x93, 0x3c, 0xc0, 0xee, 0xbb, 0xb7, 0x4c, 0x65,
|
||||||
|
0x7d, 0x77, 0x00, 0x23, 0x7f, 0x7c, 0x6b, 0xc5, 0xfc, 0x50, 0xbf, 0xc6, 0x16, 0x7a, 0xec, 0x3e,
|
||||||
|
0x82, 0xe1, 0x37, 0x17, 0xbb, 0x46, 0x24, 0x13, 0x44, 0xae, 0x18, 0x9b, 0x59, 0x03, 0x6d, 0xba,
|
||||||
|
0x3e, 0xde, 0x5c, 0x31, 0xd8, 0x57, 0x8c, 0x19, 0x7e, 0xcf, 0x89, 0x7b, 0xbc, 0x29, 0xc8, 0x16,
|
||||||
|
0x5e, 0xe7, 0xea, 0x34, 0xc9, 0x8a, 0xd9, 0xbf, 0xf9, 0xb0, 0xe7, 0xc4, 0xbe, 0x55, 0x5b, 0xa8,
|
||||||
|
0x94, 0x45, 0xce, 0xe7, 0x35, 0xd4, 0xd1, 0x8b, 0x6b, 0xc8, 0xaa, 0x16, 0xba, 0x87, 0x98, 0x08,
|
||||||
|
0xd1, 0xac, 0xb1, 0x36, 0x80, 0xd1, 0x35, 0x3d, 0x4a, 0x6b, 0x16, 0x78, 0x62, 0x5c, 0x54, 0x2a,
|
||||||
|
0x6b, 0xa4, 0x6b, 0xa2, 0xde, 0xbe, 0xe2, 0x8e, 0xb5, 0xbd, 0x4a, 0x65, 0x9b, 0x92, 0xe5, 0x65,
|
||||||
|
0xd3, 0xeb, 0x99, 0xde, 0xd5, 0x94, 0x61, 0x5e, 0xca, 0x36, 0x25, 0x6b, 0x8a, 0xa9, 0x87, 0x6b,
|
||||||
|
0x27, 0x39, 0x3f, 0x1a, 0x4e, 0xb0, 0xd7, 0x12, 0x24, 0x40, 0xcf, 0x98, 0x35, 0x7f, 0xf4, 0xaa,
|
||||||
|
0xa3, 0xd7, 0xd4, 0xfd, 0x3b, 0xd8, 0x6b, 0x8f, 0x48, 0xd6, 0x11, 0xf7, 0x0f, 0xc2, 0x70, 0x76,
|
||||||
|
0xf8, 0x34, 0x3c, 0xd8, 0xd9, 0x70, 0xa6, 0x1f, 0xe1, 0xe7, 0x92, 0x3a, 0xe7, 0x4b, 0x0a, 0x17,
|
||||||
|
0x4b, 0x0a, 0x1f, 0x2a, 0x0a, 0x5f, 0x2a, 0x0a, 0xdf, 0x2b, 0x0a, 0x3f, 0x2a, 0x0a, 0xbf, 0x2a,
|
||||||
|
0x0a, 0x7f, 0x2a, 0xea, 0x9c, 0x6b, 0xed, 0x37, 0x05, 0xbc, 0x99, 0x8a, 0xd3, 0xcb, 0xe3, 0xa6,
|
||||||
|
0xbe, 0x4d, 0x1e, 0xe9, 0x3a, 0x82, 0x37, 0x5d, 0xb9, 0x38, 0xcb, 0xca, 0x0b, 0x80, 0xcf, 0x6e,
|
||||||
|
0x67, 0x37, 0x9a, 0x7e, 0x75, 0xe9, 0xae, 0x6d, 0x88, 0x9a, 0xfd, 0x5e, 0x67, 0x8c, 0x3d, 0xe7,
|
||||||
|
0xe2, 0x3d, 0x7f, 0xa5, 0xc9, 0xc4, 0x33, 0x4e, 0x0f, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xad,
|
||||||
|
0x84, 0x08, 0xae, 0xe5, 0x02, 0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
func (x NullValue) String() string {
|
func (x NullValue) String() string {
|
||||||
s, ok := NullValue_name[int32(x)]
|
s, ok := NullValue_name[int32(x)]
|
||||||
if ok {
|
if ok {
|
||||||
@ -386,6 +518,9 @@ func (this *Struct) Equal(that interface{}) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
func (this *Value) Equal(that interface{}) bool {
|
func (this *Value) Equal(that interface{}) bool {
|
||||||
@ -416,6 +551,9 @@ func (this *Value) Equal(that interface{}) bool {
|
|||||||
} else if !this.Kind.Equal(that1.Kind) {
|
} else if !this.Kind.Equal(that1.Kind) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
func (this *Value_NullValue) Equal(that interface{}) bool {
|
func (this *Value_NullValue) Equal(that interface{}) bool {
|
||||||
@ -589,6 +727,9 @@ func (this *ListValue) Equal(that interface{}) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
func (this *Struct) GoString() string {
|
func (this *Struct) GoString() string {
|
||||||
@ -601,7 +742,7 @@ func (this *Struct) GoString() string {
|
|||||||
for k := range this.Fields {
|
for k := range this.Fields {
|
||||||
keysForFields = append(keysForFields, k)
|
keysForFields = append(keysForFields, k)
|
||||||
}
|
}
|
||||||
sortkeys.Strings(keysForFields)
|
github_com_gogo_protobuf_sortkeys.Strings(keysForFields)
|
||||||
mapStringForFields := "map[string]*Value{"
|
mapStringForFields := "map[string]*Value{"
|
||||||
for _, k := range keysForFields {
|
for _, k := range keysForFields {
|
||||||
mapStringForFields += fmt.Sprintf("%#v: %#v,", k, this.Fields[k])
|
mapStringForFields += fmt.Sprintf("%#v: %#v,", k, this.Fields[k])
|
||||||
@ -610,6 +751,9 @@ func (this *Struct) GoString() string {
|
|||||||
if this.Fields != nil {
|
if this.Fields != nil {
|
||||||
s = append(s, "Fields: "+mapStringForFields+",\n")
|
s = append(s, "Fields: "+mapStringForFields+",\n")
|
||||||
}
|
}
|
||||||
|
if this.XXX_unrecognized != nil {
|
||||||
|
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
||||||
|
}
|
||||||
s = append(s, "}")
|
s = append(s, "}")
|
||||||
return strings.Join(s, "")
|
return strings.Join(s, "")
|
||||||
}
|
}
|
||||||
@ -622,6 +766,9 @@ func (this *Value) GoString() string {
|
|||||||
if this.Kind != nil {
|
if this.Kind != nil {
|
||||||
s = append(s, "Kind: "+fmt.Sprintf("%#v", this.Kind)+",\n")
|
s = append(s, "Kind: "+fmt.Sprintf("%#v", this.Kind)+",\n")
|
||||||
}
|
}
|
||||||
|
if this.XXX_unrecognized != nil {
|
||||||
|
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
||||||
|
}
|
||||||
s = append(s, "}")
|
s = append(s, "}")
|
||||||
return strings.Join(s, "")
|
return strings.Join(s, "")
|
||||||
}
|
}
|
||||||
@ -682,6 +829,9 @@ func (this *ListValue) GoString() string {
|
|||||||
if this.Values != nil {
|
if this.Values != nil {
|
||||||
s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\n")
|
s = append(s, "Values: "+fmt.Sprintf("%#v", this.Values)+",\n")
|
||||||
}
|
}
|
||||||
|
if this.XXX_unrecognized != nil {
|
||||||
|
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
||||||
|
}
|
||||||
s = append(s, "}")
|
s = append(s, "}")
|
||||||
return strings.Join(s, "")
|
return strings.Join(s, "")
|
||||||
}
|
}
|
||||||
@ -736,6 +886,9 @@ func (m *Struct) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -761,6 +914,9 @@ func (m *Value) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
}
|
}
|
||||||
i += nn2
|
i += nn2
|
||||||
}
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -775,7 +931,7 @@ func (m *Value_NumberValue) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
i := 0
|
i := 0
|
||||||
dAtA[i] = 0x11
|
dAtA[i] = 0x11
|
||||||
i++
|
i++
|
||||||
binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.NumberValue))))
|
encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.NumberValue))))
|
||||||
i += 8
|
i += 8
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
@ -854,6 +1010,9 @@ func (m *ListValue) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
i += n
|
i += n
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -876,6 +1035,7 @@ func NewPopulatedStruct(r randyStruct, easy bool) *Struct {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !easy && r.Intn(10) != 0 {
|
if !easy && r.Intn(10) != 0 {
|
||||||
|
this.XXX_unrecognized = randUnrecognizedStruct(r, 2)
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
@ -898,6 +1058,7 @@ func NewPopulatedValue(r randyStruct, easy bool) *Value {
|
|||||||
this.Kind = NewPopulatedValue_ListValue(r, easy)
|
this.Kind = NewPopulatedValue_ListValue(r, easy)
|
||||||
}
|
}
|
||||||
if !easy && r.Intn(10) != 0 {
|
if !easy && r.Intn(10) != 0 {
|
||||||
|
this.XXX_unrecognized = randUnrecognizedStruct(r, 7)
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
@ -945,6 +1106,7 @@ func NewPopulatedListValue(r randyStruct, easy bool) *ListValue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !easy && r.Intn(10) != 0 {
|
if !easy && r.Intn(10) != 0 {
|
||||||
|
this.XXX_unrecognized = randUnrecognizedStruct(r, 2)
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
@ -1022,6 +1184,9 @@ func encodeVarintPopulateStruct(dAtA []byte, v uint64) []byte {
|
|||||||
return dAtA
|
return dAtA
|
||||||
}
|
}
|
||||||
func (m *Struct) Size() (n int) {
|
func (m *Struct) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.Fields) > 0 {
|
if len(m.Fields) > 0 {
|
||||||
@ -1037,31 +1202,49 @@ func (m *Struct) Size() (n int) {
|
|||||||
n += mapEntrySize + 1 + sovStruct(uint64(mapEntrySize))
|
n += mapEntrySize + 1 + sovStruct(uint64(mapEntrySize))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
n += len(m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Value) Size() (n int) {
|
func (m *Value) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Kind != nil {
|
if m.Kind != nil {
|
||||||
n += m.Kind.Size()
|
n += m.Kind.Size()
|
||||||
}
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
n += len(m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Value_NullValue) Size() (n int) {
|
func (m *Value_NullValue) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
n += 1 + sovStruct(uint64(m.NullValue))
|
n += 1 + sovStruct(uint64(m.NullValue))
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
func (m *Value_NumberValue) Size() (n int) {
|
func (m *Value_NumberValue) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
n += 9
|
n += 9
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
func (m *Value_StringValue) Size() (n int) {
|
func (m *Value_StringValue) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
l = len(m.StringValue)
|
l = len(m.StringValue)
|
||||||
@ -1069,12 +1252,18 @@ func (m *Value_StringValue) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
func (m *Value_BoolValue) Size() (n int) {
|
func (m *Value_BoolValue) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
n += 2
|
n += 2
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
func (m *Value_StructValue) Size() (n int) {
|
func (m *Value_StructValue) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.StructValue != nil {
|
if m.StructValue != nil {
|
||||||
@ -1084,6 +1273,9 @@ func (m *Value_StructValue) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
func (m *Value_ListValue) Size() (n int) {
|
func (m *Value_ListValue) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.ListValue != nil {
|
if m.ListValue != nil {
|
||||||
@ -1093,6 +1285,9 @@ func (m *Value_ListValue) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
func (m *ListValue) Size() (n int) {
|
func (m *ListValue) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if len(m.Values) > 0 {
|
if len(m.Values) > 0 {
|
||||||
@ -1101,6 +1296,9 @@ func (m *ListValue) Size() (n int) {
|
|||||||
n += 1 + l + sovStruct(uint64(l))
|
n += 1 + l + sovStruct(uint64(l))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
n += len(m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1125,7 +1323,7 @@ func (this *Struct) String() string {
|
|||||||
for k := range this.Fields {
|
for k := range this.Fields {
|
||||||
keysForFields = append(keysForFields, k)
|
keysForFields = append(keysForFields, k)
|
||||||
}
|
}
|
||||||
sortkeys.Strings(keysForFields)
|
github_com_gogo_protobuf_sortkeys.Strings(keysForFields)
|
||||||
mapStringForFields := "map[string]*Value{"
|
mapStringForFields := "map[string]*Value{"
|
||||||
for _, k := range keysForFields {
|
for _, k := range keysForFields {
|
||||||
mapStringForFields += fmt.Sprintf("%v: %v,", k, this.Fields[k])
|
mapStringForFields += fmt.Sprintf("%v: %v,", k, this.Fields[k])
|
||||||
@ -1133,6 +1331,7 @@ func (this *Struct) String() string {
|
|||||||
mapStringForFields += "}"
|
mapStringForFields += "}"
|
||||||
s := strings.Join([]string{`&Struct{`,
|
s := strings.Join([]string{`&Struct{`,
|
||||||
`Fields:` + mapStringForFields + `,`,
|
`Fields:` + mapStringForFields + `,`,
|
||||||
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
@ -1143,6 +1342,7 @@ func (this *Value) String() string {
|
|||||||
}
|
}
|
||||||
s := strings.Join([]string{`&Value{`,
|
s := strings.Join([]string{`&Value{`,
|
||||||
`Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
|
`Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
|
||||||
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
@ -1213,6 +1413,7 @@ func (this *ListValue) String() string {
|
|||||||
}
|
}
|
||||||
s := strings.Join([]string{`&ListValue{`,
|
s := strings.Join([]string{`&ListValue{`,
|
||||||
`Values:` + strings.Replace(fmt.Sprintf("%v", this.Values), "Value", "Value", 1) + `,`,
|
`Values:` + strings.Replace(fmt.Sprintf("%v", this.Values), "Value", "Value", 1) + `,`,
|
||||||
|
`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
|
||||||
`}`,
|
`}`,
|
||||||
}, "")
|
}, "")
|
||||||
return s
|
return s
|
||||||
@ -1240,7 +1441,7 @@ func (m *Struct) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
wire |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1268,7 +1469,7 @@ func (m *Struct) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
msglen |= (int(b) & 0x7F) << shift
|
msglen |= int(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1277,6 +1478,9 @@ func (m *Struct) Unmarshal(dAtA []byte) error {
|
|||||||
return ErrInvalidLengthStruct
|
return ErrInvalidLengthStruct
|
||||||
}
|
}
|
||||||
postIndex := iNdEx + msglen
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthStruct
|
||||||
|
}
|
||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
@ -1297,7 +1501,7 @@ func (m *Struct) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
wire |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1314,7 +1518,7 @@ func (m *Struct) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
stringLenmapkey |= (uint64(b) & 0x7F) << shift
|
stringLenmapkey |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1324,6 +1528,9 @@ func (m *Struct) Unmarshal(dAtA []byte) error {
|
|||||||
return ErrInvalidLengthStruct
|
return ErrInvalidLengthStruct
|
||||||
}
|
}
|
||||||
postStringIndexmapkey := iNdEx + intStringLenmapkey
|
postStringIndexmapkey := iNdEx + intStringLenmapkey
|
||||||
|
if postStringIndexmapkey < 0 {
|
||||||
|
return ErrInvalidLengthStruct
|
||||||
|
}
|
||||||
if postStringIndexmapkey > l {
|
if postStringIndexmapkey > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
@ -1340,7 +1547,7 @@ func (m *Struct) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
mapmsglen |= (int(b) & 0x7F) << shift
|
mapmsglen |= int(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1349,7 +1556,7 @@ func (m *Struct) Unmarshal(dAtA []byte) error {
|
|||||||
return ErrInvalidLengthStruct
|
return ErrInvalidLengthStruct
|
||||||
}
|
}
|
||||||
postmsgIndex := iNdEx + mapmsglen
|
postmsgIndex := iNdEx + mapmsglen
|
||||||
if mapmsglen < 0 {
|
if postmsgIndex < 0 {
|
||||||
return ErrInvalidLengthStruct
|
return ErrInvalidLengthStruct
|
||||||
}
|
}
|
||||||
if postmsgIndex > l {
|
if postmsgIndex > l {
|
||||||
@ -1386,9 +1593,13 @@ func (m *Struct) Unmarshal(dAtA []byte) error {
|
|||||||
if skippy < 0 {
|
if skippy < 0 {
|
||||||
return ErrInvalidLengthStruct
|
return ErrInvalidLengthStruct
|
||||||
}
|
}
|
||||||
|
if (iNdEx + skippy) < 0 {
|
||||||
|
return ErrInvalidLengthStruct
|
||||||
|
}
|
||||||
if (iNdEx + skippy) > l {
|
if (iNdEx + skippy) > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||||
iNdEx += skippy
|
iNdEx += skippy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1413,7 +1624,7 @@ func (m *Value) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
wire |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1441,7 +1652,7 @@ func (m *Value) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
v |= (NullValue(b) & 0x7F) << shift
|
v |= NullValue(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1455,7 +1666,7 @@ func (m *Value) Unmarshal(dAtA []byte) error {
|
|||||||
if (iNdEx + 8) > l {
|
if (iNdEx + 8) > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:]))
|
v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:]))
|
||||||
iNdEx += 8
|
iNdEx += 8
|
||||||
m.Kind = &Value_NumberValue{float64(math.Float64frombits(v))}
|
m.Kind = &Value_NumberValue{float64(math.Float64frombits(v))}
|
||||||
case 3:
|
case 3:
|
||||||
@ -1472,7 +1683,7 @@ func (m *Value) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
stringLen |= (uint64(b) & 0x7F) << shift
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1482,6 +1693,9 @@ func (m *Value) Unmarshal(dAtA []byte) error {
|
|||||||
return ErrInvalidLengthStruct
|
return ErrInvalidLengthStruct
|
||||||
}
|
}
|
||||||
postIndex := iNdEx + intStringLen
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthStruct
|
||||||
|
}
|
||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
@ -1501,7 +1715,7 @@ func (m *Value) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
v |= (int(b) & 0x7F) << shift
|
v |= int(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1522,7 +1736,7 @@ func (m *Value) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
msglen |= (int(b) & 0x7F) << shift
|
msglen |= int(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1531,6 +1745,9 @@ func (m *Value) Unmarshal(dAtA []byte) error {
|
|||||||
return ErrInvalidLengthStruct
|
return ErrInvalidLengthStruct
|
||||||
}
|
}
|
||||||
postIndex := iNdEx + msglen
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthStruct
|
||||||
|
}
|
||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
@ -1554,7 +1771,7 @@ func (m *Value) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
msglen |= (int(b) & 0x7F) << shift
|
msglen |= int(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1563,6 +1780,9 @@ func (m *Value) Unmarshal(dAtA []byte) error {
|
|||||||
return ErrInvalidLengthStruct
|
return ErrInvalidLengthStruct
|
||||||
}
|
}
|
||||||
postIndex := iNdEx + msglen
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthStruct
|
||||||
|
}
|
||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
@ -1581,9 +1801,13 @@ func (m *Value) Unmarshal(dAtA []byte) error {
|
|||||||
if skippy < 0 {
|
if skippy < 0 {
|
||||||
return ErrInvalidLengthStruct
|
return ErrInvalidLengthStruct
|
||||||
}
|
}
|
||||||
|
if (iNdEx + skippy) < 0 {
|
||||||
|
return ErrInvalidLengthStruct
|
||||||
|
}
|
||||||
if (iNdEx + skippy) > l {
|
if (iNdEx + skippy) > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||||
iNdEx += skippy
|
iNdEx += skippy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1608,7 +1832,7 @@ func (m *ListValue) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
wire |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1636,7 +1860,7 @@ func (m *ListValue) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
msglen |= (int(b) & 0x7F) << shift
|
msglen |= int(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -1645,6 +1869,9 @@ func (m *ListValue) Unmarshal(dAtA []byte) error {
|
|||||||
return ErrInvalidLengthStruct
|
return ErrInvalidLengthStruct
|
||||||
}
|
}
|
||||||
postIndex := iNdEx + msglen
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthStruct
|
||||||
|
}
|
||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
@ -1662,9 +1889,13 @@ func (m *ListValue) Unmarshal(dAtA []byte) error {
|
|||||||
if skippy < 0 {
|
if skippy < 0 {
|
||||||
return ErrInvalidLengthStruct
|
return ErrInvalidLengthStruct
|
||||||
}
|
}
|
||||||
|
if (iNdEx + skippy) < 0 {
|
||||||
|
return ErrInvalidLengthStruct
|
||||||
|
}
|
||||||
if (iNdEx + skippy) > l {
|
if (iNdEx + skippy) > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||||
iNdEx += skippy
|
iNdEx += skippy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1728,10 +1959,13 @@ func skipStruct(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iNdEx += length
|
|
||||||
if length < 0 {
|
if length < 0 {
|
||||||
return 0, ErrInvalidLengthStruct
|
return 0, ErrInvalidLengthStruct
|
||||||
}
|
}
|
||||||
|
iNdEx += length
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthStruct
|
||||||
|
}
|
||||||
return iNdEx, nil
|
return iNdEx, nil
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
for {
|
||||||
@ -1760,6 +1994,9 @@ func skipStruct(dAtA []byte) (n int, err error) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
iNdEx = start + next
|
iNdEx = start + next
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthStruct
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
return iNdEx, nil
|
||||||
case 4:
|
case 4:
|
||||||
@ -1778,36 +2015,3 @@ var (
|
|||||||
ErrInvalidLengthStruct = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthStruct = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowStruct = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowStruct = fmt.Errorf("proto: integer overflow")
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() { proto.RegisterFile("struct.proto", fileDescriptorStruct) }
|
|
||||||
|
|
||||||
var fileDescriptorStruct = []byte{
|
|
||||||
// 432 bytes of a gzipped FileDescriptorProto
|
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xb1, 0x6f, 0xd3, 0x40,
|
|
||||||
0x14, 0xc6, 0xfd, 0x9c, 0xc6, 0x22, 0xcf, 0x55, 0xa9, 0x0e, 0x09, 0xa2, 0x22, 0x1d, 0x51, 0xba,
|
|
||||||
0x58, 0x08, 0x79, 0x08, 0x0b, 0x22, 0x2c, 0x58, 0x2a, 0xad, 0x84, 0x55, 0x19, 0x43, 0x8b, 0xc4,
|
|
||||||
0x12, 0xe1, 0xd4, 0x8d, 0xac, 0x5e, 0xef, 0x2a, 0xfb, 0x0c, 0xca, 0x06, 0xff, 0x05, 0x33, 0x13,
|
|
||||||
0x62, 0xe4, 0xaf, 0x60, 0xec, 0xc8, 0x88, 0x3d, 0x31, 0x76, 0xec, 0x88, 0xee, 0xce, 0x36, 0xa8,
|
|
||||||
0x51, 0x36, 0xbf, 0xcf, 0xbf, 0xf7, 0xbd, 0xf7, 0xbd, 0xc3, 0xcd, 0x42, 0xe6, 0xe5, 0x5c, 0xfa,
|
|
||||||
0x17, 0xb9, 0x90, 0x82, 0xdc, 0x5e, 0x08, 0xb1, 0x60, 0xa9, 0xa9, 0x92, 0xf2, 0x74, 0xfc, 0x05,
|
|
||||||
0xd0, 0x79, 0xad, 0x09, 0x32, 0x45, 0xe7, 0x34, 0x4b, 0xd9, 0x49, 0x31, 0x84, 0x51, 0xcf, 0x73,
|
|
||||||
0x27, 0xbb, 0xfe, 0x0d, 0xd8, 0x37, 0xa0, 0xff, 0x42, 0x53, 0x7b, 0x5c, 0xe6, 0xcb, 0xb8, 0x69,
|
|
||||||
0xd9, 0x79, 0x85, 0xee, 0x7f, 0x32, 0xd9, 0xc6, 0xde, 0x59, 0xba, 0x1c, 0xc2, 0x08, 0xbc, 0x41,
|
|
||||||
0xac, 0x3e, 0xc9, 0x23, 0xec, 0x7f, 0x78, 0xcf, 0xca, 0x74, 0x68, 0x8f, 0xc0, 0x73, 0x27, 0x77,
|
|
||||||
0x57, 0xcc, 0x8f, 0xd5, 0xdf, 0xd8, 0x40, 0x4f, 0xed, 0x27, 0x30, 0xfe, 0x61, 0x63, 0x5f, 0x8b,
|
|
||||||
0x64, 0x8a, 0xc8, 0x4b, 0xc6, 0x66, 0xc6, 0x40, 0x99, 0x6e, 0x4d, 0x76, 0x56, 0x0c, 0x0e, 0x4b,
|
|
||||||
0xc6, 0x34, 0x7f, 0x60, 0xc5, 0x03, 0xde, 0x16, 0x64, 0x17, 0x37, 0x79, 0x79, 0x9e, 0xa4, 0xf9,
|
|
||||||
0xec, 0xdf, 0x7c, 0x38, 0xb0, 0x62, 0xd7, 0xa8, 0x1d, 0x54, 0xc8, 0x3c, 0xe3, 0x8b, 0x06, 0xea,
|
|
||||||
0xa9, 0xc5, 0x15, 0x64, 0x54, 0x03, 0x3d, 0x40, 0x4c, 0x84, 0x68, 0xd7, 0xd8, 0x18, 0x81, 0x77,
|
|
||||||
0x4b, 0x8d, 0x52, 0x9a, 0x01, 0x9e, 0xb5, 0xd7, 0x6e, 0x90, 0xbe, 0x8e, 0x7a, 0x6f, 0xcd, 0x1d,
|
|
||||||
0x1b, 0xfb, 0x72, 0x2e, 0xbb, 0x94, 0x2c, 0x2b, 0xda, 0x5e, 0x47, 0xf7, 0xae, 0xa6, 0x0c, 0xb3,
|
|
||||||
0x42, 0x76, 0x29, 0x59, 0x5b, 0x04, 0x0e, 0x6e, 0x9c, 0x65, 0xfc, 0x64, 0x3c, 0xc5, 0x41, 0x47,
|
|
||||||
0x10, 0x1f, 0x1d, 0x6d, 0xd6, 0xbe, 0xe8, 0xba, 0xa3, 0x37, 0xd4, 0xc3, 0xfb, 0x38, 0xe8, 0x8e,
|
|
||||||
0x48, 0xb6, 0x10, 0x0f, 0x8f, 0xc2, 0x70, 0x76, 0xfc, 0x3c, 0x3c, 0xda, 0xdb, 0xb6, 0x82, 0xcf,
|
|
||||||
0x70, 0x59, 0x51, 0xeb, 0x57, 0x45, 0xad, 0xab, 0x8a, 0xc2, 0x75, 0x45, 0xe1, 0x53, 0x4d, 0xe1,
|
|
||||||
0x5b, 0x4d, 0xe1, 0x67, 0x4d, 0xe1, 0xb2, 0xa6, 0xf0, 0xbb, 0xa6, 0xf0, 0xa7, 0xa6, 0xd6, 0x55,
|
|
||||||
0x4d, 0x01, 0xef, 0xcc, 0xc5, 0xf9, 0xcd, 0x71, 0x81, 0x6b, 0x92, 0x47, 0xaa, 0x8e, 0xe0, 0x5d,
|
|
||||||
0x5f, 0x2e, 0x2f, 0xd2, 0xe2, 0x1a, 0xe0, 0xab, 0xdd, 0xdb, 0x8f, 0x82, 0xef, 0x36, 0xdd, 0x37,
|
|
||||||
0x0d, 0x51, 0xbb, 0xdf, 0xdb, 0x94, 0xb1, 0x97, 0x5c, 0x7c, 0xe4, 0x6f, 0x14, 0x99, 0x38, 0xda,
|
|
||||||
0xe9, 0xf1, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x75, 0xc5, 0x1c, 0x3b, 0xd5, 0x02, 0x00, 0x00,
|
|
||||||
}
|
|
||||||
|
6
vendor/github.com/gogo/protobuf/types/timestamp.go
generated
vendored
6
vendor/github.com/gogo/protobuf/types/timestamp.go
generated
vendored
@ -109,11 +109,9 @@ func TimestampNow() *Timestamp {
|
|||||||
// TimestampProto converts the time.Time to a google.protobuf.Timestamp proto.
|
// TimestampProto converts the time.Time to a google.protobuf.Timestamp proto.
|
||||||
// It returns an error if the resulting Timestamp is invalid.
|
// It returns an error if the resulting Timestamp is invalid.
|
||||||
func TimestampProto(t time.Time) (*Timestamp, error) {
|
func TimestampProto(t time.Time) (*Timestamp, error) {
|
||||||
seconds := t.Unix()
|
|
||||||
nanos := int32(t.Sub(time.Unix(seconds, 0)))
|
|
||||||
ts := &Timestamp{
|
ts := &Timestamp{
|
||||||
Seconds: seconds,
|
Seconds: t.Unix(),
|
||||||
Nanos: nanos,
|
Nanos: int32(t.Nanosecond()),
|
||||||
}
|
}
|
||||||
if err := validateTimestamp(ts); err != nil {
|
if err := validateTimestamp(ts); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
182
vendor/github.com/gogo/protobuf/types/timestamp.pb.go
generated
vendored
182
vendor/github.com/gogo/protobuf/types/timestamp.pb.go
generated
vendored
@ -1,25 +1,17 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
// source: timestamp.proto
|
// source: google/protobuf/timestamp.proto
|
||||||
|
|
||||||
/*
|
|
||||||
Package types is a generated protocol buffer package.
|
|
||||||
|
|
||||||
It is generated from these files:
|
|
||||||
timestamp.proto
|
|
||||||
|
|
||||||
It has these top-level messages:
|
|
||||||
Timestamp
|
|
||||||
*/
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import proto "github.com/gogo/protobuf/proto"
|
import (
|
||||||
import fmt "fmt"
|
bytes "bytes"
|
||||||
import math "math"
|
fmt "fmt"
|
||||||
|
proto "github.com/gogo/protobuf/proto"
|
||||||
import strings "strings"
|
io "io"
|
||||||
import reflect "reflect"
|
math "math"
|
||||||
|
reflect "reflect"
|
||||||
import io "io"
|
strings "strings"
|
||||||
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ = proto.Marshal
|
var _ = proto.Marshal
|
||||||
@ -32,17 +24,19 @@ var _ = math.Inf
|
|||||||
// proto package needs to be updated.
|
// proto package needs to be updated.
|
||||||
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
||||||
|
|
||||||
// A Timestamp represents a point in time independent of any time zone
|
// A Timestamp represents a point in time independent of any time zone or local
|
||||||
// or calendar, represented as seconds and fractions of seconds at
|
// calendar, encoded as a count of seconds and fractions of seconds at
|
||||||
// nanosecond resolution in UTC Epoch time. It is encoded using the
|
// nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
||||||
// Proleptic Gregorian Calendar which extends the Gregorian calendar
|
// January 1, 1970, in the proleptic Gregorian calendar which extends the
|
||||||
// backwards to year one. It is encoded assuming all minutes are 60
|
// Gregorian calendar backwards to year one.
|
||||||
// seconds long, i.e. leap seconds are "smeared" so that no leap second
|
//
|
||||||
// table is needed for interpretation. Range is from
|
// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
||||||
// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
|
// second table is needed for interpretation, using a [24-hour linear
|
||||||
// By restricting to that range, we ensure that we can convert to
|
// smear](https://developers.google.com/time/smear).
|
||||||
// and from RFC 3339 date strings.
|
//
|
||||||
// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
|
// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
||||||
|
// restricting to that range, we ensure that we can convert to and from [RFC
|
||||||
|
// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
||||||
//
|
//
|
||||||
// # Examples
|
// # Examples
|
||||||
//
|
//
|
||||||
@ -95,19 +89,21 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
|||||||
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
||||||
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
||||||
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
||||||
// is required, though only UTC (as indicated by "Z") is presently supported.
|
// is required. A proto3 JSON serializer should always use UTC (as indicated by
|
||||||
|
// "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
||||||
|
// able to accept both UTC and other timezones (as indicated by an offset).
|
||||||
//
|
//
|
||||||
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
||||||
// 01:30 UTC on January 15, 2017.
|
// 01:30 UTC on January 15, 2017.
|
||||||
//
|
//
|
||||||
// In JavaScript, one can convert a Date object to this format using the
|
// 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
|
// 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)
|
// 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
|
// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
||||||
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||||
// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#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.
|
// ) to obtain a formatter capable of generating timestamps in this format.
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
type Timestamp struct {
|
type Timestamp struct {
|
||||||
@ -119,13 +115,44 @@ type Timestamp struct {
|
|||||||
// second values with fractions must still have non-negative nanos values
|
// second values with fractions must still have non-negative nanos values
|
||||||
// that count forward in time. Must be from 0 to 999,999,999
|
// that count forward in time. Must be from 0 to 999,999,999
|
||||||
// inclusive.
|
// inclusive.
|
||||||
Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
|
Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
|
||||||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Timestamp) Reset() { *m = Timestamp{} }
|
func (m *Timestamp) Reset() { *m = Timestamp{} }
|
||||||
func (*Timestamp) ProtoMessage() {}
|
func (*Timestamp) ProtoMessage() {}
|
||||||
func (*Timestamp) Descriptor() ([]byte, []int) { return fileDescriptorTimestamp, []int{0} }
|
func (*Timestamp) Descriptor() ([]byte, []int) {
|
||||||
func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" }
|
return fileDescriptor_292007bbfe81227e, []int{0}
|
||||||
|
}
|
||||||
|
func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" }
|
||||||
|
func (m *Timestamp) XXX_Unmarshal(b []byte) error {
|
||||||
|
return m.Unmarshal(b)
|
||||||
|
}
|
||||||
|
func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
if deterministic {
|
||||||
|
return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic)
|
||||||
|
} else {
|
||||||
|
b = b[:cap(b)]
|
||||||
|
n, err := m.MarshalTo(b)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return b[:n], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (m *Timestamp) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_Timestamp.Merge(m, src)
|
||||||
|
}
|
||||||
|
func (m *Timestamp) XXX_Size() int {
|
||||||
|
return m.Size()
|
||||||
|
}
|
||||||
|
func (m *Timestamp) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_Timestamp.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_Timestamp proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *Timestamp) GetSeconds() int64 {
|
func (m *Timestamp) GetSeconds() int64 {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
@ -141,9 +168,33 @@ func (m *Timestamp) GetNanos() int32 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (*Timestamp) XXX_MessageName() string {
|
||||||
|
return "google.protobuf.Timestamp"
|
||||||
|
}
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*Timestamp)(nil), "google.protobuf.Timestamp")
|
proto.RegisterType((*Timestamp)(nil), "google.protobuf.Timestamp")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("google/protobuf/timestamp.proto", fileDescriptor_292007bbfe81227e) }
|
||||||
|
|
||||||
|
var fileDescriptor_292007bbfe81227e = []byte{
|
||||||
|
// 212 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xcf, 0xcf, 0x4f,
|
||||||
|
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0xc9, 0xcc, 0x4d,
|
||||||
|
0x2d, 0x2e, 0x49, 0xcc, 0x2d, 0xd0, 0x03, 0x0b, 0x09, 0xf1, 0x43, 0x14, 0xe8, 0xc1, 0x14, 0x28,
|
||||||
|
0x59, 0x73, 0x71, 0x86, 0xc0, 0xd4, 0x08, 0x49, 0x70, 0xb1, 0x17, 0xa7, 0x26, 0xe7, 0xe7, 0xa5,
|
||||||
|
0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0xc1, 0xb8, 0x42, 0x22, 0x5c, 0xac, 0x79, 0x89,
|
||||||
|
0x79, 0xf9, 0xc5, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xac, 0x41, 0x10, 0x8e, 0x53, 0x03, 0xe3, 0x8d,
|
||||||
|
0x87, 0x72, 0x0c, 0x1f, 0x1e, 0xca, 0x31, 0xae, 0x78, 0x24, 0xc7, 0x78, 0xe2, 0x91, 0x1c, 0xe3,
|
||||||
|
0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0xbe, 0x78, 0x24, 0xc7, 0xf0, 0xe1, 0x91, 0x1c,
|
||||||
|
0xe3, 0x8a, 0xc7, 0x72, 0x8c, 0x27, 0x1e, 0xcb, 0x31, 0x72, 0x09, 0x27, 0xe7, 0xe7, 0xea, 0xa1,
|
||||||
|
0x59, 0xee, 0xc4, 0x07, 0xb7, 0x3a, 0x00, 0x24, 0x14, 0xc0, 0x18, 0xc5, 0x5a, 0x52, 0x59, 0x90,
|
||||||
|
0x5a, 0xfc, 0x83, 0x91, 0x71, 0x11, 0x13, 0xb3, 0x7b, 0x80, 0xd3, 0x2a, 0x26, 0x39, 0x77, 0x88,
|
||||||
|
0x9e, 0x00, 0xa8, 0x1e, 0xbd, 0xf0, 0xd4, 0x9c, 0x1c, 0xef, 0xbc, 0xfc, 0xf2, 0xbc, 0x10, 0x90,
|
||||||
|
0xca, 0x24, 0x36, 0xb0, 0x61, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x23, 0x83, 0xdd,
|
||||||
|
0xfa, 0x00, 0x00, 0x00,
|
||||||
|
}
|
||||||
|
|
||||||
func (this *Timestamp) Compare(that interface{}) int {
|
func (this *Timestamp) Compare(that interface{}) int {
|
||||||
if that == nil {
|
if that == nil {
|
||||||
if this == nil {
|
if this == nil {
|
||||||
@ -181,6 +232,9 @@ func (this *Timestamp) Compare(that interface{}) int {
|
|||||||
}
|
}
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
|
||||||
|
return c
|
||||||
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
func (this *Timestamp) Equal(that interface{}) bool {
|
func (this *Timestamp) Equal(that interface{}) bool {
|
||||||
@ -208,6 +262,9 @@ func (this *Timestamp) Equal(that interface{}) bool {
|
|||||||
if this.Nanos != that1.Nanos {
|
if this.Nanos != that1.Nanos {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
func (this *Timestamp) GoString() string {
|
func (this *Timestamp) GoString() string {
|
||||||
@ -218,6 +275,9 @@ func (this *Timestamp) GoString() string {
|
|||||||
s = append(s, "&types.Timestamp{")
|
s = append(s, "&types.Timestamp{")
|
||||||
s = append(s, "Seconds: "+fmt.Sprintf("%#v", this.Seconds)+",\n")
|
s = append(s, "Seconds: "+fmt.Sprintf("%#v", this.Seconds)+",\n")
|
||||||
s = append(s, "Nanos: "+fmt.Sprintf("%#v", this.Nanos)+",\n")
|
s = append(s, "Nanos: "+fmt.Sprintf("%#v", this.Nanos)+",\n")
|
||||||
|
if this.XXX_unrecognized != nil {
|
||||||
|
s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
|
||||||
|
}
|
||||||
s = append(s, "}")
|
s = append(s, "}")
|
||||||
return strings.Join(s, "")
|
return strings.Join(s, "")
|
||||||
}
|
}
|
||||||
@ -254,6 +314,9 @@ func (m *Timestamp) MarshalTo(dAtA []byte) (int, error) {
|
|||||||
i++
|
i++
|
||||||
i = encodeVarintTimestamp(dAtA, i, uint64(m.Nanos))
|
i = encodeVarintTimestamp(dAtA, i, uint64(m.Nanos))
|
||||||
}
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
i += copy(dAtA[i:], m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,6 +330,9 @@ func encodeVarintTimestamp(dAtA []byte, offset int, v uint64) int {
|
|||||||
return offset + 1
|
return offset + 1
|
||||||
}
|
}
|
||||||
func (m *Timestamp) Size() (n int) {
|
func (m *Timestamp) Size() (n int) {
|
||||||
|
if m == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Seconds != 0 {
|
if m.Seconds != 0 {
|
||||||
@ -275,6 +341,9 @@ func (m *Timestamp) Size() (n int) {
|
|||||||
if m.Nanos != 0 {
|
if m.Nanos != 0 {
|
||||||
n += 1 + sovTimestamp(uint64(m.Nanos))
|
n += 1 + sovTimestamp(uint64(m.Nanos))
|
||||||
}
|
}
|
||||||
|
if m.XXX_unrecognized != nil {
|
||||||
|
n += len(m.XXX_unrecognized)
|
||||||
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,7 +375,7 @@ func (m *Timestamp) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
wire |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -334,7 +403,7 @@ func (m *Timestamp) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
m.Seconds |= (int64(b) & 0x7F) << shift
|
m.Seconds |= int64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -353,7 +422,7 @@ func (m *Timestamp) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
m.Nanos |= (int32(b) & 0x7F) << shift
|
m.Nanos |= int32(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -367,9 +436,13 @@ func (m *Timestamp) Unmarshal(dAtA []byte) error {
|
|||||||
if skippy < 0 {
|
if skippy < 0 {
|
||||||
return ErrInvalidLengthTimestamp
|
return ErrInvalidLengthTimestamp
|
||||||
}
|
}
|
||||||
|
if (iNdEx + skippy) < 0 {
|
||||||
|
return ErrInvalidLengthTimestamp
|
||||||
|
}
|
||||||
if (iNdEx + skippy) > l {
|
if (iNdEx + skippy) > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
|
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
|
||||||
iNdEx += skippy
|
iNdEx += skippy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -433,10 +506,13 @@ func skipTimestamp(dAtA []byte) (n int, err error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iNdEx += length
|
|
||||||
if length < 0 {
|
if length < 0 {
|
||||||
return 0, ErrInvalidLengthTimestamp
|
return 0, ErrInvalidLengthTimestamp
|
||||||
}
|
}
|
||||||
|
iNdEx += length
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthTimestamp
|
||||||
|
}
|
||||||
return iNdEx, nil
|
return iNdEx, nil
|
||||||
case 3:
|
case 3:
|
||||||
for {
|
for {
|
||||||
@ -465,6 +541,9 @@ func skipTimestamp(dAtA []byte) (n int, err error) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
iNdEx = start + next
|
iNdEx = start + next
|
||||||
|
if iNdEx < 0 {
|
||||||
|
return 0, ErrInvalidLengthTimestamp
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return iNdEx, nil
|
return iNdEx, nil
|
||||||
case 4:
|
case 4:
|
||||||
@ -483,22 +562,3 @@ var (
|
|||||||
ErrInvalidLengthTimestamp = fmt.Errorf("proto: negative length found during unmarshaling")
|
ErrInvalidLengthTimestamp = fmt.Errorf("proto: negative length found during unmarshaling")
|
||||||
ErrIntOverflowTimestamp = fmt.Errorf("proto: integer overflow")
|
ErrIntOverflowTimestamp = fmt.Errorf("proto: integer overflow")
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() { proto.RegisterFile("timestamp.proto", fileDescriptorTimestamp) }
|
|
||||||
|
|
||||||
var fileDescriptorTimestamp = []byte{
|
|
||||||
// 205 bytes of a gzipped FileDescriptorProto
|
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0xc9, 0xcc, 0x4d,
|
|
||||||
0x2d, 0x2e, 0x49, 0xcc, 0x2d, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4f, 0xcf, 0xcf,
|
|
||||||
0x4f, 0xcf, 0x49, 0x85, 0xf0, 0x92, 0x4a, 0xd3, 0x94, 0xac, 0xb9, 0x38, 0x43, 0x60, 0x6a, 0x84,
|
|
||||||
0x24, 0xb8, 0xd8, 0x8b, 0x53, 0x93, 0xf3, 0xf3, 0x52, 0x8a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x98,
|
|
||||||
0x83, 0x60, 0x5c, 0x21, 0x11, 0x2e, 0xd6, 0xbc, 0xc4, 0xbc, 0xfc, 0x62, 0x09, 0x26, 0x05, 0x46,
|
|
||||||
0x0d, 0xd6, 0x20, 0x08, 0xc7, 0xa9, 0x81, 0xf1, 0xc2, 0x43, 0x39, 0x86, 0x1b, 0x0f, 0xe5, 0x18,
|
|
||||||
0x3e, 0x3c, 0x94, 0x63, 0x5c, 0xf1, 0x48, 0x8e, 0xf1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4,
|
|
||||||
0x18, 0x1f, 0x3c, 0x92, 0x63, 0x7c, 0xf1, 0x48, 0x8e, 0xe1, 0xc3, 0x23, 0x39, 0xc6, 0x15, 0x8f,
|
|
||||||
0xe5, 0x18, 0xb9, 0x84, 0x93, 0xf3, 0x73, 0xf5, 0xd0, 0x2c, 0x77, 0xe2, 0x83, 0x5b, 0x1d, 0x00,
|
|
||||||
0x12, 0x0a, 0x60, 0x8c, 0x62, 0x2d, 0xa9, 0x2c, 0x48, 0x2d, 0xfe, 0xc1, 0xc8, 0xb8, 0x88, 0x89,
|
|
||||||
0xd9, 0x3d, 0xc0, 0x69, 0x15, 0x93, 0x9c, 0x3b, 0x44, 0x4f, 0x00, 0x54, 0x8f, 0x5e, 0x78, 0x6a,
|
|
||||||
0x4e, 0x8e, 0x77, 0x5e, 0x7e, 0x79, 0x5e, 0x08, 0x48, 0x65, 0x12, 0x1b, 0xd8, 0x30, 0x63, 0x40,
|
|
||||||
0x00, 0x00, 0x00, 0xff, 0xff, 0x9b, 0xa2, 0x42, 0xda, 0xea, 0x00, 0x00, 0x00,
|
|
||||||
}
|
|
||||||
|
3320
vendor/github.com/gogo/protobuf/types/type.pb.go
generated
vendored
Normal file
3320
vendor/github.com/gogo/protobuf/types/type.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
764
vendor/github.com/gogo/protobuf/types/wrappers.pb.go
generated
vendored
764
vendor/github.com/gogo/protobuf/types/wrappers.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
300
vendor/github.com/gogo/protobuf/types/wrappers_gogo.go
generated
vendored
Normal file
300
vendor/github.com/gogo/protobuf/types/wrappers_gogo.go
generated
vendored
Normal file
@ -0,0 +1,300 @@
|
|||||||
|
// Protocol Buffers for Go with Gadgets
|
||||||
|
//
|
||||||
|
// Copyright (c) 2018, The GoGo Authors. All rights reserved.
|
||||||
|
// http://github.com/gogo/protobuf
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
package types
|
||||||
|
|
||||||
|
func NewPopulatedStdDouble(r randyWrappers, easy bool) *float64 {
|
||||||
|
v := NewPopulatedDoubleValue(r, easy)
|
||||||
|
return &v.Value
|
||||||
|
}
|
||||||
|
|
||||||
|
func SizeOfStdDouble(v float64) int {
|
||||||
|
pv := &DoubleValue{Value: v}
|
||||||
|
return pv.Size()
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdDoubleMarshal(v float64) ([]byte, error) {
|
||||||
|
size := SizeOfStdDouble(v)
|
||||||
|
buf := make([]byte, size)
|
||||||
|
_, err := StdDoubleMarshalTo(v, buf)
|
||||||
|
return buf, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdDoubleMarshalTo(v float64, data []byte) (int, error) {
|
||||||
|
pv := &DoubleValue{Value: v}
|
||||||
|
return pv.MarshalTo(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdDoubleUnmarshal(v *float64, data []byte) error {
|
||||||
|
pv := &DoubleValue{}
|
||||||
|
if err := pv.Unmarshal(data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*v = pv.Value
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func NewPopulatedStdFloat(r randyWrappers, easy bool) *float32 {
|
||||||
|
v := NewPopulatedFloatValue(r, easy)
|
||||||
|
return &v.Value
|
||||||
|
}
|
||||||
|
|
||||||
|
func SizeOfStdFloat(v float32) int {
|
||||||
|
pv := &FloatValue{Value: v}
|
||||||
|
return pv.Size()
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdFloatMarshal(v float32) ([]byte, error) {
|
||||||
|
size := SizeOfStdFloat(v)
|
||||||
|
buf := make([]byte, size)
|
||||||
|
_, err := StdFloatMarshalTo(v, buf)
|
||||||
|
return buf, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdFloatMarshalTo(v float32, data []byte) (int, error) {
|
||||||
|
pv := &FloatValue{Value: v}
|
||||||
|
return pv.MarshalTo(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdFloatUnmarshal(v *float32, data []byte) error {
|
||||||
|
pv := &FloatValue{}
|
||||||
|
if err := pv.Unmarshal(data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*v = pv.Value
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func NewPopulatedStdInt64(r randyWrappers, easy bool) *int64 {
|
||||||
|
v := NewPopulatedInt64Value(r, easy)
|
||||||
|
return &v.Value
|
||||||
|
}
|
||||||
|
|
||||||
|
func SizeOfStdInt64(v int64) int {
|
||||||
|
pv := &Int64Value{Value: v}
|
||||||
|
return pv.Size()
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdInt64Marshal(v int64) ([]byte, error) {
|
||||||
|
size := SizeOfStdInt64(v)
|
||||||
|
buf := make([]byte, size)
|
||||||
|
_, err := StdInt64MarshalTo(v, buf)
|
||||||
|
return buf, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdInt64MarshalTo(v int64, data []byte) (int, error) {
|
||||||
|
pv := &Int64Value{Value: v}
|
||||||
|
return pv.MarshalTo(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdInt64Unmarshal(v *int64, data []byte) error {
|
||||||
|
pv := &Int64Value{}
|
||||||
|
if err := pv.Unmarshal(data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*v = pv.Value
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func NewPopulatedStdUInt64(r randyWrappers, easy bool) *uint64 {
|
||||||
|
v := NewPopulatedUInt64Value(r, easy)
|
||||||
|
return &v.Value
|
||||||
|
}
|
||||||
|
|
||||||
|
func SizeOfStdUInt64(v uint64) int {
|
||||||
|
pv := &UInt64Value{Value: v}
|
||||||
|
return pv.Size()
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdUInt64Marshal(v uint64) ([]byte, error) {
|
||||||
|
size := SizeOfStdUInt64(v)
|
||||||
|
buf := make([]byte, size)
|
||||||
|
_, err := StdUInt64MarshalTo(v, buf)
|
||||||
|
return buf, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdUInt64MarshalTo(v uint64, data []byte) (int, error) {
|
||||||
|
pv := &UInt64Value{Value: v}
|
||||||
|
return pv.MarshalTo(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdUInt64Unmarshal(v *uint64, data []byte) error {
|
||||||
|
pv := &UInt64Value{}
|
||||||
|
if err := pv.Unmarshal(data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*v = pv.Value
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func NewPopulatedStdInt32(r randyWrappers, easy bool) *int32 {
|
||||||
|
v := NewPopulatedInt32Value(r, easy)
|
||||||
|
return &v.Value
|
||||||
|
}
|
||||||
|
|
||||||
|
func SizeOfStdInt32(v int32) int {
|
||||||
|
pv := &Int32Value{Value: v}
|
||||||
|
return pv.Size()
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdInt32Marshal(v int32) ([]byte, error) {
|
||||||
|
size := SizeOfStdInt32(v)
|
||||||
|
buf := make([]byte, size)
|
||||||
|
_, err := StdInt32MarshalTo(v, buf)
|
||||||
|
return buf, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdInt32MarshalTo(v int32, data []byte) (int, error) {
|
||||||
|
pv := &Int32Value{Value: v}
|
||||||
|
return pv.MarshalTo(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdInt32Unmarshal(v *int32, data []byte) error {
|
||||||
|
pv := &Int32Value{}
|
||||||
|
if err := pv.Unmarshal(data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*v = pv.Value
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func NewPopulatedStdUInt32(r randyWrappers, easy bool) *uint32 {
|
||||||
|
v := NewPopulatedUInt32Value(r, easy)
|
||||||
|
return &v.Value
|
||||||
|
}
|
||||||
|
|
||||||
|
func SizeOfStdUInt32(v uint32) int {
|
||||||
|
pv := &UInt32Value{Value: v}
|
||||||
|
return pv.Size()
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdUInt32Marshal(v uint32) ([]byte, error) {
|
||||||
|
size := SizeOfStdUInt32(v)
|
||||||
|
buf := make([]byte, size)
|
||||||
|
_, err := StdUInt32MarshalTo(v, buf)
|
||||||
|
return buf, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdUInt32MarshalTo(v uint32, data []byte) (int, error) {
|
||||||
|
pv := &UInt32Value{Value: v}
|
||||||
|
return pv.MarshalTo(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdUInt32Unmarshal(v *uint32, data []byte) error {
|
||||||
|
pv := &UInt32Value{}
|
||||||
|
if err := pv.Unmarshal(data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*v = pv.Value
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func NewPopulatedStdBool(r randyWrappers, easy bool) *bool {
|
||||||
|
v := NewPopulatedBoolValue(r, easy)
|
||||||
|
return &v.Value
|
||||||
|
}
|
||||||
|
|
||||||
|
func SizeOfStdBool(v bool) int {
|
||||||
|
pv := &BoolValue{Value: v}
|
||||||
|
return pv.Size()
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdBoolMarshal(v bool) ([]byte, error) {
|
||||||
|
size := SizeOfStdBool(v)
|
||||||
|
buf := make([]byte, size)
|
||||||
|
_, err := StdBoolMarshalTo(v, buf)
|
||||||
|
return buf, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdBoolMarshalTo(v bool, data []byte) (int, error) {
|
||||||
|
pv := &BoolValue{Value: v}
|
||||||
|
return pv.MarshalTo(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdBoolUnmarshal(v *bool, data []byte) error {
|
||||||
|
pv := &BoolValue{}
|
||||||
|
if err := pv.Unmarshal(data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*v = pv.Value
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func NewPopulatedStdString(r randyWrappers, easy bool) *string {
|
||||||
|
v := NewPopulatedStringValue(r, easy)
|
||||||
|
return &v.Value
|
||||||
|
}
|
||||||
|
|
||||||
|
func SizeOfStdString(v string) int {
|
||||||
|
pv := &StringValue{Value: v}
|
||||||
|
return pv.Size()
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdStringMarshal(v string) ([]byte, error) {
|
||||||
|
size := SizeOfStdString(v)
|
||||||
|
buf := make([]byte, size)
|
||||||
|
_, err := StdStringMarshalTo(v, buf)
|
||||||
|
return buf, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdStringMarshalTo(v string, data []byte) (int, error) {
|
||||||
|
pv := &StringValue{Value: v}
|
||||||
|
return pv.MarshalTo(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdStringUnmarshal(v *string, data []byte) error {
|
||||||
|
pv := &StringValue{}
|
||||||
|
if err := pv.Unmarshal(data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*v = pv.Value
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func NewPopulatedStdBytes(r randyWrappers, easy bool) *[]byte {
|
||||||
|
v := NewPopulatedBytesValue(r, easy)
|
||||||
|
return &v.Value
|
||||||
|
}
|
||||||
|
|
||||||
|
func SizeOfStdBytes(v []byte) int {
|
||||||
|
pv := &BytesValue{Value: v}
|
||||||
|
return pv.Size()
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdBytesMarshal(v []byte) ([]byte, error) {
|
||||||
|
size := SizeOfStdBytes(v)
|
||||||
|
buf := make([]byte, size)
|
||||||
|
_, err := StdBytesMarshalTo(v, buf)
|
||||||
|
return buf, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdBytesMarshalTo(v []byte, data []byte) (int, error) {
|
||||||
|
pv := &BytesValue{Value: v}
|
||||||
|
return pv.MarshalTo(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
func StdBytesUnmarshal(v *[]byte, data []byte) error {
|
||||||
|
pv := &BytesValue{}
|
||||||
|
if err := pv.Unmarshal(data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*v = pv.Value
|
||||||
|
return nil
|
||||||
|
}
|
16
vendor/github.com/gogo/protobuf/vanity/file.go
generated
vendored
16
vendor/github.com/gogo/protobuf/vanity/file.go
generated
vendored
@ -172,6 +172,14 @@ func TurnOffGoUnrecognizedAll(file *descriptor.FileDescriptorProto) {
|
|||||||
SetBoolFileOption(gogoproto.E_GoprotoUnrecognizedAll, false)(file)
|
SetBoolFileOption(gogoproto.E_GoprotoUnrecognizedAll, false)(file)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TurnOffGoUnkeyedAll(file *descriptor.FileDescriptorProto) {
|
||||||
|
SetBoolFileOption(gogoproto.E_GoprotoUnkeyedAll, false)(file)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TurnOffGoSizecacheAll(file *descriptor.FileDescriptorProto) {
|
||||||
|
SetBoolFileOption(gogoproto.E_GoprotoSizecacheAll, false)(file)
|
||||||
|
}
|
||||||
|
|
||||||
func TurnOffGogoImport(file *descriptor.FileDescriptorProto) {
|
func TurnOffGogoImport(file *descriptor.FileDescriptorProto) {
|
||||||
SetBoolFileOption(gogoproto.E_GogoprotoImport, false)(file)
|
SetBoolFileOption(gogoproto.E_GogoprotoImport, false)(file)
|
||||||
}
|
}
|
||||||
@ -179,3 +187,11 @@ func TurnOffGogoImport(file *descriptor.FileDescriptorProto) {
|
|||||||
func TurnOnCompareAll(file *descriptor.FileDescriptorProto) {
|
func TurnOnCompareAll(file *descriptor.FileDescriptorProto) {
|
||||||
SetBoolFileOption(gogoproto.E_CompareAll, true)(file)
|
SetBoolFileOption(gogoproto.E_CompareAll, true)(file)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TurnOnMessageNameAll(file *descriptor.FileDescriptorProto) {
|
||||||
|
SetBoolFileOption(gogoproto.E_MessagenameAll, true)(file)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TurnOnGoRegistration(file *descriptor.FileDescriptorProto) {
|
||||||
|
SetBoolFileOption(gogoproto.E_GoprotoRegistration, true)(file)
|
||||||
|
}
|
||||||
|
12
vendor/github.com/gogo/protobuf/vanity/msg.go
generated
vendored
12
vendor/github.com/gogo/protobuf/vanity/msg.go
generated
vendored
@ -137,6 +137,18 @@ func TurnOffGoUnrecognized(msg *descriptor.DescriptorProto) {
|
|||||||
SetBoolMessageOption(gogoproto.E_GoprotoUnrecognized, false)(msg)
|
SetBoolMessageOption(gogoproto.E_GoprotoUnrecognized, false)(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TurnOffGoUnkeyed(msg *descriptor.DescriptorProto) {
|
||||||
|
SetBoolMessageOption(gogoproto.E_GoprotoUnkeyed, false)(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TurnOffGoSizecache(msg *descriptor.DescriptorProto) {
|
||||||
|
SetBoolMessageOption(gogoproto.E_GoprotoSizecache, false)(msg)
|
||||||
|
}
|
||||||
|
|
||||||
func TurnOnCompare(msg *descriptor.DescriptorProto) {
|
func TurnOnCompare(msg *descriptor.DescriptorProto) {
|
||||||
SetBoolMessageOption(gogoproto.E_Compare, true)(msg)
|
SetBoolMessageOption(gogoproto.E_Compare, true)(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TurnOnMessageName(msg *descriptor.DescriptorProto) {
|
||||||
|
SetBoolMessageOption(gogoproto.E_Messagename, true)(msg)
|
||||||
|
}
|
||||||
|
3
vendor/github.com/golang/protobuf/LICENSE
generated
vendored
3
vendor/github.com/golang/protobuf/LICENSE
generated
vendored
@ -1,7 +1,4 @@
|
|||||||
Go support for Protocol Buffers - Google's data interchange format
|
|
||||||
|
|
||||||
Copyright 2010 The Go Authors. All rights reserved.
|
Copyright 2010 The Go Authors. All rights reserved.
|
||||||
https://github.com/golang/protobuf
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are
|
modification, are permitted provided that the following conditions are
|
||||||
|
22
vendor/github.com/golang/protobuf/README.md
generated
vendored
22
vendor/github.com/golang/protobuf/README.md
generated
vendored
@ -1,4 +1,4 @@
|
|||||||
# Go support for Protocol Buffers
|
# Go support for Protocol Buffers - Google's data interchange format
|
||||||
|
|
||||||
[](https://travis-ci.org/golang/protobuf)
|
[](https://travis-ci.org/golang/protobuf)
|
||||||
[](https://godoc.org/github.com/golang/protobuf)
|
[](https://godoc.org/github.com/golang/protobuf)
|
||||||
@ -83,15 +83,19 @@ be:
|
|||||||
|
|
||||||
- Relative to the import path:
|
- Relative to the import path:
|
||||||
|
|
||||||
protoc --go_out=. inputs/x.proto
|
```shell
|
||||||
# writes ./github.com/golang/protobuf/p/x.pb.go
|
protoc --go_out=. inputs/x.proto
|
||||||
|
# writes ./github.com/golang/protobuf/p/x.pb.go
|
||||||
|
```
|
||||||
|
|
||||||
(This can work well with `--go_out=$GOPATH`.)
|
(This can work well with `--go_out=$GOPATH`.)
|
||||||
|
|
||||||
- Relative to the input file:
|
- Relative to the input file:
|
||||||
|
|
||||||
protoc --go_out=paths=source_relative:. inputs/x.proto
|
```shell
|
||||||
# generate ./inputs/x.pb.go
|
protoc --go_out=paths=source_relative:. inputs/x.proto
|
||||||
|
# generate ./inputs/x.pb.go
|
||||||
|
```
|
||||||
|
|
||||||
## Generated code ##
|
## Generated code ##
|
||||||
|
|
||||||
@ -157,9 +161,6 @@ Consider file test.proto, containing
|
|||||||
required string label = 1;
|
required string label = 1;
|
||||||
optional int32 type = 2 [default=77];
|
optional int32 type = 2 [default=77];
|
||||||
repeated int64 reps = 3;
|
repeated int64 reps = 3;
|
||||||
optional group OptionalGroup = 4 {
|
|
||||||
required string RequiredField = 5;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -176,13 +177,10 @@ To create and play with a Test object from the example package,
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
test := &example.Test {
|
test := &example.Test{
|
||||||
Label: proto.String("hello"),
|
Label: proto.String("hello"),
|
||||||
Type: proto.Int32(17),
|
Type: proto.Int32(17),
|
||||||
Reps: []int64{1, 2, 3},
|
Reps: []int64{1, 2, 3},
|
||||||
Optionalgroup: &example.Test_OptionalGroup {
|
|
||||||
RequiredField: proto.String("good bye"),
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
data, err := proto.Marshal(test)
|
data, err := proto.Marshal(test)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
18
vendor/github.com/golang/protobuf/proto/encode.go
generated
vendored
18
vendor/github.com/golang/protobuf/proto/encode.go
generated
vendored
@ -37,27 +37,9 @@ package proto
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RequiredNotSetError is the error returned if Marshal is called with
|
|
||||||
// a protocol buffer struct whose required fields have not
|
|
||||||
// all been initialized. It is also the error returned if Unmarshal is
|
|
||||||
// called with an encoded protocol buffer that does not include all the
|
|
||||||
// required fields.
|
|
||||||
//
|
|
||||||
// When printed, RequiredNotSetError reports the first unset required field in a
|
|
||||||
// message. If the field cannot be precisely determined, it is reported as
|
|
||||||
// "{Unknown}".
|
|
||||||
type RequiredNotSetError struct {
|
|
||||||
field string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *RequiredNotSetError) Error() string {
|
|
||||||
return fmt.Sprintf("proto: required field %q not set", e.field)
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// errRepeatedHasNil is the error returned if Marshal is called with
|
// errRepeatedHasNil is the error returned if Marshal is called with
|
||||||
// a struct with a repeated field containing a nil element.
|
// a struct with a repeated field containing a nil element.
|
||||||
|
62
vendor/github.com/golang/protobuf/proto/lib.go
generated
vendored
62
vendor/github.com/golang/protobuf/proto/lib.go
generated
vendored
@ -265,7 +265,6 @@ package proto
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"reflect"
|
"reflect"
|
||||||
@ -274,7 +273,66 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
var errInvalidUTF8 = errors.New("proto: invalid UTF-8 string")
|
// RequiredNotSetError is an error type returned by either Marshal or Unmarshal.
|
||||||
|
// Marshal reports this when a required field is not initialized.
|
||||||
|
// Unmarshal reports this when a required field is missing from the wire data.
|
||||||
|
type RequiredNotSetError struct{ field string }
|
||||||
|
|
||||||
|
func (e *RequiredNotSetError) Error() string {
|
||||||
|
if e.field == "" {
|
||||||
|
return fmt.Sprintf("proto: required field not set")
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("proto: required field %q not set", e.field)
|
||||||
|
}
|
||||||
|
func (e *RequiredNotSetError) RequiredNotSet() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
type invalidUTF8Error struct{ field string }
|
||||||
|
|
||||||
|
func (e *invalidUTF8Error) Error() string {
|
||||||
|
if e.field == "" {
|
||||||
|
return "proto: invalid UTF-8 detected"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("proto: field %q contains invalid UTF-8", e.field)
|
||||||
|
}
|
||||||
|
func (e *invalidUTF8Error) InvalidUTF8() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// errInvalidUTF8 is a sentinel error to identify fields with invalid UTF-8.
|
||||||
|
// This error should not be exposed to the external API as such errors should
|
||||||
|
// be recreated with the field information.
|
||||||
|
var errInvalidUTF8 = &invalidUTF8Error{}
|
||||||
|
|
||||||
|
// isNonFatal reports whether the error is either a RequiredNotSet error
|
||||||
|
// or a InvalidUTF8 error.
|
||||||
|
func isNonFatal(err error) bool {
|
||||||
|
if re, ok := err.(interface{ RequiredNotSet() bool }); ok && re.RequiredNotSet() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if re, ok := err.(interface{ InvalidUTF8() bool }); ok && re.InvalidUTF8() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
type nonFatal struct{ E error }
|
||||||
|
|
||||||
|
// Merge merges err into nf and reports whether it was successful.
|
||||||
|
// Otherwise it returns false for any fatal non-nil errors.
|
||||||
|
func (nf *nonFatal) Merge(err error) (ok bool) {
|
||||||
|
if err == nil {
|
||||||
|
return true // not an error
|
||||||
|
}
|
||||||
|
if !isNonFatal(err) {
|
||||||
|
return false // fatal error
|
||||||
|
}
|
||||||
|
if nf.E == nil {
|
||||||
|
nf.E = err // store first instance of non-fatal error
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
// Message is implemented by generated protocol buffer messages.
|
// Message is implemented by generated protocol buffer messages.
|
||||||
type Message interface {
|
type Message interface {
|
||||||
|
16
vendor/github.com/golang/protobuf/proto/properties.go
generated
vendored
16
vendor/github.com/golang/protobuf/proto/properties.go
generated
vendored
@ -139,7 +139,7 @@ type Properties struct {
|
|||||||
Repeated bool
|
Repeated bool
|
||||||
Packed bool // relevant for repeated primitives only
|
Packed bool // relevant for repeated primitives only
|
||||||
Enum string // set for enum types only
|
Enum string // set for enum types only
|
||||||
proto3 bool // whether this is known to be a proto3 field; set for []byte only
|
proto3 bool // whether this is known to be a proto3 field
|
||||||
oneof bool // whether this is a oneof field
|
oneof bool // whether this is a oneof field
|
||||||
|
|
||||||
Default string // default value
|
Default string // default value
|
||||||
@ -148,9 +148,9 @@ type Properties struct {
|
|||||||
stype reflect.Type // set for struct types only
|
stype reflect.Type // set for struct types only
|
||||||
sprop *StructProperties // set for struct types only
|
sprop *StructProperties // set for struct types only
|
||||||
|
|
||||||
mtype reflect.Type // set for map types only
|
mtype reflect.Type // set for map types only
|
||||||
mkeyprop *Properties // set for map types only
|
MapKeyProp *Properties // set for map types only
|
||||||
mvalprop *Properties // set for map types only
|
MapValProp *Properties // set for map types only
|
||||||
}
|
}
|
||||||
|
|
||||||
// String formats the properties in the protobuf struct field tag style.
|
// String formats the properties in the protobuf struct field tag style.
|
||||||
@ -275,16 +275,16 @@ func (p *Properties) setFieldProps(typ reflect.Type, f *reflect.StructField, loc
|
|||||||
|
|
||||||
case reflect.Map:
|
case reflect.Map:
|
||||||
p.mtype = t1
|
p.mtype = t1
|
||||||
p.mkeyprop = &Properties{}
|
p.MapKeyProp = &Properties{}
|
||||||
p.mkeyprop.init(reflect.PtrTo(p.mtype.Key()), "Key", f.Tag.Get("protobuf_key"), nil, lockGetProp)
|
p.MapKeyProp.init(reflect.PtrTo(p.mtype.Key()), "Key", f.Tag.Get("protobuf_key"), nil, lockGetProp)
|
||||||
p.mvalprop = &Properties{}
|
p.MapValProp = &Properties{}
|
||||||
vtype := p.mtype.Elem()
|
vtype := p.mtype.Elem()
|
||||||
if vtype.Kind() != reflect.Ptr && vtype.Kind() != reflect.Slice {
|
if vtype.Kind() != reflect.Ptr && vtype.Kind() != reflect.Slice {
|
||||||
// The value type is not a message (*T) or bytes ([]byte),
|
// The value type is not a message (*T) or bytes ([]byte),
|
||||||
// so we need encoders for the pointer to this type.
|
// so we need encoders for the pointer to this type.
|
||||||
vtype = reflect.PtrTo(vtype)
|
vtype = reflect.PtrTo(vtype)
|
||||||
}
|
}
|
||||||
p.mvalprop.init(vtype, "Value", f.Tag.Get("protobuf_val"), nil, lockGetProp)
|
p.MapValProp.init(vtype, "Value", f.Tag.Get("protobuf_val"), nil, lockGetProp)
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.stype != nil {
|
if p.stype != nil {
|
||||||
|
190
vendor/github.com/golang/protobuf/proto/table_marshal.go
generated
vendored
190
vendor/github.com/golang/protobuf/proto/table_marshal.go
generated
vendored
@ -231,7 +231,7 @@ func (u *marshalInfo) marshal(b []byte, ptr pointer, deterministic bool) ([]byte
|
|||||||
return b, err
|
return b, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var err, errreq error
|
var err, errLater error
|
||||||
// The old marshaler encodes extensions at beginning.
|
// The old marshaler encodes extensions at beginning.
|
||||||
if u.extensions.IsValid() {
|
if u.extensions.IsValid() {
|
||||||
e := ptr.offset(u.extensions).toExtensions()
|
e := ptr.offset(u.extensions).toExtensions()
|
||||||
@ -252,11 +252,13 @@ func (u *marshalInfo) marshal(b []byte, ptr pointer, deterministic bool) ([]byte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, f := range u.fields {
|
for _, f := range u.fields {
|
||||||
if f.required && errreq == nil {
|
if f.required {
|
||||||
if ptr.offset(f.field).getPointer().isNil() {
|
if ptr.offset(f.field).getPointer().isNil() {
|
||||||
// Required field is not set.
|
// Required field is not set.
|
||||||
// We record the error but keep going, to give a complete marshaling.
|
// We record the error but keep going, to give a complete marshaling.
|
||||||
errreq = &RequiredNotSetError{f.name}
|
if errLater == nil {
|
||||||
|
errLater = &RequiredNotSetError{f.name}
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -269,14 +271,21 @@ func (u *marshalInfo) marshal(b []byte, ptr pointer, deterministic bool) ([]byte
|
|||||||
if err1, ok := err.(*RequiredNotSetError); ok {
|
if err1, ok := err.(*RequiredNotSetError); ok {
|
||||||
// Required field in submessage is not set.
|
// Required field in submessage is not set.
|
||||||
// We record the error but keep going, to give a complete marshaling.
|
// We record the error but keep going, to give a complete marshaling.
|
||||||
if errreq == nil {
|
if errLater == nil {
|
||||||
errreq = &RequiredNotSetError{f.name + "." + err1.field}
|
errLater = &RequiredNotSetError{f.name + "." + err1.field}
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if err == errRepeatedHasNil {
|
if err == errRepeatedHasNil {
|
||||||
err = errors.New("proto: repeated field " + f.name + " has nil element")
|
err = errors.New("proto: repeated field " + f.name + " has nil element")
|
||||||
}
|
}
|
||||||
|
if err == errInvalidUTF8 {
|
||||||
|
if errLater == nil {
|
||||||
|
fullName := revProtoTypes[reflect.PtrTo(u.typ)] + "." + f.name
|
||||||
|
errLater = &invalidUTF8Error{fullName}
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
return b, err
|
return b, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -284,7 +293,7 @@ func (u *marshalInfo) marshal(b []byte, ptr pointer, deterministic bool) ([]byte
|
|||||||
s := *ptr.offset(u.unrecognized).toBytes()
|
s := *ptr.offset(u.unrecognized).toBytes()
|
||||||
b = append(b, s...)
|
b = append(b, s...)
|
||||||
}
|
}
|
||||||
return b, errreq
|
return b, errLater
|
||||||
}
|
}
|
||||||
|
|
||||||
// computeMarshalInfo initializes the marshal info.
|
// computeMarshalInfo initializes the marshal info.
|
||||||
@ -530,6 +539,7 @@ func typeMarshaler(t reflect.Type, tags []string, nozero, oneof bool) (sizer, ma
|
|||||||
|
|
||||||
packed := false
|
packed := false
|
||||||
proto3 := false
|
proto3 := false
|
||||||
|
validateUTF8 := true
|
||||||
for i := 2; i < len(tags); i++ {
|
for i := 2; i < len(tags); i++ {
|
||||||
if tags[i] == "packed" {
|
if tags[i] == "packed" {
|
||||||
packed = true
|
packed = true
|
||||||
@ -538,6 +548,7 @@ func typeMarshaler(t reflect.Type, tags []string, nozero, oneof bool) (sizer, ma
|
|||||||
proto3 = true
|
proto3 = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
validateUTF8 = validateUTF8 && proto3
|
||||||
|
|
||||||
switch t.Kind() {
|
switch t.Kind() {
|
||||||
case reflect.Bool:
|
case reflect.Bool:
|
||||||
@ -735,6 +746,18 @@ func typeMarshaler(t reflect.Type, tags []string, nozero, oneof bool) (sizer, ma
|
|||||||
}
|
}
|
||||||
return sizeFloat64Value, appendFloat64Value
|
return sizeFloat64Value, appendFloat64Value
|
||||||
case reflect.String:
|
case reflect.String:
|
||||||
|
if validateUTF8 {
|
||||||
|
if pointer {
|
||||||
|
return sizeStringPtr, appendUTF8StringPtr
|
||||||
|
}
|
||||||
|
if slice {
|
||||||
|
return sizeStringSlice, appendUTF8StringSlice
|
||||||
|
}
|
||||||
|
if nozero {
|
||||||
|
return sizeStringValueNoZero, appendUTF8StringValueNoZero
|
||||||
|
}
|
||||||
|
return sizeStringValue, appendUTF8StringValue
|
||||||
|
}
|
||||||
if pointer {
|
if pointer {
|
||||||
return sizeStringPtr, appendStringPtr
|
return sizeStringPtr, appendStringPtr
|
||||||
}
|
}
|
||||||
@ -1984,9 +2007,6 @@ func appendBoolPackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byt
|
|||||||
}
|
}
|
||||||
func appendStringValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
|
func appendStringValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
|
||||||
v := *ptr.toString()
|
v := *ptr.toString()
|
||||||
if !utf8.ValidString(v) {
|
|
||||||
return nil, errInvalidUTF8
|
|
||||||
}
|
|
||||||
b = appendVarint(b, wiretag)
|
b = appendVarint(b, wiretag)
|
||||||
b = appendVarint(b, uint64(len(v)))
|
b = appendVarint(b, uint64(len(v)))
|
||||||
b = append(b, v...)
|
b = append(b, v...)
|
||||||
@ -1997,9 +2017,6 @@ func appendStringValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]b
|
|||||||
if v == "" {
|
if v == "" {
|
||||||
return b, nil
|
return b, nil
|
||||||
}
|
}
|
||||||
if !utf8.ValidString(v) {
|
|
||||||
return nil, errInvalidUTF8
|
|
||||||
}
|
|
||||||
b = appendVarint(b, wiretag)
|
b = appendVarint(b, wiretag)
|
||||||
b = appendVarint(b, uint64(len(v)))
|
b = appendVarint(b, uint64(len(v)))
|
||||||
b = append(b, v...)
|
b = append(b, v...)
|
||||||
@ -2011,24 +2028,83 @@ func appendStringPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, err
|
|||||||
return b, nil
|
return b, nil
|
||||||
}
|
}
|
||||||
v := *p
|
v := *p
|
||||||
if !utf8.ValidString(v) {
|
|
||||||
return nil, errInvalidUTF8
|
|
||||||
}
|
|
||||||
b = appendVarint(b, wiretag)
|
b = appendVarint(b, wiretag)
|
||||||
b = appendVarint(b, uint64(len(v)))
|
b = appendVarint(b, uint64(len(v)))
|
||||||
b = append(b, v...)
|
b = append(b, v...)
|
||||||
return b, nil
|
return b, nil
|
||||||
}
|
}
|
||||||
func appendStringSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
|
func appendStringSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
|
||||||
|
s := *ptr.toStringSlice()
|
||||||
|
for _, v := range s {
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
b = appendVarint(b, uint64(len(v)))
|
||||||
|
b = append(b, v...)
|
||||||
|
}
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
func appendUTF8StringValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
|
||||||
|
var invalidUTF8 bool
|
||||||
|
v := *ptr.toString()
|
||||||
|
if !utf8.ValidString(v) {
|
||||||
|
invalidUTF8 = true
|
||||||
|
}
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
b = appendVarint(b, uint64(len(v)))
|
||||||
|
b = append(b, v...)
|
||||||
|
if invalidUTF8 {
|
||||||
|
return b, errInvalidUTF8
|
||||||
|
}
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
func appendUTF8StringValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
|
||||||
|
var invalidUTF8 bool
|
||||||
|
v := *ptr.toString()
|
||||||
|
if v == "" {
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
if !utf8.ValidString(v) {
|
||||||
|
invalidUTF8 = true
|
||||||
|
}
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
b = appendVarint(b, uint64(len(v)))
|
||||||
|
b = append(b, v...)
|
||||||
|
if invalidUTF8 {
|
||||||
|
return b, errInvalidUTF8
|
||||||
|
}
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
func appendUTF8StringPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
|
||||||
|
var invalidUTF8 bool
|
||||||
|
p := *ptr.toStringPtr()
|
||||||
|
if p == nil {
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
v := *p
|
||||||
|
if !utf8.ValidString(v) {
|
||||||
|
invalidUTF8 = true
|
||||||
|
}
|
||||||
|
b = appendVarint(b, wiretag)
|
||||||
|
b = appendVarint(b, uint64(len(v)))
|
||||||
|
b = append(b, v...)
|
||||||
|
if invalidUTF8 {
|
||||||
|
return b, errInvalidUTF8
|
||||||
|
}
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
func appendUTF8StringSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
|
||||||
|
var invalidUTF8 bool
|
||||||
s := *ptr.toStringSlice()
|
s := *ptr.toStringSlice()
|
||||||
for _, v := range s {
|
for _, v := range s {
|
||||||
if !utf8.ValidString(v) {
|
if !utf8.ValidString(v) {
|
||||||
return nil, errInvalidUTF8
|
invalidUTF8 = true
|
||||||
}
|
}
|
||||||
b = appendVarint(b, wiretag)
|
b = appendVarint(b, wiretag)
|
||||||
b = appendVarint(b, uint64(len(v)))
|
b = appendVarint(b, uint64(len(v)))
|
||||||
b = append(b, v...)
|
b = append(b, v...)
|
||||||
}
|
}
|
||||||
|
if invalidUTF8 {
|
||||||
|
return b, errInvalidUTF8
|
||||||
|
}
|
||||||
return b, nil
|
return b, nil
|
||||||
}
|
}
|
||||||
func appendBytes(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
|
func appendBytes(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
|
||||||
@ -2107,7 +2183,8 @@ func makeGroupSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
|
|||||||
},
|
},
|
||||||
func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
||||||
s := ptr.getPointerSlice()
|
s := ptr.getPointerSlice()
|
||||||
var err, errreq error
|
var err error
|
||||||
|
var nerr nonFatal
|
||||||
for _, v := range s {
|
for _, v := range s {
|
||||||
if v.isNil() {
|
if v.isNil() {
|
||||||
return b, errRepeatedHasNil
|
return b, errRepeatedHasNil
|
||||||
@ -2115,22 +2192,14 @@ func makeGroupSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
|
|||||||
b = appendVarint(b, wiretag) // start group
|
b = appendVarint(b, wiretag) // start group
|
||||||
b, err = u.marshal(b, v, deterministic)
|
b, err = u.marshal(b, v, deterministic)
|
||||||
b = appendVarint(b, wiretag+(WireEndGroup-WireStartGroup)) // end group
|
b = appendVarint(b, wiretag+(WireEndGroup-WireStartGroup)) // end group
|
||||||
if err != nil {
|
if !nerr.Merge(err) {
|
||||||
if _, ok := err.(*RequiredNotSetError); ok {
|
|
||||||
// Required field in submessage is not set.
|
|
||||||
// We record the error but keep going, to give a complete marshaling.
|
|
||||||
if errreq == nil {
|
|
||||||
errreq = err
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if err == ErrNil {
|
if err == ErrNil {
|
||||||
err = errRepeatedHasNil
|
err = errRepeatedHasNil
|
||||||
}
|
}
|
||||||
return b, err
|
return b, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return b, errreq
|
return b, nerr.E
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2174,7 +2243,8 @@ func makeMessageSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
|
|||||||
},
|
},
|
||||||
func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
|
||||||
s := ptr.getPointerSlice()
|
s := ptr.getPointerSlice()
|
||||||
var err, errreq error
|
var err error
|
||||||
|
var nerr nonFatal
|
||||||
for _, v := range s {
|
for _, v := range s {
|
||||||
if v.isNil() {
|
if v.isNil() {
|
||||||
return b, errRepeatedHasNil
|
return b, errRepeatedHasNil
|
||||||
@ -2184,22 +2254,14 @@ func makeMessageSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
|
|||||||
b = appendVarint(b, uint64(siz))
|
b = appendVarint(b, uint64(siz))
|
||||||
b, err = u.marshal(b, v, deterministic)
|
b, err = u.marshal(b, v, deterministic)
|
||||||
|
|
||||||
if err != nil {
|
if !nerr.Merge(err) {
|
||||||
if _, ok := err.(*RequiredNotSetError); ok {
|
|
||||||
// Required field in submessage is not set.
|
|
||||||
// We record the error but keep going, to give a complete marshaling.
|
|
||||||
if errreq == nil {
|
|
||||||
errreq = err
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if err == ErrNil {
|
if err == ErrNil {
|
||||||
err = errRepeatedHasNil
|
err = errRepeatedHasNil
|
||||||
}
|
}
|
||||||
return b, err
|
return b, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return b, errreq
|
return b, nerr.E
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2223,6 +2285,25 @@ func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) {
|
|||||||
// value.
|
// value.
|
||||||
// Key cannot be pointer-typed.
|
// Key cannot be pointer-typed.
|
||||||
valIsPtr := valType.Kind() == reflect.Ptr
|
valIsPtr := valType.Kind() == reflect.Ptr
|
||||||
|
|
||||||
|
// If value is a message with nested maps, calling
|
||||||
|
// valSizer in marshal may be quadratic. We should use
|
||||||
|
// cached version in marshal (but not in size).
|
||||||
|
// If value is not message type, we don't have size cache,
|
||||||
|
// but it cannot be nested either. Just use valSizer.
|
||||||
|
valCachedSizer := valSizer
|
||||||
|
if valIsPtr && valType.Elem().Kind() == reflect.Struct {
|
||||||
|
u := getMarshalInfo(valType.Elem())
|
||||||
|
valCachedSizer = func(ptr pointer, tagsize int) int {
|
||||||
|
// Same as message sizer, but use cache.
|
||||||
|
p := ptr.getPointer()
|
||||||
|
if p.isNil() {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
siz := u.cachedsize(p)
|
||||||
|
return siz + SizeVarint(uint64(siz)) + tagsize
|
||||||
|
}
|
||||||
|
}
|
||||||
return func(ptr pointer, tagsize int) int {
|
return func(ptr pointer, tagsize int) int {
|
||||||
m := ptr.asPointerTo(t).Elem() // the map
|
m := ptr.asPointerTo(t).Elem() // the map
|
||||||
n := 0
|
n := 0
|
||||||
@ -2243,24 +2324,26 @@ func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) {
|
|||||||
if len(keys) > 1 && deterministic {
|
if len(keys) > 1 && deterministic {
|
||||||
sort.Sort(mapKeys(keys))
|
sort.Sort(mapKeys(keys))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var nerr nonFatal
|
||||||
for _, k := range keys {
|
for _, k := range keys {
|
||||||
ki := k.Interface()
|
ki := k.Interface()
|
||||||
vi := m.MapIndex(k).Interface()
|
vi := m.MapIndex(k).Interface()
|
||||||
kaddr := toAddrPointer(&ki, false) // pointer to key
|
kaddr := toAddrPointer(&ki, false) // pointer to key
|
||||||
vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value
|
vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value
|
||||||
b = appendVarint(b, tag)
|
b = appendVarint(b, tag)
|
||||||
siz := keySizer(kaddr, 1) + valSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1)
|
siz := keySizer(kaddr, 1) + valCachedSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1)
|
||||||
b = appendVarint(b, uint64(siz))
|
b = appendVarint(b, uint64(siz))
|
||||||
b, err = keyMarshaler(b, kaddr, keyWireTag, deterministic)
|
b, err = keyMarshaler(b, kaddr, keyWireTag, deterministic)
|
||||||
if err != nil {
|
if !nerr.Merge(err) {
|
||||||
return b, err
|
return b, err
|
||||||
}
|
}
|
||||||
b, err = valMarshaler(b, vaddr, valWireTag, deterministic)
|
b, err = valMarshaler(b, vaddr, valWireTag, deterministic)
|
||||||
if err != nil && err != ErrNil { // allow nil value in map
|
if err != ErrNil && !nerr.Merge(err) { // allow nil value in map
|
||||||
return b, err
|
return b, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return b, nil
|
return b, nerr.E
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2333,6 +2416,7 @@ func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, de
|
|||||||
defer mu.Unlock()
|
defer mu.Unlock()
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
|
var nerr nonFatal
|
||||||
|
|
||||||
// Fast-path for common cases: zero or one extensions.
|
// Fast-path for common cases: zero or one extensions.
|
||||||
// Don't bother sorting the keys.
|
// Don't bother sorting the keys.
|
||||||
@ -2352,11 +2436,11 @@ func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, de
|
|||||||
v := e.value
|
v := e.value
|
||||||
p := toAddrPointer(&v, ei.isptr)
|
p := toAddrPointer(&v, ei.isptr)
|
||||||
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
|
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
|
||||||
if err != nil {
|
if !nerr.Merge(err) {
|
||||||
return b, err
|
return b, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return b, nil
|
return b, nerr.E
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort the keys to provide a deterministic encoding.
|
// Sort the keys to provide a deterministic encoding.
|
||||||
@ -2383,11 +2467,11 @@ func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, de
|
|||||||
v := e.value
|
v := e.value
|
||||||
p := toAddrPointer(&v, ei.isptr)
|
p := toAddrPointer(&v, ei.isptr)
|
||||||
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
|
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
|
||||||
if err != nil {
|
if !nerr.Merge(err) {
|
||||||
return b, err
|
return b, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return b, nil
|
return b, nerr.E
|
||||||
}
|
}
|
||||||
|
|
||||||
// message set format is:
|
// message set format is:
|
||||||
@ -2444,6 +2528,7 @@ func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, de
|
|||||||
defer mu.Unlock()
|
defer mu.Unlock()
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
|
var nerr nonFatal
|
||||||
|
|
||||||
// Fast-path for common cases: zero or one extensions.
|
// Fast-path for common cases: zero or one extensions.
|
||||||
// Don't bother sorting the keys.
|
// Don't bother sorting the keys.
|
||||||
@ -2470,12 +2555,12 @@ func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, de
|
|||||||
v := e.value
|
v := e.value
|
||||||
p := toAddrPointer(&v, ei.isptr)
|
p := toAddrPointer(&v, ei.isptr)
|
||||||
b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic)
|
b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic)
|
||||||
if err != nil {
|
if !nerr.Merge(err) {
|
||||||
return b, err
|
return b, err
|
||||||
}
|
}
|
||||||
b = append(b, 1<<3|WireEndGroup)
|
b = append(b, 1<<3|WireEndGroup)
|
||||||
}
|
}
|
||||||
return b, nil
|
return b, nerr.E
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort the keys to provide a deterministic encoding.
|
// Sort the keys to provide a deterministic encoding.
|
||||||
@ -2509,11 +2594,11 @@ func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, de
|
|||||||
p := toAddrPointer(&v, ei.isptr)
|
p := toAddrPointer(&v, ei.isptr)
|
||||||
b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic)
|
b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic)
|
||||||
b = append(b, 1<<3|WireEndGroup)
|
b = append(b, 1<<3|WireEndGroup)
|
||||||
if err != nil {
|
if !nerr.Merge(err) {
|
||||||
return b, err
|
return b, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return b, nil
|
return b, nerr.E
|
||||||
}
|
}
|
||||||
|
|
||||||
// sizeV1Extensions computes the size of encoded data for a V1-API extension field.
|
// sizeV1Extensions computes the size of encoded data for a V1-API extension field.
|
||||||
@ -2556,6 +2641,7 @@ func (u *marshalInfo) appendV1Extensions(b []byte, m map[int32]Extension, determ
|
|||||||
sort.Ints(keys)
|
sort.Ints(keys)
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
|
var nerr nonFatal
|
||||||
for _, k := range keys {
|
for _, k := range keys {
|
||||||
e := m[int32(k)]
|
e := m[int32(k)]
|
||||||
if e.value == nil || e.desc == nil {
|
if e.value == nil || e.desc == nil {
|
||||||
@ -2572,11 +2658,11 @@ func (u *marshalInfo) appendV1Extensions(b []byte, m map[int32]Extension, determ
|
|||||||
v := e.value
|
v := e.value
|
||||||
p := toAddrPointer(&v, ei.isptr)
|
p := toAddrPointer(&v, ei.isptr)
|
||||||
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
|
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
|
||||||
if err != nil {
|
if !nerr.Merge(err) {
|
||||||
return b, err
|
return b, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return b, nil
|
return b, nerr.E
|
||||||
}
|
}
|
||||||
|
|
||||||
// newMarshaler is the interface representing objects that can marshal themselves.
|
// newMarshaler is the interface representing objects that can marshal themselves.
|
||||||
|
146
vendor/github.com/golang/protobuf/proto/table_unmarshal.go
generated
vendored
146
vendor/github.com/golang/protobuf/proto/table_unmarshal.go
generated
vendored
@ -97,6 +97,8 @@ type unmarshalFieldInfo struct {
|
|||||||
|
|
||||||
// if a required field, contains a single set bit at this field's index in the required field list.
|
// if a required field, contains a single set bit at this field's index in the required field list.
|
||||||
reqMask uint64
|
reqMask uint64
|
||||||
|
|
||||||
|
name string // name of the field, for error reporting
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -136,8 +138,8 @@ func (u *unmarshalInfo) unmarshal(m pointer, b []byte) error {
|
|||||||
if u.isMessageSet {
|
if u.isMessageSet {
|
||||||
return UnmarshalMessageSet(b, m.offset(u.extensions).toExtensions())
|
return UnmarshalMessageSet(b, m.offset(u.extensions).toExtensions())
|
||||||
}
|
}
|
||||||
var reqMask uint64 // bitmask of required fields we've seen.
|
var reqMask uint64 // bitmask of required fields we've seen.
|
||||||
var rnse *RequiredNotSetError // an instance of a RequiredNotSetError returned by a submessage.
|
var errLater error
|
||||||
for len(b) > 0 {
|
for len(b) > 0 {
|
||||||
// Read tag and wire type.
|
// Read tag and wire type.
|
||||||
// Special case 1 and 2 byte varints.
|
// Special case 1 and 2 byte varints.
|
||||||
@ -176,11 +178,20 @@ func (u *unmarshalInfo) unmarshal(m pointer, b []byte) error {
|
|||||||
if r, ok := err.(*RequiredNotSetError); ok {
|
if r, ok := err.(*RequiredNotSetError); ok {
|
||||||
// Remember this error, but keep parsing. We need to produce
|
// Remember this error, but keep parsing. We need to produce
|
||||||
// a full parse even if a required field is missing.
|
// a full parse even if a required field is missing.
|
||||||
rnse = r
|
if errLater == nil {
|
||||||
|
errLater = r
|
||||||
|
}
|
||||||
reqMask |= f.reqMask
|
reqMask |= f.reqMask
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if err != errInternalBadWireType {
|
if err != errInternalBadWireType {
|
||||||
|
if err == errInvalidUTF8 {
|
||||||
|
if errLater == nil {
|
||||||
|
fullName := revProtoTypes[reflect.PtrTo(u.typ)] + "." + f.name
|
||||||
|
errLater = &invalidUTF8Error{fullName}
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Fragments with bad wire type are treated as unknown fields.
|
// Fragments with bad wire type are treated as unknown fields.
|
||||||
@ -239,20 +250,16 @@ func (u *unmarshalInfo) unmarshal(m pointer, b []byte) error {
|
|||||||
emap[int32(tag)] = e
|
emap[int32(tag)] = e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if rnse != nil {
|
if reqMask != u.reqMask && errLater == nil {
|
||||||
// A required field of a submessage/group is missing. Return that error.
|
|
||||||
return rnse
|
|
||||||
}
|
|
||||||
if reqMask != u.reqMask {
|
|
||||||
// A required field of this message is missing.
|
// A required field of this message is missing.
|
||||||
for _, n := range u.reqFields {
|
for _, n := range u.reqFields {
|
||||||
if reqMask&1 == 0 {
|
if reqMask&1 == 0 {
|
||||||
return &RequiredNotSetError{n}
|
errLater = &RequiredNotSetError{n}
|
||||||
}
|
}
|
||||||
reqMask >>= 1
|
reqMask >>= 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return errLater
|
||||||
}
|
}
|
||||||
|
|
||||||
// computeUnmarshalInfo fills in u with information for use
|
// computeUnmarshalInfo fills in u with information for use
|
||||||
@ -351,7 +358,7 @@ func (u *unmarshalInfo) computeUnmarshalInfo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Store the info in the correct slot in the message.
|
// Store the info in the correct slot in the message.
|
||||||
u.setTag(tag, toField(&f), unmarshal, reqMask)
|
u.setTag(tag, toField(&f), unmarshal, reqMask, name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find any types associated with oneof fields.
|
// Find any types associated with oneof fields.
|
||||||
@ -366,10 +373,17 @@ func (u *unmarshalInfo) computeUnmarshalInfo() {
|
|||||||
|
|
||||||
f := typ.Field(0) // oneof implementers have one field
|
f := typ.Field(0) // oneof implementers have one field
|
||||||
baseUnmarshal := fieldUnmarshaler(&f)
|
baseUnmarshal := fieldUnmarshaler(&f)
|
||||||
tagstr := strings.Split(f.Tag.Get("protobuf"), ",")[1]
|
tags := strings.Split(f.Tag.Get("protobuf"), ",")
|
||||||
tag, err := strconv.Atoi(tagstr)
|
fieldNum, err := strconv.Atoi(tags[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("protobuf tag field not an integer: " + tagstr)
|
panic("protobuf tag field not an integer: " + tags[1])
|
||||||
|
}
|
||||||
|
var name string
|
||||||
|
for _, tag := range tags {
|
||||||
|
if strings.HasPrefix(tag, "name=") {
|
||||||
|
name = strings.TrimPrefix(tag, "name=")
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the oneof field that this struct implements.
|
// Find the oneof field that this struct implements.
|
||||||
@ -380,7 +394,7 @@ func (u *unmarshalInfo) computeUnmarshalInfo() {
|
|||||||
// That lets us know where this struct should be stored
|
// That lets us know where this struct should be stored
|
||||||
// when we encounter it during unmarshaling.
|
// when we encounter it during unmarshaling.
|
||||||
unmarshal := makeUnmarshalOneof(typ, of.ityp, baseUnmarshal)
|
unmarshal := makeUnmarshalOneof(typ, of.ityp, baseUnmarshal)
|
||||||
u.setTag(tag, of.field, unmarshal, 0)
|
u.setTag(fieldNum, of.field, unmarshal, 0, name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -401,7 +415,7 @@ func (u *unmarshalInfo) computeUnmarshalInfo() {
|
|||||||
// [0 0] is [tag=0/wiretype=varint varint-encoded-0].
|
// [0 0] is [tag=0/wiretype=varint varint-encoded-0].
|
||||||
u.setTag(0, zeroField, func(b []byte, f pointer, w int) ([]byte, error) {
|
u.setTag(0, zeroField, func(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
return nil, fmt.Errorf("proto: %s: illegal tag 0 (wire type %d)", t, w)
|
return nil, fmt.Errorf("proto: %s: illegal tag 0 (wire type %d)", t, w)
|
||||||
}, 0)
|
}, 0, "")
|
||||||
|
|
||||||
// Set mask for required field check.
|
// Set mask for required field check.
|
||||||
u.reqMask = uint64(1)<<uint(len(u.reqFields)) - 1
|
u.reqMask = uint64(1)<<uint(len(u.reqFields)) - 1
|
||||||
@ -413,8 +427,9 @@ func (u *unmarshalInfo) computeUnmarshalInfo() {
|
|||||||
// tag = tag # for field
|
// tag = tag # for field
|
||||||
// field/unmarshal = unmarshal info for that field.
|
// field/unmarshal = unmarshal info for that field.
|
||||||
// reqMask = if required, bitmask for field position in required field list. 0 otherwise.
|
// reqMask = if required, bitmask for field position in required field list. 0 otherwise.
|
||||||
func (u *unmarshalInfo) setTag(tag int, field field, unmarshal unmarshaler, reqMask uint64) {
|
// name = short name of the field.
|
||||||
i := unmarshalFieldInfo{field: field, unmarshal: unmarshal, reqMask: reqMask}
|
func (u *unmarshalInfo) setTag(tag int, field field, unmarshal unmarshaler, reqMask uint64, name string) {
|
||||||
|
i := unmarshalFieldInfo{field: field, unmarshal: unmarshal, reqMask: reqMask, name: name}
|
||||||
n := u.typ.NumField()
|
n := u.typ.NumField()
|
||||||
if tag >= 0 && (tag < 16 || tag < 2*n) { // TODO: what are the right numbers here?
|
if tag >= 0 && (tag < 16 || tag < 2*n) { // TODO: what are the right numbers here?
|
||||||
for len(u.dense) <= tag {
|
for len(u.dense) <= tag {
|
||||||
@ -442,11 +457,17 @@ func typeUnmarshaler(t reflect.Type, tags string) unmarshaler {
|
|||||||
tagArray := strings.Split(tags, ",")
|
tagArray := strings.Split(tags, ",")
|
||||||
encoding := tagArray[0]
|
encoding := tagArray[0]
|
||||||
name := "unknown"
|
name := "unknown"
|
||||||
|
proto3 := false
|
||||||
|
validateUTF8 := true
|
||||||
for _, tag := range tagArray[3:] {
|
for _, tag := range tagArray[3:] {
|
||||||
if strings.HasPrefix(tag, "name=") {
|
if strings.HasPrefix(tag, "name=") {
|
||||||
name = tag[5:]
|
name = tag[5:]
|
||||||
}
|
}
|
||||||
|
if tag == "proto3" {
|
||||||
|
proto3 = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
validateUTF8 = validateUTF8 && proto3
|
||||||
|
|
||||||
// Figure out packaging (pointer, slice, or both)
|
// Figure out packaging (pointer, slice, or both)
|
||||||
slice := false
|
slice := false
|
||||||
@ -594,6 +615,15 @@ func typeUnmarshaler(t reflect.Type, tags string) unmarshaler {
|
|||||||
}
|
}
|
||||||
return unmarshalBytesValue
|
return unmarshalBytesValue
|
||||||
case reflect.String:
|
case reflect.String:
|
||||||
|
if validateUTF8 {
|
||||||
|
if pointer {
|
||||||
|
return unmarshalUTF8StringPtr
|
||||||
|
}
|
||||||
|
if slice {
|
||||||
|
return unmarshalUTF8StringSlice
|
||||||
|
}
|
||||||
|
return unmarshalUTF8StringValue
|
||||||
|
}
|
||||||
if pointer {
|
if pointer {
|
||||||
return unmarshalStringPtr
|
return unmarshalStringPtr
|
||||||
}
|
}
|
||||||
@ -1448,9 +1478,6 @@ func unmarshalStringValue(b []byte, f pointer, w int) ([]byte, error) {
|
|||||||
return nil, io.ErrUnexpectedEOF
|
return nil, io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
v := string(b[:x])
|
v := string(b[:x])
|
||||||
if !utf8.ValidString(v) {
|
|
||||||
return nil, errInvalidUTF8
|
|
||||||
}
|
|
||||||
*f.toString() = v
|
*f.toString() = v
|
||||||
return b[x:], nil
|
return b[x:], nil
|
||||||
}
|
}
|
||||||
@ -1468,9 +1495,6 @@ func unmarshalStringPtr(b []byte, f pointer, w int) ([]byte, error) {
|
|||||||
return nil, io.ErrUnexpectedEOF
|
return nil, io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
v := string(b[:x])
|
v := string(b[:x])
|
||||||
if !utf8.ValidString(v) {
|
|
||||||
return nil, errInvalidUTF8
|
|
||||||
}
|
|
||||||
*f.toStringPtr() = &v
|
*f.toStringPtr() = &v
|
||||||
return b[x:], nil
|
return b[x:], nil
|
||||||
}
|
}
|
||||||
@ -1488,14 +1512,72 @@ func unmarshalStringSlice(b []byte, f pointer, w int) ([]byte, error) {
|
|||||||
return nil, io.ErrUnexpectedEOF
|
return nil, io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
v := string(b[:x])
|
v := string(b[:x])
|
||||||
if !utf8.ValidString(v) {
|
|
||||||
return nil, errInvalidUTF8
|
|
||||||
}
|
|
||||||
s := f.toStringSlice()
|
s := f.toStringSlice()
|
||||||
*s = append(*s, v)
|
*s = append(*s, v)
|
||||||
return b[x:], nil
|
return b[x:], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func unmarshalUTF8StringValue(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return b, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
v := string(b[:x])
|
||||||
|
*f.toString() = v
|
||||||
|
if !utf8.ValidString(v) {
|
||||||
|
return b[x:], errInvalidUTF8
|
||||||
|
}
|
||||||
|
return b[x:], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func unmarshalUTF8StringPtr(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return b, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
v := string(b[:x])
|
||||||
|
*f.toStringPtr() = &v
|
||||||
|
if !utf8.ValidString(v) {
|
||||||
|
return b[x:], errInvalidUTF8
|
||||||
|
}
|
||||||
|
return b[x:], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func unmarshalUTF8StringSlice(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
|
if w != WireBytes {
|
||||||
|
return b, errInternalBadWireType
|
||||||
|
}
|
||||||
|
x, n := decodeVarint(b)
|
||||||
|
if n == 0 {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b = b[n:]
|
||||||
|
if x > uint64(len(b)) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
v := string(b[:x])
|
||||||
|
s := f.toStringSlice()
|
||||||
|
*s = append(*s, v)
|
||||||
|
if !utf8.ValidString(v) {
|
||||||
|
return b[x:], errInvalidUTF8
|
||||||
|
}
|
||||||
|
return b[x:], nil
|
||||||
|
}
|
||||||
|
|
||||||
var emptyBuf [0]byte
|
var emptyBuf [0]byte
|
||||||
|
|
||||||
func unmarshalBytesValue(b []byte, f pointer, w int) ([]byte, error) {
|
func unmarshalBytesValue(b []byte, f pointer, w int) ([]byte, error) {
|
||||||
@ -1674,6 +1756,7 @@ func makeUnmarshalMap(f *reflect.StructField) unmarshaler {
|
|||||||
// Maps will be somewhat slow. Oh well.
|
// Maps will be somewhat slow. Oh well.
|
||||||
|
|
||||||
// Read key and value from data.
|
// Read key and value from data.
|
||||||
|
var nerr nonFatal
|
||||||
k := reflect.New(kt)
|
k := reflect.New(kt)
|
||||||
v := reflect.New(vt)
|
v := reflect.New(vt)
|
||||||
for len(b) > 0 {
|
for len(b) > 0 {
|
||||||
@ -1694,7 +1777,7 @@ func makeUnmarshalMap(f *reflect.StructField) unmarshaler {
|
|||||||
err = errInternalBadWireType // skip unknown tag
|
err = errInternalBadWireType // skip unknown tag
|
||||||
}
|
}
|
||||||
|
|
||||||
if err == nil {
|
if nerr.Merge(err) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if err != errInternalBadWireType {
|
if err != errInternalBadWireType {
|
||||||
@ -1717,7 +1800,7 @@ func makeUnmarshalMap(f *reflect.StructField) unmarshaler {
|
|||||||
// Insert into map.
|
// Insert into map.
|
||||||
m.SetMapIndex(k.Elem(), v.Elem())
|
m.SetMapIndex(k.Elem(), v.Elem())
|
||||||
|
|
||||||
return r, nil
|
return r, nerr.E
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1743,15 +1826,16 @@ func makeUnmarshalOneof(typ, ityp reflect.Type, unmarshal unmarshaler) unmarshal
|
|||||||
// Unmarshal data into holder.
|
// Unmarshal data into holder.
|
||||||
// We unmarshal into the first field of the holder object.
|
// We unmarshal into the first field of the holder object.
|
||||||
var err error
|
var err error
|
||||||
|
var nerr nonFatal
|
||||||
b, err = unmarshal(b, valToPointer(v).offset(field0), w)
|
b, err = unmarshal(b, valToPointer(v).offset(field0), w)
|
||||||
if err != nil {
|
if !nerr.Merge(err) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write pointer to holder into target field.
|
// Write pointer to holder into target field.
|
||||||
f.asPointerTo(ityp).Elem().Set(v)
|
f.asPointerTo(ityp).Elem().Set(v)
|
||||||
|
|
||||||
return b, nil
|
return b, nerr.E
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
vendor/github.com/golang/protobuf/proto/text.go
generated
vendored
4
vendor/github.com/golang/protobuf/proto/text.go
generated
vendored
@ -353,7 +353,7 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := tm.writeAny(w, key, props.mkeyprop); err != nil {
|
if err := tm.writeAny(w, key, props.MapKeyProp); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := w.WriteByte('\n'); err != nil {
|
if err := w.WriteByte('\n'); err != nil {
|
||||||
@ -370,7 +370,7 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := tm.writeAny(w, val, props.mvalprop); err != nil {
|
if err := tm.writeAny(w, val, props.MapValProp); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := w.WriteByte('\n'); err != nil {
|
if err := w.WriteByte('\n'); err != nil {
|
||||||
|
6
vendor/github.com/golang/protobuf/proto/text_parser.go
generated
vendored
6
vendor/github.com/golang/protobuf/proto/text_parser.go
generated
vendored
@ -630,17 +630,17 @@ func (p *textParser) readStruct(sv reflect.Value, terminator string) error {
|
|||||||
if err := p.consumeToken(":"); err != nil {
|
if err := p.consumeToken(":"); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := p.readAny(key, props.mkeyprop); err != nil {
|
if err := p.readAny(key, props.MapKeyProp); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := p.consumeOptionalSeparator(); err != nil {
|
if err := p.consumeOptionalSeparator(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
case "value":
|
case "value":
|
||||||
if err := p.checkForColon(props.mvalprop, dst.Type().Elem()); err != nil {
|
if err := p.checkForColon(props.MapValProp, dst.Type().Elem()); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := p.readAny(val, props.mvalprop); err != nil {
|
if err := p.readAny(val, props.MapValProp); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := p.consumeOptionalSeparator(); err != nil {
|
if err := p.consumeOptionalSeparator(); err != nil {
|
||||||
|
10
vendor/github.com/golang/protobuf/ptypes/any.go
generated
vendored
10
vendor/github.com/golang/protobuf/ptypes/any.go
generated
vendored
@ -130,10 +130,12 @@ func UnmarshalAny(any *any.Any, pb proto.Message) error {
|
|||||||
|
|
||||||
// Is returns true if any value contains a given message type.
|
// Is returns true if any value contains a given message type.
|
||||||
func Is(any *any.Any, pb proto.Message) bool {
|
func Is(any *any.Any, pb proto.Message) bool {
|
||||||
aname, err := AnyMessageName(any)
|
// The following is equivalent to AnyMessageName(any) == proto.MessageName(pb),
|
||||||
if err != nil {
|
// but it avoids scanning TypeUrl for the slash.
|
||||||
|
if any == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
name := proto.MessageName(pb)
|
||||||
return aname == proto.MessageName(pb)
|
prefix := len(any.TypeUrl) - len(name)
|
||||||
|
return prefix >= 1 && any.TypeUrl[prefix-1] == '/' && any.TypeUrl[prefix:] == name
|
||||||
}
|
}
|
||||||
|
2
vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
generated
vendored
2
vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
generated
vendored
@ -121,7 +121,7 @@ type Any struct {
|
|||||||
// Schemes other than `http`, `https` (or the empty scheme) might be
|
// Schemes other than `http`, `https` (or the empty scheme) might be
|
||||||
// used with implementation specific semantics.
|
// used with implementation specific semantics.
|
||||||
//
|
//
|
||||||
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl" json:"type_url,omitempty"`
|
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
|
||||||
// Must be a valid serialized protocol buffer of the above specified type.
|
// Must be a valid serialized protocol buffer of the above specified type.
|
||||||
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
4
vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
generated
vendored
4
vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
generated
vendored
@ -82,14 +82,14 @@ type Duration struct {
|
|||||||
// Signed seconds of the span of time. Must be from -315,576,000,000
|
// 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:
|
// 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
|
// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
||||||
Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
|
Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
|
||||||
// Signed fractions of a second at nanosecond resolution of the span
|
// Signed fractions of a second at nanosecond resolution of the span
|
||||||
// of time. Durations less than one second are represented with a 0
|
// of time. Durations less than one second are represented with a 0
|
||||||
// `seconds` field and a positive or negative `nanos` field. For durations
|
// `seconds` field and a positive or negative `nanos` field. For durations
|
||||||
// of one second or more, a non-zero value for the `nanos` field must be
|
// of one second or more, a non-zero value for the `nanos` field must be
|
||||||
// of the same sign as the `seconds` field. Must be from -999,999,999
|
// of the same sign as the `seconds` field. Must be from -999,999,999
|
||||||
// to +999,999,999 inclusive.
|
// to +999,999,999 inclusive.
|
||||||
Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
|
Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_unrecognized []byte `json:"-"`
|
||||||
XXX_sizecache int32 `json:"-"`
|
XXX_sizecache int32 `json:"-"`
|
||||||
|
4
vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
generated
vendored
4
vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
generated
vendored
@ -100,12 +100,12 @@ type Timestamp struct {
|
|||||||
// Represents seconds of UTC time since Unix epoch
|
// Represents seconds of UTC time since Unix epoch
|
||||||
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
||||||
// 9999-12-31T23:59:59Z inclusive.
|
// 9999-12-31T23:59:59Z inclusive.
|
||||||
Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
|
Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
|
||||||
// Non-negative fractions of a second at nanosecond resolution. Negative
|
// Non-negative fractions of a second at nanosecond resolution. Negative
|
||||||
// second values with fractions must still have non-negative nanos values
|
// second values with fractions must still have non-negative nanos values
|
||||||
// that count forward in time. Must be from 0 to 999,999,999
|
// that count forward in time. Must be from 0 to 999,999,999
|
||||||
// inclusive.
|
// inclusive.
|
||||||
Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
|
Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_unrecognized []byte `json:"-"`
|
||||||
XXX_sizecache int32 `json:"-"`
|
XXX_sizecache int32 `json:"-"`
|
||||||
|
Loading…
Reference in New Issue
Block a user