Merge pull request #64719 from davidz627/feature/CSIv0.3
Automatic merge from submit-queue (batch tested with PRs 64276, 64094, 64719, 64766, 64750). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Upgrade container-storage-interface/spec dependency to v0.3.0 Also updated golang/protobuf to v1.1.0 to satisfy hard requirement of new CSI Spec version /sig storage /kind enhancement /assign @saad-ali ```release-note Updated Container Storage Interface specification version to v0.3.0 ```
This commit is contained in:
		
							
								
								
									
										44
									
								
								Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										44
									
								
								Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							@@ -490,8 +490,8 @@
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/container-storage-interface/spec/lib/go/csi/v0",
 | 
			
		||||
			"Comment": "v0.2.0",
 | 
			
		||||
			"Rev": "35d9f9d77954980e449e52c3f3e43c21bd8171f5"
 | 
			
		||||
			"Comment": "v0.3.0",
 | 
			
		||||
			"Rev": "2178fdeea87f1150a17a63252eee28d4d8141f72"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/containerd/console",
 | 
			
		||||
@@ -1454,39 +1454,53 @@
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/jsonpb",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Comment": "v1.1.0",
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/proto",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Comment": "v1.1.0",
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/protoc-gen-go/descriptor",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Comment": "v1.1.0",
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Comment": "v1.1.0",
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/any",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Comment": "v1.1.0",
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/duration",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Comment": "v1.1.0",
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/empty",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Comment": "v1.1.0",
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/struct",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Comment": "v1.1.0",
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/timestamp",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Comment": "v1.1.0",
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/wrappers",
 | 
			
		||||
			"Comment": "v1.1.0",
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/btree",
 | 
			
		||||
@@ -1709,34 +1723,42 @@
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/certificate-transparency-go",
 | 
			
		||||
			"Comment": "v1.0.10",
 | 
			
		||||
			"Rev": "1bec4527572c443752ad4f2830bef88be0533236"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/certificate-transparency-go/asn1",
 | 
			
		||||
			"Comment": "v1.0.10",
 | 
			
		||||
			"Rev": "1bec4527572c443752ad4f2830bef88be0533236"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/certificate-transparency-go/client",
 | 
			
		||||
			"Comment": "v1.0.10",
 | 
			
		||||
			"Rev": "1bec4527572c443752ad4f2830bef88be0533236"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/certificate-transparency-go/client/configpb",
 | 
			
		||||
			"Comment": "v1.0.10",
 | 
			
		||||
			"Rev": "1bec4527572c443752ad4f2830bef88be0533236"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/certificate-transparency-go/jsonclient",
 | 
			
		||||
			"Comment": "v1.0.10",
 | 
			
		||||
			"Rev": "1bec4527572c443752ad4f2830bef88be0533236"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/certificate-transparency-go/tls",
 | 
			
		||||
			"Comment": "v1.0.10",
 | 
			
		||||
			"Rev": "1bec4527572c443752ad4f2830bef88be0533236"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/certificate-transparency-go/x509",
 | 
			
		||||
			"Comment": "v1.0.10",
 | 
			
		||||
			"Rev": "1bec4527572c443752ad4f2830bef88be0533236"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/certificate-transparency-go/x509/pkix",
 | 
			
		||||
			"Comment": "v1.0.10",
 | 
			
		||||
			"Rev": "1bec4527572c443752ad4f2830bef88be0533236"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										39
									
								
								Godeps/LICENSES
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										39
									
								
								Godeps/LICENSES
									
									
									
										generated
									
									
									
								
							@@ -48067,6 +48067,45 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
================================================================================
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
================================================================================
 | 
			
		||||
= vendor/github.com/golang/protobuf/ptypes/wrappers licensed under: =
 | 
			
		||||
 | 
			
		||||
Go support for Protocol Buffers - Google's data interchange format
 | 
			
		||||
 | 
			
		||||
Copyright 2010 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.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
= vendor/github.com/golang/protobuf/LICENSE 14db3a56c3796a940ba32948a15f97d0
 | 
			
		||||
================================================================================
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
================================================================================
 | 
			
		||||
= vendor/github.com/google/btree licensed under: =
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								staging/src/k8s.io/api/Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								staging/src/k8s.io/api/Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							@@ -28,7 +28,7 @@
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/proto",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/gofuzz",
 | 
			
		||||
 
 | 
			
		||||
@@ -436,35 +436,35 @@
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/jsonpb",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/proto",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/protoc-gen-go/descriptor",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/any",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/duration",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/struct",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/timestamp",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/btree",
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								staging/src/k8s.io/apimachinery/Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										10
									
								
								staging/src/k8s.io/apimachinery/Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							@@ -48,23 +48,23 @@
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/proto",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/any",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/duration",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/timestamp",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/gofuzz",
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										16
									
								
								staging/src/k8s.io/apiserver/Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										16
									
								
								staging/src/k8s.io/apiserver/Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							@@ -412,35 +412,35 @@
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/jsonpb",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/proto",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/protoc-gen-go/descriptor",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/any",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/duration",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/struct",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/timestamp",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/btree",
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								staging/src/k8s.io/client-go/Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										10
									
								
								staging/src/k8s.io/client-go/Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							@@ -68,23 +68,23 @@
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/proto",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/any",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/duration",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/timestamp",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/btree",
 | 
			
		||||
 
 | 
			
		||||
@@ -148,27 +148,27 @@
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/proto",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/protoc-gen-go/descriptor",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/any",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/duration",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/timestamp",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/btree",
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								staging/src/k8s.io/metrics/Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										10
									
								
								staging/src/k8s.io/metrics/Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							@@ -28,23 +28,23 @@
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/proto",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/any",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/duration",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/timestamp",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/btree",
 | 
			
		||||
 
 | 
			
		||||
@@ -140,27 +140,27 @@
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/proto",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/protoc-gen-go/descriptor",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/any",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/duration",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/timestamp",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/btree",
 | 
			
		||||
 
 | 
			
		||||
@@ -32,23 +32,23 @@
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/proto",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/any",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/duration",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/golang/protobuf/ptypes/timestamp",
 | 
			
		||||
			"Rev": "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
 | 
			
		||||
			"Rev": "b4deda0973fb4c70b50d226b1af49f3da59f5265"
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			"ImportPath": "github.com/google/btree",
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								vendor/github.com/container-storage-interface/spec/lib/go/csi/v0/BUILD
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								vendor/github.com/container-storage-interface/spec/lib/go/csi/v0/BUILD
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -7,6 +7,7 @@ go_library(
 | 
			
		||||
    visibility = ["//visibility:public"],
 | 
			
		||||
    deps = [
 | 
			
		||||
        "//vendor/github.com/golang/protobuf/proto:go_default_library",
 | 
			
		||||
        "//vendor/github.com/golang/protobuf/ptypes/wrappers:go_default_library",
 | 
			
		||||
        "//vendor/golang.org/x/net/context:go_default_library",
 | 
			
		||||
        "//vendor/google.golang.org/grpc:go_default_library",
 | 
			
		||||
    ],
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3320
									
								
								vendor/github.com/container-storage-interface/spec/lib/go/csi/v0/csi.pb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										3320
									
								
								vendor/github.com/container-storage-interface/spec/lib/go/csi/v0/csi.pb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										188
									
								
								vendor/github.com/golang/protobuf/jsonpb/jsonpb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										188
									
								
								vendor/github.com/golang/protobuf/jsonpb/jsonpb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -56,6 +56,8 @@ import (
 | 
			
		||||
	stpb "github.com/golang/protobuf/ptypes/struct"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const secondInNanos = int64(time.Second / time.Nanosecond)
 | 
			
		||||
 | 
			
		||||
// Marshaler is a configurable object for converting between
 | 
			
		||||
// protocol buffer objects and a JSON representation for them.
 | 
			
		||||
type Marshaler struct {
 | 
			
		||||
@@ -118,6 +120,14 @@ type JSONPBUnmarshaler interface {
 | 
			
		||||
 | 
			
		||||
// Marshal marshals a protocol buffer into JSON.
 | 
			
		||||
func (m *Marshaler) Marshal(out io.Writer, pb proto.Message) error {
 | 
			
		||||
	v := reflect.ValueOf(pb)
 | 
			
		||||
	if pb == nil || (v.Kind() == reflect.Ptr && v.IsNil()) {
 | 
			
		||||
		return errors.New("Marshal called with nil")
 | 
			
		||||
	}
 | 
			
		||||
	// Check for unset required fields first.
 | 
			
		||||
	if err := checkRequiredFields(pb); err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	writer := &errWriter{writer: out}
 | 
			
		||||
	return m.marshalObject(writer, pb, "", "")
 | 
			
		||||
}
 | 
			
		||||
@@ -190,13 +200,22 @@ func (m *Marshaler) marshalObject(out *errWriter, v proto.Message, indent, typeU
 | 
			
		||||
			// Any is a bit more involved.
 | 
			
		||||
			return m.marshalAny(out, v, indent)
 | 
			
		||||
		case "Duration":
 | 
			
		||||
			// "Generated output always contains 3, 6, or 9 fractional digits,
 | 
			
		||||
			// "Generated output always contains 0, 3, 6, or 9 fractional digits,
 | 
			
		||||
			//  depending on required precision."
 | 
			
		||||
			s, ns := s.Field(0).Int(), s.Field(1).Int()
 | 
			
		||||
			d := time.Duration(s)*time.Second + time.Duration(ns)*time.Nanosecond
 | 
			
		||||
			x := fmt.Sprintf("%.9f", d.Seconds())
 | 
			
		||||
			if ns <= -secondInNanos || ns >= secondInNanos {
 | 
			
		||||
				return fmt.Errorf("ns out of range (%v, %v)", -secondInNanos, secondInNanos)
 | 
			
		||||
			}
 | 
			
		||||
			if (s > 0 && ns < 0) || (s < 0 && ns > 0) {
 | 
			
		||||
				return errors.New("signs of seconds and nanos do not match")
 | 
			
		||||
			}
 | 
			
		||||
			if s < 0 {
 | 
			
		||||
				ns = -ns
 | 
			
		||||
			}
 | 
			
		||||
			x := fmt.Sprintf("%d.%09d", s, ns)
 | 
			
		||||
			x = strings.TrimSuffix(x, "000")
 | 
			
		||||
			x = strings.TrimSuffix(x, "000")
 | 
			
		||||
			x = strings.TrimSuffix(x, ".000")
 | 
			
		||||
			out.write(`"`)
 | 
			
		||||
			out.write(x)
 | 
			
		||||
			out.write(`s"`)
 | 
			
		||||
@@ -207,13 +226,17 @@ func (m *Marshaler) marshalObject(out *errWriter, v proto.Message, indent, typeU
 | 
			
		||||
			return m.marshalValue(out, &proto.Properties{}, s.Field(0), indent)
 | 
			
		||||
		case "Timestamp":
 | 
			
		||||
			// "RFC 3339, where generated output will always be Z-normalized
 | 
			
		||||
			//  and uses 3, 6 or 9 fractional digits."
 | 
			
		||||
			//  and uses 0, 3, 6 or 9 fractional digits."
 | 
			
		||||
			s, ns := s.Field(0).Int(), s.Field(1).Int()
 | 
			
		||||
			if ns < 0 || ns >= secondInNanos {
 | 
			
		||||
				return fmt.Errorf("ns out of range [0, %v)", secondInNanos)
 | 
			
		||||
			}
 | 
			
		||||
			t := time.Unix(s, ns).UTC()
 | 
			
		||||
			// time.RFC3339Nano isn't exactly right (we need to get 3/6/9 fractional digits).
 | 
			
		||||
			x := t.Format("2006-01-02T15:04:05.000000000")
 | 
			
		||||
			x = strings.TrimSuffix(x, "000")
 | 
			
		||||
			x = strings.TrimSuffix(x, "000")
 | 
			
		||||
			x = strings.TrimSuffix(x, ".000")
 | 
			
		||||
			out.write(`"`)
 | 
			
		||||
			out.write(x)
 | 
			
		||||
			out.write(`Z"`)
 | 
			
		||||
@@ -632,7 +655,10 @@ func (u *Unmarshaler) UnmarshalNext(dec *json.Decoder, pb proto.Message) error {
 | 
			
		||||
	if err := dec.Decode(&inputValue); err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	return u.unmarshalValue(reflect.ValueOf(pb).Elem(), inputValue, nil)
 | 
			
		||||
	if err := u.unmarshalValue(reflect.ValueOf(pb).Elem(), inputValue, nil); err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	return checkRequiredFields(pb)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Unmarshal unmarshals a JSON object stream into a protocol
 | 
			
		||||
@@ -803,7 +829,7 @@ func (u *Unmarshaler) unmarshalValue(target reflect.Value, inputValue json.RawMe
 | 
			
		||||
				return fmt.Errorf("bad ListValue: %v", err)
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			target.Field(0).Set(reflect.ValueOf(make([]*stpb.Value, len(s), len(s))))
 | 
			
		||||
			target.Field(0).Set(reflect.ValueOf(make([]*stpb.Value, len(s))))
 | 
			
		||||
			for i, sv := range s {
 | 
			
		||||
				if err := u.unmarshalValue(target.Field(0).Index(i), sv, prop); err != nil {
 | 
			
		||||
					return err
 | 
			
		||||
@@ -973,13 +999,6 @@ func (u *Unmarshaler) unmarshalValue(target reflect.Value, inputValue json.RawMe
 | 
			
		||||
		}
 | 
			
		||||
		if mp != nil {
 | 
			
		||||
			target.Set(reflect.MakeMap(targetType))
 | 
			
		||||
			var keyprop, valprop *proto.Properties
 | 
			
		||||
			if prop != nil {
 | 
			
		||||
				// These could still be nil if the protobuf metadata is broken somehow.
 | 
			
		||||
				// TODO: This won't work because the fields are unexported.
 | 
			
		||||
				// We should probably just reparse them.
 | 
			
		||||
				//keyprop, valprop = prop.mkeyprop, prop.mvalprop
 | 
			
		||||
			}
 | 
			
		||||
			for ks, raw := range mp {
 | 
			
		||||
				// Unmarshal map key. The core json library already decoded the key into a
 | 
			
		||||
				// string, so we handle that specially. Other types were quoted post-serialization.
 | 
			
		||||
@@ -988,14 +1007,16 @@ func (u *Unmarshaler) unmarshalValue(target reflect.Value, inputValue json.RawMe
 | 
			
		||||
					k = reflect.ValueOf(ks)
 | 
			
		||||
				} else {
 | 
			
		||||
					k = reflect.New(targetType.Key()).Elem()
 | 
			
		||||
					if err := u.unmarshalValue(k, json.RawMessage(ks), keyprop); err != nil {
 | 
			
		||||
					// TODO: pass the correct Properties if needed.
 | 
			
		||||
					if err := u.unmarshalValue(k, json.RawMessage(ks), nil); err != nil {
 | 
			
		||||
						return err
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				// Unmarshal map value.
 | 
			
		||||
				v := reflect.New(targetType.Elem()).Elem()
 | 
			
		||||
				if err := u.unmarshalValue(v, raw, valprop); err != nil {
 | 
			
		||||
				// TODO: pass the correct Properties if needed.
 | 
			
		||||
				if err := u.unmarshalValue(v, raw, nil); err != nil {
 | 
			
		||||
					return err
 | 
			
		||||
				}
 | 
			
		||||
				target.SetMapIndex(k, v)
 | 
			
		||||
@@ -1081,3 +1102,140 @@ func (s mapKeys) Less(i, j int) bool {
 | 
			
		||||
	}
 | 
			
		||||
	return fmt.Sprint(s[i].Interface()) < fmt.Sprint(s[j].Interface())
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// checkRequiredFields returns an error if any required field in the given proto message is not set.
 | 
			
		||||
// This function is used by both Marshal and Unmarshal.  While required fields only exist in a
 | 
			
		||||
// proto2 message, a proto3 message can contain proto2 message(s).
 | 
			
		||||
func checkRequiredFields(pb proto.Message) error {
 | 
			
		||||
	// Most well-known type messages do not contain required fields.  The "Any" type may contain
 | 
			
		||||
	// a message that has required fields.
 | 
			
		||||
	//
 | 
			
		||||
	// When an Any message is being marshaled, the code will invoked proto.Unmarshal on Any.Value
 | 
			
		||||
	// field in order to transform that into JSON, and that should have returned an error if a
 | 
			
		||||
	// required field is not set in the embedded message.
 | 
			
		||||
	//
 | 
			
		||||
	// When an Any message is being unmarshaled, the code will have invoked proto.Marshal on the
 | 
			
		||||
	// embedded message to store the serialized message in Any.Value field, and that should have
 | 
			
		||||
	// returned an error if a required field is not set.
 | 
			
		||||
	if _, ok := pb.(wkt); ok {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	v := reflect.ValueOf(pb)
 | 
			
		||||
	// Skip message if it is not a struct pointer.
 | 
			
		||||
	if v.Kind() != reflect.Ptr {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
	v = v.Elem()
 | 
			
		||||
	if v.Kind() != reflect.Struct {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for i := 0; i < v.NumField(); i++ {
 | 
			
		||||
		field := v.Field(i)
 | 
			
		||||
		sfield := v.Type().Field(i)
 | 
			
		||||
 | 
			
		||||
		if sfield.PkgPath != "" {
 | 
			
		||||
			// blank PkgPath means the field is exported; skip if not exported
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if strings.HasPrefix(sfield.Name, "XXX_") {
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// Oneof field is an interface implemented by wrapper structs containing the actual oneof
 | 
			
		||||
		// field, i.e. an interface containing &T{real_value}.
 | 
			
		||||
		if sfield.Tag.Get("protobuf_oneof") != "" {
 | 
			
		||||
			if field.Kind() != reflect.Interface {
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
			v := field.Elem()
 | 
			
		||||
			if v.Kind() != reflect.Ptr || v.IsNil() {
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
			v = v.Elem()
 | 
			
		||||
			if v.Kind() != reflect.Struct || v.NumField() < 1 {
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
			field = v.Field(0)
 | 
			
		||||
			sfield = v.Type().Field(0)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		protoTag := sfield.Tag.Get("protobuf")
 | 
			
		||||
		if protoTag == "" {
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		var prop proto.Properties
 | 
			
		||||
		prop.Init(sfield.Type, sfield.Name, protoTag, &sfield)
 | 
			
		||||
 | 
			
		||||
		switch field.Kind() {
 | 
			
		||||
		case reflect.Map:
 | 
			
		||||
			if field.IsNil() {
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
			// Check each map value.
 | 
			
		||||
			keys := field.MapKeys()
 | 
			
		||||
			for _, k := range keys {
 | 
			
		||||
				v := field.MapIndex(k)
 | 
			
		||||
				if err := checkRequiredFieldsInValue(v); err != nil {
 | 
			
		||||
					return err
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		case reflect.Slice:
 | 
			
		||||
			// Handle non-repeated type, e.g. bytes.
 | 
			
		||||
			if !prop.Repeated {
 | 
			
		||||
				if prop.Required && field.IsNil() {
 | 
			
		||||
					return fmt.Errorf("required field %q is not set", prop.Name)
 | 
			
		||||
				}
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			// Handle repeated type.
 | 
			
		||||
			if field.IsNil() {
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
			// Check each slice item.
 | 
			
		||||
			for i := 0; i < field.Len(); i++ {
 | 
			
		||||
				v := field.Index(i)
 | 
			
		||||
				if err := checkRequiredFieldsInValue(v); err != nil {
 | 
			
		||||
					return err
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		case reflect.Ptr:
 | 
			
		||||
			if field.IsNil() {
 | 
			
		||||
				if prop.Required {
 | 
			
		||||
					return fmt.Errorf("required field %q is not set", prop.Name)
 | 
			
		||||
				}
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
			if err := checkRequiredFieldsInValue(field); err != nil {
 | 
			
		||||
				return err
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Handle proto2 extensions.
 | 
			
		||||
	for _, ext := range proto.RegisteredExtensions(pb) {
 | 
			
		||||
		if !proto.HasExtension(pb, ext) {
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		ep, err := proto.GetExtension(pb, ext)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		err = checkRequiredFieldsInValue(reflect.ValueOf(ep))
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func checkRequiredFieldsInValue(v reflect.Value) error {
 | 
			
		||||
	if pm, ok := v.Interface().(proto.Message); ok {
 | 
			
		||||
		return checkRequiredFields(pm)
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								vendor/github.com/golang/protobuf/proto/BUILD
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/golang/protobuf/proto/BUILD
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -5,6 +5,7 @@ go_library(
 | 
			
		||||
    srcs = [
 | 
			
		||||
        "clone.go",
 | 
			
		||||
        "decode.go",
 | 
			
		||||
        "discard.go",
 | 
			
		||||
        "encode.go",
 | 
			
		||||
        "equal.go",
 | 
			
		||||
        "extensions.go",
 | 
			
		||||
@@ -12,6 +13,9 @@ go_library(
 | 
			
		||||
        "message_set.go",
 | 
			
		||||
        "pointer_unsafe.go",
 | 
			
		||||
        "properties.go",
 | 
			
		||||
        "table_marshal.go",
 | 
			
		||||
        "table_merge.go",
 | 
			
		||||
        "table_unmarshal.go",
 | 
			
		||||
        "text.go",
 | 
			
		||||
        "text_parser.go",
 | 
			
		||||
    ],
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										43
									
								
								vendor/github.com/golang/protobuf/proto/Makefile
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										43
									
								
								vendor/github.com/golang/protobuf/proto/Makefile
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,43 +0,0 @@
 | 
			
		||||
# Go support for Protocol Buffers - Google's data interchange format
 | 
			
		||||
#
 | 
			
		||||
# Copyright 2010 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.
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
	go install
 | 
			
		||||
 | 
			
		||||
test: install generate-test-pbs
 | 
			
		||||
	go test
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
generate-test-pbs:
 | 
			
		||||
	make install
 | 
			
		||||
	make -C testdata
 | 
			
		||||
	protoc --go_out=Mtestdata/test.proto=github.com/golang/protobuf/proto/testdata,Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any:. proto3_proto/proto3.proto
 | 
			
		||||
	make
 | 
			
		||||
							
								
								
									
										46
									
								
								vendor/github.com/golang/protobuf/proto/clone.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										46
									
								
								vendor/github.com/golang/protobuf/proto/clone.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -35,22 +35,39 @@
 | 
			
		||||
package proto
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"log"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Clone returns a deep copy of a protocol buffer.
 | 
			
		||||
func Clone(pb Message) Message {
 | 
			
		||||
	in := reflect.ValueOf(pb)
 | 
			
		||||
func Clone(src Message) Message {
 | 
			
		||||
	in := reflect.ValueOf(src)
 | 
			
		||||
	if in.IsNil() {
 | 
			
		||||
		return pb
 | 
			
		||||
		return src
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	out := reflect.New(in.Type().Elem())
 | 
			
		||||
	// out is empty so a merge is a deep copy.
 | 
			
		||||
	mergeStruct(out.Elem(), in.Elem())
 | 
			
		||||
	return out.Interface().(Message)
 | 
			
		||||
	dst := out.Interface().(Message)
 | 
			
		||||
	Merge(dst, src)
 | 
			
		||||
	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.
 | 
			
		||||
@@ -58,17 +75,24 @@ func Clone(pb Message) Message {
 | 
			
		||||
// Elements of repeated fields will be appended.
 | 
			
		||||
// Merge panics if src and dst are not the same type, or if dst is nil.
 | 
			
		||||
func Merge(dst, src Message) {
 | 
			
		||||
	if m, ok := dst.(Merger); ok {
 | 
			
		||||
		m.Merge(src)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	in := reflect.ValueOf(src)
 | 
			
		||||
	out := reflect.ValueOf(dst)
 | 
			
		||||
	if out.IsNil() {
 | 
			
		||||
		panic("proto: nil destination")
 | 
			
		||||
	}
 | 
			
		||||
	if in.Type() != out.Type() {
 | 
			
		||||
		// Explicit test prior to mergeStruct so that mistyped nils will fail
 | 
			
		||||
		panic("proto: type mismatch")
 | 
			
		||||
		panic(fmt.Sprintf("proto.Merge(%T, %T) type mismatch", dst, src))
 | 
			
		||||
	}
 | 
			
		||||
	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
 | 
			
		||||
	}
 | 
			
		||||
	mergeStruct(out.Elem(), in.Elem())
 | 
			
		||||
@@ -84,7 +108,7 @@ func mergeStruct(out, in reflect.Value) {
 | 
			
		||||
		mergeAny(out.Field(i), in.Field(i), false, sprop.Prop[i])
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if emIn, ok := extendable(in.Addr().Interface()); ok {
 | 
			
		||||
	if emIn, err := extendable(in.Addr().Interface()); err == nil {
 | 
			
		||||
		emOut, _ := extendable(out.Addr().Interface())
 | 
			
		||||
		mIn, muIn := emIn.extensionsRead()
 | 
			
		||||
		if mIn != nil {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										668
									
								
								vendor/github.com/golang/protobuf/proto/decode.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										668
									
								
								vendor/github.com/golang/protobuf/proto/decode.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -39,8 +39,6 @@ import (
 | 
			
		||||
	"errors"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io"
 | 
			
		||||
	"os"
 | 
			
		||||
	"reflect"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// 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.
 | 
			
		||||
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.
 | 
			
		||||
// It returns the integer and the number of bytes consumed, or
 | 
			
		||||
// zero if there is not enough.
 | 
			
		||||
@@ -267,9 +261,6 @@ func (p *Buffer) DecodeZigzag32() (x uint64, err error) {
 | 
			
		||||
	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.
 | 
			
		||||
// This is the format used for the bytes protocol buffer
 | 
			
		||||
// type and for embedded messages.
 | 
			
		||||
@@ -311,81 +302,29 @@ func (p *Buffer) DecodeStringBytes() (s string, err error) {
 | 
			
		||||
	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
 | 
			
		||||
// unmarshal themselves.  The method should reset the receiver before
 | 
			
		||||
// decoding starts.  The argument points to data that may be
 | 
			
		||||
// unmarshal themselves.  The argument points to data that may be
 | 
			
		||||
// overwritten, so implementations should not keep references to the
 | 
			
		||||
// 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 {
 | 
			
		||||
	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
 | 
			
		||||
// decoded result in pb.  If the struct underlying pb does not match
 | 
			
		||||
// the data in buf, the results can be unpredictable.
 | 
			
		||||
@@ -395,7 +334,13 @@ type Unmarshaler interface {
 | 
			
		||||
// to preserve and append to existing data.
 | 
			
		||||
func Unmarshal(buf []byte, pb Message) error {
 | 
			
		||||
	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
 | 
			
		||||
@@ -405,8 +350,16 @@ func Unmarshal(buf []byte, pb Message) error {
 | 
			
		||||
// UnmarshalMerge merges into existing data in pb.
 | 
			
		||||
// Most code should use Unmarshal instead.
 | 
			
		||||
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 {
 | 
			
		||||
		// 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 NewBuffer(buf).Unmarshal(pb)
 | 
			
		||||
@@ -422,12 +375,17 @@ func (p *Buffer) DecodeMessage(pb Message) error {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 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 {
 | 
			
		||||
	typ, base, err := getbase(pb)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	b := p.buf[p.index:]
 | 
			
		||||
	x, y := findEndGroup(b)
 | 
			
		||||
	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
 | 
			
		||||
@@ -438,533 +396,33 @@ func (p *Buffer) DecodeGroup(pb Message) error {
 | 
			
		||||
// Unlike proto.Unmarshal, this does not reset pb before starting to unmarshal.
 | 
			
		||||
func (p *Buffer) Unmarshal(pb Message) error {
 | 
			
		||||
	// 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 {
 | 
			
		||||
		// 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:])
 | 
			
		||||
		p.index = len(p.buf)
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	typ, base, err := getbase(pb)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	err = p.unmarshalType(typ.Elem(), GetProperties(typ.Elem()), false, base)
 | 
			
		||||
 | 
			
		||||
	if collectStats {
 | 
			
		||||
		stats.Decode++
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	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, _ := 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
 | 
			
		||||
 | 
			
		||||
	// Slow workaround for messages that aren't Unmarshalers.
 | 
			
		||||
	// This includes some hand-coded .pb.go files and
 | 
			
		||||
	// bootstrap protos.
 | 
			
		||||
	// TODO: fix all of those and then add Unmarshal to
 | 
			
		||||
	// the Message interface. Then:
 | 
			
		||||
	// The cast above and code below can be deleted.
 | 
			
		||||
	// The old unmarshaler can be deleted.
 | 
			
		||||
	// Clients can call Unmarshal directly (can already do that, actually).
 | 
			
		||||
	var info InternalMessageInfo
 | 
			
		||||
	err := info.Unmarshal(pb, p.buf[p.index:])
 | 
			
		||||
	p.index = len(p.buf)
 | 
			
		||||
	return err
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										350
									
								
								vendor/github.com/golang/protobuf/proto/discard.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										350
									
								
								vendor/github.com/golang/protobuf/proto/discard.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,350 @@
 | 
			
		||||
// 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 proto
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"sync"
 | 
			
		||||
	"sync/atomic"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type generatedDiscarder interface {
 | 
			
		||||
	XXX_DiscardUnknown()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// DiscardUnknown recursively discards all unknown fields from this message
 | 
			
		||||
// and all embedded messages.
 | 
			
		||||
//
 | 
			
		||||
// When unmarshaling a message with unrecognized fields, the tags and values
 | 
			
		||||
// of such fields are preserved in the Message. This allows a later call to
 | 
			
		||||
// marshal to be able to produce a message that continues to have those
 | 
			
		||||
// unrecognized fields. To avoid this, DiscardUnknown is used to
 | 
			
		||||
// explicitly clear the unknown fields after unmarshaling.
 | 
			
		||||
//
 | 
			
		||||
// For proto2 messages, the unknown fields of message extensions are only
 | 
			
		||||
// discarded from messages that have been accessed via GetExtension.
 | 
			
		||||
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)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 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
 | 
			
		||||
				di := getDiscardInfo(tf)
 | 
			
		||||
				dfi.discard = func(src pointer) {
 | 
			
		||||
					sps := src.getPointerSlice()
 | 
			
		||||
					for _, sp := range sps {
 | 
			
		||||
						if !sp.isNil() {
 | 
			
		||||
							di.discard(sp)
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			default: // E.g., *pb.T
 | 
			
		||||
				di := getDiscardInfo(tf)
 | 
			
		||||
				dfi.discard = func(src pointer) {
 | 
			
		||||
					sp := src.getPointer()
 | 
			
		||||
					if !sp.isNil() {
 | 
			
		||||
						di.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) {
 | 
			
		||||
	v := reflect.ValueOf(m)
 | 
			
		||||
	if v.Kind() != reflect.Ptr || v.IsNil() {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	v = v.Elem()
 | 
			
		||||
	if v.Kind() != reflect.Struct {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	t := v.Type()
 | 
			
		||||
 | 
			
		||||
	for i := 0; i < v.NumField(); i++ {
 | 
			
		||||
		f := t.Field(i)
 | 
			
		||||
		if strings.HasPrefix(f.Name, "XXX_") {
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		vf := v.Field(i)
 | 
			
		||||
		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("%T.%s cannot be a slice of pointers to primitive types", m, f.Name))
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		switch tf.Kind() {
 | 
			
		||||
		case reflect.Struct:
 | 
			
		||||
			switch {
 | 
			
		||||
			case !isPointer:
 | 
			
		||||
				panic(fmt.Sprintf("%T.%s cannot be a direct struct value", m, f.Name))
 | 
			
		||||
			case isSlice: // E.g., []*pb.T
 | 
			
		||||
				for j := 0; j < vf.Len(); j++ {
 | 
			
		||||
					discardLegacy(vf.Index(j).Interface().(Message))
 | 
			
		||||
				}
 | 
			
		||||
			default: // E.g., *pb.T
 | 
			
		||||
				discardLegacy(vf.Interface().(Message))
 | 
			
		||||
			}
 | 
			
		||||
		case reflect.Map:
 | 
			
		||||
			switch {
 | 
			
		||||
			case isPointer || isSlice:
 | 
			
		||||
				panic(fmt.Sprintf("%T.%s cannot be a pointer to a map or a slice of map values", m, f.Name))
 | 
			
		||||
			default: // E.g., map[K]V
 | 
			
		||||
				tv := vf.Type().Elem()
 | 
			
		||||
				if tv.Kind() == reflect.Ptr && tv.Implements(protoMessageType) { // Proto struct (e.g., *T)
 | 
			
		||||
					for _, key := range vf.MapKeys() {
 | 
			
		||||
						val := vf.MapIndex(key)
 | 
			
		||||
						discardLegacy(val.Interface().(Message))
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		case reflect.Interface:
 | 
			
		||||
			// Must be oneof field.
 | 
			
		||||
			switch {
 | 
			
		||||
			case isPointer || isSlice:
 | 
			
		||||
				panic(fmt.Sprintf("%T.%s cannot be a pointer to a interface or a slice of interface values", m, f.Name))
 | 
			
		||||
			default: // E.g., test_proto.isCommunique_Union interface
 | 
			
		||||
				if !vf.IsNil() && f.Tag.Get("protobuf_oneof") != "" {
 | 
			
		||||
					vf = vf.Elem() // E.g., *test_proto.Communique_Msg
 | 
			
		||||
					if !vf.IsNil() {
 | 
			
		||||
						vf = vf.Elem()   // E.g., test_proto.Communique_Msg
 | 
			
		||||
						vf = vf.Field(0) // E.g., Proto struct (e.g., *T) or primitive value
 | 
			
		||||
						if vf.Kind() == reflect.Ptr {
 | 
			
		||||
							discardLegacy(vf.Interface().(Message))
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if vf := v.FieldByName("XXX_unrecognized"); vf.IsValid() {
 | 
			
		||||
		if vf.Type() != reflect.TypeOf([]byte{}) {
 | 
			
		||||
			panic("expected XXX_unrecognized to be of type []byte")
 | 
			
		||||
		}
 | 
			
		||||
		vf.Set(reflect.ValueOf([]byte(nil)))
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// For proto2 messages, only discard unknown fields in message extensions
 | 
			
		||||
	// that have been accessed via GetExtension.
 | 
			
		||||
	if em, err := extendable(m); err == nil {
 | 
			
		||||
		// Ignore lock since discardLegacy is not concurrency safe.
 | 
			
		||||
		emm, _ := em.extensionsRead()
 | 
			
		||||
		for _, mx := range emm {
 | 
			
		||||
			if m, ok := mx.value.(Message); ok {
 | 
			
		||||
				discardLegacy(m)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1189
									
								
								vendor/github.com/golang/protobuf/proto/encode.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1189
									
								
								vendor/github.com/golang/protobuf/proto/encode.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										30
									
								
								vendor/github.com/golang/protobuf/proto/equal.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										30
									
								
								vendor/github.com/golang/protobuf/proto/equal.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -109,15 +109,6 @@ func equalStruct(v1, v2 reflect.Value) bool {
 | 
			
		||||
				// set/unset mismatch
 | 
			
		||||
				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()
 | 
			
		||||
		}
 | 
			
		||||
		if !equalAny(f1, f2, sprop.Prop[i]) {
 | 
			
		||||
@@ -146,11 +137,7 @@ func equalStruct(v1, v2 reflect.Value) bool {
 | 
			
		||||
 | 
			
		||||
	u1 := uf.Bytes()
 | 
			
		||||
	u2 := v2.FieldByName("XXX_unrecognized").Bytes()
 | 
			
		||||
	if !bytes.Equal(u1, u2) {
 | 
			
		||||
		return false
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return true
 | 
			
		||||
	return bytes.Equal(u1, u2)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 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
 | 
			
		||||
 | 
			
		||||
		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 {
 | 
			
		||||
			// Both are unencoded.
 | 
			
		||||
			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]
 | 
			
		||||
		}
 | 
			
		||||
		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)
 | 
			
		||||
			continue
 | 
			
		||||
			return false
 | 
			
		||||
		}
 | 
			
		||||
		var err error
 | 
			
		||||
		if m1 == nil {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										208
									
								
								vendor/github.com/golang/protobuf/proto/extensions.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										208
									
								
								vendor/github.com/golang/protobuf/proto/extensions.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -38,6 +38,7 @@ package proto
 | 
			
		||||
import (
 | 
			
		||||
	"errors"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"sync"
 | 
			
		||||
@@ -91,14 +92,29 @@ func (n notLocker) Unlock() {}
 | 
			
		||||
// 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
 | 
			
		||||
// the extendableProto interface.
 | 
			
		||||
func extendable(p interface{}) (extendableProto, bool) {
 | 
			
		||||
	if ep, ok := p.(extendableProto); ok {
 | 
			
		||||
		return ep, ok
 | 
			
		||||
func extendable(p interface{}) (extendableProto, error) {
 | 
			
		||||
	switch p := p.(type) {
 | 
			
		||||
	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
 | 
			
		||||
	}
 | 
			
		||||
	if ep, ok := p.(extendableProtoV1); ok {
 | 
			
		||||
		return extensionAdapter{ep}, ok
 | 
			
		||||
	}
 | 
			
		||||
	return nil, false
 | 
			
		||||
	// Don't allocate a specific error containing %T:
 | 
			
		||||
	// this is the hot path for Clone and MarshalText.
 | 
			
		||||
	return nil, errNotExtendable
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
@@ -143,9 +159,6 @@ func (e *XXX_InternalExtensions) extensionsRead() (map[int32]Extension, sync.Loc
 | 
			
		||||
	return e.p.extensionMap, &e.p.mu
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var extendableProtoType = reflect.TypeOf((*extendableProto)(nil)).Elem()
 | 
			
		||||
var extendableProtoV1Type = reflect.TypeOf((*extendableProtoV1)(nil)).Elem()
 | 
			
		||||
 | 
			
		||||
// ExtensionDesc represents an extension specification.
 | 
			
		||||
// Used in generated code from the protocol compiler.
 | 
			
		||||
type ExtensionDesc struct {
 | 
			
		||||
@@ -179,8 +192,8 @@ type Extension struct {
 | 
			
		||||
 | 
			
		||||
// SetRawExtension is for testing only.
 | 
			
		||||
func SetRawExtension(base Message, id int32, b []byte) {
 | 
			
		||||
	epb, ok := extendable(base)
 | 
			
		||||
	if !ok {
 | 
			
		||||
	epb, err := extendable(base)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	extmap := epb.extensionsWrite()
 | 
			
		||||
@@ -205,7 +218,7 @@ func checkExtensionTypes(pb extendableProto, extension *ExtensionDesc) error {
 | 
			
		||||
		pbi = ea.extendableProtoV1
 | 
			
		||||
	}
 | 
			
		||||
	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.
 | 
			
		||||
	if !isExtensionField(pb, extension.Field) {
 | 
			
		||||
@@ -250,85 +263,11 @@ func extensionProperties(ed *ExtensionDesc) *Properties {
 | 
			
		||||
	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.
 | 
			
		||||
func HasExtension(pb Message, extension *ExtensionDesc) bool {
 | 
			
		||||
	// TODO: Check types, field numbers, etc.?
 | 
			
		||||
	epb, ok := extendable(pb)
 | 
			
		||||
	if !ok {
 | 
			
		||||
	epb, err := extendable(pb)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return false
 | 
			
		||||
	}
 | 
			
		||||
	extmap, mu := epb.extensionsRead()
 | 
			
		||||
@@ -336,15 +275,15 @@ func HasExtension(pb Message, extension *ExtensionDesc) bool {
 | 
			
		||||
		return false
 | 
			
		||||
	}
 | 
			
		||||
	mu.Lock()
 | 
			
		||||
	_, ok = extmap[extension.Field]
 | 
			
		||||
	_, ok := extmap[extension.Field]
 | 
			
		||||
	mu.Unlock()
 | 
			
		||||
	return ok
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ClearExtension removes the given extension from pb.
 | 
			
		||||
func ClearExtension(pb Message, extension *ExtensionDesc) {
 | 
			
		||||
	epb, ok := extendable(pb)
 | 
			
		||||
	if !ok {
 | 
			
		||||
	epb, err := extendable(pb)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	// TODO: Check types, field numbers, etc.?
 | 
			
		||||
@@ -352,16 +291,26 @@ func ClearExtension(pb Message, extension *ExtensionDesc) {
 | 
			
		||||
	delete(extmap, extension.Field)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// GetExtension parses and returns the given extension of pb.
 | 
			
		||||
// If the extension is not present and has no default value it returns ErrMissingExtension.
 | 
			
		||||
// GetExtension retrieves a proto2 extended field from pb.
 | 
			
		||||
//
 | 
			
		||||
// 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) {
 | 
			
		||||
	epb, ok := extendable(pb)
 | 
			
		||||
	if !ok {
 | 
			
		||||
		return nil, errors.New("proto: not an extendable proto")
 | 
			
		||||
	epb, err := extendable(pb)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if err := checkExtensionTypes(epb, extension); err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	if extension.ExtendedType != nil {
 | 
			
		||||
		// can only check type if this is a complete descriptor
 | 
			
		||||
		if err := checkExtensionTypes(epb, extension); err != nil {
 | 
			
		||||
			return nil, err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	emap, mu := epb.extensionsRead()
 | 
			
		||||
@@ -388,6 +337,11 @@ func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {
 | 
			
		||||
		return e.value, nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if extension.ExtensionType == nil {
 | 
			
		||||
		// incomplete descriptor
 | 
			
		||||
		return e.enc, nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	v, err := decodeExtension(e.enc, extension)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
@@ -405,6 +359,11 @@ func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {
 | 
			
		||||
// defaultExtensionValue returns the default value for extension.
 | 
			
		||||
// If no default for an extension is defined ErrMissingExtension is returned.
 | 
			
		||||
func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) {
 | 
			
		||||
	if extension.ExtensionType == nil {
 | 
			
		||||
		// incomplete descriptor, so no default
 | 
			
		||||
		return nil, ErrMissingExtension
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	t := reflect.TypeOf(extension.ExtensionType)
 | 
			
		||||
	props := extensionProperties(extension)
 | 
			
		||||
 | 
			
		||||
@@ -439,31 +398,28 @@ func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) {
 | 
			
		||||
 | 
			
		||||
// decodeExtension decodes an extension encoded in b.
 | 
			
		||||
func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) {
 | 
			
		||||
	o := NewBuffer(b)
 | 
			
		||||
 | 
			
		||||
	t := reflect.TypeOf(extension.ExtensionType)
 | 
			
		||||
 | 
			
		||||
	props := extensionProperties(extension)
 | 
			
		||||
	unmarshal := typeUnmarshaler(t, extension.Tag)
 | 
			
		||||
 | 
			
		||||
	// t is a pointer to a struct, pointer to basic type or a slice.
 | 
			
		||||
	// Allocate a "field" to store the pointer/slice itself; the
 | 
			
		||||
	// 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 }.
 | 
			
		||||
	// Allocate space to store the pointer/slice.
 | 
			
		||||
	value := reflect.New(t).Elem()
 | 
			
		||||
 | 
			
		||||
	var err error
 | 
			
		||||
	for {
 | 
			
		||||
		// Discard wire type and field number varint. It isn't needed.
 | 
			
		||||
		if _, err := o.DecodeVarint(); err != nil {
 | 
			
		||||
		x, n := decodeVarint(b)
 | 
			
		||||
		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
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if err := props.dec(o, props, toStructPointer(value.Addr())); err != nil {
 | 
			
		||||
			return nil, err
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if o.index >= len(o.buf) {
 | 
			
		||||
		if len(b) == 0 {
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
@@ -473,9 +429,9 @@ func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) {
 | 
			
		||||
// 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.
 | 
			
		||||
func GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interface{}, err error) {
 | 
			
		||||
	epb, ok := extendable(pb)
 | 
			
		||||
	if !ok {
 | 
			
		||||
		return nil, errors.New("proto: not an extendable proto")
 | 
			
		||||
	epb, err := extendable(pb)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	extensions = make([]interface{}, len(es))
 | 
			
		||||
	for i, e := range es {
 | 
			
		||||
@@ -494,9 +450,9 @@ func GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interface{}, e
 | 
			
		||||
// For non-registered extensions, ExtensionDescs returns an incomplete descriptor containing
 | 
			
		||||
// just the Field field, which defines the extension's field number.
 | 
			
		||||
func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) {
 | 
			
		||||
	epb, ok := extendable(pb)
 | 
			
		||||
	if !ok {
 | 
			
		||||
		return nil, fmt.Errorf("proto: %T is not an extendable proto.Message", pb)
 | 
			
		||||
	epb, err := extendable(pb)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	registeredExtensions := RegisteredExtensions(pb)
 | 
			
		||||
 | 
			
		||||
@@ -523,9 +479,9 @@ func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) {
 | 
			
		||||
 | 
			
		||||
// SetExtension sets the specified extension of pb to the specified value.
 | 
			
		||||
func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error {
 | 
			
		||||
	epb, ok := extendable(pb)
 | 
			
		||||
	if !ok {
 | 
			
		||||
		return errors.New("proto: not an extendable proto")
 | 
			
		||||
	epb, err := extendable(pb)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	if err := checkExtensionTypes(epb, extension); err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
@@ -550,8 +506,8 @@ func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error
 | 
			
		||||
 | 
			
		||||
// ClearAllExtensions clears all extensions from pb.
 | 
			
		||||
func ClearAllExtensions(pb Message) {
 | 
			
		||||
	epb, ok := extendable(pb)
 | 
			
		||||
	if !ok {
 | 
			
		||||
	epb, err := extendable(pb)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	m := epb.extensionsWrite()
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										70
									
								
								vendor/github.com/golang/protobuf/proto/lib.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										70
									
								
								vendor/github.com/golang/protobuf/proto/lib.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -265,6 +265,7 @@ package proto
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"errors"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"log"
 | 
			
		||||
	"reflect"
 | 
			
		||||
@@ -273,6 +274,8 @@ import (
 | 
			
		||||
	"sync"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var errInvalidUTF8 = errors.New("proto: invalid UTF-8 string")
 | 
			
		||||
 | 
			
		||||
// Message is implemented by generated protocol buffer messages.
 | 
			
		||||
type Message interface {
 | 
			
		||||
	Reset()
 | 
			
		||||
@@ -309,16 +312,7 @@ type Buffer struct {
 | 
			
		||||
	buf   []byte // encode/decode byte stream
 | 
			
		||||
	index int    // read point
 | 
			
		||||
 | 
			
		||||
	// pools of basic types to amortize allocation.
 | 
			
		||||
	bools   []bool
 | 
			
		||||
	uint32s []uint32
 | 
			
		||||
	uint64s []uint64
 | 
			
		||||
 | 
			
		||||
	// extra pools, only used with pointer_reflect.go
 | 
			
		||||
	int32s   []int32
 | 
			
		||||
	int64s   []int64
 | 
			
		||||
	float32s []float32
 | 
			
		||||
	float64s []float64
 | 
			
		||||
	deterministic bool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewBuffer allocates a new Buffer and initializes its internal data to
 | 
			
		||||
@@ -343,6 +337,30 @@ func (p *Buffer) SetBuf(s []byte) {
 | 
			
		||||
// Bytes returns the contents of the Buffer.
 | 
			
		||||
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.
 | 
			
		||||
 */
 | 
			
		||||
@@ -831,22 +849,12 @@ func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, nestedMes
 | 
			
		||||
	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.
 | 
			
		||||
// 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 {
 | 
			
		||||
	s := mapKeySorter{
 | 
			
		||||
		vs: vs,
 | 
			
		||||
		// default Less function: textual comparison
 | 
			
		||||
		less: func(a, b reflect.Value) bool {
 | 
			
		||||
			return fmt.Sprint(a.Interface()) < fmt.Sprint(b.Interface())
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
	s := mapKeySorter{vs: vs}
 | 
			
		||||
 | 
			
		||||
	// Type specialization per https://developers.google.com/protocol-buffers/docs/proto#maps;
 | 
			
		||||
	// numeric keys are sorted numerically.
 | 
			
		||||
	// Type specialization per https://developers.google.com/protocol-buffers/docs/proto#maps.
 | 
			
		||||
	if len(vs) == 0 {
 | 
			
		||||
		return s
 | 
			
		||||
	}
 | 
			
		||||
@@ -855,6 +863,12 @@ func mapKeys(vs []reflect.Value) sort.Interface {
 | 
			
		||||
		s.less = func(a, b reflect.Value) bool { return a.Int() < b.Int() }
 | 
			
		||||
	case reflect.Uint32, reflect.Uint64:
 | 
			
		||||
		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
 | 
			
		||||
@@ -895,3 +909,13 @@ const ProtoPackageIsVersion2 = true
 | 
			
		||||
// ProtoPackageIsVersion1 is referenced from generated protocol buffer files
 | 
			
		||||
// to assert that that code is compatible with this version of the proto package.
 | 
			
		||||
const ProtoPackageIsVersion1 = 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
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										81
									
								
								vendor/github.com/golang/protobuf/proto/message_set.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										81
									
								
								vendor/github.com/golang/protobuf/proto/message_set.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -42,6 +42,7 @@ import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"sort"
 | 
			
		||||
	"sync"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// errNoMessageTypeID occurs when a protocol buffer does not have a message type ID.
 | 
			
		||||
@@ -94,10 +95,7 @@ func (ms *messageSet) find(pb Message) *_MessageSet_Item {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (ms *messageSet) Has(pb Message) bool {
 | 
			
		||||
	if ms.find(pb) != nil {
 | 
			
		||||
		return true
 | 
			
		||||
	}
 | 
			
		||||
	return false
 | 
			
		||||
	return ms.find(pb) != nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (ms *messageSet) Unmarshal(pb Message) error {
 | 
			
		||||
@@ -150,46 +148,42 @@ func skipVarint(buf []byte) []byte {
 | 
			
		||||
// MarshalMessageSet encodes the extension map represented by m in the message set wire format.
 | 
			
		||||
// It is called by generated Marshal methods on protocol buffer messages with the message_set_wire_format option.
 | 
			
		||||
func MarshalMessageSet(exts interface{}) ([]byte, error) {
 | 
			
		||||
	var m map[int32]Extension
 | 
			
		||||
	return marshalMessageSet(exts, false)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// marshaMessageSet implements above function, with the opt to turn on / off deterministic during Marshal.
 | 
			
		||||
func marshalMessageSet(exts interface{}, deterministic bool) ([]byte, error) {
 | 
			
		||||
	switch exts := exts.(type) {
 | 
			
		||||
	case *XXX_InternalExtensions:
 | 
			
		||||
		if err := encodeExtensions(exts); err != nil {
 | 
			
		||||
			return nil, err
 | 
			
		||||
		}
 | 
			
		||||
		m, _ = exts.extensionsRead()
 | 
			
		||||
		var u marshalInfo
 | 
			
		||||
		siz := u.sizeMessageSet(exts)
 | 
			
		||||
		b := make([]byte, 0, siz)
 | 
			
		||||
		return u.appendMessageSet(b, exts, deterministic)
 | 
			
		||||
 | 
			
		||||
	case map[int32]Extension:
 | 
			
		||||
		if err := encodeExtensionsMap(exts); err != nil {
 | 
			
		||||
			return nil, err
 | 
			
		||||
		// This is an old-style extension map.
 | 
			
		||||
		// Wrap it in a new-style XXX_InternalExtensions.
 | 
			
		||||
		ie := XXX_InternalExtensions{
 | 
			
		||||
			p: &struct {
 | 
			
		||||
				mu           sync.Mutex
 | 
			
		||||
				extensionMap map[int32]Extension
 | 
			
		||||
			}{
 | 
			
		||||
				extensionMap: exts,
 | 
			
		||||
			},
 | 
			
		||||
		}
 | 
			
		||||
		m = exts
 | 
			
		||||
 | 
			
		||||
		var u marshalInfo
 | 
			
		||||
		siz := u.sizeMessageSet(&ie)
 | 
			
		||||
		b := make([]byte, 0, siz)
 | 
			
		||||
		return u.appendMessageSet(b, &ie, deterministic)
 | 
			
		||||
 | 
			
		||||
	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.
 | 
			
		||||
// It is called by 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
 | 
			
		||||
	switch exts := exts.(type) {
 | 
			
		||||
@@ -235,7 +229,15 @@ func MarshalMessageSetJSON(exts interface{}) ([]byte, error) {
 | 
			
		||||
	var m map[int32]Extension
 | 
			
		||||
	switch exts := exts.(type) {
 | 
			
		||||
	case *XXX_InternalExtensions:
 | 
			
		||||
		m, _ = exts.extensionsRead()
 | 
			
		||||
		var mu sync.Locker
 | 
			
		||||
		m, mu = exts.extensionsRead()
 | 
			
		||||
		if m != nil {
 | 
			
		||||
			// Keep the extensions map locked until we're done marshaling to prevent
 | 
			
		||||
			// races between marshaling and unmarshaling the lazily-{en,de}coded
 | 
			
		||||
			// values.
 | 
			
		||||
			mu.Lock()
 | 
			
		||||
			defer mu.Unlock()
 | 
			
		||||
		}
 | 
			
		||||
	case map[int32]Extension:
 | 
			
		||||
		m = exts
 | 
			
		||||
	default:
 | 
			
		||||
@@ -253,15 +255,16 @@ func MarshalMessageSetJSON(exts interface{}) ([]byte, error) {
 | 
			
		||||
 | 
			
		||||
	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
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if i > 0 && b.Len() > 1 {
 | 
			
		||||
			b.WriteByte(',')
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		fmt.Fprintf(&b, `"[%s]":`, msd.name)
 | 
			
		||||
 | 
			
		||||
		x := ext.value
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										645
									
								
								vendor/github.com/golang/protobuf/proto/pointer_reflect.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										645
									
								
								vendor/github.com/golang/protobuf/proto/pointer_reflect.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -29,7 +29,7 @@
 | 
			
		||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 | 
			
		||||
// 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
 | 
			
		||||
@@ -38,32 +38,13 @@
 | 
			
		||||
package proto
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"math"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"sync"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A structPointer is a pointer to a struct.
 | 
			
		||||
type structPointer struct {
 | 
			
		||||
	v reflect.Value
 | 
			
		||||
}
 | 
			
		||||
const unsafeAllowed = false
 | 
			
		||||
 | 
			
		||||
// toStructPointer returns a structPointer equivalent to the given reflect value.
 | 
			
		||||
// 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.
 | 
			
		||||
// A field identifies a field in a struct, accessible from a pointer.
 | 
			
		||||
// In this implementation, a field is identified by the sequence of field indices
 | 
			
		||||
// passed to reflect's FieldByIndex.
 | 
			
		||||
type field []int
 | 
			
		||||
@@ -76,409 +57,301 @@ func toField(f *reflect.StructField) field {
 | 
			
		||||
// invalidField is an invalid field identifier.
 | 
			
		||||
var invalidField = field(nil)
 | 
			
		||||
 | 
			
		||||
// zeroField is a noop when calling pointer.offset.
 | 
			
		||||
var zeroField = field([]int{})
 | 
			
		||||
 | 
			
		||||
// IsValid reports whether the field identifier is valid.
 | 
			
		||||
func (f field) IsValid() bool { return f != nil }
 | 
			
		||||
 | 
			
		||||
// field returns the given field in the struct as a reflect value.
 | 
			
		||||
func structPointer_field(p structPointer, f field) reflect.Value {
 | 
			
		||||
	// Special case: an extension map entry with a value of type T
 | 
			
		||||
	// passes a *T to the struct-handling code with a zero field,
 | 
			
		||||
	// expecting that it will be treated as equivalent to *struct{ X T },
 | 
			
		||||
	// 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 {
 | 
			
		||||
// The pointer type is for the table-driven decoder.
 | 
			
		||||
// The implementation here uses a reflect.Value of pointer type to
 | 
			
		||||
// create a generic pointer. In pointer_unsafe.go we use unsafe
 | 
			
		||||
// instead of reflect to implement the same (but faster) interface.
 | 
			
		||||
type pointer struct {
 | 
			
		||||
	v reflect.Value
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (p structPointerSlice) Len() int                  { return p.v.Len() }
 | 
			
		||||
func (p structPointerSlice) Index(i int) structPointer { return structPointer{p.v.Index(i)} }
 | 
			
		||||
func (p structPointerSlice) Append(q structPointer) {
 | 
			
		||||
	p.v.Set(reflect.Append(p.v, q.v))
 | 
			
		||||
// toPointer converts an interface of pointer type to a pointer
 | 
			
		||||
// that points to the same target.
 | 
			
		||||
func toPointer(i *Message) pointer {
 | 
			
		||||
	return pointer{v: reflect.ValueOf(*i)}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	int32Type   = reflect.TypeOf(int32(0))
 | 
			
		||||
	uint32Type  = reflect.TypeOf(uint32(0))
 | 
			
		||||
	float32Type = reflect.TypeOf(float32(0))
 | 
			
		||||
	int64Type   = reflect.TypeOf(int64(0))
 | 
			
		||||
	uint64Type  = reflect.TypeOf(uint64(0))
 | 
			
		||||
	float64Type = reflect.TypeOf(float64(0))
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// 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
 | 
			
		||||
// toAddrPointer converts an interface to a pointer that points to
 | 
			
		||||
// the interface data.
 | 
			
		||||
func toAddrPointer(i *interface{}, isptr bool) pointer {
 | 
			
		||||
	v := reflect.ValueOf(*i)
 | 
			
		||||
	u := reflect.New(v.Type())
 | 
			
		||||
	u.Elem().Set(v)
 | 
			
		||||
	return pointer{v: u}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsNil reports whether p is nil.
 | 
			
		||||
func word32_IsNil(p word32) bool {
 | 
			
		||||
// valToPointer converts v to a pointer.  v must be of pointer type.
 | 
			
		||||
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()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Set sets p to point at a newly allocated word with bits set to x.
 | 
			
		||||
func word32_Set(p word32, o *Buffer, x uint32) {
 | 
			
		||||
	t := p.v.Type().Elem()
 | 
			
		||||
	switch t {
 | 
			
		||||
	case int32Type:
 | 
			
		||||
		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()
 | 
			
		||||
// grow updates the slice s in place to make it one element longer.
 | 
			
		||||
// s must be addressable.
 | 
			
		||||
// Returns the (addressable) new element.
 | 
			
		||||
func grow(s reflect.Value) reflect.Value {
 | 
			
		||||
	n, m := s.Len(), s.Cap()
 | 
			
		||||
	if n < m {
 | 
			
		||||
		p.v.SetLen(n + 1)
 | 
			
		||||
		s.SetLen(n + 1)
 | 
			
		||||
	} else {
 | 
			
		||||
		t := p.v.Type().Elem()
 | 
			
		||||
		p.v.Set(reflect.Append(p.v, reflect.Zero(t)))
 | 
			
		||||
		s.Set(reflect.Append(s, reflect.Zero(s.Type().Elem())))
 | 
			
		||||
	}
 | 
			
		||||
	elem := p.v.Index(n)
 | 
			
		||||
	switch elem.Kind() {
 | 
			
		||||
	case reflect.Int32:
 | 
			
		||||
		elem.SetInt(int64(int32(x)))
 | 
			
		||||
	case reflect.Uint32:
 | 
			
		||||
		elem.SetUint(uint64(x))
 | 
			
		||||
	case reflect.Float32:
 | 
			
		||||
		elem.SetFloat(float64(math.Float32frombits(x)))
 | 
			
		||||
	return s.Index(n)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (p pointer) toInt64() *int64 {
 | 
			
		||||
	return p.v.Interface().(*int64)
 | 
			
		||||
}
 | 
			
		||||
func (p pointer) toInt64Ptr() **int64 {
 | 
			
		||||
	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 {
 | 
			
		||||
	return p.v.Len()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (p word32Slice) Index(i int) uint32 {
 | 
			
		||||
	elem := p.v.Index(i)
 | 
			
		||||
	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()))
 | 
			
		||||
// getInt32Slice copies []int32 from p as a new slice.
 | 
			
		||||
// 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)) {
 | 
			
		||||
		// raw int32 type
 | 
			
		||||
		return p.v.Elem().Interface().([]int32)
 | 
			
		||||
	}
 | 
			
		||||
	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.
 | 
			
		||||
func structPointer_Word32Slice(p structPointer, f field) word32Slice {
 | 
			
		||||
	return word32Slice{structPointer_field(p, f)}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// word64 is like word32 but for 64-bit values.
 | 
			
		||||
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:]
 | 
			
		||||
// setInt32Slice copies []int32 into p as a new slice.
 | 
			
		||||
// This behavior differs from the implementation in pointer_unsafe.go.
 | 
			
		||||
func (p pointer) setInt32Slice(v []int32) {
 | 
			
		||||
	if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) {
 | 
			
		||||
		// raw int32 type
 | 
			
		||||
		p.v.Elem().Set(reflect.ValueOf(v))
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	panic("unreachable")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func word64_IsNil(p word64) bool {
 | 
			
		||||
	return p.v.IsNil()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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())
 | 
			
		||||
	// an enum
 | 
			
		||||
	// Allocate a []enum, then assign []int32's values into it.
 | 
			
		||||
	// Note: we can't convert []enum to []int32.
 | 
			
		||||
	slice := reflect.MakeSlice(p.v.Type().Elem(), len(v), cap(v))
 | 
			
		||||
	for i, x := range v {
 | 
			
		||||
		slice.Index(i).SetInt(int64(x))
 | 
			
		||||
	}
 | 
			
		||||
	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 {
 | 
			
		||||
	return word64{structPointer_field(p, f)}
 | 
			
		||||
func (p pointer) toUint64() *uint64 {
 | 
			
		||||
	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.
 | 
			
		||||
type word64Val struct {
 | 
			
		||||
	v reflect.Value
 | 
			
		||||
// getPointerSlice copies []*T from p as a new []pointer.
 | 
			
		||||
// This behavior differs from the implementation in pointer_unsafe.go.
 | 
			
		||||
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) {
 | 
			
		||||
	switch p.v.Type() {
 | 
			
		||||
	case int64Type:
 | 
			
		||||
		p.v.SetInt(int64(x))
 | 
			
		||||
		return
 | 
			
		||||
	case uint64Type:
 | 
			
		||||
		p.v.SetUint(x)
 | 
			
		||||
		return
 | 
			
		||||
	case float64Type:
 | 
			
		||||
		p.v.SetFloat(math.Float64frombits(x))
 | 
			
		||||
// setPointerSlice copies []pointer into p as a new []*T.
 | 
			
		||||
// This behavior differs from the implementation in pointer_unsafe.go.
 | 
			
		||||
func (p pointer) setPointerSlice(v []pointer) {
 | 
			
		||||
	if v == nil {
 | 
			
		||||
		p.v.Elem().Set(reflect.New(p.v.Elem().Type()).Elem())
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	panic("unreachable")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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())
 | 
			
		||||
	s := reflect.MakeSlice(p.v.Elem().Type(), 0, len(v))
 | 
			
		||||
	for _, p := range v {
 | 
			
		||||
		s = reflect.Append(s, p.v)
 | 
			
		||||
	}
 | 
			
		||||
	panic("unreachable")
 | 
			
		||||
	p.v.Elem().Set(s)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func structPointer_Word64Val(p structPointer, f field) word64Val {
 | 
			
		||||
	return word64Val{structPointer_field(p, f)}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type word64Slice struct {
 | 
			
		||||
	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)))
 | 
			
		||||
// getInterfacePointer returns a pointer that points to the
 | 
			
		||||
// interface data of the interface pointed by p.
 | 
			
		||||
func (p pointer) getInterfacePointer() pointer {
 | 
			
		||||
	if p.v.Elem().IsNil() {
 | 
			
		||||
		return pointer{v: p.v.Elem()}
 | 
			
		||||
	}
 | 
			
		||||
	return pointer{v: p.v.Elem().Elem().Elem().Field(0).Addr()} // *interface -> interface -> *struct -> struct
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (p word64Slice) Len() int {
 | 
			
		||||
	return p.v.Len()
 | 
			
		||||
func (p pointer) asPointerTo(t reflect.Type) reflect.Value {
 | 
			
		||||
	// TODO: check that p.v.Type().Elem() == t?
 | 
			
		||||
	return p.v
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (p word64Slice) Index(i int) uint64 {
 | 
			
		||||
	elem := p.v.Index(i)
 | 
			
		||||
	switch elem.Kind() {
 | 
			
		||||
	case reflect.Int64:
 | 
			
		||||
		return uint64(elem.Int())
 | 
			
		||||
	case reflect.Uint64:
 | 
			
		||||
		return uint64(elem.Uint())
 | 
			
		||||
	case reflect.Float64:
 | 
			
		||||
		return math.Float64bits(float64(elem.Float()))
 | 
			
		||||
	}
 | 
			
		||||
	panic("unreachable")
 | 
			
		||||
func atomicLoadUnmarshalInfo(p **unmarshalInfo) *unmarshalInfo {
 | 
			
		||||
	atomicLock.Lock()
 | 
			
		||||
	defer atomicLock.Unlock()
 | 
			
		||||
	return *p
 | 
			
		||||
}
 | 
			
		||||
func atomicStoreUnmarshalInfo(p **unmarshalInfo, v *unmarshalInfo) {
 | 
			
		||||
	atomicLock.Lock()
 | 
			
		||||
	defer atomicLock.Unlock()
 | 
			
		||||
	*p = v
 | 
			
		||||
}
 | 
			
		||||
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 {
 | 
			
		||||
	return word64Slice{structPointer_field(p, f)}
 | 
			
		||||
}
 | 
			
		||||
var atomicLock sync.Mutex
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										402
									
								
								vendor/github.com/golang/protobuf/proto/pointer_unsafe.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										402
									
								
								vendor/github.com/golang/protobuf/proto/pointer_unsafe.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -29,7 +29,7 @@
 | 
			
		||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 | 
			
		||||
// 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.
 | 
			
		||||
 | 
			
		||||
@@ -37,38 +37,13 @@ package proto
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"sync/atomic"
 | 
			
		||||
	"unsafe"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// NOTE: These type_Foo functions would more idiomatically be methods,
 | 
			
		||||
// 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.
 | 
			
		||||
const unsafeAllowed = true
 | 
			
		||||
 | 
			
		||||
// A structPointer is a pointer to a struct.
 | 
			
		||||
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.
 | 
			
		||||
// A field identifies a field in a struct, accessible from a pointer.
 | 
			
		||||
// In this implementation, a field is identified by its byte offset from the start of the struct.
 | 
			
		||||
type field uintptr
 | 
			
		||||
 | 
			
		||||
@@ -80,191 +55,254 @@ func toField(f *reflect.StructField) field {
 | 
			
		||||
// invalidField is an invalid field identifier.
 | 
			
		||||
const invalidField = ^field(0)
 | 
			
		||||
 | 
			
		||||
// zeroField is a noop when calling pointer.offset.
 | 
			
		||||
const zeroField = field(0)
 | 
			
		||||
 | 
			
		||||
// IsValid reports whether the field identifier is valid.
 | 
			
		||||
func (f field) IsValid() bool {
 | 
			
		||||
	return f != ^field(0)
 | 
			
		||||
	return f != invalidField
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Bytes returns the address of a []byte field in the struct.
 | 
			
		||||
func structPointer_Bytes(p structPointer, f field) *[]byte {
 | 
			
		||||
	return (*[]byte)(unsafe.Pointer(uintptr(p) + uintptr(f)))
 | 
			
		||||
// The pointer type below is for the new table-driven encoder/decoder.
 | 
			
		||||
// The implementation here uses unsafe.Pointer to create a generic pointer.
 | 
			
		||||
// 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.
 | 
			
		||||
func structPointer_BytesSlice(p structPointer, f field) *[][]byte {
 | 
			
		||||
	return (*[][]byte)(unsafe.Pointer(uintptr(p) + uintptr(f)))
 | 
			
		||||
// size of pointer
 | 
			
		||||
var ptrSize = unsafe.Sizeof(uintptr(0))
 | 
			
		||||
 | 
			
		||||
// 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.
 | 
			
		||||
func structPointer_Bool(p structPointer, f field) **bool {
 | 
			
		||||
	return (**bool)(unsafe.Pointer(uintptr(p) + uintptr(f)))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// BoolVal returns the address of a bool field in the struct.
 | 
			
		||||
func structPointer_BoolVal(p structPointer, f field) *bool {
 | 
			
		||||
	return (*bool)(unsafe.Pointer(uintptr(p) + uintptr(f)))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 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)
 | 
			
		||||
// toAddrPointer converts an interface to a pointer that points to
 | 
			
		||||
// the interface data.
 | 
			
		||||
func toAddrPointer(i *interface{}, isptr bool) pointer {
 | 
			
		||||
	// Super-tricky - read or get the address of data word of interface value.
 | 
			
		||||
	if isptr {
 | 
			
		||||
		// The interface is of pointer type, thus it is a direct interface.
 | 
			
		||||
		// The data word is the pointer data itself. We take its address.
 | 
			
		||||
		return pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)}
 | 
			
		||||
	}
 | 
			
		||||
	o.uint32s[0] = x
 | 
			
		||||
	*p = &o.uint32s[0]
 | 
			
		||||
	o.uint32s = o.uint32s[1:]
 | 
			
		||||
	// The interface is not of pointer type. The data word is the pointer
 | 
			
		||||
	// to the data.
 | 
			
		||||
	return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Get gets the value pointed at by *v.
 | 
			
		||||
func word32_Get(p word32) uint32 {
 | 
			
		||||
	return **p
 | 
			
		||||
// valToPointer converts v to a pointer. v must be of pointer type.
 | 
			
		||||
func valToPointer(v reflect.Value) pointer {
 | 
			
		||||
	return pointer{p: unsafe.Pointer(v.Pointer())}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Word32 returns the address of a *int32, *uint32, *float32, or *enum field in the struct.
 | 
			
		||||
func structPointer_Word32(p structPointer, f field) word32 {
 | 
			
		||||
	return word32((**uint32)(unsafe.Pointer(uintptr(p) + uintptr(f))))
 | 
			
		||||
// offset converts from a pointer to a structure to a pointer to
 | 
			
		||||
// one of its fields.
 | 
			
		||||
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.
 | 
			
		||||
type word32Val *uint32
 | 
			
		||||
 | 
			
		||||
// Set sets *p to x.
 | 
			
		||||
func word32Val_Set(p word32Val, x uint32) {
 | 
			
		||||
	*p = x
 | 
			
		||||
func (p pointer) isNil() bool {
 | 
			
		||||
	return p.p == nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Get gets the value pointed at by p.
 | 
			
		||||
func word32Val_Get(p word32Val) uint32 {
 | 
			
		||||
	return *p
 | 
			
		||||
func (p pointer) toInt64() *int64 {
 | 
			
		||||
	return (*int64)(p.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.
 | 
			
		||||
func structPointer_Word32Val(p structPointer, f field) word32Val {
 | 
			
		||||
	return word32Val((*uint32)(unsafe.Pointer(uintptr(p) + uintptr(f))))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 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)
 | 
			
		||||
// See pointer_reflect.go for why toInt32Ptr/Slice doesn't exist.
 | 
			
		||||
/*
 | 
			
		||||
	func (p pointer) toInt32Ptr() **int32 {
 | 
			
		||||
		return (**int32)(p.p)
 | 
			
		||||
	}
 | 
			
		||||
	o.uint64s[0] = x
 | 
			
		||||
	*p = &o.uint64s[0]
 | 
			
		||||
	o.uint64s = o.uint64s[1:]
 | 
			
		||||
	func (p pointer) toInt32Slice() *[]int32 {
 | 
			
		||||
		return (*[]int32)(p.p)
 | 
			
		||||
	}
 | 
			
		||||
*/
 | 
			
		||||
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 {
 | 
			
		||||
	return *p == nil
 | 
			
		||||
// getInt32Slice loads a []int32 from p.
 | 
			
		||||
// 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 {
 | 
			
		||||
	return **p
 | 
			
		||||
// setInt32Slice stores a []int32 to 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 {
 | 
			
		||||
	return word64((**uint64)(unsafe.Pointer(uintptr(p) + uintptr(f))))
 | 
			
		||||
// TODO: Can we get rid of appendInt32Slice and use setInt32Slice instead?
 | 
			
		||||
func (p pointer) appendInt32Slice(v int32) {
 | 
			
		||||
	s := (*[]int32)(p.p)
 | 
			
		||||
	*s = append(*s, v)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// word64Val is like word32Val but for 64-bit values.
 | 
			
		||||
type word64Val *uint64
 | 
			
		||||
 | 
			
		||||
func word64Val_Set(p word64Val, o *Buffer, x uint64) {
 | 
			
		||||
	*p = x
 | 
			
		||||
func (p pointer) toUint64() *uint64 {
 | 
			
		||||
	return (*uint64)(p.p)
 | 
			
		||||
}
 | 
			
		||||
func (p pointer) toUint64Ptr() **uint64 {
 | 
			
		||||
	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 {
 | 
			
		||||
	return *p
 | 
			
		||||
// getPointerSlice loads []*T from p as a []pointer.
 | 
			
		||||
// 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 {
 | 
			
		||||
	return word64Val((*uint64)(unsafe.Pointer(uintptr(p) + uintptr(f))))
 | 
			
		||||
// setPointerSlice stores []pointer into p as a []*T.
 | 
			
		||||
// 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.
 | 
			
		||||
type word64Slice []uint64
 | 
			
		||||
 | 
			
		||||
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] }
 | 
			
		||||
 | 
			
		||||
func structPointer_Word64Slice(p structPointer, f field) *word64Slice {
 | 
			
		||||
	return (*word64Slice)(unsafe.Pointer(uintptr(p) + uintptr(f)))
 | 
			
		||||
// getPointer loads the pointer at p and returns it.
 | 
			
		||||
func (p pointer) getPointer() pointer {
 | 
			
		||||
	return pointer{p: *(*unsafe.Pointer)(p.p)}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// setPointer stores the pointer q at p.
 | 
			
		||||
func (p pointer) setPointer(q pointer) {
 | 
			
		||||
	*(*unsafe.Pointer)(p.p) = q.p
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 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))
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										422
									
								
								vendor/github.com/golang/protobuf/proto/properties.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										422
									
								
								vendor/github.com/golang/protobuf/proto/properties.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -58,42 +58,6 @@ const (
 | 
			
		||||
	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
 | 
			
		||||
// use-cases. Encoded protocol buffers are often in tag order with small tag
 | 
			
		||||
// numbers.
 | 
			
		||||
@@ -140,13 +104,6 @@ type StructProperties struct {
 | 
			
		||||
	decoderTags      tagMap         // map from proto tag 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
 | 
			
		||||
	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.
 | 
			
		||||
	// It is keyed by the original name of a field.
 | 
			
		||||
@@ -187,36 +144,19 @@ type Properties struct {
 | 
			
		||||
 | 
			
		||||
	Default    string // default value
 | 
			
		||||
	HasDefault bool   // whether an explicit default was provided
 | 
			
		||||
	def_uint64 uint64
 | 
			
		||||
 | 
			
		||||
	enc           encoder
 | 
			
		||||
	valEnc        valueEncoder // set for bool and numeric types only
 | 
			
		||||
	field         field
 | 
			
		||||
	tagcode       []byte // encoding of EncodeVarint((Tag<<3)|WireType)
 | 
			
		||||
	tagbuf        [8]byte
 | 
			
		||||
	stype         reflect.Type      // set for struct types only
 | 
			
		||||
	sprop         *StructProperties // set for struct types only
 | 
			
		||||
	isMarshaler   bool
 | 
			
		||||
	isUnmarshaler bool
 | 
			
		||||
	stype reflect.Type      // set for struct types only
 | 
			
		||||
	sprop *StructProperties // set for struct types only
 | 
			
		||||
 | 
			
		||||
	mtype    reflect.Type // set for map types only
 | 
			
		||||
	mkeyprop *Properties  // set for map types only
 | 
			
		||||
	mvalprop *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.
 | 
			
		||||
func (p *Properties) String() string {
 | 
			
		||||
	s := p.Wire
 | 
			
		||||
	s = ","
 | 
			
		||||
	s += ","
 | 
			
		||||
	s += strconv.Itoa(p.Tag)
 | 
			
		||||
	if p.Required {
 | 
			
		||||
		s += ",req"
 | 
			
		||||
@@ -262,29 +202,14 @@ func (p *Properties) Parse(s string) {
 | 
			
		||||
	switch p.Wire {
 | 
			
		||||
	case "varint":
 | 
			
		||||
		p.WireType = WireVarint
 | 
			
		||||
		p.valEnc = (*Buffer).EncodeVarint
 | 
			
		||||
		p.valDec = (*Buffer).DecodeVarint
 | 
			
		||||
		p.valSize = sizeVarint
 | 
			
		||||
	case "fixed32":
 | 
			
		||||
		p.WireType = WireFixed32
 | 
			
		||||
		p.valEnc = (*Buffer).EncodeFixed32
 | 
			
		||||
		p.valDec = (*Buffer).DecodeFixed32
 | 
			
		||||
		p.valSize = sizeFixed32
 | 
			
		||||
	case "fixed64":
 | 
			
		||||
		p.WireType = WireFixed64
 | 
			
		||||
		p.valEnc = (*Buffer).EncodeFixed64
 | 
			
		||||
		p.valDec = (*Buffer).DecodeFixed64
 | 
			
		||||
		p.valSize = sizeFixed64
 | 
			
		||||
	case "zigzag32":
 | 
			
		||||
		p.WireType = WireVarint
 | 
			
		||||
		p.valEnc = (*Buffer).EncodeZigzag32
 | 
			
		||||
		p.valDec = (*Buffer).DecodeZigzag32
 | 
			
		||||
		p.valSize = sizeZigzag32
 | 
			
		||||
	case "zigzag64":
 | 
			
		||||
		p.WireType = WireVarint
 | 
			
		||||
		p.valEnc = (*Buffer).EncodeZigzag64
 | 
			
		||||
		p.valDec = (*Buffer).DecodeZigzag64
 | 
			
		||||
		p.valSize = sizeZigzag64
 | 
			
		||||
	case "bytes", "group":
 | 
			
		||||
		p.WireType = WireBytes
 | 
			
		||||
		// no numeric converter for non-numeric types
 | 
			
		||||
@@ -299,6 +224,7 @@ func (p *Properties) Parse(s string) {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
outer:
 | 
			
		||||
	for i := 2; i < len(fields); i++ {
 | 
			
		||||
		f := fields[i]
 | 
			
		||||
		switch {
 | 
			
		||||
@@ -326,229 +252,28 @@ func (p *Properties) Parse(s string) {
 | 
			
		||||
			if i+1 < len(fields) {
 | 
			
		||||
				// Commas aren't escaped, and def is always last.
 | 
			
		||||
				p.Default += "," + strings.Join(fields[i+1:], ",")
 | 
			
		||||
				break
 | 
			
		||||
				break outer
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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()
 | 
			
		||||
 | 
			
		||||
// Initialize the fields for encoding and decoding.
 | 
			
		||||
func (p *Properties) setEncAndDec(typ reflect.Type, f *reflect.StructField, lockGetProp bool) {
 | 
			
		||||
	p.enc = nil
 | 
			
		||||
	p.dec = nil
 | 
			
		||||
	p.size = nil
 | 
			
		||||
 | 
			
		||||
// setFieldProps initializes the field properties for submessages and maps.
 | 
			
		||||
func (p *Properties) setFieldProps(typ reflect.Type, f *reflect.StructField, lockGetProp bool) {
 | 
			
		||||
	switch t1 := typ; t1.Kind() {
 | 
			
		||||
	default:
 | 
			
		||||
		fmt.Fprintf(os.Stderr, "proto: no coders for %v\n", t1)
 | 
			
		||||
 | 
			
		||||
	// proto3 scalar types
 | 
			
		||||
 | 
			
		||||
	case reflect.Bool:
 | 
			
		||||
		p.enc = (*Buffer).enc_proto3_bool
 | 
			
		||||
		p.dec = (*Buffer).dec_proto3_bool
 | 
			
		||||
		p.size = size_proto3_bool
 | 
			
		||||
	case reflect.Int32:
 | 
			
		||||
		p.enc = (*Buffer).enc_proto3_int32
 | 
			
		||||
		p.dec = (*Buffer).dec_proto3_int32
 | 
			
		||||
		p.size = size_proto3_int32
 | 
			
		||||
	case reflect.Uint32:
 | 
			
		||||
		p.enc = (*Buffer).enc_proto3_uint32
 | 
			
		||||
		p.dec = (*Buffer).dec_proto3_int32 // can reuse
 | 
			
		||||
		p.size = size_proto3_uint32
 | 
			
		||||
	case reflect.Int64, reflect.Uint64:
 | 
			
		||||
		p.enc = (*Buffer).enc_proto3_int64
 | 
			
		||||
		p.dec = (*Buffer).dec_proto3_int64
 | 
			
		||||
		p.size = size_proto3_int64
 | 
			
		||||
	case reflect.Float32:
 | 
			
		||||
		p.enc = (*Buffer).enc_proto3_uint32 // can just treat them as bits
 | 
			
		||||
		p.dec = (*Buffer).dec_proto3_int32
 | 
			
		||||
		p.size = size_proto3_uint32
 | 
			
		||||
	case reflect.Float64:
 | 
			
		||||
		p.enc = (*Buffer).enc_proto3_int64 // can just treat them as bits
 | 
			
		||||
		p.dec = (*Buffer).dec_proto3_int64
 | 
			
		||||
		p.size = size_proto3_int64
 | 
			
		||||
	case reflect.String:
 | 
			
		||||
		p.enc = (*Buffer).enc_proto3_string
 | 
			
		||||
		p.dec = (*Buffer).dec_proto3_string
 | 
			
		||||
		p.size = size_proto3_string
 | 
			
		||||
 | 
			
		||||
	case reflect.Ptr:
 | 
			
		||||
		switch t2 := t1.Elem(); t2.Kind() {
 | 
			
		||||
		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:
 | 
			
		||||
		if t1.Elem().Kind() == reflect.Struct {
 | 
			
		||||
			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:
 | 
			
		||||
		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:
 | 
			
		||||
			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:
 | 
			
		||||
				p.stype = t2.Elem()
 | 
			
		||||
				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
 | 
			
		||||
			}
 | 
			
		||||
		if t2 := t1.Elem(); t2.Kind() == reflect.Ptr && t2.Elem().Kind() == reflect.Struct {
 | 
			
		||||
			p.stype = t2.Elem()
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	case reflect.Map:
 | 
			
		||||
		p.enc = (*Buffer).enc_new_map
 | 
			
		||||
		p.dec = (*Buffer).dec_new_map
 | 
			
		||||
		p.size = size_new_map
 | 
			
		||||
 | 
			
		||||
		p.mtype = t1
 | 
			
		||||
		p.mkeyprop = &Properties{}
 | 
			
		||||
		p.mkeyprop.init(reflect.PtrTo(p.mtype.Key()), "Key", f.Tag.Get("protobuf_key"), nil, lockGetProp)
 | 
			
		||||
@@ -562,20 +287,6 @@ func (p *Properties) setEncAndDec(typ reflect.Type, f *reflect.StructField, lock
 | 
			
		||||
		p.mvalprop.init(vtype, "Value", f.Tag.Get("protobuf_val"), nil, lockGetProp)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// 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 lockGetProp {
 | 
			
		||||
			p.sprop = GetProperties(p.stype)
 | 
			
		||||
@@ -586,32 +297,9 @@ func (p *Properties) setEncAndDec(typ reflect.Type, f *reflect.StructField, lock
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	marshalerType   = reflect.TypeOf((*Marshaler)(nil)).Elem()
 | 
			
		||||
	unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem()
 | 
			
		||||
	marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem()
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// isMarshaler reports whether type t implements Marshaler.
 | 
			
		||||
func isMarshaler(t reflect.Type) bool {
 | 
			
		||||
	// We're checking for (likely) pointer-receiver methods
 | 
			
		||||
	// so if t is not a pointer, something is very wrong.
 | 
			
		||||
	// The calls above only invoke isMarshaler on pointer types.
 | 
			
		||||
	if t.Kind() != reflect.Ptr {
 | 
			
		||||
		panic("proto: misuse of isMarshaler")
 | 
			
		||||
	}
 | 
			
		||||
	return t.Implements(marshalerType)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// isUnmarshaler reports whether type t implements Unmarshaler.
 | 
			
		||||
func isUnmarshaler(t reflect.Type) bool {
 | 
			
		||||
	// We're checking for (likely) pointer-receiver methods
 | 
			
		||||
	// so if t is not a pointer, something is very wrong.
 | 
			
		||||
	// The calls above only invoke isUnmarshaler on pointer types.
 | 
			
		||||
	if t.Kind() != reflect.Ptr {
 | 
			
		||||
		panic("proto: misuse of isUnmarshaler")
 | 
			
		||||
	}
 | 
			
		||||
	return t.Implements(unmarshalerType)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Init populates the properties from a protocol buffer struct tag.
 | 
			
		||||
func (p *Properties) Init(typ reflect.Type, name, tag string, f *reflect.StructField) {
 | 
			
		||||
	p.init(typ, name, tag, f, true)
 | 
			
		||||
@@ -621,14 +309,11 @@ func (p *Properties) init(typ reflect.Type, name, tag string, f *reflect.StructF
 | 
			
		||||
	// "bytes,49,opt,def=hello!"
 | 
			
		||||
	p.Name = name
 | 
			
		||||
	p.OrigName = name
 | 
			
		||||
	if f != nil {
 | 
			
		||||
		p.field = toField(f)
 | 
			
		||||
	}
 | 
			
		||||
	if tag == "" {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	p.Parse(tag)
 | 
			
		||||
	p.setEncAndDec(typ, f, lockGetProp)
 | 
			
		||||
	p.setFieldProps(typ, f, lockGetProp)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
@@ -678,9 +363,6 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
 | 
			
		||||
	propertiesMap[t] = prop
 | 
			
		||||
 | 
			
		||||
	// build properties
 | 
			
		||||
	prop.extendable = reflect.PtrTo(t).Implements(extendableProtoType) ||
 | 
			
		||||
		reflect.PtrTo(t).Implements(extendableProtoV1Type)
 | 
			
		||||
	prop.unrecField = invalidField
 | 
			
		||||
	prop.Prop = make([]*Properties, t.NumField())
 | 
			
		||||
	prop.order = make([]int, t.NumField())
 | 
			
		||||
 | 
			
		||||
@@ -690,17 +372,6 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
 | 
			
		||||
		name := f.Name
 | 
			
		||||
		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
 | 
			
		||||
			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
 | 
			
		||||
		if oneof != "" {
 | 
			
		||||
			// Oneof fields don't use the traditional protobuf tag.
 | 
			
		||||
@@ -715,9 +386,6 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
 | 
			
		||||
			}
 | 
			
		||||
			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.
 | 
			
		||||
@@ -728,8 +396,7 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
 | 
			
		||||
	}
 | 
			
		||||
	if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok {
 | 
			
		||||
		var oots []interface{}
 | 
			
		||||
		prop.oneofMarshaler, prop.oneofUnmarshaler, prop.oneofSizer, oots = om.XXX_OneofFuncs()
 | 
			
		||||
		prop.stype = t
 | 
			
		||||
		_, _, _, oots = om.XXX_OneofFuncs()
 | 
			
		||||
 | 
			
		||||
		// Interpret oneof metadata.
 | 
			
		||||
		prop.OneofTypes = make(map[string]*OneofProperties)
 | 
			
		||||
@@ -779,30 +446,6 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
 | 
			
		||||
	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.
 | 
			
		||||
// The generated code will register the generated maps by calling RegisterEnum.
 | 
			
		||||
 | 
			
		||||
@@ -826,20 +469,42 @@ func EnumValueMap(enumType string) map[string]int32 {
 | 
			
		||||
// A registry of all linked message types.
 | 
			
		||||
// The string is a fully-qualified proto name ("pkg.Message").
 | 
			
		||||
var (
 | 
			
		||||
	protoTypes    = make(map[string]reflect.Type)
 | 
			
		||||
	revProtoTypes = make(map[reflect.Type]string)
 | 
			
		||||
	protoTypedNils = make(map[string]Message)      // a map from proto names to typed nil pointers
 | 
			
		||||
	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
 | 
			
		||||
// proto name to the type (pointer to struct) of the protocol buffer.
 | 
			
		||||
func RegisterType(x Message, name string) {
 | 
			
		||||
	if _, ok := protoTypes[name]; ok {
 | 
			
		||||
	if _, ok := protoTypedNils[name]; ok {
 | 
			
		||||
		// TODO: Some day, make this a panic.
 | 
			
		||||
		log.Printf("proto: duplicate proto type registered: %s", name)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -855,7 +520,14 @@ func MessageName(x Message) string {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 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.
 | 
			
		||||
var (
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2681
									
								
								vendor/github.com/golang/protobuf/proto/table_marshal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2681
									
								
								vendor/github.com/golang/protobuf/proto/table_marshal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										654
									
								
								vendor/github.com/golang/protobuf/proto/table_merge.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										654
									
								
								vendor/github.com/golang/protobuf/proto/table_merge.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,654 @@
 | 
			
		||||
// 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:
 | 
			
		||||
				panic(fmt.Sprintf("message field %s without pointer", tf))
 | 
			
		||||
			case isSlice: // E.g., []*pb.T
 | 
			
		||||
				mi := 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))
 | 
			
		||||
								mi.merge(dp, sp)
 | 
			
		||||
							}
 | 
			
		||||
							dps = append(dps, dp)
 | 
			
		||||
						}
 | 
			
		||||
						if dps == nil {
 | 
			
		||||
							dps = []pointer{}
 | 
			
		||||
						}
 | 
			
		||||
						dst.setPointerSlice(dps)
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			default: // E.g., *pb.T
 | 
			
		||||
				mi := 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)
 | 
			
		||||
						}
 | 
			
		||||
						mi.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)
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1967
									
								
								vendor/github.com/golang/protobuf/proto/table_unmarshal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1967
									
								
								vendor/github.com/golang/protobuf/proto/table_unmarshal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										61
									
								
								vendor/github.com/golang/protobuf/proto/text.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										61
									
								
								vendor/github.com/golang/protobuf/proto/text.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -50,7 +50,6 @@ import (
 | 
			
		||||
var (
 | 
			
		||||
	newline         = []byte("\n")
 | 
			
		||||
	spaces          = []byte("                                        ")
 | 
			
		||||
	gtNewline       = []byte(">\n")
 | 
			
		||||
	endBraceNewline = []byte("}\n")
 | 
			
		||||
	backslashN      = []byte{'\\', 'n'}
 | 
			
		||||
	backslashR      = []byte{'\\', 'r'}
 | 
			
		||||
@@ -170,11 +169,6 @@ func writeName(w *textWriter, props *Properties) error {
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// raw is the interface satisfied by RawMessage.
 | 
			
		||||
type raw interface {
 | 
			
		||||
	Bytes() []byte
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func requiresQuotes(u string) bool {
 | 
			
		||||
	// When type URL contains any characters except [0-9A-Za-z./\-]*, it must be quoted.
 | 
			
		||||
	for _, ch := range u {
 | 
			
		||||
@@ -269,6 +263,10 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
 | 
			
		||||
		props := sprops.Prop[i]
 | 
			
		||||
		name := st.Field(i).Name
 | 
			
		||||
 | 
			
		||||
		if name == "XXX_NoUnkeyedLiteral" {
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if strings.HasPrefix(name, "XXX_") {
 | 
			
		||||
			// There are two XXX_ fields:
 | 
			
		||||
			//   XXX_unrecognized []byte
 | 
			
		||||
@@ -436,12 +434,6 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
 | 
			
		||||
				return err
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		if b, ok := fv.Interface().(raw); ok {
 | 
			
		||||
			if err := writeRaw(w, b.Bytes()); err != nil {
 | 
			
		||||
				return err
 | 
			
		||||
			}
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// Enums have a String method, so writeAny will work fine.
 | 
			
		||||
		if err := tm.writeAny(w, fv, props); err != nil {
 | 
			
		||||
@@ -455,7 +447,7 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
 | 
			
		||||
 | 
			
		||||
	// Extensions (the XXX_extensions field).
 | 
			
		||||
	pv := sv.Addr()
 | 
			
		||||
	if _, ok := extendable(pv.Interface()); ok {
 | 
			
		||||
	if _, err := extendable(pv.Interface()); err == nil {
 | 
			
		||||
		if err := tm.writeExtensions(w, pv); err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
@@ -464,27 +456,6 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
 | 
			
		||||
	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.
 | 
			
		||||
func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error {
 | 
			
		||||
	v = reflect.Indirect(v)
 | 
			
		||||
@@ -535,6 +506,19 @@ func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Propert
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		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 {
 | 
			
		||||
			text, err := etm.MarshalText()
 | 
			
		||||
			if err != nil {
 | 
			
		||||
@@ -543,8 +527,13 @@ func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Propert
 | 
			
		||||
			if _, err = w.Write(text); err != nil {
 | 
			
		||||
				return err
 | 
			
		||||
			}
 | 
			
		||||
		} else if err := tm.writeStruct(w, v); err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		} else {
 | 
			
		||||
			if v.Kind() == reflect.Ptr {
 | 
			
		||||
				v = v.Elem()
 | 
			
		||||
			}
 | 
			
		||||
			if err := tm.writeStruct(w, v); err != nil {
 | 
			
		||||
				return err
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		w.unindent()
 | 
			
		||||
		if err := w.WriteByte(ket); err != nil {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										77
									
								
								vendor/github.com/golang/protobuf/proto/text_parser.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										77
									
								
								vendor/github.com/golang/protobuf/proto/text_parser.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -206,7 +206,6 @@ func (p *textParser) advance() {
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	errBadUTF8 = errors.New("proto: bad UTF-8")
 | 
			
		||||
	errBadHex  = errors.New("proto: bad hexadecimal")
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func unquoteC(s string, quote rune) (string, error) {
 | 
			
		||||
@@ -277,60 +276,47 @@ func unescape(s string) (ch string, tail string, err error) {
 | 
			
		||||
		return "?", s, nil // trigraph workaround
 | 
			
		||||
	case '\'', '"', '\\':
 | 
			
		||||
		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 {
 | 
			
		||||
			return "", "", fmt.Errorf(`\%c requires 2 following digits`, r)
 | 
			
		||||
		}
 | 
			
		||||
		base := 8
 | 
			
		||||
		ss := s[:2]
 | 
			
		||||
		ss := string(r) + s[:2]
 | 
			
		||||
		s = s[2:]
 | 
			
		||||
		if r == 'x' || r == 'X' {
 | 
			
		||||
			base = 16
 | 
			
		||||
		} else {
 | 
			
		||||
			ss = string(r) + ss
 | 
			
		||||
		}
 | 
			
		||||
		i, err := strconv.ParseUint(ss, base, 8)
 | 
			
		||||
		i, err := strconv.ParseUint(ss, 8, 8)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return "", "", err
 | 
			
		||||
			return "", "", fmt.Errorf(`\%s contains non-octal digits`, ss)
 | 
			
		||||
		}
 | 
			
		||||
		return string([]byte{byte(i)}), s, nil
 | 
			
		||||
	case 'u', 'U':
 | 
			
		||||
		n := 4
 | 
			
		||||
		if r == 'U' {
 | 
			
		||||
	case 'x', 'X', 'u', 'U':
 | 
			
		||||
		var n int
 | 
			
		||||
		switch r {
 | 
			
		||||
		case 'x', 'X':
 | 
			
		||||
			n = 2
 | 
			
		||||
		case 'u':
 | 
			
		||||
			n = 4
 | 
			
		||||
		case 'U':
 | 
			
		||||
			n = 8
 | 
			
		||||
		}
 | 
			
		||||
		if len(s) < n {
 | 
			
		||||
			return "", "", fmt.Errorf(`\%c requires %d 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
 | 
			
		||||
			return "", "", fmt.Errorf(`\%c requires %d following digits`, r, n)
 | 
			
		||||
		}
 | 
			
		||||
		ss := 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)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 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().
 | 
			
		||||
// It makes the next advance() a no-op.
 | 
			
		||||
func (p *textParser) back() { p.backed = true }
 | 
			
		||||
@@ -728,6 +714,9 @@ func (p *textParser) consumeExtName() (string, error) {
 | 
			
		||||
		if tok.err != nil {
 | 
			
		||||
			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
 | 
			
		||||
}
 | 
			
		||||
@@ -865,7 +854,7 @@ func (p *textParser) readAny(v reflect.Value, props *Properties) error {
 | 
			
		||||
		return p.readStruct(fv, terminator)
 | 
			
		||||
	case reflect.Uint32:
 | 
			
		||||
		if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil {
 | 
			
		||||
			fv.SetUint(x)
 | 
			
		||||
			fv.SetUint(uint64(x))
 | 
			
		||||
			return nil
 | 
			
		||||
		}
 | 
			
		||||
	case reflect.Uint64:
 | 
			
		||||
@@ -883,13 +872,9 @@ func (p *textParser) readAny(v reflect.Value, props *Properties) error {
 | 
			
		||||
// UnmarshalText returns *RequiredNotSetError.
 | 
			
		||||
func UnmarshalText(s string, pb Message) error {
 | 
			
		||||
	if um, ok := pb.(encoding.TextUnmarshaler); ok {
 | 
			
		||||
		err := um.UnmarshalText([]byte(s))
 | 
			
		||||
		return err
 | 
			
		||||
		return um.UnmarshalText([]byte(s))
 | 
			
		||||
	}
 | 
			
		||||
	pb.Reset()
 | 
			
		||||
	v := reflect.ValueOf(pb)
 | 
			
		||||
	if pe := newTextParser(s).readStruct(v.Elem(), ""); pe != nil {
 | 
			
		||||
		return pe
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
	return newTextParser(s).readStruct(v.Elem(), "")
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										37
									
								
								vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/Makefile
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										37
									
								
								vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/Makefile
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,37 +0,0 @@
 | 
			
		||||
# Go support for Protocol Buffers - Google's data interchange format
 | 
			
		||||
#
 | 
			
		||||
# Copyright 2010 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.
 | 
			
		||||
 | 
			
		||||
# Not stored here, but descriptor.proto is in https://github.com/google/protobuf/
 | 
			
		||||
# at src/google/protobuf/descriptor.proto
 | 
			
		||||
regenerate:
 | 
			
		||||
	@echo WARNING! THIS RULE IS PROBABLY NOT RIGHT FOR YOUR INSTALLATION
 | 
			
		||||
	cp $(HOME)/src/protobuf/include/google/protobuf/descriptor.proto .
 | 
			
		||||
	protoc --go_out=../../../../.. -I$(HOME)/src/protobuf/include $(HOME)/src/protobuf/include/google/protobuf/descriptor.proto
 | 
			
		||||
							
								
								
									
										1299
									
								
								vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1299
									
								
								vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										27
									
								
								vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										27
									
								
								vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.proto
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -45,6 +45,7 @@ option java_package = "com.google.protobuf";
 | 
			
		||||
option java_outer_classname = "DescriptorProtos";
 | 
			
		||||
option csharp_namespace = "Google.Protobuf.Reflection";
 | 
			
		||||
option objc_class_prefix = "GPB";
 | 
			
		||||
option cc_enable_arenas = true;
 | 
			
		||||
 | 
			
		||||
// descriptor.proto must be optimized for speed because reflection-based
 | 
			
		||||
// algorithms don't work during bootstrapping.
 | 
			
		||||
@@ -225,6 +226,26 @@ message EnumDescriptorProto {
 | 
			
		||||
  repeated EnumValueDescriptorProto value = 2;
 | 
			
		||||
 | 
			
		||||
  optional EnumOptions options = 3;
 | 
			
		||||
 | 
			
		||||
  // Range of reserved numeric values. Reserved values may not be used by
 | 
			
		||||
  // entries in the same enum. Reserved ranges may not overlap.
 | 
			
		||||
  //
 | 
			
		||||
  // Note that this is distinct from DescriptorProto.ReservedRange in that it
 | 
			
		||||
  // is inclusive such that it can appropriately represent the entire int32
 | 
			
		||||
  // domain.
 | 
			
		||||
  message EnumReservedRange {
 | 
			
		||||
    optional int32 start = 1; // Inclusive.
 | 
			
		||||
    optional int32 end = 2;   // Inclusive.
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // Range of reserved numeric values. Reserved numeric values may not be used
 | 
			
		||||
  // by enum values in the same enum declaration. Reserved ranges may not
 | 
			
		||||
  // overlap.
 | 
			
		||||
  repeated EnumReservedRange reserved_range = 4;
 | 
			
		||||
 | 
			
		||||
  // Reserved enum value names, which may not be reused. A given name may only
 | 
			
		||||
  // be reserved once.
 | 
			
		||||
  repeated string reserved_name = 5;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Describes a value within an enum.
 | 
			
		||||
@@ -396,10 +417,12 @@ message FileOptions {
 | 
			
		||||
  // determining the namespace.
 | 
			
		||||
  optional string php_namespace = 41;
 | 
			
		||||
 | 
			
		||||
  // The parser stores options it doesn't recognize here. See above.
 | 
			
		||||
  // The parser stores options it doesn't recognize here.
 | 
			
		||||
  // See the documentation for the "Options" section above.
 | 
			
		||||
  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;
 | 
			
		||||
 | 
			
		||||
  reserved 38;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								vendor/github.com/golang/protobuf/ptypes/BUILD
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								vendor/github.com/golang/protobuf/ptypes/BUILD
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -34,6 +34,7 @@ filegroup(
 | 
			
		||||
        "//vendor/github.com/golang/protobuf/ptypes/empty:all-srcs",
 | 
			
		||||
        "//vendor/github.com/golang/protobuf/ptypes/struct:all-srcs",
 | 
			
		||||
        "//vendor/github.com/golang/protobuf/ptypes/timestamp:all-srcs",
 | 
			
		||||
        "//vendor/github.com/golang/protobuf/ptypes/wrappers:all-srcs",
 | 
			
		||||
    ],
 | 
			
		||||
    tags = ["automanaged"],
 | 
			
		||||
    visibility = ["//visibility:public"],
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										47
									
								
								vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										47
									
								
								vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,15 +1,6 @@
 | 
			
		||||
// Code generated by protoc-gen-go. DO NOT EDIT.
 | 
			
		||||
// source: google/protobuf/any.proto
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
Package any is a generated protocol buffer package.
 | 
			
		||||
 | 
			
		||||
It is generated from these files:
 | 
			
		||||
	google/protobuf/any.proto
 | 
			
		||||
 | 
			
		||||
It has these top-level messages:
 | 
			
		||||
	Any
 | 
			
		||||
*/
 | 
			
		||||
package any
 | 
			
		||||
 | 
			
		||||
import proto "github.com/golang/protobuf/proto"
 | 
			
		||||
@@ -132,14 +123,36 @@ type Any struct {
 | 
			
		||||
	//
 | 
			
		||||
	TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl" json:"type_url,omitempty"`
 | 
			
		||||
	// 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) String() string            { return proto.CompactTextString(m) }
 | 
			
		||||
func (*Any) ProtoMessage()               {}
 | 
			
		||||
func (*Any) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
 | 
			
		||||
func (*Any) XXX_WellKnownType() string   { return "Any" }
 | 
			
		||||
func (m *Any) Reset()         { *m = Any{} }
 | 
			
		||||
func (m *Any) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*Any) ProtoMessage()    {}
 | 
			
		||||
func (*Any) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_any_744b9ca530f228db, []int{0}
 | 
			
		||||
}
 | 
			
		||||
func (*Any) XXX_WellKnownType() string { return "Any" }
 | 
			
		||||
func (m *Any) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_Any.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_Any.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *Any) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_Any.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *Any) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_Any.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *Any) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_Any.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_Any proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func (m *Any) GetTypeUrl() string {
 | 
			
		||||
	if m != nil {
 | 
			
		||||
@@ -159,9 +172,9 @@ func init() {
 | 
			
		||||
	proto.RegisterType((*Any)(nil), "google.protobuf.Any")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor0) }
 | 
			
		||||
func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_any_744b9ca530f228db) }
 | 
			
		||||
 | 
			
		||||
var fileDescriptor0 = []byte{
 | 
			
		||||
var fileDescriptor_any_744b9ca530f228db = []byte{
 | 
			
		||||
	// 185 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,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										49
									
								
								vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										49
									
								
								vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,15 +1,6 @@
 | 
			
		||||
// Code generated by protoc-gen-go. DO NOT EDIT.
 | 
			
		||||
// source: google/protobuf/duration.proto
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
Package duration is a generated protocol buffer package.
 | 
			
		||||
 | 
			
		||||
It is generated from these files:
 | 
			
		||||
	google/protobuf/duration.proto
 | 
			
		||||
 | 
			
		||||
It has these top-level messages:
 | 
			
		||||
	Duration
 | 
			
		||||
*/
 | 
			
		||||
package duration
 | 
			
		||||
 | 
			
		||||
import proto "github.com/golang/protobuf/proto"
 | 
			
		||||
@@ -98,14 +89,36 @@ type Duration struct {
 | 
			
		||||
	// 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
 | 
			
		||||
	// to +999,999,999 inclusive.
 | 
			
		||||
	Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
 | 
			
		||||
	Nanos                int32    `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
 | 
			
		||||
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 | 
			
		||||
	XXX_unrecognized     []byte   `json:"-"`
 | 
			
		||||
	XXX_sizecache        int32    `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *Duration) Reset()                    { *m = Duration{} }
 | 
			
		||||
func (m *Duration) String() string            { return proto.CompactTextString(m) }
 | 
			
		||||
func (*Duration) ProtoMessage()               {}
 | 
			
		||||
func (*Duration) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
 | 
			
		||||
func (*Duration) XXX_WellKnownType() string   { return "Duration" }
 | 
			
		||||
func (m *Duration) Reset()         { *m = Duration{} }
 | 
			
		||||
func (m *Duration) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*Duration) ProtoMessage()    {}
 | 
			
		||||
func (*Duration) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_duration_e7d612259e3f0613, []int{0}
 | 
			
		||||
}
 | 
			
		||||
func (*Duration) XXX_WellKnownType() string { return "Duration" }
 | 
			
		||||
func (m *Duration) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_Duration.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_Duration.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *Duration) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_Duration.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *Duration) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_Duration.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *Duration) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_Duration.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_Duration proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func (m *Duration) GetSeconds() int64 {
 | 
			
		||||
	if m != nil {
 | 
			
		||||
@@ -125,9 +138,11 @@ func init() {
 | 
			
		||||
	proto.RegisterType((*Duration)(nil), "google.protobuf.Duration")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func init() { proto.RegisterFile("google/protobuf/duration.proto", fileDescriptor0) }
 | 
			
		||||
func init() {
 | 
			
		||||
	proto.RegisterFile("google/protobuf/duration.proto", fileDescriptor_duration_e7d612259e3f0613)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var fileDescriptor0 = []byte{
 | 
			
		||||
var fileDescriptor_duration_e7d612259e3f0613 = []byte{
 | 
			
		||||
	// 190 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,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										45
									
								
								vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										45
									
								
								vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,15 +1,6 @@
 | 
			
		||||
// Code generated by protoc-gen-go. DO NOT EDIT.
 | 
			
		||||
// source: google/protobuf/empty.proto
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
Package empty is a generated protocol buffer package.
 | 
			
		||||
 | 
			
		||||
It is generated from these files:
 | 
			
		||||
	google/protobuf/empty.proto
 | 
			
		||||
 | 
			
		||||
It has these top-level messages:
 | 
			
		||||
	Empty
 | 
			
		||||
*/
 | 
			
		||||
package empty
 | 
			
		||||
 | 
			
		||||
import proto "github.com/golang/protobuf/proto"
 | 
			
		||||
@@ -37,21 +28,43 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `Empty` is empty JSON object `{}`.
 | 
			
		||||
type Empty struct {
 | 
			
		||||
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 | 
			
		||||
	XXX_unrecognized     []byte   `json:"-"`
 | 
			
		||||
	XXX_sizecache        int32    `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *Empty) Reset()                    { *m = Empty{} }
 | 
			
		||||
func (m *Empty) String() string            { return proto.CompactTextString(m) }
 | 
			
		||||
func (*Empty) ProtoMessage()               {}
 | 
			
		||||
func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
 | 
			
		||||
func (*Empty) XXX_WellKnownType() string   { return "Empty" }
 | 
			
		||||
func (m *Empty) Reset()         { *m = Empty{} }
 | 
			
		||||
func (m *Empty) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*Empty) ProtoMessage()    {}
 | 
			
		||||
func (*Empty) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_empty_39e6d6db0632e5b2, []int{0}
 | 
			
		||||
}
 | 
			
		||||
func (*Empty) XXX_WellKnownType() string { return "Empty" }
 | 
			
		||||
func (m *Empty) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_Empty.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_Empty.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *Empty) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_Empty.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *Empty) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_Empty.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *Empty) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_Empty.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_Empty proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	proto.RegisterType((*Empty)(nil), "google.protobuf.Empty")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func init() { proto.RegisterFile("google/protobuf/empty.proto", fileDescriptor0) }
 | 
			
		||||
func init() { proto.RegisterFile("google/protobuf/empty.proto", fileDescriptor_empty_39e6d6db0632e5b2) }
 | 
			
		||||
 | 
			
		||||
var fileDescriptor0 = []byte{
 | 
			
		||||
var fileDescriptor_empty_39e6d6db0632e5b2 = []byte{
 | 
			
		||||
	// 148 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,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										43
									
								
								vendor/github.com/golang/protobuf/ptypes/regen.sh
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										43
									
								
								vendor/github.com/golang/protobuf/ptypes/regen.sh
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,43 +0,0 @@
 | 
			
		||||
#!/bin/bash -e
 | 
			
		||||
#
 | 
			
		||||
# This script fetches and rebuilds the "well-known types" protocol buffers.
 | 
			
		||||
# To run this you will need protoc and goprotobuf installed;
 | 
			
		||||
# see https://github.com/golang/protobuf for instructions.
 | 
			
		||||
# You also need Go and Git installed.
 | 
			
		||||
 | 
			
		||||
PKG=github.com/golang/protobuf/ptypes
 | 
			
		||||
UPSTREAM=https://github.com/google/protobuf
 | 
			
		||||
UPSTREAM_SUBDIR=src/google/protobuf
 | 
			
		||||
PROTO_FILES=(any duration empty struct timestamp wrappers)
 | 
			
		||||
 | 
			
		||||
function die() {
 | 
			
		||||
  echo 1>&2 $*
 | 
			
		||||
  exit 1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Sanity check that the right tools are accessible.
 | 
			
		||||
for tool in go git protoc protoc-gen-go; do
 | 
			
		||||
  q=$(which $tool) || die "didn't find $tool"
 | 
			
		||||
  echo 1>&2 "$tool: $q"
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
tmpdir=$(mktemp -d -t regen-wkt.XXXXXX)
 | 
			
		||||
trap 'rm -rf $tmpdir' EXIT
 | 
			
		||||
 | 
			
		||||
echo -n 1>&2 "finding package dir... "
 | 
			
		||||
pkgdir=$(go list -f '{{.Dir}}' $PKG)
 | 
			
		||||
echo 1>&2 $pkgdir
 | 
			
		||||
base=$(echo $pkgdir | sed "s,/$PKG\$,,")
 | 
			
		||||
echo 1>&2 "base: $base"
 | 
			
		||||
cd "$base"
 | 
			
		||||
 | 
			
		||||
echo 1>&2 "fetching latest protos... "
 | 
			
		||||
git clone -q $UPSTREAM $tmpdir
 | 
			
		||||
 | 
			
		||||
for file in ${PROTO_FILES[@]}; do
 | 
			
		||||
  echo 1>&2 "* $file"
 | 
			
		||||
  protoc --go_out=. -I$tmpdir/src $tmpdir/src/google/protobuf/$file.proto || die
 | 
			
		||||
  cp $tmpdir/src/google/protobuf/$file.proto $PKG/$file
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
echo 1>&2 "All OK"
 | 
			
		||||
							
								
								
									
										138
									
								
								vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										138
									
								
								vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,17 +1,6 @@
 | 
			
		||||
// Code generated by protoc-gen-go. DO NOT EDIT.
 | 
			
		||||
// source: google/protobuf/struct.proto
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
Package structpb is a generated protocol buffer package.
 | 
			
		||||
 | 
			
		||||
It is generated from these files:
 | 
			
		||||
	google/protobuf/struct.proto
 | 
			
		||||
 | 
			
		||||
It has these top-level messages:
 | 
			
		||||
	Struct
 | 
			
		||||
	Value
 | 
			
		||||
	ListValue
 | 
			
		||||
*/
 | 
			
		||||
package structpb
 | 
			
		||||
 | 
			
		||||
import proto "github.com/golang/protobuf/proto"
 | 
			
		||||
@@ -50,8 +39,10 @@ var NullValue_value = map[string]int32{
 | 
			
		||||
func (x NullValue) String() string {
 | 
			
		||||
	return proto.EnumName(NullValue_name, int32(x))
 | 
			
		||||
}
 | 
			
		||||
func (NullValue) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
 | 
			
		||||
func (NullValue) XXX_WellKnownType() string       { return "NullValue" }
 | 
			
		||||
func (NullValue) EnumDescriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_struct_3a5a94e0c7801b27, []int{0}
 | 
			
		||||
}
 | 
			
		||||
func (NullValue) XXX_WellKnownType() string { return "NullValue" }
 | 
			
		||||
 | 
			
		||||
// `Struct` represents a structured data value, consisting of fields
 | 
			
		||||
// which map to dynamically typed values. In some languages, `Struct`
 | 
			
		||||
@@ -63,14 +54,36 @@ func (NullValue) XXX_WellKnownType() string       { return "NullValue" }
 | 
			
		||||
// The JSON representation for `Struct` is JSON object.
 | 
			
		||||
type Struct struct {
 | 
			
		||||
	// 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" protobuf_val:"bytes,2,opt,name=value"`
 | 
			
		||||
	Fields               map[string]*Value `protobuf:"bytes,1,rep,name=fields" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
 | 
			
		||||
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
 | 
			
		||||
	XXX_unrecognized     []byte            `json:"-"`
 | 
			
		||||
	XXX_sizecache        int32             `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *Struct) Reset()                    { *m = Struct{} }
 | 
			
		||||
func (m *Struct) String() string            { return proto.CompactTextString(m) }
 | 
			
		||||
func (*Struct) ProtoMessage()               {}
 | 
			
		||||
func (*Struct) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
 | 
			
		||||
func (*Struct) XXX_WellKnownType() string   { return "Struct" }
 | 
			
		||||
func (m *Struct) Reset()         { *m = Struct{} }
 | 
			
		||||
func (m *Struct) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*Struct) ProtoMessage()    {}
 | 
			
		||||
func (*Struct) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_struct_3a5a94e0c7801b27, []int{0}
 | 
			
		||||
}
 | 
			
		||||
func (*Struct) XXX_WellKnownType() string { return "Struct" }
 | 
			
		||||
func (m *Struct) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_Struct.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *Struct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_Struct.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *Struct) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_Struct.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *Struct) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_Struct.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *Struct) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_Struct.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_Struct proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func (m *Struct) GetFields() map[string]*Value {
 | 
			
		||||
	if m != nil {
 | 
			
		||||
@@ -95,14 +108,36 @@ type Value struct {
 | 
			
		||||
	//	*Value_BoolValue
 | 
			
		||||
	//	*Value_StructValue
 | 
			
		||||
	//	*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) String() string            { return proto.CompactTextString(m) }
 | 
			
		||||
func (*Value) ProtoMessage()               {}
 | 
			
		||||
func (*Value) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
 | 
			
		||||
func (*Value) XXX_WellKnownType() string   { return "Value" }
 | 
			
		||||
func (m *Value) Reset()         { *m = Value{} }
 | 
			
		||||
func (m *Value) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*Value) ProtoMessage()    {}
 | 
			
		||||
func (*Value) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_struct_3a5a94e0c7801b27, []int{1}
 | 
			
		||||
}
 | 
			
		||||
func (*Value) XXX_WellKnownType() string { return "Value" }
 | 
			
		||||
func (m *Value) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_Value.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_Value.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *Value) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_Value.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *Value) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_Value.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *Value) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_Value.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_Value proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
type isValue_Kind interface {
 | 
			
		||||
	isValue_Kind()
 | 
			
		||||
@@ -289,26 +324,26 @@ func _Value_OneofSizer(msg proto.Message) (n int) {
 | 
			
		||||
	// kind
 | 
			
		||||
	switch x := m.Kind.(type) {
 | 
			
		||||
	case *Value_NullValue:
 | 
			
		||||
		n += proto.SizeVarint(1<<3 | proto.WireVarint)
 | 
			
		||||
		n += 1 // tag and wire
 | 
			
		||||
		n += proto.SizeVarint(uint64(x.NullValue))
 | 
			
		||||
	case *Value_NumberValue:
 | 
			
		||||
		n += proto.SizeVarint(2<<3 | proto.WireFixed64)
 | 
			
		||||
		n += 1 // tag and wire
 | 
			
		||||
		n += 8
 | 
			
		||||
	case *Value_StringValue:
 | 
			
		||||
		n += proto.SizeVarint(3<<3 | proto.WireBytes)
 | 
			
		||||
		n += 1 // tag and wire
 | 
			
		||||
		n += proto.SizeVarint(uint64(len(x.StringValue)))
 | 
			
		||||
		n += len(x.StringValue)
 | 
			
		||||
	case *Value_BoolValue:
 | 
			
		||||
		n += proto.SizeVarint(4<<3 | proto.WireVarint)
 | 
			
		||||
		n += 1 // tag and wire
 | 
			
		||||
		n += 1
 | 
			
		||||
	case *Value_StructValue:
 | 
			
		||||
		s := proto.Size(x.StructValue)
 | 
			
		||||
		n += proto.SizeVarint(5<<3 | proto.WireBytes)
 | 
			
		||||
		n += 1 // tag and wire
 | 
			
		||||
		n += proto.SizeVarint(uint64(s))
 | 
			
		||||
		n += s
 | 
			
		||||
	case *Value_ListValue:
 | 
			
		||||
		s := proto.Size(x.ListValue)
 | 
			
		||||
		n += proto.SizeVarint(6<<3 | proto.WireBytes)
 | 
			
		||||
		n += 1 // tag and wire
 | 
			
		||||
		n += proto.SizeVarint(uint64(s))
 | 
			
		||||
		n += s
 | 
			
		||||
	case nil:
 | 
			
		||||
@@ -323,14 +358,36 @@ func _Value_OneofSizer(msg proto.Message) (n int) {
 | 
			
		||||
// The JSON representation for `ListValue` is JSON array.
 | 
			
		||||
type ListValue struct {
 | 
			
		||||
	// 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" json:"values,omitempty"`
 | 
			
		||||
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 | 
			
		||||
	XXX_unrecognized     []byte   `json:"-"`
 | 
			
		||||
	XXX_sizecache        int32    `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *ListValue) Reset()                    { *m = ListValue{} }
 | 
			
		||||
func (m *ListValue) String() string            { return proto.CompactTextString(m) }
 | 
			
		||||
func (*ListValue) ProtoMessage()               {}
 | 
			
		||||
func (*ListValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
 | 
			
		||||
func (*ListValue) XXX_WellKnownType() string   { return "ListValue" }
 | 
			
		||||
func (m *ListValue) Reset()         { *m = ListValue{} }
 | 
			
		||||
func (m *ListValue) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*ListValue) ProtoMessage()    {}
 | 
			
		||||
func (*ListValue) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_struct_3a5a94e0c7801b27, []int{2}
 | 
			
		||||
}
 | 
			
		||||
func (*ListValue) XXX_WellKnownType() string { return "ListValue" }
 | 
			
		||||
func (m *ListValue) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_ListValue.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *ListValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_ListValue.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *ListValue) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_ListValue.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *ListValue) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_ListValue.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *ListValue) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_ListValue.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_ListValue proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func (m *ListValue) GetValues() []*Value {
 | 
			
		||||
	if m != nil {
 | 
			
		||||
@@ -341,14 +398,17 @@ func (m *ListValue) GetValues() []*Value {
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	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((*ListValue)(nil), "google.protobuf.ListValue")
 | 
			
		||||
	proto.RegisterEnum("google.protobuf.NullValue", NullValue_name, NullValue_value)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func init() { proto.RegisterFile("google/protobuf/struct.proto", fileDescriptor0) }
 | 
			
		||||
func init() {
 | 
			
		||||
	proto.RegisterFile("google/protobuf/struct.proto", fileDescriptor_struct_3a5a94e0c7801b27)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var fileDescriptor0 = []byte{
 | 
			
		||||
var fileDescriptor_struct_3a5a94e0c7801b27 = []byte{
 | 
			
		||||
	// 417 bytes of a gzipped FileDescriptorProto
 | 
			
		||||
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x41, 0x8b, 0xd3, 0x40,
 | 
			
		||||
	0x14, 0xc7, 0x3b, 0xc9, 0x36, 0x98, 0x17, 0x59, 0x97, 0x11, 0xb4, 0xac, 0xa2, 0xa1, 0x7b, 0x09,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										51
									
								
								vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										51
									
								
								vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,15 +1,6 @@
 | 
			
		||||
// Code generated by protoc-gen-go. DO NOT EDIT.
 | 
			
		||||
// source: google/protobuf/timestamp.proto
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
Package timestamp is a generated protocol buffer package.
 | 
			
		||||
 | 
			
		||||
It is generated from these files:
 | 
			
		||||
	google/protobuf/timestamp.proto
 | 
			
		||||
 | 
			
		||||
It has these top-level messages:
 | 
			
		||||
	Timestamp
 | 
			
		||||
*/
 | 
			
		||||
package timestamp
 | 
			
		||||
 | 
			
		||||
import proto "github.com/golang/protobuf/proto"
 | 
			
		||||
@@ -101,7 +92,7 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
 | 
			
		||||
// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
 | 
			
		||||
// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
 | 
			
		||||
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
 | 
			
		||||
// http://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--)
 | 
			
		||||
// to obtain a formatter capable of generating timestamps in this format.
 | 
			
		||||
//
 | 
			
		||||
//
 | 
			
		||||
@@ -114,14 +105,36 @@ type Timestamp struct {
 | 
			
		||||
	// second values with fractions must still have non-negative nanos values
 | 
			
		||||
	// that count forward in time. Must be from 0 to 999,999,999
 | 
			
		||||
	// inclusive.
 | 
			
		||||
	Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
 | 
			
		||||
	Nanos                int32    `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
 | 
			
		||||
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 | 
			
		||||
	XXX_unrecognized     []byte   `json:"-"`
 | 
			
		||||
	XXX_sizecache        int32    `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *Timestamp) Reset()                    { *m = Timestamp{} }
 | 
			
		||||
func (m *Timestamp) String() string            { return proto.CompactTextString(m) }
 | 
			
		||||
func (*Timestamp) ProtoMessage()               {}
 | 
			
		||||
func (*Timestamp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
 | 
			
		||||
func (*Timestamp) XXX_WellKnownType() string   { return "Timestamp" }
 | 
			
		||||
func (m *Timestamp) Reset()         { *m = Timestamp{} }
 | 
			
		||||
func (m *Timestamp) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*Timestamp) ProtoMessage()    {}
 | 
			
		||||
func (*Timestamp) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_timestamp_b826e8e5fba671a8, []int{0}
 | 
			
		||||
}
 | 
			
		||||
func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" }
 | 
			
		||||
func (m *Timestamp) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_Timestamp.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *Timestamp) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_Timestamp.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *Timestamp) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_Timestamp.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *Timestamp) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_Timestamp.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_Timestamp proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func (m *Timestamp) GetSeconds() int64 {
 | 
			
		||||
	if m != nil {
 | 
			
		||||
@@ -141,9 +154,11 @@ func init() {
 | 
			
		||||
	proto.RegisterType((*Timestamp)(nil), "google.protobuf.Timestamp")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func init() { proto.RegisterFile("google/protobuf/timestamp.proto", fileDescriptor0) }
 | 
			
		||||
func init() {
 | 
			
		||||
	proto.RegisterFile("google/protobuf/timestamp.proto", fileDescriptor_timestamp_b826e8e5fba671a8)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var fileDescriptor0 = []byte{
 | 
			
		||||
var fileDescriptor_timestamp_b826e8e5fba671a8 = []byte{
 | 
			
		||||
	// 191 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,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -114,7 +114,7 @@ option objc_class_prefix = "GPB";
 | 
			
		||||
// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
 | 
			
		||||
// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
 | 
			
		||||
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
 | 
			
		||||
// http://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--)
 | 
			
		||||
// to obtain a formatter capable of generating timestamps in this format.
 | 
			
		||||
//
 | 
			
		||||
//
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										29
									
								
								vendor/github.com/golang/protobuf/ptypes/wrappers/BUILD
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								vendor/github.com/golang/protobuf/ptypes/wrappers/BUILD
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
 | 
			
		||||
 | 
			
		||||
filegroup(
 | 
			
		||||
    name = "go_default_library_protos",
 | 
			
		||||
    srcs = ["wrappers.proto"],
 | 
			
		||||
    visibility = ["//visibility:public"],
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
go_library(
 | 
			
		||||
    name = "go_default_library",
 | 
			
		||||
    srcs = ["wrappers.pb.go"],
 | 
			
		||||
    importpath = "github.com/golang/protobuf/ptypes/wrappers",
 | 
			
		||||
    visibility = ["//visibility:public"],
 | 
			
		||||
    deps = ["//vendor/github.com/golang/protobuf/proto:go_default_library"],
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
filegroup(
 | 
			
		||||
    name = "package-srcs",
 | 
			
		||||
    srcs = glob(["**"]),
 | 
			
		||||
    tags = ["automanaged"],
 | 
			
		||||
    visibility = ["//visibility:private"],
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
filegroup(
 | 
			
		||||
    name = "all-srcs",
 | 
			
		||||
    srcs = [":package-srcs"],
 | 
			
		||||
    tags = ["automanaged"],
 | 
			
		||||
    visibility = ["//visibility:public"],
 | 
			
		||||
)
 | 
			
		||||
							
								
								
									
										443
									
								
								vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										443
									
								
								vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,443 @@
 | 
			
		||||
// Code generated by protoc-gen-go. DO NOT EDIT.
 | 
			
		||||
// source: google/protobuf/wrappers.proto
 | 
			
		||||
 | 
			
		||||
package wrappers
 | 
			
		||||
 | 
			
		||||
import proto "github.com/golang/protobuf/proto"
 | 
			
		||||
import fmt "fmt"
 | 
			
		||||
import math "math"
 | 
			
		||||
 | 
			
		||||
// 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.ProtoPackageIsVersion2 // please upgrade the proto package
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `double`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `DoubleValue` is JSON number.
 | 
			
		||||
type DoubleValue struct {
 | 
			
		||||
	// The double value.
 | 
			
		||||
	Value                float64  `protobuf:"fixed64,1,opt,name=value" json:"value,omitempty"`
 | 
			
		||||
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 | 
			
		||||
	XXX_unrecognized     []byte   `json:"-"`
 | 
			
		||||
	XXX_sizecache        int32    `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *DoubleValue) Reset()         { *m = DoubleValue{} }
 | 
			
		||||
func (m *DoubleValue) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*DoubleValue) ProtoMessage()    {}
 | 
			
		||||
func (*DoubleValue) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_wrappers_16c7c35c009f3253, []int{0}
 | 
			
		||||
}
 | 
			
		||||
func (*DoubleValue) XXX_WellKnownType() string { return "DoubleValue" }
 | 
			
		||||
func (m *DoubleValue) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_DoubleValue.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *DoubleValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_DoubleValue.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *DoubleValue) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_DoubleValue.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *DoubleValue) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_DoubleValue.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *DoubleValue) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_DoubleValue.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_DoubleValue proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func (m *DoubleValue) GetValue() float64 {
 | 
			
		||||
	if m != nil {
 | 
			
		||||
		return m.Value
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `float`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `FloatValue` is JSON number.
 | 
			
		||||
type FloatValue struct {
 | 
			
		||||
	// The float value.
 | 
			
		||||
	Value                float32  `protobuf:"fixed32,1,opt,name=value" json:"value,omitempty"`
 | 
			
		||||
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 | 
			
		||||
	XXX_unrecognized     []byte   `json:"-"`
 | 
			
		||||
	XXX_sizecache        int32    `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *FloatValue) Reset()         { *m = FloatValue{} }
 | 
			
		||||
func (m *FloatValue) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*FloatValue) ProtoMessage()    {}
 | 
			
		||||
func (*FloatValue) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_wrappers_16c7c35c009f3253, []int{1}
 | 
			
		||||
}
 | 
			
		||||
func (*FloatValue) XXX_WellKnownType() string { return "FloatValue" }
 | 
			
		||||
func (m *FloatValue) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_FloatValue.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *FloatValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_FloatValue.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *FloatValue) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_FloatValue.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *FloatValue) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_FloatValue.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *FloatValue) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_FloatValue.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_FloatValue proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func (m *FloatValue) GetValue() float32 {
 | 
			
		||||
	if m != nil {
 | 
			
		||||
		return m.Value
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `int64`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `Int64Value` is JSON string.
 | 
			
		||||
type Int64Value struct {
 | 
			
		||||
	// The int64 value.
 | 
			
		||||
	Value                int64    `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
 | 
			
		||||
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 | 
			
		||||
	XXX_unrecognized     []byte   `json:"-"`
 | 
			
		||||
	XXX_sizecache        int32    `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *Int64Value) Reset()         { *m = Int64Value{} }
 | 
			
		||||
func (m *Int64Value) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*Int64Value) ProtoMessage()    {}
 | 
			
		||||
func (*Int64Value) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_wrappers_16c7c35c009f3253, []int{2}
 | 
			
		||||
}
 | 
			
		||||
func (*Int64Value) XXX_WellKnownType() string { return "Int64Value" }
 | 
			
		||||
func (m *Int64Value) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_Int64Value.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *Int64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_Int64Value.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *Int64Value) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_Int64Value.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *Int64Value) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_Int64Value.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *Int64Value) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_Int64Value.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_Int64Value proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func (m *Int64Value) GetValue() int64 {
 | 
			
		||||
	if m != nil {
 | 
			
		||||
		return m.Value
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `uint64`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `UInt64Value` is JSON string.
 | 
			
		||||
type UInt64Value struct {
 | 
			
		||||
	// The uint64 value.
 | 
			
		||||
	Value                uint64   `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
 | 
			
		||||
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 | 
			
		||||
	XXX_unrecognized     []byte   `json:"-"`
 | 
			
		||||
	XXX_sizecache        int32    `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *UInt64Value) Reset()         { *m = UInt64Value{} }
 | 
			
		||||
func (m *UInt64Value) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*UInt64Value) ProtoMessage()    {}
 | 
			
		||||
func (*UInt64Value) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_wrappers_16c7c35c009f3253, []int{3}
 | 
			
		||||
}
 | 
			
		||||
func (*UInt64Value) XXX_WellKnownType() string { return "UInt64Value" }
 | 
			
		||||
func (m *UInt64Value) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_UInt64Value.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *UInt64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_UInt64Value.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *UInt64Value) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_UInt64Value.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *UInt64Value) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_UInt64Value.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *UInt64Value) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_UInt64Value.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_UInt64Value proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func (m *UInt64Value) GetValue() uint64 {
 | 
			
		||||
	if m != nil {
 | 
			
		||||
		return m.Value
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `int32`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `Int32Value` is JSON number.
 | 
			
		||||
type Int32Value struct {
 | 
			
		||||
	// The int32 value.
 | 
			
		||||
	Value                int32    `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
 | 
			
		||||
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 | 
			
		||||
	XXX_unrecognized     []byte   `json:"-"`
 | 
			
		||||
	XXX_sizecache        int32    `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *Int32Value) Reset()         { *m = Int32Value{} }
 | 
			
		||||
func (m *Int32Value) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*Int32Value) ProtoMessage()    {}
 | 
			
		||||
func (*Int32Value) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_wrappers_16c7c35c009f3253, []int{4}
 | 
			
		||||
}
 | 
			
		||||
func (*Int32Value) XXX_WellKnownType() string { return "Int32Value" }
 | 
			
		||||
func (m *Int32Value) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_Int32Value.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *Int32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_Int32Value.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *Int32Value) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_Int32Value.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *Int32Value) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_Int32Value.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *Int32Value) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_Int32Value.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_Int32Value proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func (m *Int32Value) GetValue() int32 {
 | 
			
		||||
	if m != nil {
 | 
			
		||||
		return m.Value
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `uint32`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `UInt32Value` is JSON number.
 | 
			
		||||
type UInt32Value struct {
 | 
			
		||||
	// The uint32 value.
 | 
			
		||||
	Value                uint32   `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
 | 
			
		||||
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 | 
			
		||||
	XXX_unrecognized     []byte   `json:"-"`
 | 
			
		||||
	XXX_sizecache        int32    `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *UInt32Value) Reset()         { *m = UInt32Value{} }
 | 
			
		||||
func (m *UInt32Value) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*UInt32Value) ProtoMessage()    {}
 | 
			
		||||
func (*UInt32Value) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_wrappers_16c7c35c009f3253, []int{5}
 | 
			
		||||
}
 | 
			
		||||
func (*UInt32Value) XXX_WellKnownType() string { return "UInt32Value" }
 | 
			
		||||
func (m *UInt32Value) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_UInt32Value.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *UInt32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_UInt32Value.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *UInt32Value) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_UInt32Value.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *UInt32Value) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_UInt32Value.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *UInt32Value) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_UInt32Value.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_UInt32Value proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func (m *UInt32Value) GetValue() uint32 {
 | 
			
		||||
	if m != nil {
 | 
			
		||||
		return m.Value
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `bool`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `BoolValue` is JSON `true` and `false`.
 | 
			
		||||
type BoolValue struct {
 | 
			
		||||
	// The bool value.
 | 
			
		||||
	Value                bool     `protobuf:"varint,1,opt,name=value" json:"value,omitempty"`
 | 
			
		||||
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 | 
			
		||||
	XXX_unrecognized     []byte   `json:"-"`
 | 
			
		||||
	XXX_sizecache        int32    `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *BoolValue) Reset()         { *m = BoolValue{} }
 | 
			
		||||
func (m *BoolValue) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*BoolValue) ProtoMessage()    {}
 | 
			
		||||
func (*BoolValue) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_wrappers_16c7c35c009f3253, []int{6}
 | 
			
		||||
}
 | 
			
		||||
func (*BoolValue) XXX_WellKnownType() string { return "BoolValue" }
 | 
			
		||||
func (m *BoolValue) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_BoolValue.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *BoolValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_BoolValue.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *BoolValue) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_BoolValue.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *BoolValue) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_BoolValue.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *BoolValue) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_BoolValue.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_BoolValue proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func (m *BoolValue) GetValue() bool {
 | 
			
		||||
	if m != nil {
 | 
			
		||||
		return m.Value
 | 
			
		||||
	}
 | 
			
		||||
	return false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `string`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `StringValue` is JSON string.
 | 
			
		||||
type StringValue struct {
 | 
			
		||||
	// The string value.
 | 
			
		||||
	Value                string   `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
 | 
			
		||||
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 | 
			
		||||
	XXX_unrecognized     []byte   `json:"-"`
 | 
			
		||||
	XXX_sizecache        int32    `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *StringValue) Reset()         { *m = StringValue{} }
 | 
			
		||||
func (m *StringValue) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*StringValue) ProtoMessage()    {}
 | 
			
		||||
func (*StringValue) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_wrappers_16c7c35c009f3253, []int{7}
 | 
			
		||||
}
 | 
			
		||||
func (*StringValue) XXX_WellKnownType() string { return "StringValue" }
 | 
			
		||||
func (m *StringValue) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_StringValue.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *StringValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_StringValue.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *StringValue) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_StringValue.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *StringValue) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_StringValue.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *StringValue) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_StringValue.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_StringValue proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func (m *StringValue) GetValue() string {
 | 
			
		||||
	if m != nil {
 | 
			
		||||
		return m.Value
 | 
			
		||||
	}
 | 
			
		||||
	return ""
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `bytes`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `BytesValue` is JSON string.
 | 
			
		||||
type BytesValue struct {
 | 
			
		||||
	// The bytes value.
 | 
			
		||||
	Value                []byte   `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
 | 
			
		||||
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
 | 
			
		||||
	XXX_unrecognized     []byte   `json:"-"`
 | 
			
		||||
	XXX_sizecache        int32    `json:"-"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *BytesValue) Reset()         { *m = BytesValue{} }
 | 
			
		||||
func (m *BytesValue) String() string { return proto.CompactTextString(m) }
 | 
			
		||||
func (*BytesValue) ProtoMessage()    {}
 | 
			
		||||
func (*BytesValue) Descriptor() ([]byte, []int) {
 | 
			
		||||
	return fileDescriptor_wrappers_16c7c35c009f3253, []int{8}
 | 
			
		||||
}
 | 
			
		||||
func (*BytesValue) XXX_WellKnownType() string { return "BytesValue" }
 | 
			
		||||
func (m *BytesValue) XXX_Unmarshal(b []byte) error {
 | 
			
		||||
	return xxx_messageInfo_BytesValue.Unmarshal(m, b)
 | 
			
		||||
}
 | 
			
		||||
func (m *BytesValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
 | 
			
		||||
	return xxx_messageInfo_BytesValue.Marshal(b, m, deterministic)
 | 
			
		||||
}
 | 
			
		||||
func (dst *BytesValue) XXX_Merge(src proto.Message) {
 | 
			
		||||
	xxx_messageInfo_BytesValue.Merge(dst, src)
 | 
			
		||||
}
 | 
			
		||||
func (m *BytesValue) XXX_Size() int {
 | 
			
		||||
	return xxx_messageInfo_BytesValue.Size(m)
 | 
			
		||||
}
 | 
			
		||||
func (m *BytesValue) XXX_DiscardUnknown() {
 | 
			
		||||
	xxx_messageInfo_BytesValue.DiscardUnknown(m)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var xxx_messageInfo_BytesValue proto.InternalMessageInfo
 | 
			
		||||
 | 
			
		||||
func (m *BytesValue) GetValue() []byte {
 | 
			
		||||
	if m != nil {
 | 
			
		||||
		return m.Value
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	proto.RegisterType((*DoubleValue)(nil), "google.protobuf.DoubleValue")
 | 
			
		||||
	proto.RegisterType((*FloatValue)(nil), "google.protobuf.FloatValue")
 | 
			
		||||
	proto.RegisterType((*Int64Value)(nil), "google.protobuf.Int64Value")
 | 
			
		||||
	proto.RegisterType((*UInt64Value)(nil), "google.protobuf.UInt64Value")
 | 
			
		||||
	proto.RegisterType((*Int32Value)(nil), "google.protobuf.Int32Value")
 | 
			
		||||
	proto.RegisterType((*UInt32Value)(nil), "google.protobuf.UInt32Value")
 | 
			
		||||
	proto.RegisterType((*BoolValue)(nil), "google.protobuf.BoolValue")
 | 
			
		||||
	proto.RegisterType((*StringValue)(nil), "google.protobuf.StringValue")
 | 
			
		||||
	proto.RegisterType((*BytesValue)(nil), "google.protobuf.BytesValue")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	proto.RegisterFile("google/protobuf/wrappers.proto", fileDescriptor_wrappers_16c7c35c009f3253)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var fileDescriptor_wrappers_16c7c35c009f3253 = []byte{
 | 
			
		||||
	// 259 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, 0x2f, 0x2f, 0x4a, 0x2c,
 | 
			
		||||
	0x28, 0x48, 0x2d, 0x2a, 0xd6, 0x03, 0x8b, 0x08, 0xf1, 0x43, 0xe4, 0xf5, 0x60, 0xf2, 0x4a, 0xca,
 | 
			
		||||
	0x5c, 0xdc, 0x2e, 0xf9, 0xa5, 0x49, 0x39, 0xa9, 0x61, 0x89, 0x39, 0xa5, 0xa9, 0x42, 0x22, 0x5c,
 | 
			
		||||
	0xac, 0x65, 0x20, 0x86, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x63, 0x10, 0x84, 0xa3, 0xa4, 0xc4, 0xc5,
 | 
			
		||||
	0xe5, 0x96, 0x93, 0x9f, 0x58, 0x82, 0x45, 0x0d, 0x13, 0x92, 0x1a, 0xcf, 0xbc, 0x12, 0x33, 0x13,
 | 
			
		||||
	0x2c, 0x6a, 0x98, 0x61, 0x6a, 0x94, 0xb9, 0xb8, 0x43, 0x71, 0x29, 0x62, 0x41, 0x35, 0xc8, 0xd8,
 | 
			
		||||
	0x08, 0x8b, 0x1a, 0x56, 0x34, 0x83, 0xb0, 0x2a, 0xe2, 0x85, 0x29, 0x52, 0xe4, 0xe2, 0x74, 0xca,
 | 
			
		||||
	0xcf, 0xcf, 0xc1, 0xa2, 0x84, 0x03, 0xc9, 0x9c, 0xe0, 0x92, 0xa2, 0xcc, 0xbc, 0x74, 0x2c, 0x8a,
 | 
			
		||||
	0x38, 0x91, 0x1c, 0xe4, 0x54, 0x59, 0x92, 0x5a, 0x8c, 0x45, 0x0d, 0x0f, 0x54, 0x8d, 0x53, 0x0d,
 | 
			
		||||
	0x97, 0x70, 0x72, 0x7e, 0xae, 0x1e, 0x5a, 0xe8, 0x3a, 0xf1, 0x86, 0x43, 0x83, 0x3f, 0x00, 0x24,
 | 
			
		||||
	0x12, 0xc0, 0x18, 0xa5, 0x95, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f,
 | 
			
		||||
	0x9e, 0x9f, 0x93, 0x98, 0x97, 0x8e, 0x88, 0xaa, 0x82, 0x92, 0xca, 0x82, 0xd4, 0x62, 0x78, 0x8c,
 | 
			
		||||
	0xfd, 0x60, 0x64, 0x5c, 0xc4, 0xc4, 0xec, 0x1e, 0xe0, 0xb4, 0x8a, 0x49, 0xce, 0x1d, 0x62, 0x6e,
 | 
			
		||||
	0x00, 0x54, 0xa9, 0x5e, 0x78, 0x6a, 0x4e, 0x8e, 0x77, 0x5e, 0x7e, 0x79, 0x5e, 0x08, 0x48, 0x4b,
 | 
			
		||||
	0x12, 0x1b, 0xd8, 0x0c, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x19, 0x6c, 0xb9, 0xb8, 0xfe,
 | 
			
		||||
	0x01, 0x00, 0x00,
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										118
									
								
								vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.proto
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										118
									
								
								vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.proto
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,118 @@
 | 
			
		||||
// 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.
 | 
			
		||||
 | 
			
		||||
// Wrappers for primitive (non-message) types. These types are useful
 | 
			
		||||
// for embedding primitives in the `google.protobuf.Any` type and for places
 | 
			
		||||
// where we need to distinguish between the absence of a primitive
 | 
			
		||||
// typed field and its default value.
 | 
			
		||||
 | 
			
		||||
syntax = "proto3";
 | 
			
		||||
 | 
			
		||||
package google.protobuf;
 | 
			
		||||
 | 
			
		||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
 | 
			
		||||
option cc_enable_arenas = true;
 | 
			
		||||
option go_package = "github.com/golang/protobuf/ptypes/wrappers";
 | 
			
		||||
option java_package = "com.google.protobuf";
 | 
			
		||||
option java_outer_classname = "WrappersProto";
 | 
			
		||||
option java_multiple_files = true;
 | 
			
		||||
option objc_class_prefix = "GPB";
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `double`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `DoubleValue` is JSON number.
 | 
			
		||||
message DoubleValue {
 | 
			
		||||
  // The double value.
 | 
			
		||||
  double value = 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `float`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `FloatValue` is JSON number.
 | 
			
		||||
message FloatValue {
 | 
			
		||||
  // The float value.
 | 
			
		||||
  float value = 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `int64`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `Int64Value` is JSON string.
 | 
			
		||||
message Int64Value {
 | 
			
		||||
  // The int64 value.
 | 
			
		||||
  int64 value = 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `uint64`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `UInt64Value` is JSON string.
 | 
			
		||||
message UInt64Value {
 | 
			
		||||
  // The uint64 value.
 | 
			
		||||
  uint64 value = 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `int32`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `Int32Value` is JSON number.
 | 
			
		||||
message Int32Value {
 | 
			
		||||
  // The int32 value.
 | 
			
		||||
  int32 value = 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `uint32`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `UInt32Value` is JSON number.
 | 
			
		||||
message UInt32Value {
 | 
			
		||||
  // The uint32 value.
 | 
			
		||||
  uint32 value = 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `bool`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `BoolValue` is JSON `true` and `false`.
 | 
			
		||||
message BoolValue {
 | 
			
		||||
  // The bool value.
 | 
			
		||||
  bool value = 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `string`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `StringValue` is JSON string.
 | 
			
		||||
message StringValue {
 | 
			
		||||
  // The string value.
 | 
			
		||||
  string value = 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wrapper message for `bytes`.
 | 
			
		||||
//
 | 
			
		||||
// The JSON representation for `BytesValue` is JSON string.
 | 
			
		||||
message BytesValue {
 | 
			
		||||
  // The bytes value.
 | 
			
		||||
  bytes value = 1;
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user