Compare commits
13 Commits
v1.0.5
...
f563ef004f
| Author | SHA1 | Date | |
|---|---|---|---|
| f563ef004f | |||
| 5cfabce7cf | |||
| 7123d890b6 | |||
| 0b0eba0c40 | |||
| c1ec02f54e | |||
| 24b722ecc7 | |||
| 9f206db8b9 | |||
| 994a61a759 | |||
| 225900de04 | |||
| 23faa6d2f1 | |||
| f4adea7e31 | |||
| d168da16fc | |||
| 9ec84a1ff3 |
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
python/build
|
||||
python/dist
|
||||
|
||||
@@ -15,6 +15,14 @@ message FrameMessage {
|
||||
bytes frame = 2;
|
||||
}
|
||||
|
||||
message DisparityMessage {
|
||||
FrameRef frame_ref= 1;
|
||||
bytes disparity = 2;
|
||||
double focal_length_in_pixels = 3;
|
||||
// the distance between two mono cameras
|
||||
double baseline_in_mm = 4;
|
||||
}
|
||||
|
||||
message SteeringMessage {
|
||||
float steering = 1;
|
||||
float confidence = 2;
|
||||
@@ -27,6 +35,19 @@ message ThrottleMessage {
|
||||
FrameRef frame_ref = 3;
|
||||
}
|
||||
|
||||
enum SpeedZone {
|
||||
UNKNOWN = 0;
|
||||
SLOW = 1;
|
||||
NORMAL = 2;
|
||||
FAST = 3;
|
||||
}
|
||||
|
||||
message SpeedZoneMessage {
|
||||
SpeedZone speed_zone = 1;
|
||||
float confidence = 2;
|
||||
FrameRef frame_ref = 3;
|
||||
}
|
||||
|
||||
message DriveModeMessage {
|
||||
DriveMode drive_mode = 1;
|
||||
}
|
||||
@@ -35,6 +56,7 @@ enum DriveMode {
|
||||
INVALID = 0;
|
||||
USER = 1;
|
||||
PILOT = 2;
|
||||
COPILOT = 3;
|
||||
}
|
||||
|
||||
message ObjectsMessage {
|
||||
@@ -42,14 +64,15 @@ message ObjectsMessage {
|
||||
FrameRef frame_ref = 2;
|
||||
}
|
||||
|
||||
// BoundingBox that contains an object
|
||||
// BoundingBox that contains an object, coordinates as percent
|
||||
message Object {
|
||||
TypeObject type = 1;
|
||||
int32 left = 2;
|
||||
int32 top = 3;
|
||||
int32 right = 4;
|
||||
int32 bottom = 5;
|
||||
float left = 2;
|
||||
float top = 3;
|
||||
float right = 4;
|
||||
float bottom = 5;
|
||||
float confidence = 6;
|
||||
int64 distanceInMm = 7;
|
||||
}
|
||||
|
||||
enum TypeObject {
|
||||
@@ -87,5 +110,7 @@ message Ellipse {
|
||||
message RecordMessage {
|
||||
FrameMessage frame = 1;
|
||||
SteeringMessage steering = 2;
|
||||
SteeringMessage autopilot_steering = 4;
|
||||
DriveModeMessage drive_mode = 5;
|
||||
string recordSet = 3; // Record set name
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,5 @@
|
||||
module github.com/cyrilix/robocar-protobuf/go
|
||||
|
||||
go 1.18
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
github.com/golang/protobuf v1.5.2
|
||||
google.golang.org/protobuf v1.28.0
|
||||
)
|
||||
require google.golang.org/protobuf v1.32.0
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
|
||||
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
|
||||
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||
|
||||
3
go/vendor/github.com/golang/protobuf/AUTHORS
generated
vendored
3
go/vendor/github.com/golang/protobuf/AUTHORS
generated
vendored
@@ -1,3 +0,0 @@
|
||||
# This source code refers to The Go Authors for copyright purposes.
|
||||
# The master list of authors is in the main Go distribution,
|
||||
# visible at http://tip.golang.org/AUTHORS.
|
||||
3
go/vendor/github.com/golang/protobuf/CONTRIBUTORS
generated
vendored
3
go/vendor/github.com/golang/protobuf/CONTRIBUTORS
generated
vendored
@@ -1,3 +0,0 @@
|
||||
# This source code was written by the Go contributors.
|
||||
# The master list of contributors is in the main Go distribution,
|
||||
# visible at http://tip.golang.org/CONTRIBUTORS.
|
||||
28
go/vendor/github.com/golang/protobuf/LICENSE
generated
vendored
28
go/vendor/github.com/golang/protobuf/LICENSE
generated
vendored
@@ -1,28 +0,0 @@
|
||||
Copyright 2010 The Go Authors. All rights reserved.
|
||||
|
||||
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.
|
||||
|
||||
64
go/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
generated
vendored
64
go/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
generated
vendored
@@ -1,64 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: github.com/golang/protobuf/ptypes/timestamp/timestamp.proto
|
||||
|
||||
package timestamp
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// Symbols defined in public import of google/protobuf/timestamp.proto.
|
||||
|
||||
type Timestamp = timestamppb.Timestamp
|
||||
|
||||
var File_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_rawDesc = []byte{
|
||||
0x0a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c,
|
||||
0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79,
|
||||
0x70, 0x65, 0x73, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2f, 0x74, 0x69,
|
||||
0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67,
|
||||
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74,
|
||||
0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x37,
|
||||
0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c,
|
||||
0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79,
|
||||
0x70, 0x65, 0x73, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x3b, 0x74, 0x69,
|
||||
0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x50, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_goTypes = []interface{}{}
|
||||
var file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_init() }
|
||||
func file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_init() {
|
||||
if File_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_goTypes,
|
||||
DependencyIndexes: file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_depIdxs,
|
||||
}.Build()
|
||||
File_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto = out.File
|
||||
file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_rawDesc = nil
|
||||
file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_goTypes = nil
|
||||
file_github_com_golang_protobuf_ptypes_timestamp_timestamp_proto_depIdxs = nil
|
||||
}
|
||||
3
go/vendor/google.golang.org/protobuf/AUTHORS
generated
vendored
3
go/vendor/google.golang.org/protobuf/AUTHORS
generated
vendored
@@ -1,3 +0,0 @@
|
||||
# This source code refers to The Go Authors for copyright purposes.
|
||||
# The master list of authors is in the main Go distribution,
|
||||
# visible at https://tip.golang.org/AUTHORS.
|
||||
3
go/vendor/google.golang.org/protobuf/CONTRIBUTORS
generated
vendored
3
go/vendor/google.golang.org/protobuf/CONTRIBUTORS
generated
vendored
@@ -1,3 +0,0 @@
|
||||
# This source code was written by the Go contributors.
|
||||
# The master list of contributors is in the main Go distribution,
|
||||
# visible at https://tip.golang.org/CONTRIBUTORS.
|
||||
124
go/vendor/google.golang.org/protobuf/encoding/prototext/decode.go
generated
vendored
124
go/vendor/google.golang.org/protobuf/encoding/prototext/decode.go
generated
vendored
@@ -17,11 +17,11 @@ import (
|
||||
"google.golang.org/protobuf/internal/set"
|
||||
"google.golang.org/protobuf/internal/strs"
|
||||
"google.golang.org/protobuf/proto"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
)
|
||||
|
||||
// Unmarshal reads the given []byte into the given proto.Message.
|
||||
// Unmarshal reads the given []byte into the given [proto.Message].
|
||||
// The provided message must be mutable (e.g., a non-nil pointer to a message).
|
||||
func Unmarshal(b []byte, m proto.Message) error {
|
||||
return UnmarshalOptions{}.Unmarshal(b, m)
|
||||
@@ -51,7 +51,7 @@ type UnmarshalOptions struct {
|
||||
}
|
||||
}
|
||||
|
||||
// Unmarshal reads the given []byte and populates the given proto.Message
|
||||
// Unmarshal reads the given []byte and populates the given [proto.Message]
|
||||
// using options in the UnmarshalOptions object.
|
||||
// The provided message must be mutable (e.g., a non-nil pointer to a message).
|
||||
func (o UnmarshalOptions) Unmarshal(b []byte, m proto.Message) error {
|
||||
@@ -103,7 +103,7 @@ func (d decoder) syntaxError(pos int, f string, x ...interface{}) error {
|
||||
}
|
||||
|
||||
// unmarshalMessage unmarshals into the given protoreflect.Message.
|
||||
func (d decoder) unmarshalMessage(m pref.Message, checkDelims bool) error {
|
||||
func (d decoder) unmarshalMessage(m protoreflect.Message, checkDelims bool) error {
|
||||
messageDesc := m.Descriptor()
|
||||
if !flags.ProtoLegacy && messageset.IsMessageSet(messageDesc) {
|
||||
return errors.New("no support for proto1 MessageSets")
|
||||
@@ -150,24 +150,24 @@ func (d decoder) unmarshalMessage(m pref.Message, checkDelims bool) error {
|
||||
}
|
||||
|
||||
// Resolve the field descriptor.
|
||||
var name pref.Name
|
||||
var fd pref.FieldDescriptor
|
||||
var xt pref.ExtensionType
|
||||
var name protoreflect.Name
|
||||
var fd protoreflect.FieldDescriptor
|
||||
var xt protoreflect.ExtensionType
|
||||
var xtErr error
|
||||
var isFieldNumberName bool
|
||||
|
||||
switch tok.NameKind() {
|
||||
case text.IdentName:
|
||||
name = pref.Name(tok.IdentName())
|
||||
name = protoreflect.Name(tok.IdentName())
|
||||
fd = fieldDescs.ByTextName(string(name))
|
||||
|
||||
case text.TypeName:
|
||||
// Handle extensions only. This code path is not for Any.
|
||||
xt, xtErr = d.opts.Resolver.FindExtensionByName(pref.FullName(tok.TypeName()))
|
||||
xt, xtErr = d.opts.Resolver.FindExtensionByName(protoreflect.FullName(tok.TypeName()))
|
||||
|
||||
case text.FieldNumber:
|
||||
isFieldNumberName = true
|
||||
num := pref.FieldNumber(tok.FieldNumber())
|
||||
num := protoreflect.FieldNumber(tok.FieldNumber())
|
||||
if !num.IsValid() {
|
||||
return d.newError(tok.Pos(), "invalid field number: %d", num)
|
||||
}
|
||||
@@ -215,7 +215,7 @@ func (d decoder) unmarshalMessage(m pref.Message, checkDelims bool) error {
|
||||
switch {
|
||||
case fd.IsList():
|
||||
kind := fd.Kind()
|
||||
if kind != pref.MessageKind && kind != pref.GroupKind && !tok.HasSeparator() {
|
||||
if kind != protoreflect.MessageKind && kind != protoreflect.GroupKind && !tok.HasSeparator() {
|
||||
return d.syntaxError(tok.Pos(), "missing field separator :")
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ func (d decoder) unmarshalMessage(m pref.Message, checkDelims bool) error {
|
||||
|
||||
default:
|
||||
kind := fd.Kind()
|
||||
if kind != pref.MessageKind && kind != pref.GroupKind && !tok.HasSeparator() {
|
||||
if kind != protoreflect.MessageKind && kind != protoreflect.GroupKind && !tok.HasSeparator() {
|
||||
return d.syntaxError(tok.Pos(), "missing field separator :")
|
||||
}
|
||||
|
||||
@@ -262,11 +262,11 @@ func (d decoder) unmarshalMessage(m pref.Message, checkDelims bool) error {
|
||||
|
||||
// unmarshalSingular unmarshals a non-repeated field value specified by the
|
||||
// given FieldDescriptor.
|
||||
func (d decoder) unmarshalSingular(fd pref.FieldDescriptor, m pref.Message) error {
|
||||
var val pref.Value
|
||||
func (d decoder) unmarshalSingular(fd protoreflect.FieldDescriptor, m protoreflect.Message) error {
|
||||
var val protoreflect.Value
|
||||
var err error
|
||||
switch fd.Kind() {
|
||||
case pref.MessageKind, pref.GroupKind:
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
val = m.NewField(fd)
|
||||
err = d.unmarshalMessage(val.Message(), true)
|
||||
default:
|
||||
@@ -280,94 +280,94 @@ func (d decoder) unmarshalSingular(fd pref.FieldDescriptor, m pref.Message) erro
|
||||
|
||||
// unmarshalScalar unmarshals a scalar/enum protoreflect.Value specified by the
|
||||
// given FieldDescriptor.
|
||||
func (d decoder) unmarshalScalar(fd pref.FieldDescriptor) (pref.Value, error) {
|
||||
func (d decoder) unmarshalScalar(fd protoreflect.FieldDescriptor) (protoreflect.Value, error) {
|
||||
tok, err := d.Read()
|
||||
if err != nil {
|
||||
return pref.Value{}, err
|
||||
return protoreflect.Value{}, err
|
||||
}
|
||||
|
||||
if tok.Kind() != text.Scalar {
|
||||
return pref.Value{}, d.unexpectedTokenError(tok)
|
||||
return protoreflect.Value{}, d.unexpectedTokenError(tok)
|
||||
}
|
||||
|
||||
kind := fd.Kind()
|
||||
switch kind {
|
||||
case pref.BoolKind:
|
||||
case protoreflect.BoolKind:
|
||||
if b, ok := tok.Bool(); ok {
|
||||
return pref.ValueOfBool(b), nil
|
||||
return protoreflect.ValueOfBool(b), nil
|
||||
}
|
||||
|
||||
case pref.Int32Kind, pref.Sint32Kind, pref.Sfixed32Kind:
|
||||
case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
|
||||
if n, ok := tok.Int32(); ok {
|
||||
return pref.ValueOfInt32(n), nil
|
||||
return protoreflect.ValueOfInt32(n), nil
|
||||
}
|
||||
|
||||
case pref.Int64Kind, pref.Sint64Kind, pref.Sfixed64Kind:
|
||||
case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
|
||||
if n, ok := tok.Int64(); ok {
|
||||
return pref.ValueOfInt64(n), nil
|
||||
return protoreflect.ValueOfInt64(n), nil
|
||||
}
|
||||
|
||||
case pref.Uint32Kind, pref.Fixed32Kind:
|
||||
case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
|
||||
if n, ok := tok.Uint32(); ok {
|
||||
return pref.ValueOfUint32(n), nil
|
||||
return protoreflect.ValueOfUint32(n), nil
|
||||
}
|
||||
|
||||
case pref.Uint64Kind, pref.Fixed64Kind:
|
||||
case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
|
||||
if n, ok := tok.Uint64(); ok {
|
||||
return pref.ValueOfUint64(n), nil
|
||||
return protoreflect.ValueOfUint64(n), nil
|
||||
}
|
||||
|
||||
case pref.FloatKind:
|
||||
case protoreflect.FloatKind:
|
||||
if n, ok := tok.Float32(); ok {
|
||||
return pref.ValueOfFloat32(n), nil
|
||||
return protoreflect.ValueOfFloat32(n), nil
|
||||
}
|
||||
|
||||
case pref.DoubleKind:
|
||||
case protoreflect.DoubleKind:
|
||||
if n, ok := tok.Float64(); ok {
|
||||
return pref.ValueOfFloat64(n), nil
|
||||
return protoreflect.ValueOfFloat64(n), nil
|
||||
}
|
||||
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
if s, ok := tok.String(); ok {
|
||||
if strs.EnforceUTF8(fd) && !utf8.ValidString(s) {
|
||||
return pref.Value{}, d.newError(tok.Pos(), "contains invalid UTF-8")
|
||||
return protoreflect.Value{}, d.newError(tok.Pos(), "contains invalid UTF-8")
|
||||
}
|
||||
return pref.ValueOfString(s), nil
|
||||
return protoreflect.ValueOfString(s), nil
|
||||
}
|
||||
|
||||
case pref.BytesKind:
|
||||
case protoreflect.BytesKind:
|
||||
if b, ok := tok.String(); ok {
|
||||
return pref.ValueOfBytes([]byte(b)), nil
|
||||
return protoreflect.ValueOfBytes([]byte(b)), nil
|
||||
}
|
||||
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
if lit, ok := tok.Enum(); ok {
|
||||
// Lookup EnumNumber based on name.
|
||||
if enumVal := fd.Enum().Values().ByName(pref.Name(lit)); enumVal != nil {
|
||||
return pref.ValueOfEnum(enumVal.Number()), nil
|
||||
if enumVal := fd.Enum().Values().ByName(protoreflect.Name(lit)); enumVal != nil {
|
||||
return protoreflect.ValueOfEnum(enumVal.Number()), nil
|
||||
}
|
||||
}
|
||||
if num, ok := tok.Int32(); ok {
|
||||
return pref.ValueOfEnum(pref.EnumNumber(num)), nil
|
||||
return protoreflect.ValueOfEnum(protoreflect.EnumNumber(num)), nil
|
||||
}
|
||||
|
||||
default:
|
||||
panic(fmt.Sprintf("invalid scalar kind %v", kind))
|
||||
}
|
||||
|
||||
return pref.Value{}, d.newError(tok.Pos(), "invalid value for %v type: %v", kind, tok.RawString())
|
||||
return protoreflect.Value{}, d.newError(tok.Pos(), "invalid value for %v type: %v", kind, tok.RawString())
|
||||
}
|
||||
|
||||
// unmarshalList unmarshals into given protoreflect.List. A list value can
|
||||
// either be in [] syntax or simply just a single scalar/message value.
|
||||
func (d decoder) unmarshalList(fd pref.FieldDescriptor, list pref.List) error {
|
||||
func (d decoder) unmarshalList(fd protoreflect.FieldDescriptor, list protoreflect.List) error {
|
||||
tok, err := d.Peek()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
switch fd.Kind() {
|
||||
case pref.MessageKind, pref.GroupKind:
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
switch tok.Kind() {
|
||||
case text.ListOpen:
|
||||
d.Read()
|
||||
@@ -441,22 +441,22 @@ func (d decoder) unmarshalList(fd pref.FieldDescriptor, list pref.List) error {
|
||||
|
||||
// unmarshalMap unmarshals into given protoreflect.Map. A map value is a
|
||||
// textproto message containing {key: <kvalue>, value: <mvalue>}.
|
||||
func (d decoder) unmarshalMap(fd pref.FieldDescriptor, mmap pref.Map) error {
|
||||
func (d decoder) unmarshalMap(fd protoreflect.FieldDescriptor, mmap protoreflect.Map) error {
|
||||
// Determine ahead whether map entry is a scalar type or a message type in
|
||||
// order to call the appropriate unmarshalMapValue func inside
|
||||
// unmarshalMapEntry.
|
||||
var unmarshalMapValue func() (pref.Value, error)
|
||||
var unmarshalMapValue func() (protoreflect.Value, error)
|
||||
switch fd.MapValue().Kind() {
|
||||
case pref.MessageKind, pref.GroupKind:
|
||||
unmarshalMapValue = func() (pref.Value, error) {
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
unmarshalMapValue = func() (protoreflect.Value, error) {
|
||||
pval := mmap.NewValue()
|
||||
if err := d.unmarshalMessage(pval.Message(), true); err != nil {
|
||||
return pref.Value{}, err
|
||||
return protoreflect.Value{}, err
|
||||
}
|
||||
return pval, nil
|
||||
}
|
||||
default:
|
||||
unmarshalMapValue = func() (pref.Value, error) {
|
||||
unmarshalMapValue = func() (protoreflect.Value, error) {
|
||||
return d.unmarshalScalar(fd.MapValue())
|
||||
}
|
||||
}
|
||||
@@ -494,9 +494,9 @@ func (d decoder) unmarshalMap(fd pref.FieldDescriptor, mmap pref.Map) error {
|
||||
|
||||
// unmarshalMap unmarshals into given protoreflect.Map. A map value is a
|
||||
// textproto message containing {key: <kvalue>, value: <mvalue>}.
|
||||
func (d decoder) unmarshalMapEntry(fd pref.FieldDescriptor, mmap pref.Map, unmarshalMapValue func() (pref.Value, error)) error {
|
||||
var key pref.MapKey
|
||||
var pval pref.Value
|
||||
func (d decoder) unmarshalMapEntry(fd protoreflect.FieldDescriptor, mmap protoreflect.Map, unmarshalMapValue func() (protoreflect.Value, error)) error {
|
||||
var key protoreflect.MapKey
|
||||
var pval protoreflect.Value
|
||||
Loop:
|
||||
for {
|
||||
// Read field name.
|
||||
@@ -520,7 +520,7 @@ Loop:
|
||||
return d.unexpectedTokenError(tok)
|
||||
}
|
||||
|
||||
switch name := pref.Name(tok.IdentName()); name {
|
||||
switch name := protoreflect.Name(tok.IdentName()); name {
|
||||
case genid.MapEntry_Key_field_name:
|
||||
if !tok.HasSeparator() {
|
||||
return d.syntaxError(tok.Pos(), "missing field separator :")
|
||||
@@ -535,7 +535,7 @@ Loop:
|
||||
key = val.MapKey()
|
||||
|
||||
case genid.MapEntry_Value_field_name:
|
||||
if kind := fd.MapValue().Kind(); (kind != pref.MessageKind) && (kind != pref.GroupKind) {
|
||||
if kind := fd.MapValue().Kind(); (kind != protoreflect.MessageKind) && (kind != protoreflect.GroupKind) {
|
||||
if !tok.HasSeparator() {
|
||||
return d.syntaxError(tok.Pos(), "missing field separator :")
|
||||
}
|
||||
@@ -561,7 +561,7 @@ Loop:
|
||||
}
|
||||
if !pval.IsValid() {
|
||||
switch fd.MapValue().Kind() {
|
||||
case pref.MessageKind, pref.GroupKind:
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
// If value field is not set for message/group types, construct an
|
||||
// empty one as default.
|
||||
pval = mmap.NewValue()
|
||||
@@ -575,7 +575,7 @@ Loop:
|
||||
|
||||
// unmarshalAny unmarshals an Any textproto. It can either be in expanded form
|
||||
// or non-expanded form.
|
||||
func (d decoder) unmarshalAny(m pref.Message, checkDelims bool) error {
|
||||
func (d decoder) unmarshalAny(m protoreflect.Message, checkDelims bool) error {
|
||||
var typeURL string
|
||||
var bValue []byte
|
||||
var seenTypeUrl bool
|
||||
@@ -619,7 +619,7 @@ Loop:
|
||||
return d.syntaxError(tok.Pos(), "missing field separator :")
|
||||
}
|
||||
|
||||
switch name := pref.Name(tok.IdentName()); name {
|
||||
switch name := protoreflect.Name(tok.IdentName()); name {
|
||||
case genid.Any_TypeUrl_field_name:
|
||||
if seenTypeUrl {
|
||||
return d.newError(tok.Pos(), "duplicate %v field", genid.Any_TypeUrl_field_fullname)
|
||||
@@ -686,10 +686,10 @@ Loop:
|
||||
|
||||
fds := m.Descriptor().Fields()
|
||||
if len(typeURL) > 0 {
|
||||
m.Set(fds.ByNumber(genid.Any_TypeUrl_field_number), pref.ValueOfString(typeURL))
|
||||
m.Set(fds.ByNumber(genid.Any_TypeUrl_field_number), protoreflect.ValueOfString(typeURL))
|
||||
}
|
||||
if len(bValue) > 0 {
|
||||
m.Set(fds.ByNumber(genid.Any_Value_field_number), pref.ValueOfBytes(bValue))
|
||||
m.Set(fds.ByNumber(genid.Any_Value_field_number), protoreflect.ValueOfBytes(bValue))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -739,7 +739,9 @@ func (d decoder) skipValue() error {
|
||||
case text.ListClose:
|
||||
return nil
|
||||
case text.MessageOpen:
|
||||
return d.skipMessageValue()
|
||||
if err := d.skipMessageValue(); err != nil {
|
||||
return err
|
||||
}
|
||||
default:
|
||||
// Skip items. This will not validate whether skipped values are
|
||||
// of the same type or not, same behavior as C++
|
||||
|
||||
57
go/vendor/google.golang.org/protobuf/encoding/prototext/encode.go
generated
vendored
57
go/vendor/google.golang.org/protobuf/encoding/prototext/encode.go
generated
vendored
@@ -20,7 +20,6 @@ import (
|
||||
"google.golang.org/protobuf/internal/strs"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
)
|
||||
|
||||
@@ -34,7 +33,7 @@ func Format(m proto.Message) string {
|
||||
return MarshalOptions{Multiline: true}.Format(m)
|
||||
}
|
||||
|
||||
// Marshal writes the given proto.Message in textproto format using default
|
||||
// Marshal writes the given [proto.Message] in textproto format using default
|
||||
// options. Do not depend on the output being stable. It may change over time
|
||||
// across different versions of the program.
|
||||
func Marshal(m proto.Message) ([]byte, error) {
|
||||
@@ -98,17 +97,23 @@ func (o MarshalOptions) Format(m proto.Message) string {
|
||||
return string(b)
|
||||
}
|
||||
|
||||
// Marshal writes the given proto.Message in textproto format using options in
|
||||
// Marshal writes the given [proto.Message] in textproto format using options in
|
||||
// MarshalOptions object. Do not depend on the output being stable. It may
|
||||
// change over time across different versions of the program.
|
||||
func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) {
|
||||
return o.marshal(m)
|
||||
return o.marshal(nil, m)
|
||||
}
|
||||
|
||||
// MarshalAppend appends the textproto format encoding of m to b,
|
||||
// returning the result.
|
||||
func (o MarshalOptions) MarshalAppend(b []byte, m proto.Message) ([]byte, error) {
|
||||
return o.marshal(b, m)
|
||||
}
|
||||
|
||||
// marshal is a centralized function that all marshal operations go through.
|
||||
// For profiling purposes, avoid changing the name of this function or
|
||||
// introducing other code paths for marshal that do not go through this.
|
||||
func (o MarshalOptions) marshal(m proto.Message) ([]byte, error) {
|
||||
func (o MarshalOptions) marshal(b []byte, m proto.Message) ([]byte, error) {
|
||||
var delims = [2]byte{'{', '}'}
|
||||
|
||||
if o.Multiline && o.Indent == "" {
|
||||
@@ -118,7 +123,7 @@ func (o MarshalOptions) marshal(m proto.Message) ([]byte, error) {
|
||||
o.Resolver = protoregistry.GlobalTypes
|
||||
}
|
||||
|
||||
internalEnc, err := text.NewEncoder(o.Indent, delims, o.EmitASCII)
|
||||
internalEnc, err := text.NewEncoder(b, o.Indent, delims, o.EmitASCII)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -126,7 +131,7 @@ func (o MarshalOptions) marshal(m proto.Message) ([]byte, error) {
|
||||
// Treat nil message interface as an empty message,
|
||||
// in which case there is nothing to output.
|
||||
if m == nil {
|
||||
return []byte{}, nil
|
||||
return b, nil
|
||||
}
|
||||
|
||||
enc := encoder{internalEnc, o}
|
||||
@@ -150,7 +155,7 @@ type encoder struct {
|
||||
}
|
||||
|
||||
// marshalMessage marshals the given protoreflect.Message.
|
||||
func (e encoder) marshalMessage(m pref.Message, inclDelims bool) error {
|
||||
func (e encoder) marshalMessage(m protoreflect.Message, inclDelims bool) error {
|
||||
messageDesc := m.Descriptor()
|
||||
if !flags.ProtoLegacy && messageset.IsMessageSet(messageDesc) {
|
||||
return errors.New("no support for proto1 MessageSets")
|
||||
@@ -190,7 +195,7 @@ func (e encoder) marshalMessage(m pref.Message, inclDelims bool) error {
|
||||
}
|
||||
|
||||
// marshalField marshals the given field with protoreflect.Value.
|
||||
func (e encoder) marshalField(name string, val pref.Value, fd pref.FieldDescriptor) error {
|
||||
func (e encoder) marshalField(name string, val protoreflect.Value, fd protoreflect.FieldDescriptor) error {
|
||||
switch {
|
||||
case fd.IsList():
|
||||
return e.marshalList(name, val.List(), fd)
|
||||
@@ -204,40 +209,40 @@ func (e encoder) marshalField(name string, val pref.Value, fd pref.FieldDescript
|
||||
|
||||
// marshalSingular marshals the given non-repeated field value. This includes
|
||||
// all scalar types, enums, messages, and groups.
|
||||
func (e encoder) marshalSingular(val pref.Value, fd pref.FieldDescriptor) error {
|
||||
func (e encoder) marshalSingular(val protoreflect.Value, fd protoreflect.FieldDescriptor) error {
|
||||
kind := fd.Kind()
|
||||
switch kind {
|
||||
case pref.BoolKind:
|
||||
case protoreflect.BoolKind:
|
||||
e.WriteBool(val.Bool())
|
||||
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
s := val.String()
|
||||
if !e.opts.allowInvalidUTF8 && strs.EnforceUTF8(fd) && !utf8.ValidString(s) {
|
||||
return errors.InvalidUTF8(string(fd.FullName()))
|
||||
}
|
||||
e.WriteString(s)
|
||||
|
||||
case pref.Int32Kind, pref.Int64Kind,
|
||||
pref.Sint32Kind, pref.Sint64Kind,
|
||||
pref.Sfixed32Kind, pref.Sfixed64Kind:
|
||||
case protoreflect.Int32Kind, protoreflect.Int64Kind,
|
||||
protoreflect.Sint32Kind, protoreflect.Sint64Kind,
|
||||
protoreflect.Sfixed32Kind, protoreflect.Sfixed64Kind:
|
||||
e.WriteInt(val.Int())
|
||||
|
||||
case pref.Uint32Kind, pref.Uint64Kind,
|
||||
pref.Fixed32Kind, pref.Fixed64Kind:
|
||||
case protoreflect.Uint32Kind, protoreflect.Uint64Kind,
|
||||
protoreflect.Fixed32Kind, protoreflect.Fixed64Kind:
|
||||
e.WriteUint(val.Uint())
|
||||
|
||||
case pref.FloatKind:
|
||||
case protoreflect.FloatKind:
|
||||
// Encoder.WriteFloat handles the special numbers NaN and infinites.
|
||||
e.WriteFloat(val.Float(), 32)
|
||||
|
||||
case pref.DoubleKind:
|
||||
case protoreflect.DoubleKind:
|
||||
// Encoder.WriteFloat handles the special numbers NaN and infinites.
|
||||
e.WriteFloat(val.Float(), 64)
|
||||
|
||||
case pref.BytesKind:
|
||||
case protoreflect.BytesKind:
|
||||
e.WriteString(string(val.Bytes()))
|
||||
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
num := val.Enum()
|
||||
if desc := fd.Enum().Values().ByNumber(num); desc != nil {
|
||||
e.WriteLiteral(string(desc.Name()))
|
||||
@@ -246,7 +251,7 @@ func (e encoder) marshalSingular(val pref.Value, fd pref.FieldDescriptor) error
|
||||
e.WriteInt(int64(num))
|
||||
}
|
||||
|
||||
case pref.MessageKind, pref.GroupKind:
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
return e.marshalMessage(val.Message(), true)
|
||||
|
||||
default:
|
||||
@@ -256,7 +261,7 @@ func (e encoder) marshalSingular(val pref.Value, fd pref.FieldDescriptor) error
|
||||
}
|
||||
|
||||
// marshalList marshals the given protoreflect.List as multiple name-value fields.
|
||||
func (e encoder) marshalList(name string, list pref.List, fd pref.FieldDescriptor) error {
|
||||
func (e encoder) marshalList(name string, list protoreflect.List, fd protoreflect.FieldDescriptor) error {
|
||||
size := list.Len()
|
||||
for i := 0; i < size; i++ {
|
||||
e.WriteName(name)
|
||||
@@ -268,9 +273,9 @@ func (e encoder) marshalList(name string, list pref.List, fd pref.FieldDescripto
|
||||
}
|
||||
|
||||
// marshalMap marshals the given protoreflect.Map as multiple name-value fields.
|
||||
func (e encoder) marshalMap(name string, mmap pref.Map, fd pref.FieldDescriptor) error {
|
||||
func (e encoder) marshalMap(name string, mmap protoreflect.Map, fd protoreflect.FieldDescriptor) error {
|
||||
var err error
|
||||
order.RangeEntries(mmap, order.GenericKeyOrder, func(key pref.MapKey, val pref.Value) bool {
|
||||
order.RangeEntries(mmap, order.GenericKeyOrder, func(key protoreflect.MapKey, val protoreflect.Value) bool {
|
||||
e.WriteName(name)
|
||||
e.StartMessage()
|
||||
defer e.EndMessage()
|
||||
@@ -334,7 +339,7 @@ func (e encoder) marshalUnknown(b []byte) {
|
||||
|
||||
// marshalAny marshals the given google.protobuf.Any message in expanded form.
|
||||
// It returns true if it was able to marshal, else false.
|
||||
func (e encoder) marshalAny(any pref.Message) bool {
|
||||
func (e encoder) marshalAny(any protoreflect.Message) bool {
|
||||
// Construct the embedded message.
|
||||
fds := any.Descriptor().Fields()
|
||||
fdType := fds.ByNumber(genid.Any_TypeUrl_field_number)
|
||||
|
||||
40
go/vendor/google.golang.org/protobuf/encoding/protowire/wire.go
generated
vendored
40
go/vendor/google.golang.org/protobuf/encoding/protowire/wire.go
generated
vendored
@@ -3,10 +3,10 @@
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package protowire parses and formats the raw wire encoding.
|
||||
// See https://developers.google.com/protocol-buffers/docs/encoding.
|
||||
// See https://protobuf.dev/programming-guides/encoding.
|
||||
//
|
||||
// For marshaling and unmarshaling entire protobuf messages,
|
||||
// use the "google.golang.org/protobuf/proto" package instead.
|
||||
// use the [google.golang.org/protobuf/proto] package instead.
|
||||
package protowire
|
||||
|
||||
import (
|
||||
@@ -29,12 +29,8 @@ const (
|
||||
)
|
||||
|
||||
// IsValid reports whether the field number is semantically valid.
|
||||
//
|
||||
// Note that while numbers within the reserved range are semantically invalid,
|
||||
// they are syntactically valid in the wire format.
|
||||
// Implementations may treat records with reserved field numbers as unknown.
|
||||
func (n Number) IsValid() bool {
|
||||
return MinValidNumber <= n && n < FirstReservedNumber || LastReservedNumber < n && n <= MaxValidNumber
|
||||
return MinValidNumber <= n && n <= MaxValidNumber
|
||||
}
|
||||
|
||||
// Type represents the wire type.
|
||||
@@ -91,7 +87,7 @@ func ParseError(n int) error {
|
||||
|
||||
// ConsumeField parses an entire field record (both tag and value) and returns
|
||||
// the field number, the wire type, and the total length.
|
||||
// This returns a negative length upon an error (see ParseError).
|
||||
// This returns a negative length upon an error (see [ParseError]).
|
||||
//
|
||||
// The total length includes the tag header and the end group marker (if the
|
||||
// field is a group).
|
||||
@@ -108,8 +104,8 @@ func ConsumeField(b []byte) (Number, Type, int) {
|
||||
}
|
||||
|
||||
// ConsumeFieldValue parses a field value and returns its length.
|
||||
// This assumes that the field Number and wire Type have already been parsed.
|
||||
// This returns a negative length upon an error (see ParseError).
|
||||
// This assumes that the field [Number] and wire [Type] have already been parsed.
|
||||
// This returns a negative length upon an error (see [ParseError]).
|
||||
//
|
||||
// When parsing a group, the length includes the end group marker and
|
||||
// the end group is verified to match the starting field number.
|
||||
@@ -168,7 +164,7 @@ func AppendTag(b []byte, num Number, typ Type) []byte {
|
||||
}
|
||||
|
||||
// ConsumeTag parses b as a varint-encoded tag, reporting its length.
|
||||
// This returns a negative length upon an error (see ParseError).
|
||||
// This returns a negative length upon an error (see [ParseError]).
|
||||
func ConsumeTag(b []byte) (Number, Type, int) {
|
||||
v, n := ConsumeVarint(b)
|
||||
if n < 0 {
|
||||
@@ -267,7 +263,7 @@ func AppendVarint(b []byte, v uint64) []byte {
|
||||
}
|
||||
|
||||
// ConsumeVarint parses b as a varint-encoded uint64, reporting its length.
|
||||
// This returns a negative length upon an error (see ParseError).
|
||||
// This returns a negative length upon an error (see [ParseError]).
|
||||
func ConsumeVarint(b []byte) (v uint64, n int) {
|
||||
var y uint64
|
||||
if len(b) <= 0 {
|
||||
@@ -388,7 +384,7 @@ func AppendFixed32(b []byte, v uint32) []byte {
|
||||
}
|
||||
|
||||
// ConsumeFixed32 parses b as a little-endian uint32, reporting its length.
|
||||
// This returns a negative length upon an error (see ParseError).
|
||||
// This returns a negative length upon an error (see [ParseError]).
|
||||
func ConsumeFixed32(b []byte) (v uint32, n int) {
|
||||
if len(b) < 4 {
|
||||
return 0, errCodeTruncated
|
||||
@@ -416,7 +412,7 @@ func AppendFixed64(b []byte, v uint64) []byte {
|
||||
}
|
||||
|
||||
// ConsumeFixed64 parses b as a little-endian uint64, reporting its length.
|
||||
// This returns a negative length upon an error (see ParseError).
|
||||
// This returns a negative length upon an error (see [ParseError]).
|
||||
func ConsumeFixed64(b []byte) (v uint64, n int) {
|
||||
if len(b) < 8 {
|
||||
return 0, errCodeTruncated
|
||||
@@ -436,7 +432,7 @@ func AppendBytes(b []byte, v []byte) []byte {
|
||||
}
|
||||
|
||||
// ConsumeBytes parses b as a length-prefixed bytes value, reporting its length.
|
||||
// This returns a negative length upon an error (see ParseError).
|
||||
// This returns a negative length upon an error (see [ParseError]).
|
||||
func ConsumeBytes(b []byte) (v []byte, n int) {
|
||||
m, n := ConsumeVarint(b)
|
||||
if n < 0 {
|
||||
@@ -460,7 +456,7 @@ func AppendString(b []byte, v string) []byte {
|
||||
}
|
||||
|
||||
// ConsumeString parses b as a length-prefixed bytes value, reporting its length.
|
||||
// This returns a negative length upon an error (see ParseError).
|
||||
// This returns a negative length upon an error (see [ParseError]).
|
||||
func ConsumeString(b []byte) (v string, n int) {
|
||||
bb, n := ConsumeBytes(b)
|
||||
return string(bb), n
|
||||
@@ -475,7 +471,7 @@ func AppendGroup(b []byte, num Number, v []byte) []byte {
|
||||
// ConsumeGroup parses b as a group value until the trailing end group marker,
|
||||
// and verifies that the end marker matches the provided num. The value v
|
||||
// does not contain the end marker, while the length does contain the end marker.
|
||||
// This returns a negative length upon an error (see ParseError).
|
||||
// This returns a negative length upon an error (see [ParseError]).
|
||||
func ConsumeGroup(num Number, b []byte) (v []byte, n int) {
|
||||
n = ConsumeFieldValue(num, StartGroupType, b)
|
||||
if n < 0 {
|
||||
@@ -499,8 +495,8 @@ func SizeGroup(num Number, n int) int {
|
||||
return n + SizeTag(num)
|
||||
}
|
||||
|
||||
// DecodeTag decodes the field Number and wire Type from its unified form.
|
||||
// The Number is -1 if the decoded field number overflows int32.
|
||||
// DecodeTag decodes the field [Number] and wire [Type] from its unified form.
|
||||
// The [Number] is -1 if the decoded field number overflows int32.
|
||||
// Other than overflow, this does not check for field number validity.
|
||||
func DecodeTag(x uint64) (Number, Type) {
|
||||
// NOTE: MessageSet allows for larger field numbers than normal.
|
||||
@@ -510,12 +506,13 @@ func DecodeTag(x uint64) (Number, Type) {
|
||||
return Number(x >> 3), Type(x & 7)
|
||||
}
|
||||
|
||||
// EncodeTag encodes the field Number and wire Type into its unified form.
|
||||
// EncodeTag encodes the field [Number] and wire [Type] into its unified form.
|
||||
func EncodeTag(num Number, typ Type) uint64 {
|
||||
return uint64(num)<<3 | uint64(typ&7)
|
||||
}
|
||||
|
||||
// DecodeZigZag decodes a zig-zag-encoded uint64 as an int64.
|
||||
//
|
||||
// Input: {…, 5, 3, 1, 0, 2, 4, 6, …}
|
||||
// Output: {…, -3, -2, -1, 0, +1, +2, +3, …}
|
||||
func DecodeZigZag(x uint64) int64 {
|
||||
@@ -523,6 +520,7 @@ func DecodeZigZag(x uint64) int64 {
|
||||
}
|
||||
|
||||
// EncodeZigZag encodes an int64 as a zig-zag-encoded uint64.
|
||||
//
|
||||
// Input: {…, -3, -2, -1, 0, +1, +2, +3, …}
|
||||
// Output: {…, 5, 3, 1, 0, 2, 4, 6, …}
|
||||
func EncodeZigZag(x int64) uint64 {
|
||||
@@ -530,6 +528,7 @@ func EncodeZigZag(x int64) uint64 {
|
||||
}
|
||||
|
||||
// DecodeBool decodes a uint64 as a bool.
|
||||
//
|
||||
// Input: { 0, 1, 2, …}
|
||||
// Output: {false, true, true, …}
|
||||
func DecodeBool(x uint64) bool {
|
||||
@@ -537,6 +536,7 @@ func DecodeBool(x uint64) bool {
|
||||
}
|
||||
|
||||
// EncodeBool encodes a bool as a uint64.
|
||||
//
|
||||
// Input: {false, true}
|
||||
// Output: { 0, 1}
|
||||
func EncodeBool(x bool) uint64 {
|
||||
|
||||
229
go/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go
generated
vendored
229
go/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go
generated
vendored
@@ -14,7 +14,7 @@ import (
|
||||
|
||||
"google.golang.org/protobuf/internal/detrand"
|
||||
"google.golang.org/protobuf/internal/pragma"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
type list interface {
|
||||
@@ -30,17 +30,17 @@ func formatListOpt(vs list, isRoot, allowMulti bool) string {
|
||||
if isRoot {
|
||||
var name string
|
||||
switch vs.(type) {
|
||||
case pref.Names:
|
||||
case protoreflect.Names:
|
||||
name = "Names"
|
||||
case pref.FieldNumbers:
|
||||
case protoreflect.FieldNumbers:
|
||||
name = "FieldNumbers"
|
||||
case pref.FieldRanges:
|
||||
case protoreflect.FieldRanges:
|
||||
name = "FieldRanges"
|
||||
case pref.EnumRanges:
|
||||
case protoreflect.EnumRanges:
|
||||
name = "EnumRanges"
|
||||
case pref.FileImports:
|
||||
case protoreflect.FileImports:
|
||||
name = "FileImports"
|
||||
case pref.Descriptor:
|
||||
case protoreflect.Descriptor:
|
||||
name = reflect.ValueOf(vs).MethodByName("Get").Type().Out(0).Name() + "s"
|
||||
default:
|
||||
name = reflect.ValueOf(vs).Elem().Type().Name()
|
||||
@@ -50,17 +50,17 @@ func formatListOpt(vs list, isRoot, allowMulti bool) string {
|
||||
|
||||
var ss []string
|
||||
switch vs := vs.(type) {
|
||||
case pref.Names:
|
||||
case protoreflect.Names:
|
||||
for i := 0; i < vs.Len(); i++ {
|
||||
ss = append(ss, fmt.Sprint(vs.Get(i)))
|
||||
}
|
||||
return start + joinStrings(ss, false) + end
|
||||
case pref.FieldNumbers:
|
||||
case protoreflect.FieldNumbers:
|
||||
for i := 0; i < vs.Len(); i++ {
|
||||
ss = append(ss, fmt.Sprint(vs.Get(i)))
|
||||
}
|
||||
return start + joinStrings(ss, false) + end
|
||||
case pref.FieldRanges:
|
||||
case protoreflect.FieldRanges:
|
||||
for i := 0; i < vs.Len(); i++ {
|
||||
r := vs.Get(i)
|
||||
if r[0]+1 == r[1] {
|
||||
@@ -70,7 +70,7 @@ func formatListOpt(vs list, isRoot, allowMulti bool) string {
|
||||
}
|
||||
}
|
||||
return start + joinStrings(ss, false) + end
|
||||
case pref.EnumRanges:
|
||||
case protoreflect.EnumRanges:
|
||||
for i := 0; i < vs.Len(); i++ {
|
||||
r := vs.Get(i)
|
||||
if r[0] == r[1] {
|
||||
@@ -80,46 +80,44 @@ func formatListOpt(vs list, isRoot, allowMulti bool) string {
|
||||
}
|
||||
}
|
||||
return start + joinStrings(ss, false) + end
|
||||
case pref.FileImports:
|
||||
case protoreflect.FileImports:
|
||||
for i := 0; i < vs.Len(); i++ {
|
||||
var rs records
|
||||
rs.Append(reflect.ValueOf(vs.Get(i)), "Path", "Package", "IsPublic", "IsWeak")
|
||||
rv := reflect.ValueOf(vs.Get(i))
|
||||
rs.Append(rv, []methodAndName{
|
||||
{rv.MethodByName("Path"), "Path"},
|
||||
{rv.MethodByName("Package"), "Package"},
|
||||
{rv.MethodByName("IsPublic"), "IsPublic"},
|
||||
{rv.MethodByName("IsWeak"), "IsWeak"},
|
||||
}...)
|
||||
ss = append(ss, "{"+rs.Join()+"}")
|
||||
}
|
||||
return start + joinStrings(ss, allowMulti) + end
|
||||
default:
|
||||
_, isEnumValue := vs.(pref.EnumValueDescriptors)
|
||||
_, isEnumValue := vs.(protoreflect.EnumValueDescriptors)
|
||||
for i := 0; i < vs.Len(); i++ {
|
||||
m := reflect.ValueOf(vs).MethodByName("Get")
|
||||
v := m.Call([]reflect.Value{reflect.ValueOf(i)})[0].Interface()
|
||||
ss = append(ss, formatDescOpt(v.(pref.Descriptor), false, allowMulti && !isEnumValue))
|
||||
ss = append(ss, formatDescOpt(v.(protoreflect.Descriptor), false, allowMulti && !isEnumValue, nil))
|
||||
}
|
||||
return start + joinStrings(ss, allowMulti && isEnumValue) + end
|
||||
}
|
||||
}
|
||||
|
||||
// descriptorAccessors is a list of accessors to print for each descriptor.
|
||||
//
|
||||
// Do not print all accessors since some contain redundant information,
|
||||
// while others are pointers that we do not want to follow since the descriptor
|
||||
// is actually a cyclic graph.
|
||||
//
|
||||
// Using a list allows us to print the accessors in a sensible order.
|
||||
var descriptorAccessors = map[reflect.Type][]string{
|
||||
reflect.TypeOf((*pref.FileDescriptor)(nil)).Elem(): {"Path", "Package", "Imports", "Messages", "Enums", "Extensions", "Services"},
|
||||
reflect.TypeOf((*pref.MessageDescriptor)(nil)).Elem(): {"IsMapEntry", "Fields", "Oneofs", "ReservedNames", "ReservedRanges", "RequiredNumbers", "ExtensionRanges", "Messages", "Enums", "Extensions"},
|
||||
reflect.TypeOf((*pref.FieldDescriptor)(nil)).Elem(): {"Number", "Cardinality", "Kind", "HasJSONName", "JSONName", "HasPresence", "IsExtension", "IsPacked", "IsWeak", "IsList", "IsMap", "MapKey", "MapValue", "HasDefault", "Default", "ContainingOneof", "ContainingMessage", "Message", "Enum"},
|
||||
reflect.TypeOf((*pref.OneofDescriptor)(nil)).Elem(): {"Fields"}, // not directly used; must keep in sync with formatDescOpt
|
||||
reflect.TypeOf((*pref.EnumDescriptor)(nil)).Elem(): {"Values", "ReservedNames", "ReservedRanges"},
|
||||
reflect.TypeOf((*pref.EnumValueDescriptor)(nil)).Elem(): {"Number"},
|
||||
reflect.TypeOf((*pref.ServiceDescriptor)(nil)).Elem(): {"Methods"},
|
||||
reflect.TypeOf((*pref.MethodDescriptor)(nil)).Elem(): {"Input", "Output", "IsStreamingClient", "IsStreamingServer"},
|
||||
type methodAndName struct {
|
||||
method reflect.Value
|
||||
name string
|
||||
}
|
||||
|
||||
func FormatDesc(s fmt.State, r rune, t pref.Descriptor) {
|
||||
io.WriteString(s, formatDescOpt(t, true, r == 'v' && (s.Flag('+') || s.Flag('#'))))
|
||||
func FormatDesc(s fmt.State, r rune, t protoreflect.Descriptor) {
|
||||
io.WriteString(s, formatDescOpt(t, true, r == 'v' && (s.Flag('+') || s.Flag('#')), nil))
|
||||
}
|
||||
func formatDescOpt(t pref.Descriptor, isRoot, allowMulti bool) string {
|
||||
|
||||
func InternalFormatDescOptForTesting(t protoreflect.Descriptor, isRoot, allowMulti bool, record func(string)) string {
|
||||
return formatDescOpt(t, isRoot, allowMulti, record)
|
||||
}
|
||||
|
||||
func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool, record func(string)) string {
|
||||
rv := reflect.ValueOf(t)
|
||||
rt := rv.MethodByName("ProtoType").Type().In(0)
|
||||
|
||||
@@ -128,27 +126,61 @@ func formatDescOpt(t pref.Descriptor, isRoot, allowMulti bool) string {
|
||||
start = rt.Name() + "{"
|
||||
}
|
||||
|
||||
_, isFile := t.(pref.FileDescriptor)
|
||||
rs := records{allowMulti: allowMulti}
|
||||
_, isFile := t.(protoreflect.FileDescriptor)
|
||||
rs := records{
|
||||
allowMulti: allowMulti,
|
||||
record: record,
|
||||
}
|
||||
if t.IsPlaceholder() {
|
||||
if isFile {
|
||||
rs.Append(rv, "Path", "Package", "IsPlaceholder")
|
||||
rs.Append(rv, []methodAndName{
|
||||
{rv.MethodByName("Path"), "Path"},
|
||||
{rv.MethodByName("Package"), "Package"},
|
||||
{rv.MethodByName("IsPlaceholder"), "IsPlaceholder"},
|
||||
}...)
|
||||
} else {
|
||||
rs.Append(rv, "FullName", "IsPlaceholder")
|
||||
rs.Append(rv, []methodAndName{
|
||||
{rv.MethodByName("FullName"), "FullName"},
|
||||
{rv.MethodByName("IsPlaceholder"), "IsPlaceholder"},
|
||||
}...)
|
||||
}
|
||||
} else {
|
||||
switch {
|
||||
case isFile:
|
||||
rs.Append(rv, "Syntax")
|
||||
rs.Append(rv, methodAndName{rv.MethodByName("Syntax"), "Syntax"})
|
||||
case isRoot:
|
||||
rs.Append(rv, "Syntax", "FullName")
|
||||
rs.Append(rv, []methodAndName{
|
||||
{rv.MethodByName("Syntax"), "Syntax"},
|
||||
{rv.MethodByName("FullName"), "FullName"},
|
||||
}...)
|
||||
default:
|
||||
rs.Append(rv, "Name")
|
||||
rs.Append(rv, methodAndName{rv.MethodByName("Name"), "Name"})
|
||||
}
|
||||
switch t := t.(type) {
|
||||
case pref.FieldDescriptor:
|
||||
for _, s := range descriptorAccessors[rt] {
|
||||
switch s {
|
||||
case protoreflect.FieldDescriptor:
|
||||
accessors := []methodAndName{
|
||||
{rv.MethodByName("Number"), "Number"},
|
||||
{rv.MethodByName("Cardinality"), "Cardinality"},
|
||||
{rv.MethodByName("Kind"), "Kind"},
|
||||
{rv.MethodByName("HasJSONName"), "HasJSONName"},
|
||||
{rv.MethodByName("JSONName"), "JSONName"},
|
||||
{rv.MethodByName("HasPresence"), "HasPresence"},
|
||||
{rv.MethodByName("IsExtension"), "IsExtension"},
|
||||
{rv.MethodByName("IsPacked"), "IsPacked"},
|
||||
{rv.MethodByName("IsWeak"), "IsWeak"},
|
||||
{rv.MethodByName("IsList"), "IsList"},
|
||||
{rv.MethodByName("IsMap"), "IsMap"},
|
||||
{rv.MethodByName("MapKey"), "MapKey"},
|
||||
{rv.MethodByName("MapValue"), "MapValue"},
|
||||
{rv.MethodByName("HasDefault"), "HasDefault"},
|
||||
{rv.MethodByName("Default"), "Default"},
|
||||
{rv.MethodByName("ContainingOneof"), "ContainingOneof"},
|
||||
{rv.MethodByName("ContainingMessage"), "ContainingMessage"},
|
||||
{rv.MethodByName("Message"), "Message"},
|
||||
{rv.MethodByName("Enum"), "Enum"},
|
||||
}
|
||||
for _, s := range accessors {
|
||||
switch s.name {
|
||||
case "MapKey":
|
||||
if k := t.MapKey(); k != nil {
|
||||
rs.recs = append(rs.recs, [2]string{"MapKey", k.Kind().String()})
|
||||
@@ -156,21 +188,21 @@ func formatDescOpt(t pref.Descriptor, isRoot, allowMulti bool) string {
|
||||
case "MapValue":
|
||||
if v := t.MapValue(); v != nil {
|
||||
switch v.Kind() {
|
||||
case pref.EnumKind:
|
||||
rs.recs = append(rs.recs, [2]string{"MapValue", string(v.Enum().FullName())})
|
||||
case pref.MessageKind, pref.GroupKind:
|
||||
rs.recs = append(rs.recs, [2]string{"MapValue", string(v.Message().FullName())})
|
||||
case protoreflect.EnumKind:
|
||||
rs.AppendRecs("MapValue", [2]string{"MapValue", string(v.Enum().FullName())})
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
rs.AppendRecs("MapValue", [2]string{"MapValue", string(v.Message().FullName())})
|
||||
default:
|
||||
rs.recs = append(rs.recs, [2]string{"MapValue", v.Kind().String()})
|
||||
rs.AppendRecs("MapValue", [2]string{"MapValue", v.Kind().String()})
|
||||
}
|
||||
}
|
||||
case "ContainingOneof":
|
||||
if od := t.ContainingOneof(); od != nil {
|
||||
rs.recs = append(rs.recs, [2]string{"Oneof", string(od.Name())})
|
||||
rs.AppendRecs("ContainingOneof", [2]string{"Oneof", string(od.Name())})
|
||||
}
|
||||
case "ContainingMessage":
|
||||
if t.IsExtension() {
|
||||
rs.recs = append(rs.recs, [2]string{"Extendee", string(t.ContainingMessage().FullName())})
|
||||
rs.AppendRecs("ContainingMessage", [2]string{"Extendee", string(t.ContainingMessage().FullName())})
|
||||
}
|
||||
case "Message":
|
||||
if !t.IsMap() {
|
||||
@@ -180,20 +212,68 @@ func formatDescOpt(t pref.Descriptor, isRoot, allowMulti bool) string {
|
||||
rs.Append(rv, s)
|
||||
}
|
||||
}
|
||||
case pref.OneofDescriptor:
|
||||
case protoreflect.OneofDescriptor:
|
||||
var ss []string
|
||||
fs := t.Fields()
|
||||
for i := 0; i < fs.Len(); i++ {
|
||||
ss = append(ss, string(fs.Get(i).Name()))
|
||||
}
|
||||
if len(ss) > 0 {
|
||||
rs.recs = append(rs.recs, [2]string{"Fields", "[" + joinStrings(ss, false) + "]"})
|
||||
rs.AppendRecs("Fields", [2]string{"Fields", "[" + joinStrings(ss, false) + "]"})
|
||||
}
|
||||
default:
|
||||
rs.Append(rv, descriptorAccessors[rt]...)
|
||||
|
||||
case protoreflect.FileDescriptor:
|
||||
rs.Append(rv, []methodAndName{
|
||||
{rv.MethodByName("Path"), "Path"},
|
||||
{rv.MethodByName("Package"), "Package"},
|
||||
{rv.MethodByName("Imports"), "Imports"},
|
||||
{rv.MethodByName("Messages"), "Messages"},
|
||||
{rv.MethodByName("Enums"), "Enums"},
|
||||
{rv.MethodByName("Extensions"), "Extensions"},
|
||||
{rv.MethodByName("Services"), "Services"},
|
||||
}...)
|
||||
|
||||
case protoreflect.MessageDescriptor:
|
||||
rs.Append(rv, []methodAndName{
|
||||
{rv.MethodByName("IsMapEntry"), "IsMapEntry"},
|
||||
{rv.MethodByName("Fields"), "Fields"},
|
||||
{rv.MethodByName("Oneofs"), "Oneofs"},
|
||||
{rv.MethodByName("ReservedNames"), "ReservedNames"},
|
||||
{rv.MethodByName("ReservedRanges"), "ReservedRanges"},
|
||||
{rv.MethodByName("RequiredNumbers"), "RequiredNumbers"},
|
||||
{rv.MethodByName("ExtensionRanges"), "ExtensionRanges"},
|
||||
{rv.MethodByName("Messages"), "Messages"},
|
||||
{rv.MethodByName("Enums"), "Enums"},
|
||||
{rv.MethodByName("Extensions"), "Extensions"},
|
||||
}...)
|
||||
|
||||
case protoreflect.EnumDescriptor:
|
||||
rs.Append(rv, []methodAndName{
|
||||
{rv.MethodByName("Values"), "Values"},
|
||||
{rv.MethodByName("ReservedNames"), "ReservedNames"},
|
||||
{rv.MethodByName("ReservedRanges"), "ReservedRanges"},
|
||||
}...)
|
||||
|
||||
case protoreflect.EnumValueDescriptor:
|
||||
rs.Append(rv, []methodAndName{
|
||||
{rv.MethodByName("Number"), "Number"},
|
||||
}...)
|
||||
|
||||
case protoreflect.ServiceDescriptor:
|
||||
rs.Append(rv, []methodAndName{
|
||||
{rv.MethodByName("Methods"), "Methods"},
|
||||
}...)
|
||||
|
||||
case protoreflect.MethodDescriptor:
|
||||
rs.Append(rv, []methodAndName{
|
||||
{rv.MethodByName("Input"), "Input"},
|
||||
{rv.MethodByName("Output"), "Output"},
|
||||
{rv.MethodByName("IsStreamingClient"), "IsStreamingClient"},
|
||||
{rv.MethodByName("IsStreamingServer"), "IsStreamingServer"},
|
||||
}...)
|
||||
}
|
||||
if rv.MethodByName("GoType").IsValid() {
|
||||
rs.Append(rv, "GoType")
|
||||
if m := rv.MethodByName("GoType"); m.IsValid() {
|
||||
rs.Append(rv, methodAndName{m, "GoType"})
|
||||
}
|
||||
}
|
||||
return start + rs.Join() + end
|
||||
@@ -202,21 +282,36 @@ func formatDescOpt(t pref.Descriptor, isRoot, allowMulti bool) string {
|
||||
type records struct {
|
||||
recs [][2]string
|
||||
allowMulti bool
|
||||
|
||||
// record is a function that will be called for every Append() or
|
||||
// AppendRecs() call, to be used for testing with the
|
||||
// InternalFormatDescOptForTesting function.
|
||||
record func(string)
|
||||
}
|
||||
|
||||
func (rs *records) Append(v reflect.Value, accessors ...string) {
|
||||
func (rs *records) AppendRecs(fieldName string, newRecs [2]string) {
|
||||
if rs.record != nil {
|
||||
rs.record(fieldName)
|
||||
}
|
||||
rs.recs = append(rs.recs, newRecs)
|
||||
}
|
||||
|
||||
func (rs *records) Append(v reflect.Value, accessors ...methodAndName) {
|
||||
for _, a := range accessors {
|
||||
if rs.record != nil {
|
||||
rs.record(a.name)
|
||||
}
|
||||
var rv reflect.Value
|
||||
if m := v.MethodByName(a); m.IsValid() {
|
||||
rv = m.Call(nil)[0]
|
||||
if a.method.IsValid() {
|
||||
rv = a.method.Call(nil)[0]
|
||||
}
|
||||
if v.Kind() == reflect.Struct && !rv.IsValid() {
|
||||
rv = v.FieldByName(a)
|
||||
rv = v.FieldByName(a.name)
|
||||
}
|
||||
if !rv.IsValid() {
|
||||
panic(fmt.Sprintf("unknown accessor: %v.%s", v.Type(), a))
|
||||
panic(fmt.Sprintf("unknown accessor: %v.%s", v.Type(), a.name))
|
||||
}
|
||||
if _, ok := rv.Interface().(pref.Value); ok {
|
||||
if _, ok := rv.Interface().(protoreflect.Value); ok {
|
||||
rv = rv.MethodByName("Interface").Call(nil)[0]
|
||||
if !rv.IsNil() {
|
||||
rv = rv.Elem()
|
||||
@@ -250,9 +345,9 @@ func (rs *records) Append(v reflect.Value, accessors ...string) {
|
||||
switch v := v.(type) {
|
||||
case list:
|
||||
s = formatListOpt(v, false, rs.allowMulti)
|
||||
case pref.FieldDescriptor, pref.OneofDescriptor, pref.EnumValueDescriptor, pref.MethodDescriptor:
|
||||
s = string(v.(pref.Descriptor).Name())
|
||||
case pref.Descriptor:
|
||||
case protoreflect.FieldDescriptor, protoreflect.OneofDescriptor, protoreflect.EnumValueDescriptor, protoreflect.MethodDescriptor:
|
||||
s = string(v.(protoreflect.Descriptor).Name())
|
||||
case protoreflect.Descriptor:
|
||||
s = string(v.FullName())
|
||||
case string:
|
||||
s = strconv.Quote(v)
|
||||
@@ -261,7 +356,7 @@ func (rs *records) Append(v reflect.Value, accessors ...string) {
|
||||
default:
|
||||
s = fmt.Sprint(v)
|
||||
}
|
||||
rs.recs = append(rs.recs, [2]string{a, s})
|
||||
rs.recs = append(rs.recs, [2]string{a.name, s})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
78
go/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go
generated
vendored
78
go/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go
generated
vendored
@@ -15,8 +15,8 @@ import (
|
||||
"strconv"
|
||||
|
||||
ptext "google.golang.org/protobuf/internal/encoding/text"
|
||||
errors "google.golang.org/protobuf/internal/errors"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/internal/errors"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
// Format is the serialization format used to represent the default value.
|
||||
@@ -35,56 +35,56 @@ const (
|
||||
|
||||
// Unmarshal deserializes the default string s according to the given kind k.
|
||||
// When k is an enum, a list of enum value descriptors must be provided.
|
||||
func Unmarshal(s string, k pref.Kind, evs pref.EnumValueDescriptors, f Format) (pref.Value, pref.EnumValueDescriptor, error) {
|
||||
func Unmarshal(s string, k protoreflect.Kind, evs protoreflect.EnumValueDescriptors, f Format) (protoreflect.Value, protoreflect.EnumValueDescriptor, error) {
|
||||
switch k {
|
||||
case pref.BoolKind:
|
||||
case protoreflect.BoolKind:
|
||||
if f == GoTag {
|
||||
switch s {
|
||||
case "1":
|
||||
return pref.ValueOfBool(true), nil, nil
|
||||
return protoreflect.ValueOfBool(true), nil, nil
|
||||
case "0":
|
||||
return pref.ValueOfBool(false), nil, nil
|
||||
return protoreflect.ValueOfBool(false), nil, nil
|
||||
}
|
||||
} else {
|
||||
switch s {
|
||||
case "true":
|
||||
return pref.ValueOfBool(true), nil, nil
|
||||
return protoreflect.ValueOfBool(true), nil, nil
|
||||
case "false":
|
||||
return pref.ValueOfBool(false), nil, nil
|
||||
return protoreflect.ValueOfBool(false), nil, nil
|
||||
}
|
||||
}
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
if f == GoTag {
|
||||
// Go tags use the numeric form of the enum value.
|
||||
if n, err := strconv.ParseInt(s, 10, 32); err == nil {
|
||||
if ev := evs.ByNumber(pref.EnumNumber(n)); ev != nil {
|
||||
return pref.ValueOfEnum(ev.Number()), ev, nil
|
||||
if ev := evs.ByNumber(protoreflect.EnumNumber(n)); ev != nil {
|
||||
return protoreflect.ValueOfEnum(ev.Number()), ev, nil
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Descriptor default_value use the enum identifier.
|
||||
ev := evs.ByName(pref.Name(s))
|
||||
ev := evs.ByName(protoreflect.Name(s))
|
||||
if ev != nil {
|
||||
return pref.ValueOfEnum(ev.Number()), ev, nil
|
||||
return protoreflect.ValueOfEnum(ev.Number()), ev, nil
|
||||
}
|
||||
}
|
||||
case pref.Int32Kind, pref.Sint32Kind, pref.Sfixed32Kind:
|
||||
case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
|
||||
if v, err := strconv.ParseInt(s, 10, 32); err == nil {
|
||||
return pref.ValueOfInt32(int32(v)), nil, nil
|
||||
return protoreflect.ValueOfInt32(int32(v)), nil, nil
|
||||
}
|
||||
case pref.Int64Kind, pref.Sint64Kind, pref.Sfixed64Kind:
|
||||
case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
|
||||
if v, err := strconv.ParseInt(s, 10, 64); err == nil {
|
||||
return pref.ValueOfInt64(int64(v)), nil, nil
|
||||
return protoreflect.ValueOfInt64(int64(v)), nil, nil
|
||||
}
|
||||
case pref.Uint32Kind, pref.Fixed32Kind:
|
||||
case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
|
||||
if v, err := strconv.ParseUint(s, 10, 32); err == nil {
|
||||
return pref.ValueOfUint32(uint32(v)), nil, nil
|
||||
return protoreflect.ValueOfUint32(uint32(v)), nil, nil
|
||||
}
|
||||
case pref.Uint64Kind, pref.Fixed64Kind:
|
||||
case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
|
||||
if v, err := strconv.ParseUint(s, 10, 64); err == nil {
|
||||
return pref.ValueOfUint64(uint64(v)), nil, nil
|
||||
return protoreflect.ValueOfUint64(uint64(v)), nil, nil
|
||||
}
|
||||
case pref.FloatKind, pref.DoubleKind:
|
||||
case protoreflect.FloatKind, protoreflect.DoubleKind:
|
||||
var v float64
|
||||
var err error
|
||||
switch s {
|
||||
@@ -98,29 +98,29 @@ func Unmarshal(s string, k pref.Kind, evs pref.EnumValueDescriptors, f Format) (
|
||||
v, err = strconv.ParseFloat(s, 64)
|
||||
}
|
||||
if err == nil {
|
||||
if k == pref.FloatKind {
|
||||
return pref.ValueOfFloat32(float32(v)), nil, nil
|
||||
if k == protoreflect.FloatKind {
|
||||
return protoreflect.ValueOfFloat32(float32(v)), nil, nil
|
||||
} else {
|
||||
return pref.ValueOfFloat64(float64(v)), nil, nil
|
||||
return protoreflect.ValueOfFloat64(float64(v)), nil, nil
|
||||
}
|
||||
}
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
// String values are already unescaped and can be used as is.
|
||||
return pref.ValueOfString(s), nil, nil
|
||||
case pref.BytesKind:
|
||||
return protoreflect.ValueOfString(s), nil, nil
|
||||
case protoreflect.BytesKind:
|
||||
if b, ok := unmarshalBytes(s); ok {
|
||||
return pref.ValueOfBytes(b), nil, nil
|
||||
return protoreflect.ValueOfBytes(b), nil, nil
|
||||
}
|
||||
}
|
||||
return pref.Value{}, nil, errors.New("could not parse value for %v: %q", k, s)
|
||||
return protoreflect.Value{}, nil, errors.New("could not parse value for %v: %q", k, s)
|
||||
}
|
||||
|
||||
// Marshal serializes v as the default string according to the given kind k.
|
||||
// When specifying the Descriptor format for an enum kind, the associated
|
||||
// enum value descriptor must be provided.
|
||||
func Marshal(v pref.Value, ev pref.EnumValueDescriptor, k pref.Kind, f Format) (string, error) {
|
||||
func Marshal(v protoreflect.Value, ev protoreflect.EnumValueDescriptor, k protoreflect.Kind, f Format) (string, error) {
|
||||
switch k {
|
||||
case pref.BoolKind:
|
||||
case protoreflect.BoolKind:
|
||||
if f == GoTag {
|
||||
if v.Bool() {
|
||||
return "1", nil
|
||||
@@ -134,17 +134,17 @@ func Marshal(v pref.Value, ev pref.EnumValueDescriptor, k pref.Kind, f Format) (
|
||||
return "false", nil
|
||||
}
|
||||
}
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
if f == GoTag {
|
||||
return strconv.FormatInt(int64(v.Enum()), 10), nil
|
||||
} else {
|
||||
return string(ev.Name()), nil
|
||||
}
|
||||
case pref.Int32Kind, pref.Sint32Kind, pref.Sfixed32Kind, pref.Int64Kind, pref.Sint64Kind, pref.Sfixed64Kind:
|
||||
case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind, protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
|
||||
return strconv.FormatInt(v.Int(), 10), nil
|
||||
case pref.Uint32Kind, pref.Fixed32Kind, pref.Uint64Kind, pref.Fixed64Kind:
|
||||
case protoreflect.Uint32Kind, protoreflect.Fixed32Kind, protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
|
||||
return strconv.FormatUint(v.Uint(), 10), nil
|
||||
case pref.FloatKind, pref.DoubleKind:
|
||||
case protoreflect.FloatKind, protoreflect.DoubleKind:
|
||||
f := v.Float()
|
||||
switch {
|
||||
case math.IsInf(f, -1):
|
||||
@@ -154,16 +154,16 @@ func Marshal(v pref.Value, ev pref.EnumValueDescriptor, k pref.Kind, f Format) (
|
||||
case math.IsNaN(f):
|
||||
return "nan", nil
|
||||
default:
|
||||
if k == pref.FloatKind {
|
||||
if k == protoreflect.FloatKind {
|
||||
return strconv.FormatFloat(f, 'g', -1, 32), nil
|
||||
} else {
|
||||
return strconv.FormatFloat(f, 'g', -1, 64), nil
|
||||
}
|
||||
}
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
// String values are serialized as is without any escaping.
|
||||
return v.String(), nil
|
||||
case pref.BytesKind:
|
||||
case protoreflect.BytesKind:
|
||||
if s, ok := marshalBytes(v.Bytes()); ok {
|
||||
return s, nil
|
||||
}
|
||||
|
||||
7
go/vendor/google.golang.org/protobuf/internal/encoding/messageset/messageset.go
generated
vendored
7
go/vendor/google.golang.org/protobuf/internal/encoding/messageset/messageset.go
generated
vendored
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/internal/errors"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
// The MessageSet wire format is equivalent to a message defined as follows,
|
||||
@@ -33,6 +33,7 @@ const (
|
||||
// ExtensionName is the field name for extensions of MessageSet.
|
||||
//
|
||||
// A valid MessageSet extension must be of the form:
|
||||
//
|
||||
// message MyMessage {
|
||||
// extend proto2.bridge.MessageSet {
|
||||
// optional MyMessage message_set_extension = 1234;
|
||||
@@ -42,13 +43,13 @@ const (
|
||||
const ExtensionName = "message_set_extension"
|
||||
|
||||
// IsMessageSet returns whether the message uses the MessageSet wire format.
|
||||
func IsMessageSet(md pref.MessageDescriptor) bool {
|
||||
func IsMessageSet(md protoreflect.MessageDescriptor) bool {
|
||||
xmd, ok := md.(interface{ IsMessageSet() bool })
|
||||
return ok && xmd.IsMessageSet()
|
||||
}
|
||||
|
||||
// IsMessageSetExtension reports this field properly extends a MessageSet.
|
||||
func IsMessageSetExtension(fd pref.FieldDescriptor) bool {
|
||||
func IsMessageSetExtension(fd protoreflect.FieldDescriptor) bool {
|
||||
switch {
|
||||
case fd.Name() != ExtensionName:
|
||||
return false
|
||||
|
||||
96
go/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go
generated
vendored
96
go/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go
generated
vendored
@@ -11,10 +11,10 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
defval "google.golang.org/protobuf/internal/encoding/defval"
|
||||
fdesc "google.golang.org/protobuf/internal/filedesc"
|
||||
"google.golang.org/protobuf/internal/encoding/defval"
|
||||
"google.golang.org/protobuf/internal/filedesc"
|
||||
"google.golang.org/protobuf/internal/strs"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
var byteType = reflect.TypeOf(byte(0))
|
||||
@@ -29,9 +29,9 @@ var byteType = reflect.TypeOf(byte(0))
|
||||
// This does not populate the Enum or Message (except for weak message).
|
||||
//
|
||||
// This function is a best effort attempt; parsing errors are ignored.
|
||||
func Unmarshal(tag string, goType reflect.Type, evs pref.EnumValueDescriptors) pref.FieldDescriptor {
|
||||
f := new(fdesc.Field)
|
||||
f.L0.ParentFile = fdesc.SurrogateProto2
|
||||
func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescriptors) protoreflect.FieldDescriptor {
|
||||
f := new(filedesc.Field)
|
||||
f.L0.ParentFile = filedesc.SurrogateProto2
|
||||
for len(tag) > 0 {
|
||||
i := strings.IndexByte(tag, ',')
|
||||
if i < 0 {
|
||||
@@ -39,68 +39,68 @@ func Unmarshal(tag string, goType reflect.Type, evs pref.EnumValueDescriptors) p
|
||||
}
|
||||
switch s := tag[:i]; {
|
||||
case strings.HasPrefix(s, "name="):
|
||||
f.L0.FullName = pref.FullName(s[len("name="):])
|
||||
f.L0.FullName = protoreflect.FullName(s[len("name="):])
|
||||
case strings.Trim(s, "0123456789") == "":
|
||||
n, _ := strconv.ParseUint(s, 10, 32)
|
||||
f.L1.Number = pref.FieldNumber(n)
|
||||
f.L1.Number = protoreflect.FieldNumber(n)
|
||||
case s == "opt":
|
||||
f.L1.Cardinality = pref.Optional
|
||||
f.L1.Cardinality = protoreflect.Optional
|
||||
case s == "req":
|
||||
f.L1.Cardinality = pref.Required
|
||||
f.L1.Cardinality = protoreflect.Required
|
||||
case s == "rep":
|
||||
f.L1.Cardinality = pref.Repeated
|
||||
f.L1.Cardinality = protoreflect.Repeated
|
||||
case s == "varint":
|
||||
switch goType.Kind() {
|
||||
case reflect.Bool:
|
||||
f.L1.Kind = pref.BoolKind
|
||||
f.L1.Kind = protoreflect.BoolKind
|
||||
case reflect.Int32:
|
||||
f.L1.Kind = pref.Int32Kind
|
||||
f.L1.Kind = protoreflect.Int32Kind
|
||||
case reflect.Int64:
|
||||
f.L1.Kind = pref.Int64Kind
|
||||
f.L1.Kind = protoreflect.Int64Kind
|
||||
case reflect.Uint32:
|
||||
f.L1.Kind = pref.Uint32Kind
|
||||
f.L1.Kind = protoreflect.Uint32Kind
|
||||
case reflect.Uint64:
|
||||
f.L1.Kind = pref.Uint64Kind
|
||||
f.L1.Kind = protoreflect.Uint64Kind
|
||||
}
|
||||
case s == "zigzag32":
|
||||
if goType.Kind() == reflect.Int32 {
|
||||
f.L1.Kind = pref.Sint32Kind
|
||||
f.L1.Kind = protoreflect.Sint32Kind
|
||||
}
|
||||
case s == "zigzag64":
|
||||
if goType.Kind() == reflect.Int64 {
|
||||
f.L1.Kind = pref.Sint64Kind
|
||||
f.L1.Kind = protoreflect.Sint64Kind
|
||||
}
|
||||
case s == "fixed32":
|
||||
switch goType.Kind() {
|
||||
case reflect.Int32:
|
||||
f.L1.Kind = pref.Sfixed32Kind
|
||||
f.L1.Kind = protoreflect.Sfixed32Kind
|
||||
case reflect.Uint32:
|
||||
f.L1.Kind = pref.Fixed32Kind
|
||||
f.L1.Kind = protoreflect.Fixed32Kind
|
||||
case reflect.Float32:
|
||||
f.L1.Kind = pref.FloatKind
|
||||
f.L1.Kind = protoreflect.FloatKind
|
||||
}
|
||||
case s == "fixed64":
|
||||
switch goType.Kind() {
|
||||
case reflect.Int64:
|
||||
f.L1.Kind = pref.Sfixed64Kind
|
||||
f.L1.Kind = protoreflect.Sfixed64Kind
|
||||
case reflect.Uint64:
|
||||
f.L1.Kind = pref.Fixed64Kind
|
||||
f.L1.Kind = protoreflect.Fixed64Kind
|
||||
case reflect.Float64:
|
||||
f.L1.Kind = pref.DoubleKind
|
||||
f.L1.Kind = protoreflect.DoubleKind
|
||||
}
|
||||
case s == "bytes":
|
||||
switch {
|
||||
case goType.Kind() == reflect.String:
|
||||
f.L1.Kind = pref.StringKind
|
||||
f.L1.Kind = protoreflect.StringKind
|
||||
case goType.Kind() == reflect.Slice && goType.Elem() == byteType:
|
||||
f.L1.Kind = pref.BytesKind
|
||||
f.L1.Kind = protoreflect.BytesKind
|
||||
default:
|
||||
f.L1.Kind = pref.MessageKind
|
||||
f.L1.Kind = protoreflect.MessageKind
|
||||
}
|
||||
case s == "group":
|
||||
f.L1.Kind = pref.GroupKind
|
||||
f.L1.Kind = protoreflect.GroupKind
|
||||
case strings.HasPrefix(s, "enum="):
|
||||
f.L1.Kind = pref.EnumKind
|
||||
f.L1.Kind = protoreflect.EnumKind
|
||||
case strings.HasPrefix(s, "json="):
|
||||
jsonName := s[len("json="):]
|
||||
if jsonName != strs.JSONCamelCase(string(f.L0.FullName.Name())) {
|
||||
@@ -111,23 +111,23 @@ func Unmarshal(tag string, goType reflect.Type, evs pref.EnumValueDescriptors) p
|
||||
f.L1.IsPacked = true
|
||||
case strings.HasPrefix(s, "weak="):
|
||||
f.L1.IsWeak = true
|
||||
f.L1.Message = fdesc.PlaceholderMessage(pref.FullName(s[len("weak="):]))
|
||||
f.L1.Message = filedesc.PlaceholderMessage(protoreflect.FullName(s[len("weak="):]))
|
||||
case strings.HasPrefix(s, "def="):
|
||||
// The default tag is special in that everything afterwards is the
|
||||
// default regardless of the presence of commas.
|
||||
s, i = tag[len("def="):], len(tag)
|
||||
v, ev, _ := defval.Unmarshal(s, f.L1.Kind, evs, defval.GoTag)
|
||||
f.L1.Default = fdesc.DefaultValue(v, ev)
|
||||
f.L1.Default = filedesc.DefaultValue(v, ev)
|
||||
case s == "proto3":
|
||||
f.L0.ParentFile = fdesc.SurrogateProto3
|
||||
f.L0.ParentFile = filedesc.SurrogateProto3
|
||||
}
|
||||
tag = strings.TrimPrefix(tag[i:], ",")
|
||||
}
|
||||
|
||||
// The generator uses the group message name instead of the field name.
|
||||
// We obtain the real field name by lowercasing the group name.
|
||||
if f.L1.Kind == pref.GroupKind {
|
||||
f.L0.FullName = pref.FullName(strings.ToLower(string(f.L0.FullName)))
|
||||
if f.L1.Kind == protoreflect.GroupKind {
|
||||
f.L0.FullName = protoreflect.FullName(strings.ToLower(string(f.L0.FullName)))
|
||||
}
|
||||
return f
|
||||
}
|
||||
@@ -140,38 +140,38 @@ func Unmarshal(tag string, goType reflect.Type, evs pref.EnumValueDescriptors) p
|
||||
// Depending on the context on how Marshal is called, there are different ways
|
||||
// through which that information is determined. As such it is the caller's
|
||||
// responsibility to provide a function to obtain that information.
|
||||
func Marshal(fd pref.FieldDescriptor, enumName string) string {
|
||||
func Marshal(fd protoreflect.FieldDescriptor, enumName string) string {
|
||||
var tag []string
|
||||
switch fd.Kind() {
|
||||
case pref.BoolKind, pref.EnumKind, pref.Int32Kind, pref.Uint32Kind, pref.Int64Kind, pref.Uint64Kind:
|
||||
case protoreflect.BoolKind, protoreflect.EnumKind, protoreflect.Int32Kind, protoreflect.Uint32Kind, protoreflect.Int64Kind, protoreflect.Uint64Kind:
|
||||
tag = append(tag, "varint")
|
||||
case pref.Sint32Kind:
|
||||
case protoreflect.Sint32Kind:
|
||||
tag = append(tag, "zigzag32")
|
||||
case pref.Sint64Kind:
|
||||
case protoreflect.Sint64Kind:
|
||||
tag = append(tag, "zigzag64")
|
||||
case pref.Sfixed32Kind, pref.Fixed32Kind, pref.FloatKind:
|
||||
case protoreflect.Sfixed32Kind, protoreflect.Fixed32Kind, protoreflect.FloatKind:
|
||||
tag = append(tag, "fixed32")
|
||||
case pref.Sfixed64Kind, pref.Fixed64Kind, pref.DoubleKind:
|
||||
case protoreflect.Sfixed64Kind, protoreflect.Fixed64Kind, protoreflect.DoubleKind:
|
||||
tag = append(tag, "fixed64")
|
||||
case pref.StringKind, pref.BytesKind, pref.MessageKind:
|
||||
case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind:
|
||||
tag = append(tag, "bytes")
|
||||
case pref.GroupKind:
|
||||
case protoreflect.GroupKind:
|
||||
tag = append(tag, "group")
|
||||
}
|
||||
tag = append(tag, strconv.Itoa(int(fd.Number())))
|
||||
switch fd.Cardinality() {
|
||||
case pref.Optional:
|
||||
case protoreflect.Optional:
|
||||
tag = append(tag, "opt")
|
||||
case pref.Required:
|
||||
case protoreflect.Required:
|
||||
tag = append(tag, "req")
|
||||
case pref.Repeated:
|
||||
case protoreflect.Repeated:
|
||||
tag = append(tag, "rep")
|
||||
}
|
||||
if fd.IsPacked() {
|
||||
tag = append(tag, "packed")
|
||||
}
|
||||
name := string(fd.Name())
|
||||
if fd.Kind() == pref.GroupKind {
|
||||
if fd.Kind() == protoreflect.GroupKind {
|
||||
// The name of the FieldDescriptor for a group field is
|
||||
// lowercased. To find the original capitalization, we
|
||||
// look in the field's MessageType.
|
||||
@@ -189,10 +189,10 @@ func Marshal(fd pref.FieldDescriptor, enumName string) string {
|
||||
// The previous implementation does not tag extension fields as proto3,
|
||||
// even when the field is defined in a proto3 file. Match that behavior
|
||||
// for consistency.
|
||||
if fd.Syntax() == pref.Proto3 && !fd.IsExtension() {
|
||||
if fd.Syntax() == protoreflect.Proto3 && !fd.IsExtension() {
|
||||
tag = append(tag, "proto3")
|
||||
}
|
||||
if fd.Kind() == pref.EnumKind && enumName != "" {
|
||||
if fd.Kind() == protoreflect.EnumKind && enumName != "" {
|
||||
tag = append(tag, "enum="+enumName)
|
||||
}
|
||||
if fd.ContainingOneof() != nil {
|
||||
|
||||
35
go/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go
generated
vendored
35
go/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go
generated
vendored
@@ -8,7 +8,6 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"unicode/utf8"
|
||||
|
||||
@@ -413,15 +412,16 @@ func (d *Decoder) parseFieldName() (tok Token, err error) {
|
||||
// Field number. Identify if input is a valid number that is not negative
|
||||
// and is decimal integer within 32-bit range.
|
||||
if num := parseNumber(d.in); num.size > 0 {
|
||||
str := num.string(d.in)
|
||||
if !num.neg && num.kind == numDec {
|
||||
if _, err := strconv.ParseInt(string(d.in[:num.size]), 10, 32); err == nil {
|
||||
if _, err := strconv.ParseInt(str, 10, 32); err == nil {
|
||||
return d.consumeToken(Name, num.size, uint8(FieldNumber)), nil
|
||||
}
|
||||
}
|
||||
return Token{}, d.newSyntaxError("invalid field number: %s", d.in[:num.size])
|
||||
return Token{}, d.newSyntaxError("invalid field number: %s", str)
|
||||
}
|
||||
|
||||
return Token{}, d.newSyntaxError("invalid field name: %s", errRegexp.Find(d.in))
|
||||
return Token{}, d.newSyntaxError("invalid field name: %s", errId(d.in))
|
||||
}
|
||||
|
||||
// parseTypeName parses Any type URL or extension field name. The name is
|
||||
@@ -571,7 +571,7 @@ func (d *Decoder) parseScalar() (Token, error) {
|
||||
return tok, nil
|
||||
}
|
||||
|
||||
return Token{}, d.newSyntaxError("invalid scalar value: %s", errRegexp.Find(d.in))
|
||||
return Token{}, d.newSyntaxError("invalid scalar value: %s", errId(d.in))
|
||||
}
|
||||
|
||||
// parseLiteralValue parses a literal value. A literal value is used for
|
||||
@@ -653,8 +653,29 @@ func consume(b []byte, n int) []byte {
|
||||
return b
|
||||
}
|
||||
|
||||
// Any sequence that looks like a non-delimiter (for error reporting).
|
||||
var errRegexp = regexp.MustCompile(`^([-+._a-zA-Z0-9\/]+|.)`)
|
||||
// errId extracts a byte sequence that looks like an invalid ID
|
||||
// (for the purposes of error reporting).
|
||||
func errId(seq []byte) []byte {
|
||||
const maxLen = 32
|
||||
for i := 0; i < len(seq); {
|
||||
if i > maxLen {
|
||||
return append(seq[:i:i], "…"...)
|
||||
}
|
||||
r, size := utf8.DecodeRune(seq[i:])
|
||||
if r > utf8.RuneSelf || (r != '/' && isDelim(byte(r))) {
|
||||
if i == 0 {
|
||||
// Either the first byte is invalid UTF-8 or a
|
||||
// delimiter, or the first rune is non-ASCII.
|
||||
// Return it as-is.
|
||||
i = size
|
||||
}
|
||||
return seq[:i:i]
|
||||
}
|
||||
i += size
|
||||
}
|
||||
// No delimiter found.
|
||||
return seq
|
||||
}
|
||||
|
||||
// isDelim returns true if given byte is a delimiter character.
|
||||
func isDelim(c byte) bool {
|
||||
|
||||
49
go/vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go
generated
vendored
49
go/vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go
generated
vendored
@@ -15,17 +15,12 @@ func (d *Decoder) parseNumberValue() (Token, bool) {
|
||||
if num.neg {
|
||||
numAttrs |= isNegative
|
||||
}
|
||||
strSize := num.size
|
||||
last := num.size - 1
|
||||
if num.kind == numFloat && (d.in[last] == 'f' || d.in[last] == 'F') {
|
||||
strSize = last
|
||||
}
|
||||
tok := Token{
|
||||
kind: Scalar,
|
||||
attrs: numberValue,
|
||||
pos: len(d.orig) - len(d.in),
|
||||
raw: d.in[:num.size],
|
||||
str: string(d.in[:strSize]),
|
||||
str: num.string(d.in),
|
||||
numAttrs: numAttrs,
|
||||
}
|
||||
d.consume(num.size)
|
||||
@@ -46,12 +41,35 @@ type number struct {
|
||||
kind uint8
|
||||
neg bool
|
||||
size int
|
||||
// if neg, this is the length of whitespace and comments between
|
||||
// the minus sign and the rest fo the number literal
|
||||
sep int
|
||||
}
|
||||
|
||||
func (num number) string(data []byte) string {
|
||||
strSize := num.size
|
||||
last := num.size - 1
|
||||
if num.kind == numFloat && (data[last] == 'f' || data[last] == 'F') {
|
||||
strSize = last
|
||||
}
|
||||
if num.neg && num.sep > 0 {
|
||||
// strip whitespace/comments between negative sign and the rest
|
||||
strLen := strSize - num.sep
|
||||
str := make([]byte, strLen)
|
||||
str[0] = data[0]
|
||||
copy(str[1:], data[num.sep+1:strSize])
|
||||
return string(str)
|
||||
}
|
||||
return string(data[:strSize])
|
||||
|
||||
}
|
||||
|
||||
// parseNumber constructs a number object from given input. It allows for the
|
||||
// following patterns:
|
||||
// integer: ^-?([1-9][0-9]*|0[xX][0-9a-fA-F]+|0[0-7]*)
|
||||
// float: ^-?((0|[1-9][0-9]*)?([.][0-9]*)?([eE][+-]?[0-9]+)?[fF]?)
|
||||
//
|
||||
// integer: ^-?([1-9][0-9]*|0[xX][0-9a-fA-F]+|0[0-7]*)
|
||||
// float: ^-?((0|[1-9][0-9]*)?([.][0-9]*)?([eE][+-]?[0-9]+)?[fF]?)
|
||||
//
|
||||
// It also returns the number of parsed bytes for the given number, 0 if it is
|
||||
// not a number.
|
||||
func parseNumber(input []byte) number {
|
||||
@@ -65,19 +83,22 @@ func parseNumber(input []byte) number {
|
||||
}
|
||||
|
||||
// Optional -
|
||||
var sep int
|
||||
if s[0] == '-' {
|
||||
neg = true
|
||||
s = s[1:]
|
||||
size++
|
||||
// Consume any whitespace or comments between the
|
||||
// negative sign and the rest of the number
|
||||
lenBefore := len(s)
|
||||
s = consume(s, 0)
|
||||
sep = lenBefore - len(s)
|
||||
size += sep
|
||||
if len(s) == 0 {
|
||||
return number{}
|
||||
}
|
||||
}
|
||||
|
||||
// C++ allows for whitespace and comments in between the negative sign and
|
||||
// the rest of the number. This logic currently does not but is consistent
|
||||
// with v1.
|
||||
|
||||
switch {
|
||||
case s[0] == '0':
|
||||
if len(s) > 1 {
|
||||
@@ -114,7 +135,7 @@ func parseNumber(input []byte) number {
|
||||
if len(s) > 0 && !isDelim(s[0]) {
|
||||
return number{}
|
||||
}
|
||||
return number{kind: kind, neg: neg, size: size}
|
||||
return number{kind: kind, neg: neg, size: size, sep: sep}
|
||||
}
|
||||
}
|
||||
s = s[1:]
|
||||
@@ -186,5 +207,5 @@ func parseNumber(input []byte) number {
|
||||
return number{}
|
||||
}
|
||||
|
||||
return number{kind: kind, neg: neg, size: size}
|
||||
return number{kind: kind, neg: neg, size: size, sep: sep}
|
||||
}
|
||||
|
||||
4
go/vendor/google.golang.org/protobuf/internal/encoding/text/doc.go
generated
vendored
4
go/vendor/google.golang.org/protobuf/internal/encoding/text/doc.go
generated
vendored
@@ -24,6 +24,6 @@
|
||||
// the Go implementation should as well.
|
||||
//
|
||||
// The text format is almost a superset of JSON except:
|
||||
// * message keys are not quoted strings, but identifiers
|
||||
// * the top-level value must be a message without the delimiters
|
||||
// - message keys are not quoted strings, but identifiers
|
||||
// - the top-level value must be a message without the delimiters
|
||||
package text
|
||||
|
||||
10
go/vendor/google.golang.org/protobuf/internal/encoding/text/encode.go
generated
vendored
10
go/vendor/google.golang.org/protobuf/internal/encoding/text/encode.go
generated
vendored
@@ -53,8 +53,10 @@ type encoderState struct {
|
||||
// If outputASCII is true, strings will be serialized in such a way that
|
||||
// multi-byte UTF-8 sequences are escaped. This property ensures that the
|
||||
// overall output is ASCII (as opposed to UTF-8).
|
||||
func NewEncoder(indent string, delims [2]byte, outputASCII bool) (*Encoder, error) {
|
||||
e := &Encoder{}
|
||||
func NewEncoder(buf []byte, indent string, delims [2]byte, outputASCII bool) (*Encoder, error) {
|
||||
e := &Encoder{
|
||||
encoderState: encoderState{out: buf},
|
||||
}
|
||||
if len(indent) > 0 {
|
||||
if strings.Trim(indent, " \t") != "" {
|
||||
return nil, errors.New("indent may only be composed of space and tab characters")
|
||||
@@ -195,13 +197,13 @@ func appendFloat(out []byte, n float64, bitSize int) []byte {
|
||||
// WriteInt writes out the given signed integer value.
|
||||
func (e *Encoder) WriteInt(n int64) {
|
||||
e.prepareNext(scalar)
|
||||
e.out = append(e.out, strconv.FormatInt(n, 10)...)
|
||||
e.out = strconv.AppendInt(e.out, n, 10)
|
||||
}
|
||||
|
||||
// WriteUint writes out the given unsigned integer value.
|
||||
func (e *Encoder) WriteUint(n uint64) {
|
||||
e.prepareNext(scalar)
|
||||
e.out = append(e.out, strconv.FormatUint(n, 10)...)
|
||||
e.out = strconv.AppendUint(e.out, n, 10)
|
||||
}
|
||||
|
||||
// WriteLiteral writes out the given string as a literal value without quotes.
|
||||
|
||||
19
go/vendor/google.golang.org/protobuf/internal/filedesc/build.go
generated
vendored
19
go/vendor/google.golang.org/protobuf/internal/filedesc/build.go
generated
vendored
@@ -12,8 +12,7 @@ import (
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/internal/genid"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
preg "google.golang.org/protobuf/reflect/protoregistry"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
)
|
||||
|
||||
// Builder construct a protoreflect.FileDescriptor from the raw descriptor.
|
||||
@@ -38,7 +37,7 @@ type Builder struct {
|
||||
// TypeResolver resolves extension field types for descriptor options.
|
||||
// If nil, it uses protoregistry.GlobalTypes.
|
||||
TypeResolver interface {
|
||||
preg.ExtensionTypeResolver
|
||||
protoregistry.ExtensionTypeResolver
|
||||
}
|
||||
|
||||
// FileRegistry is use to lookup file, enum, and message dependencies.
|
||||
@@ -46,8 +45,8 @@ type Builder struct {
|
||||
// If nil, it uses protoregistry.GlobalFiles.
|
||||
FileRegistry interface {
|
||||
FindFileByPath(string) (protoreflect.FileDescriptor, error)
|
||||
FindDescriptorByName(pref.FullName) (pref.Descriptor, error)
|
||||
RegisterFile(pref.FileDescriptor) error
|
||||
FindDescriptorByName(protoreflect.FullName) (protoreflect.Descriptor, error)
|
||||
RegisterFile(protoreflect.FileDescriptor) error
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +54,8 @@ type Builder struct {
|
||||
// If so, it permits looking up an enum or message dependency based on the
|
||||
// sub-list and element index into filetype.Builder.DependencyIndexes.
|
||||
type resolverByIndex interface {
|
||||
FindEnumByIndex(int32, int32, []Enum, []Message) pref.EnumDescriptor
|
||||
FindMessageByIndex(int32, int32, []Enum, []Message) pref.MessageDescriptor
|
||||
FindEnumByIndex(int32, int32, []Enum, []Message) protoreflect.EnumDescriptor
|
||||
FindMessageByIndex(int32, int32, []Enum, []Message) protoreflect.MessageDescriptor
|
||||
}
|
||||
|
||||
// Indexes of each sub-list in filetype.Builder.DependencyIndexes.
|
||||
@@ -70,7 +69,7 @@ const (
|
||||
|
||||
// Out is the output of the Builder.
|
||||
type Out struct {
|
||||
File pref.FileDescriptor
|
||||
File protoreflect.FileDescriptor
|
||||
|
||||
// Enums is all enum descriptors in "flattened ordering".
|
||||
Enums []Enum
|
||||
@@ -97,10 +96,10 @@ func (db Builder) Build() (out Out) {
|
||||
|
||||
// Initialize resolvers and registries if unpopulated.
|
||||
if db.TypeResolver == nil {
|
||||
db.TypeResolver = preg.GlobalTypes
|
||||
db.TypeResolver = protoregistry.GlobalTypes
|
||||
}
|
||||
if db.FileRegistry == nil {
|
||||
db.FileRegistry = preg.GlobalFiles
|
||||
db.FileRegistry = protoregistry.GlobalFiles
|
||||
}
|
||||
|
||||
fd := newRawFile(db)
|
||||
|
||||
425
go/vendor/google.golang.org/protobuf/internal/filedesc/desc.go
generated
vendored
425
go/vendor/google.golang.org/protobuf/internal/filedesc/desc.go
generated
vendored
@@ -17,15 +17,30 @@ import (
|
||||
"google.golang.org/protobuf/internal/genid"
|
||||
"google.golang.org/protobuf/internal/pragma"
|
||||
"google.golang.org/protobuf/internal/strs"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
)
|
||||
|
||||
// Edition is an Enum for proto2.Edition
|
||||
type Edition int32
|
||||
|
||||
// These values align with the value of Enum in descriptor.proto which allows
|
||||
// direct conversion between the proto enum and this enum.
|
||||
const (
|
||||
EditionUnknown Edition = 0
|
||||
EditionProto2 Edition = 998
|
||||
EditionProto3 Edition = 999
|
||||
Edition2023 Edition = 1000
|
||||
EditionUnsupported Edition = 100000
|
||||
)
|
||||
|
||||
// The types in this file may have a suffix:
|
||||
// • L0: Contains fields common to all descriptors (except File) and
|
||||
// must be initialized up front.
|
||||
// • L1: Contains fields specific to a descriptor and
|
||||
// must be initialized up front.
|
||||
// must be initialized up front. If the associated proto uses Editions, the
|
||||
// Editions features must always be resolved. If not explicitly set, the
|
||||
// appropriate default must be resolved and set.
|
||||
// • L2: Contains fields that are lazily initialized when constructing
|
||||
// from the raw file descriptor. When constructing as a literal, the L2
|
||||
// fields must be initialized up front.
|
||||
@@ -43,46 +58,70 @@ type (
|
||||
L2 *FileL2
|
||||
}
|
||||
FileL1 struct {
|
||||
Syntax pref.Syntax
|
||||
Syntax protoreflect.Syntax
|
||||
Edition Edition // Only used if Syntax == Editions
|
||||
Path string
|
||||
Package pref.FullName
|
||||
Package protoreflect.FullName
|
||||
|
||||
Enums Enums
|
||||
Messages Messages
|
||||
Extensions Extensions
|
||||
Services Services
|
||||
|
||||
EditionFeatures FileEditionFeatures
|
||||
}
|
||||
FileL2 struct {
|
||||
Options func() pref.ProtoMessage
|
||||
Options func() protoreflect.ProtoMessage
|
||||
Imports FileImports
|
||||
Locations SourceLocations
|
||||
}
|
||||
|
||||
FileEditionFeatures struct {
|
||||
// IsFieldPresence is true if field_presence is EXPLICIT
|
||||
// https://protobuf.dev/editions/features/#field_presence
|
||||
IsFieldPresence bool
|
||||
// IsOpenEnum is true if enum_type is OPEN
|
||||
// https://protobuf.dev/editions/features/#enum_type
|
||||
IsOpenEnum bool
|
||||
// IsPacked is true if repeated_field_encoding is PACKED
|
||||
// https://protobuf.dev/editions/features/#repeated_field_encoding
|
||||
IsPacked bool
|
||||
// IsUTF8Validated is true if utf_validation is VERIFY
|
||||
// https://protobuf.dev/editions/features/#utf8_validation
|
||||
IsUTF8Validated bool
|
||||
// IsDelimitedEncoded is true if message_encoding is DELIMITED
|
||||
// https://protobuf.dev/editions/features/#message_encoding
|
||||
IsDelimitedEncoded bool
|
||||
// IsJSONCompliant is true if json_format is ALLOW
|
||||
// https://protobuf.dev/editions/features/#json_format
|
||||
IsJSONCompliant bool
|
||||
}
|
||||
)
|
||||
|
||||
func (fd *File) ParentFile() pref.FileDescriptor { return fd }
|
||||
func (fd *File) Parent() pref.Descriptor { return nil }
|
||||
func (fd *File) Index() int { return 0 }
|
||||
func (fd *File) Syntax() pref.Syntax { return fd.L1.Syntax }
|
||||
func (fd *File) Name() pref.Name { return fd.L1.Package.Name() }
|
||||
func (fd *File) FullName() pref.FullName { return fd.L1.Package }
|
||||
func (fd *File) IsPlaceholder() bool { return false }
|
||||
func (fd *File) Options() pref.ProtoMessage {
|
||||
func (fd *File) ParentFile() protoreflect.FileDescriptor { return fd }
|
||||
func (fd *File) Parent() protoreflect.Descriptor { return nil }
|
||||
func (fd *File) Index() int { return 0 }
|
||||
func (fd *File) Syntax() protoreflect.Syntax { return fd.L1.Syntax }
|
||||
func (fd *File) Name() protoreflect.Name { return fd.L1.Package.Name() }
|
||||
func (fd *File) FullName() protoreflect.FullName { return fd.L1.Package }
|
||||
func (fd *File) IsPlaceholder() bool { return false }
|
||||
func (fd *File) Options() protoreflect.ProtoMessage {
|
||||
if f := fd.lazyInit().Options; f != nil {
|
||||
return f()
|
||||
}
|
||||
return descopts.File
|
||||
}
|
||||
func (fd *File) Path() string { return fd.L1.Path }
|
||||
func (fd *File) Package() pref.FullName { return fd.L1.Package }
|
||||
func (fd *File) Imports() pref.FileImports { return &fd.lazyInit().Imports }
|
||||
func (fd *File) Enums() pref.EnumDescriptors { return &fd.L1.Enums }
|
||||
func (fd *File) Messages() pref.MessageDescriptors { return &fd.L1.Messages }
|
||||
func (fd *File) Extensions() pref.ExtensionDescriptors { return &fd.L1.Extensions }
|
||||
func (fd *File) Services() pref.ServiceDescriptors { return &fd.L1.Services }
|
||||
func (fd *File) SourceLocations() pref.SourceLocations { return &fd.lazyInit().Locations }
|
||||
func (fd *File) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, fd) }
|
||||
func (fd *File) ProtoType(pref.FileDescriptor) {}
|
||||
func (fd *File) ProtoInternal(pragma.DoNotImplement) {}
|
||||
func (fd *File) Path() string { return fd.L1.Path }
|
||||
func (fd *File) Package() protoreflect.FullName { return fd.L1.Package }
|
||||
func (fd *File) Imports() protoreflect.FileImports { return &fd.lazyInit().Imports }
|
||||
func (fd *File) Enums() protoreflect.EnumDescriptors { return &fd.L1.Enums }
|
||||
func (fd *File) Messages() protoreflect.MessageDescriptors { return &fd.L1.Messages }
|
||||
func (fd *File) Extensions() protoreflect.ExtensionDescriptors { return &fd.L1.Extensions }
|
||||
func (fd *File) Services() protoreflect.ServiceDescriptors { return &fd.L1.Services }
|
||||
func (fd *File) SourceLocations() protoreflect.SourceLocations { return &fd.lazyInit().Locations }
|
||||
func (fd *File) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, fd) }
|
||||
func (fd *File) ProtoType(protoreflect.FileDescriptor) {}
|
||||
func (fd *File) ProtoInternal(pragma.DoNotImplement) {}
|
||||
|
||||
func (fd *File) lazyInit() *FileL2 {
|
||||
if atomic.LoadUint32(&fd.once) == 0 {
|
||||
@@ -119,7 +158,7 @@ type (
|
||||
eagerValues bool // controls whether EnumL2.Values is already populated
|
||||
}
|
||||
EnumL2 struct {
|
||||
Options func() pref.ProtoMessage
|
||||
Options func() protoreflect.ProtoMessage
|
||||
Values EnumValues
|
||||
ReservedNames Names
|
||||
ReservedRanges EnumRanges
|
||||
@@ -130,41 +169,41 @@ type (
|
||||
L1 EnumValueL1
|
||||
}
|
||||
EnumValueL1 struct {
|
||||
Options func() pref.ProtoMessage
|
||||
Number pref.EnumNumber
|
||||
Options func() protoreflect.ProtoMessage
|
||||
Number protoreflect.EnumNumber
|
||||
}
|
||||
)
|
||||
|
||||
func (ed *Enum) Options() pref.ProtoMessage {
|
||||
func (ed *Enum) Options() protoreflect.ProtoMessage {
|
||||
if f := ed.lazyInit().Options; f != nil {
|
||||
return f()
|
||||
}
|
||||
return descopts.Enum
|
||||
}
|
||||
func (ed *Enum) Values() pref.EnumValueDescriptors {
|
||||
func (ed *Enum) Values() protoreflect.EnumValueDescriptors {
|
||||
if ed.L1.eagerValues {
|
||||
return &ed.L2.Values
|
||||
}
|
||||
return &ed.lazyInit().Values
|
||||
}
|
||||
func (ed *Enum) ReservedNames() pref.Names { return &ed.lazyInit().ReservedNames }
|
||||
func (ed *Enum) ReservedRanges() pref.EnumRanges { return &ed.lazyInit().ReservedRanges }
|
||||
func (ed *Enum) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, ed) }
|
||||
func (ed *Enum) ProtoType(pref.EnumDescriptor) {}
|
||||
func (ed *Enum) ReservedNames() protoreflect.Names { return &ed.lazyInit().ReservedNames }
|
||||
func (ed *Enum) ReservedRanges() protoreflect.EnumRanges { return &ed.lazyInit().ReservedRanges }
|
||||
func (ed *Enum) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, ed) }
|
||||
func (ed *Enum) ProtoType(protoreflect.EnumDescriptor) {}
|
||||
func (ed *Enum) lazyInit() *EnumL2 {
|
||||
ed.L0.ParentFile.lazyInit() // implicitly initializes L2
|
||||
return ed.L2
|
||||
}
|
||||
|
||||
func (ed *EnumValue) Options() pref.ProtoMessage {
|
||||
func (ed *EnumValue) Options() protoreflect.ProtoMessage {
|
||||
if f := ed.L1.Options; f != nil {
|
||||
return f()
|
||||
}
|
||||
return descopts.EnumValue
|
||||
}
|
||||
func (ed *EnumValue) Number() pref.EnumNumber { return ed.L1.Number }
|
||||
func (ed *EnumValue) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, ed) }
|
||||
func (ed *EnumValue) ProtoType(pref.EnumValueDescriptor) {}
|
||||
func (ed *EnumValue) Number() protoreflect.EnumNumber { return ed.L1.Number }
|
||||
func (ed *EnumValue) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, ed) }
|
||||
func (ed *EnumValue) ProtoType(protoreflect.EnumValueDescriptor) {}
|
||||
|
||||
type (
|
||||
Message struct {
|
||||
@@ -180,14 +219,14 @@ type (
|
||||
IsMessageSet bool // promoted from google.protobuf.MessageOptions
|
||||
}
|
||||
MessageL2 struct {
|
||||
Options func() pref.ProtoMessage
|
||||
Options func() protoreflect.ProtoMessage
|
||||
Fields Fields
|
||||
Oneofs Oneofs
|
||||
ReservedNames Names
|
||||
ReservedRanges FieldRanges
|
||||
RequiredNumbers FieldNumbers // must be consistent with Fields.Cardinality
|
||||
ExtensionRanges FieldRanges
|
||||
ExtensionRangeOptions []func() pref.ProtoMessage // must be same length as ExtensionRanges
|
||||
ExtensionRangeOptions []func() protoreflect.ProtoMessage // must be same length as ExtensionRanges
|
||||
}
|
||||
|
||||
Field struct {
|
||||
@@ -195,10 +234,10 @@ type (
|
||||
L1 FieldL1
|
||||
}
|
||||
FieldL1 struct {
|
||||
Options func() pref.ProtoMessage
|
||||
Number pref.FieldNumber
|
||||
Cardinality pref.Cardinality // must be consistent with Message.RequiredNumbers
|
||||
Kind pref.Kind
|
||||
Options func() protoreflect.ProtoMessage
|
||||
Number protoreflect.FieldNumber
|
||||
Cardinality protoreflect.Cardinality // must be consistent with Message.RequiredNumbers
|
||||
Kind protoreflect.Kind
|
||||
StringName stringName
|
||||
IsProto3Optional bool // promoted from google.protobuf.FieldDescriptorProto
|
||||
IsWeak bool // promoted from google.protobuf.FieldOptions
|
||||
@@ -207,9 +246,12 @@ type (
|
||||
HasEnforceUTF8 bool // promoted from google.protobuf.FieldOptions
|
||||
EnforceUTF8 bool // promoted from google.protobuf.FieldOptions
|
||||
Default defaultValue
|
||||
ContainingOneof pref.OneofDescriptor // must be consistent with Message.Oneofs.Fields
|
||||
Enum pref.EnumDescriptor
|
||||
Message pref.MessageDescriptor
|
||||
ContainingOneof protoreflect.OneofDescriptor // must be consistent with Message.Oneofs.Fields
|
||||
Enum protoreflect.EnumDescriptor
|
||||
Message protoreflect.MessageDescriptor
|
||||
|
||||
// Edition features.
|
||||
Presence bool
|
||||
}
|
||||
|
||||
Oneof struct {
|
||||
@@ -217,35 +259,35 @@ type (
|
||||
L1 OneofL1
|
||||
}
|
||||
OneofL1 struct {
|
||||
Options func() pref.ProtoMessage
|
||||
Options func() protoreflect.ProtoMessage
|
||||
Fields OneofFields // must be consistent with Message.Fields.ContainingOneof
|
||||
}
|
||||
)
|
||||
|
||||
func (md *Message) Options() pref.ProtoMessage {
|
||||
func (md *Message) Options() protoreflect.ProtoMessage {
|
||||
if f := md.lazyInit().Options; f != nil {
|
||||
return f()
|
||||
}
|
||||
return descopts.Message
|
||||
}
|
||||
func (md *Message) IsMapEntry() bool { return md.L1.IsMapEntry }
|
||||
func (md *Message) Fields() pref.FieldDescriptors { return &md.lazyInit().Fields }
|
||||
func (md *Message) Oneofs() pref.OneofDescriptors { return &md.lazyInit().Oneofs }
|
||||
func (md *Message) ReservedNames() pref.Names { return &md.lazyInit().ReservedNames }
|
||||
func (md *Message) ReservedRanges() pref.FieldRanges { return &md.lazyInit().ReservedRanges }
|
||||
func (md *Message) RequiredNumbers() pref.FieldNumbers { return &md.lazyInit().RequiredNumbers }
|
||||
func (md *Message) ExtensionRanges() pref.FieldRanges { return &md.lazyInit().ExtensionRanges }
|
||||
func (md *Message) ExtensionRangeOptions(i int) pref.ProtoMessage {
|
||||
func (md *Message) IsMapEntry() bool { return md.L1.IsMapEntry }
|
||||
func (md *Message) Fields() protoreflect.FieldDescriptors { return &md.lazyInit().Fields }
|
||||
func (md *Message) Oneofs() protoreflect.OneofDescriptors { return &md.lazyInit().Oneofs }
|
||||
func (md *Message) ReservedNames() protoreflect.Names { return &md.lazyInit().ReservedNames }
|
||||
func (md *Message) ReservedRanges() protoreflect.FieldRanges { return &md.lazyInit().ReservedRanges }
|
||||
func (md *Message) RequiredNumbers() protoreflect.FieldNumbers { return &md.lazyInit().RequiredNumbers }
|
||||
func (md *Message) ExtensionRanges() protoreflect.FieldRanges { return &md.lazyInit().ExtensionRanges }
|
||||
func (md *Message) ExtensionRangeOptions(i int) protoreflect.ProtoMessage {
|
||||
if f := md.lazyInit().ExtensionRangeOptions[i]; f != nil {
|
||||
return f()
|
||||
}
|
||||
return descopts.ExtensionRange
|
||||
}
|
||||
func (md *Message) Enums() pref.EnumDescriptors { return &md.L1.Enums }
|
||||
func (md *Message) Messages() pref.MessageDescriptors { return &md.L1.Messages }
|
||||
func (md *Message) Extensions() pref.ExtensionDescriptors { return &md.L1.Extensions }
|
||||
func (md *Message) ProtoType(pref.MessageDescriptor) {}
|
||||
func (md *Message) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, md) }
|
||||
func (md *Message) Enums() protoreflect.EnumDescriptors { return &md.L1.Enums }
|
||||
func (md *Message) Messages() protoreflect.MessageDescriptors { return &md.L1.Messages }
|
||||
func (md *Message) Extensions() protoreflect.ExtensionDescriptors { return &md.L1.Extensions }
|
||||
func (md *Message) ProtoType(protoreflect.MessageDescriptor) {}
|
||||
func (md *Message) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, md) }
|
||||
func (md *Message) lazyInit() *MessageL2 {
|
||||
md.L0.ParentFile.lazyInit() // implicitly initializes L2
|
||||
return md.L2
|
||||
@@ -260,28 +302,31 @@ func (md *Message) IsMessageSet() bool {
|
||||
return md.L1.IsMessageSet
|
||||
}
|
||||
|
||||
func (fd *Field) Options() pref.ProtoMessage {
|
||||
func (fd *Field) Options() protoreflect.ProtoMessage {
|
||||
if f := fd.L1.Options; f != nil {
|
||||
return f()
|
||||
}
|
||||
return descopts.Field
|
||||
}
|
||||
func (fd *Field) Number() pref.FieldNumber { return fd.L1.Number }
|
||||
func (fd *Field) Cardinality() pref.Cardinality { return fd.L1.Cardinality }
|
||||
func (fd *Field) Kind() pref.Kind { return fd.L1.Kind }
|
||||
func (fd *Field) HasJSONName() bool { return fd.L1.StringName.hasJSON }
|
||||
func (fd *Field) JSONName() string { return fd.L1.StringName.getJSON(fd) }
|
||||
func (fd *Field) TextName() string { return fd.L1.StringName.getText(fd) }
|
||||
func (fd *Field) Number() protoreflect.FieldNumber { return fd.L1.Number }
|
||||
func (fd *Field) Cardinality() protoreflect.Cardinality { return fd.L1.Cardinality }
|
||||
func (fd *Field) Kind() protoreflect.Kind { return fd.L1.Kind }
|
||||
func (fd *Field) HasJSONName() bool { return fd.L1.StringName.hasJSON }
|
||||
func (fd *Field) JSONName() string { return fd.L1.StringName.getJSON(fd) }
|
||||
func (fd *Field) TextName() string { return fd.L1.StringName.getText(fd) }
|
||||
func (fd *Field) HasPresence() bool {
|
||||
return fd.L1.Cardinality != pref.Repeated && (fd.L0.ParentFile.L1.Syntax == pref.Proto2 || fd.L1.Message != nil || fd.L1.ContainingOneof != nil)
|
||||
if fd.L0.ParentFile.L1.Syntax == protoreflect.Editions {
|
||||
return fd.L1.Presence || fd.L1.Message != nil || fd.L1.ContainingOneof != nil
|
||||
}
|
||||
return fd.L1.Cardinality != protoreflect.Repeated && (fd.L0.ParentFile.L1.Syntax == protoreflect.Proto2 || fd.L1.Message != nil || fd.L1.ContainingOneof != nil)
|
||||
}
|
||||
func (fd *Field) HasOptionalKeyword() bool {
|
||||
return (fd.L0.ParentFile.L1.Syntax == pref.Proto2 && fd.L1.Cardinality == pref.Optional && fd.L1.ContainingOneof == nil) || fd.L1.IsProto3Optional
|
||||
return (fd.L0.ParentFile.L1.Syntax == protoreflect.Proto2 && fd.L1.Cardinality == protoreflect.Optional && fd.L1.ContainingOneof == nil) || fd.L1.IsProto3Optional
|
||||
}
|
||||
func (fd *Field) IsPacked() bool {
|
||||
if !fd.L1.HasPacked && fd.L0.ParentFile.L1.Syntax != pref.Proto2 && fd.L1.Cardinality == pref.Repeated {
|
||||
if !fd.L1.HasPacked && fd.L0.ParentFile.L1.Syntax != protoreflect.Proto2 && fd.L1.Cardinality == protoreflect.Repeated {
|
||||
switch fd.L1.Kind {
|
||||
case pref.StringKind, pref.BytesKind, pref.MessageKind, pref.GroupKind:
|
||||
case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
default:
|
||||
return true
|
||||
}
|
||||
@@ -290,40 +335,40 @@ func (fd *Field) IsPacked() bool {
|
||||
}
|
||||
func (fd *Field) IsExtension() bool { return false }
|
||||
func (fd *Field) IsWeak() bool { return fd.L1.IsWeak }
|
||||
func (fd *Field) IsList() bool { return fd.Cardinality() == pref.Repeated && !fd.IsMap() }
|
||||
func (fd *Field) IsList() bool { return fd.Cardinality() == protoreflect.Repeated && !fd.IsMap() }
|
||||
func (fd *Field) IsMap() bool { return fd.Message() != nil && fd.Message().IsMapEntry() }
|
||||
func (fd *Field) MapKey() pref.FieldDescriptor {
|
||||
func (fd *Field) MapKey() protoreflect.FieldDescriptor {
|
||||
if !fd.IsMap() {
|
||||
return nil
|
||||
}
|
||||
return fd.Message().Fields().ByNumber(genid.MapEntry_Key_field_number)
|
||||
}
|
||||
func (fd *Field) MapValue() pref.FieldDescriptor {
|
||||
func (fd *Field) MapValue() protoreflect.FieldDescriptor {
|
||||
if !fd.IsMap() {
|
||||
return nil
|
||||
}
|
||||
return fd.Message().Fields().ByNumber(genid.MapEntry_Value_field_number)
|
||||
}
|
||||
func (fd *Field) HasDefault() bool { return fd.L1.Default.has }
|
||||
func (fd *Field) Default() pref.Value { return fd.L1.Default.get(fd) }
|
||||
func (fd *Field) DefaultEnumValue() pref.EnumValueDescriptor { return fd.L1.Default.enum }
|
||||
func (fd *Field) ContainingOneof() pref.OneofDescriptor { return fd.L1.ContainingOneof }
|
||||
func (fd *Field) ContainingMessage() pref.MessageDescriptor {
|
||||
return fd.L0.Parent.(pref.MessageDescriptor)
|
||||
func (fd *Field) HasDefault() bool { return fd.L1.Default.has }
|
||||
func (fd *Field) Default() protoreflect.Value { return fd.L1.Default.get(fd) }
|
||||
func (fd *Field) DefaultEnumValue() protoreflect.EnumValueDescriptor { return fd.L1.Default.enum }
|
||||
func (fd *Field) ContainingOneof() protoreflect.OneofDescriptor { return fd.L1.ContainingOneof }
|
||||
func (fd *Field) ContainingMessage() protoreflect.MessageDescriptor {
|
||||
return fd.L0.Parent.(protoreflect.MessageDescriptor)
|
||||
}
|
||||
func (fd *Field) Enum() pref.EnumDescriptor {
|
||||
func (fd *Field) Enum() protoreflect.EnumDescriptor {
|
||||
return fd.L1.Enum
|
||||
}
|
||||
func (fd *Field) Message() pref.MessageDescriptor {
|
||||
func (fd *Field) Message() protoreflect.MessageDescriptor {
|
||||
if fd.L1.IsWeak {
|
||||
if d, _ := protoregistry.GlobalFiles.FindDescriptorByName(fd.L1.Message.FullName()); d != nil {
|
||||
return d.(pref.MessageDescriptor)
|
||||
return d.(protoreflect.MessageDescriptor)
|
||||
}
|
||||
}
|
||||
return fd.L1.Message
|
||||
}
|
||||
func (fd *Field) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, fd) }
|
||||
func (fd *Field) ProtoType(pref.FieldDescriptor) {}
|
||||
func (fd *Field) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, fd) }
|
||||
func (fd *Field) ProtoType(protoreflect.FieldDescriptor) {}
|
||||
|
||||
// EnforceUTF8 is a pseudo-internal API to determine whether to enforce UTF-8
|
||||
// validation for the string field. This exists for Google-internal use only
|
||||
@@ -336,21 +381,21 @@ func (fd *Field) EnforceUTF8() bool {
|
||||
if fd.L1.HasEnforceUTF8 {
|
||||
return fd.L1.EnforceUTF8
|
||||
}
|
||||
return fd.L0.ParentFile.L1.Syntax == pref.Proto3
|
||||
return fd.L0.ParentFile.L1.Syntax == protoreflect.Proto3
|
||||
}
|
||||
|
||||
func (od *Oneof) IsSynthetic() bool {
|
||||
return od.L0.ParentFile.L1.Syntax == pref.Proto3 && len(od.L1.Fields.List) == 1 && od.L1.Fields.List[0].HasOptionalKeyword()
|
||||
return od.L0.ParentFile.L1.Syntax == protoreflect.Proto3 && len(od.L1.Fields.List) == 1 && od.L1.Fields.List[0].HasOptionalKeyword()
|
||||
}
|
||||
func (od *Oneof) Options() pref.ProtoMessage {
|
||||
func (od *Oneof) Options() protoreflect.ProtoMessage {
|
||||
if f := od.L1.Options; f != nil {
|
||||
return f()
|
||||
}
|
||||
return descopts.Oneof
|
||||
}
|
||||
func (od *Oneof) Fields() pref.FieldDescriptors { return &od.L1.Fields }
|
||||
func (od *Oneof) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, od) }
|
||||
func (od *Oneof) ProtoType(pref.OneofDescriptor) {}
|
||||
func (od *Oneof) Fields() protoreflect.FieldDescriptors { return &od.L1.Fields }
|
||||
func (od *Oneof) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, od) }
|
||||
func (od *Oneof) ProtoType(protoreflect.OneofDescriptor) {}
|
||||
|
||||
type (
|
||||
Extension struct {
|
||||
@@ -359,55 +404,57 @@ type (
|
||||
L2 *ExtensionL2 // protected by fileDesc.once
|
||||
}
|
||||
ExtensionL1 struct {
|
||||
Number pref.FieldNumber
|
||||
Extendee pref.MessageDescriptor
|
||||
Cardinality pref.Cardinality
|
||||
Kind pref.Kind
|
||||
Number protoreflect.FieldNumber
|
||||
Extendee protoreflect.MessageDescriptor
|
||||
Cardinality protoreflect.Cardinality
|
||||
Kind protoreflect.Kind
|
||||
}
|
||||
ExtensionL2 struct {
|
||||
Options func() pref.ProtoMessage
|
||||
Options func() protoreflect.ProtoMessage
|
||||
StringName stringName
|
||||
IsProto3Optional bool // promoted from google.protobuf.FieldDescriptorProto
|
||||
IsPacked bool // promoted from google.protobuf.FieldOptions
|
||||
Default defaultValue
|
||||
Enum pref.EnumDescriptor
|
||||
Message pref.MessageDescriptor
|
||||
Enum protoreflect.EnumDescriptor
|
||||
Message protoreflect.MessageDescriptor
|
||||
}
|
||||
)
|
||||
|
||||
func (xd *Extension) Options() pref.ProtoMessage {
|
||||
func (xd *Extension) Options() protoreflect.ProtoMessage {
|
||||
if f := xd.lazyInit().Options; f != nil {
|
||||
return f()
|
||||
}
|
||||
return descopts.Field
|
||||
}
|
||||
func (xd *Extension) Number() pref.FieldNumber { return xd.L1.Number }
|
||||
func (xd *Extension) Cardinality() pref.Cardinality { return xd.L1.Cardinality }
|
||||
func (xd *Extension) Kind() pref.Kind { return xd.L1.Kind }
|
||||
func (xd *Extension) HasJSONName() bool { return xd.lazyInit().StringName.hasJSON }
|
||||
func (xd *Extension) JSONName() string { return xd.lazyInit().StringName.getJSON(xd) }
|
||||
func (xd *Extension) TextName() string { return xd.lazyInit().StringName.getText(xd) }
|
||||
func (xd *Extension) HasPresence() bool { return xd.L1.Cardinality != pref.Repeated }
|
||||
func (xd *Extension) Number() protoreflect.FieldNumber { return xd.L1.Number }
|
||||
func (xd *Extension) Cardinality() protoreflect.Cardinality { return xd.L1.Cardinality }
|
||||
func (xd *Extension) Kind() protoreflect.Kind { return xd.L1.Kind }
|
||||
func (xd *Extension) HasJSONName() bool { return xd.lazyInit().StringName.hasJSON }
|
||||
func (xd *Extension) JSONName() string { return xd.lazyInit().StringName.getJSON(xd) }
|
||||
func (xd *Extension) TextName() string { return xd.lazyInit().StringName.getText(xd) }
|
||||
func (xd *Extension) HasPresence() bool { return xd.L1.Cardinality != protoreflect.Repeated }
|
||||
func (xd *Extension) HasOptionalKeyword() bool {
|
||||
return (xd.L0.ParentFile.L1.Syntax == pref.Proto2 && xd.L1.Cardinality == pref.Optional) || xd.lazyInit().IsProto3Optional
|
||||
return (xd.L0.ParentFile.L1.Syntax == protoreflect.Proto2 && xd.L1.Cardinality == protoreflect.Optional) || xd.lazyInit().IsProto3Optional
|
||||
}
|
||||
func (xd *Extension) IsPacked() bool { return xd.lazyInit().IsPacked }
|
||||
func (xd *Extension) IsExtension() bool { return true }
|
||||
func (xd *Extension) IsWeak() bool { return false }
|
||||
func (xd *Extension) IsList() bool { return xd.Cardinality() == pref.Repeated }
|
||||
func (xd *Extension) IsMap() bool { return false }
|
||||
func (xd *Extension) MapKey() pref.FieldDescriptor { return nil }
|
||||
func (xd *Extension) MapValue() pref.FieldDescriptor { return nil }
|
||||
func (xd *Extension) HasDefault() bool { return xd.lazyInit().Default.has }
|
||||
func (xd *Extension) Default() pref.Value { return xd.lazyInit().Default.get(xd) }
|
||||
func (xd *Extension) DefaultEnumValue() pref.EnumValueDescriptor { return xd.lazyInit().Default.enum }
|
||||
func (xd *Extension) ContainingOneof() pref.OneofDescriptor { return nil }
|
||||
func (xd *Extension) ContainingMessage() pref.MessageDescriptor { return xd.L1.Extendee }
|
||||
func (xd *Extension) Enum() pref.EnumDescriptor { return xd.lazyInit().Enum }
|
||||
func (xd *Extension) Message() pref.MessageDescriptor { return xd.lazyInit().Message }
|
||||
func (xd *Extension) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, xd) }
|
||||
func (xd *Extension) ProtoType(pref.FieldDescriptor) {}
|
||||
func (xd *Extension) ProtoInternal(pragma.DoNotImplement) {}
|
||||
func (xd *Extension) IsPacked() bool { return xd.lazyInit().IsPacked }
|
||||
func (xd *Extension) IsExtension() bool { return true }
|
||||
func (xd *Extension) IsWeak() bool { return false }
|
||||
func (xd *Extension) IsList() bool { return xd.Cardinality() == protoreflect.Repeated }
|
||||
func (xd *Extension) IsMap() bool { return false }
|
||||
func (xd *Extension) MapKey() protoreflect.FieldDescriptor { return nil }
|
||||
func (xd *Extension) MapValue() protoreflect.FieldDescriptor { return nil }
|
||||
func (xd *Extension) HasDefault() bool { return xd.lazyInit().Default.has }
|
||||
func (xd *Extension) Default() protoreflect.Value { return xd.lazyInit().Default.get(xd) }
|
||||
func (xd *Extension) DefaultEnumValue() protoreflect.EnumValueDescriptor {
|
||||
return xd.lazyInit().Default.enum
|
||||
}
|
||||
func (xd *Extension) ContainingOneof() protoreflect.OneofDescriptor { return nil }
|
||||
func (xd *Extension) ContainingMessage() protoreflect.MessageDescriptor { return xd.L1.Extendee }
|
||||
func (xd *Extension) Enum() protoreflect.EnumDescriptor { return xd.lazyInit().Enum }
|
||||
func (xd *Extension) Message() protoreflect.MessageDescriptor { return xd.lazyInit().Message }
|
||||
func (xd *Extension) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, xd) }
|
||||
func (xd *Extension) ProtoType(protoreflect.FieldDescriptor) {}
|
||||
func (xd *Extension) ProtoInternal(pragma.DoNotImplement) {}
|
||||
func (xd *Extension) lazyInit() *ExtensionL2 {
|
||||
xd.L0.ParentFile.lazyInit() // implicitly initializes L2
|
||||
return xd.L2
|
||||
@@ -421,7 +468,7 @@ type (
|
||||
}
|
||||
ServiceL1 struct{}
|
||||
ServiceL2 struct {
|
||||
Options func() pref.ProtoMessage
|
||||
Options func() protoreflect.ProtoMessage
|
||||
Methods Methods
|
||||
}
|
||||
|
||||
@@ -430,48 +477,48 @@ type (
|
||||
L1 MethodL1
|
||||
}
|
||||
MethodL1 struct {
|
||||
Options func() pref.ProtoMessage
|
||||
Input pref.MessageDescriptor
|
||||
Output pref.MessageDescriptor
|
||||
Options func() protoreflect.ProtoMessage
|
||||
Input protoreflect.MessageDescriptor
|
||||
Output protoreflect.MessageDescriptor
|
||||
IsStreamingClient bool
|
||||
IsStreamingServer bool
|
||||
}
|
||||
)
|
||||
|
||||
func (sd *Service) Options() pref.ProtoMessage {
|
||||
func (sd *Service) Options() protoreflect.ProtoMessage {
|
||||
if f := sd.lazyInit().Options; f != nil {
|
||||
return f()
|
||||
}
|
||||
return descopts.Service
|
||||
}
|
||||
func (sd *Service) Methods() pref.MethodDescriptors { return &sd.lazyInit().Methods }
|
||||
func (sd *Service) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, sd) }
|
||||
func (sd *Service) ProtoType(pref.ServiceDescriptor) {}
|
||||
func (sd *Service) ProtoInternal(pragma.DoNotImplement) {}
|
||||
func (sd *Service) Methods() protoreflect.MethodDescriptors { return &sd.lazyInit().Methods }
|
||||
func (sd *Service) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, sd) }
|
||||
func (sd *Service) ProtoType(protoreflect.ServiceDescriptor) {}
|
||||
func (sd *Service) ProtoInternal(pragma.DoNotImplement) {}
|
||||
func (sd *Service) lazyInit() *ServiceL2 {
|
||||
sd.L0.ParentFile.lazyInit() // implicitly initializes L2
|
||||
return sd.L2
|
||||
}
|
||||
|
||||
func (md *Method) Options() pref.ProtoMessage {
|
||||
func (md *Method) Options() protoreflect.ProtoMessage {
|
||||
if f := md.L1.Options; f != nil {
|
||||
return f()
|
||||
}
|
||||
return descopts.Method
|
||||
}
|
||||
func (md *Method) Input() pref.MessageDescriptor { return md.L1.Input }
|
||||
func (md *Method) Output() pref.MessageDescriptor { return md.L1.Output }
|
||||
func (md *Method) IsStreamingClient() bool { return md.L1.IsStreamingClient }
|
||||
func (md *Method) IsStreamingServer() bool { return md.L1.IsStreamingServer }
|
||||
func (md *Method) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, md) }
|
||||
func (md *Method) ProtoType(pref.MethodDescriptor) {}
|
||||
func (md *Method) ProtoInternal(pragma.DoNotImplement) {}
|
||||
func (md *Method) Input() protoreflect.MessageDescriptor { return md.L1.Input }
|
||||
func (md *Method) Output() protoreflect.MessageDescriptor { return md.L1.Output }
|
||||
func (md *Method) IsStreamingClient() bool { return md.L1.IsStreamingClient }
|
||||
func (md *Method) IsStreamingServer() bool { return md.L1.IsStreamingServer }
|
||||
func (md *Method) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, md) }
|
||||
func (md *Method) ProtoType(protoreflect.MethodDescriptor) {}
|
||||
func (md *Method) ProtoInternal(pragma.DoNotImplement) {}
|
||||
|
||||
// Surrogate files are can be used to create standalone descriptors
|
||||
// where the syntax is only information derived from the parent file.
|
||||
var (
|
||||
SurrogateProto2 = &File{L1: FileL1{Syntax: pref.Proto2}, L2: &FileL2{}}
|
||||
SurrogateProto3 = &File{L1: FileL1{Syntax: pref.Proto3}, L2: &FileL2{}}
|
||||
SurrogateProto2 = &File{L1: FileL1{Syntax: protoreflect.Proto2}, L2: &FileL2{}}
|
||||
SurrogateProto3 = &File{L1: FileL1{Syntax: protoreflect.Proto3}, L2: &FileL2{}}
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -479,24 +526,24 @@ type (
|
||||
L0 BaseL0
|
||||
}
|
||||
BaseL0 struct {
|
||||
FullName pref.FullName // must be populated
|
||||
ParentFile *File // must be populated
|
||||
Parent pref.Descriptor
|
||||
FullName protoreflect.FullName // must be populated
|
||||
ParentFile *File // must be populated
|
||||
Parent protoreflect.Descriptor
|
||||
Index int
|
||||
}
|
||||
)
|
||||
|
||||
func (d *Base) Name() pref.Name { return d.L0.FullName.Name() }
|
||||
func (d *Base) FullName() pref.FullName { return d.L0.FullName }
|
||||
func (d *Base) ParentFile() pref.FileDescriptor {
|
||||
func (d *Base) Name() protoreflect.Name { return d.L0.FullName.Name() }
|
||||
func (d *Base) FullName() protoreflect.FullName { return d.L0.FullName }
|
||||
func (d *Base) ParentFile() protoreflect.FileDescriptor {
|
||||
if d.L0.ParentFile == SurrogateProto2 || d.L0.ParentFile == SurrogateProto3 {
|
||||
return nil // surrogate files are not real parents
|
||||
}
|
||||
return d.L0.ParentFile
|
||||
}
|
||||
func (d *Base) Parent() pref.Descriptor { return d.L0.Parent }
|
||||
func (d *Base) Parent() protoreflect.Descriptor { return d.L0.Parent }
|
||||
func (d *Base) Index() int { return d.L0.Index }
|
||||
func (d *Base) Syntax() pref.Syntax { return d.L0.ParentFile.Syntax() }
|
||||
func (d *Base) Syntax() protoreflect.Syntax { return d.L0.ParentFile.Syntax() }
|
||||
func (d *Base) IsPlaceholder() bool { return false }
|
||||
func (d *Base) ProtoInternal(pragma.DoNotImplement) {}
|
||||
|
||||
@@ -513,7 +560,7 @@ func (s *stringName) InitJSON(name string) {
|
||||
s.nameJSON = name
|
||||
}
|
||||
|
||||
func (s *stringName) lazyInit(fd pref.FieldDescriptor) *stringName {
|
||||
func (s *stringName) lazyInit(fd protoreflect.FieldDescriptor) *stringName {
|
||||
s.once.Do(func() {
|
||||
if fd.IsExtension() {
|
||||
// For extensions, JSON and text are formatted the same way.
|
||||
@@ -533,7 +580,7 @@ func (s *stringName) lazyInit(fd pref.FieldDescriptor) *stringName {
|
||||
|
||||
// Format the text name.
|
||||
s.nameText = string(fd.Name())
|
||||
if fd.Kind() == pref.GroupKind {
|
||||
if fd.Kind() == protoreflect.GroupKind {
|
||||
s.nameText = string(fd.Message().Name())
|
||||
}
|
||||
}
|
||||
@@ -541,10 +588,10 @@ func (s *stringName) lazyInit(fd pref.FieldDescriptor) *stringName {
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *stringName) getJSON(fd pref.FieldDescriptor) string { return s.lazyInit(fd).nameJSON }
|
||||
func (s *stringName) getText(fd pref.FieldDescriptor) string { return s.lazyInit(fd).nameText }
|
||||
func (s *stringName) getJSON(fd protoreflect.FieldDescriptor) string { return s.lazyInit(fd).nameJSON }
|
||||
func (s *stringName) getText(fd protoreflect.FieldDescriptor) string { return s.lazyInit(fd).nameText }
|
||||
|
||||
func DefaultValue(v pref.Value, ev pref.EnumValueDescriptor) defaultValue {
|
||||
func DefaultValue(v protoreflect.Value, ev protoreflect.EnumValueDescriptor) defaultValue {
|
||||
dv := defaultValue{has: v.IsValid(), val: v, enum: ev}
|
||||
if b, ok := v.Interface().([]byte); ok {
|
||||
// Store a copy of the default bytes, so that we can detect
|
||||
@@ -554,9 +601,9 @@ func DefaultValue(v pref.Value, ev pref.EnumValueDescriptor) defaultValue {
|
||||
return dv
|
||||
}
|
||||
|
||||
func unmarshalDefault(b []byte, k pref.Kind, pf *File, ed pref.EnumDescriptor) defaultValue {
|
||||
var evs pref.EnumValueDescriptors
|
||||
if k == pref.EnumKind {
|
||||
func unmarshalDefault(b []byte, k protoreflect.Kind, pf *File, ed protoreflect.EnumDescriptor) defaultValue {
|
||||
var evs protoreflect.EnumValueDescriptors
|
||||
if k == protoreflect.EnumKind {
|
||||
// If the enum is declared within the same file, be careful not to
|
||||
// blindly call the Values method, lest we bind ourselves in a deadlock.
|
||||
if e, ok := ed.(*Enum); ok && e.L0.ParentFile == pf {
|
||||
@@ -567,9 +614,9 @@ func unmarshalDefault(b []byte, k pref.Kind, pf *File, ed pref.EnumDescriptor) d
|
||||
|
||||
// If we are unable to resolve the enum dependency, use a placeholder
|
||||
// enum value since we will not be able to parse the default value.
|
||||
if ed.IsPlaceholder() && pref.Name(b).IsValid() {
|
||||
v := pref.ValueOfEnum(0)
|
||||
ev := PlaceholderEnumValue(ed.FullName().Parent().Append(pref.Name(b)))
|
||||
if ed.IsPlaceholder() && protoreflect.Name(b).IsValid() {
|
||||
v := protoreflect.ValueOfEnum(0)
|
||||
ev := PlaceholderEnumValue(ed.FullName().Parent().Append(protoreflect.Name(b)))
|
||||
return DefaultValue(v, ev)
|
||||
}
|
||||
}
|
||||
@@ -583,41 +630,41 @@ func unmarshalDefault(b []byte, k pref.Kind, pf *File, ed pref.EnumDescriptor) d
|
||||
|
||||
type defaultValue struct {
|
||||
has bool
|
||||
val pref.Value
|
||||
enum pref.EnumValueDescriptor
|
||||
val protoreflect.Value
|
||||
enum protoreflect.EnumValueDescriptor
|
||||
bytes []byte
|
||||
}
|
||||
|
||||
func (dv *defaultValue) get(fd pref.FieldDescriptor) pref.Value {
|
||||
func (dv *defaultValue) get(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
// Return the zero value as the default if unpopulated.
|
||||
if !dv.has {
|
||||
if fd.Cardinality() == pref.Repeated {
|
||||
return pref.Value{}
|
||||
if fd.Cardinality() == protoreflect.Repeated {
|
||||
return protoreflect.Value{}
|
||||
}
|
||||
switch fd.Kind() {
|
||||
case pref.BoolKind:
|
||||
return pref.ValueOfBool(false)
|
||||
case pref.Int32Kind, pref.Sint32Kind, pref.Sfixed32Kind:
|
||||
return pref.ValueOfInt32(0)
|
||||
case pref.Int64Kind, pref.Sint64Kind, pref.Sfixed64Kind:
|
||||
return pref.ValueOfInt64(0)
|
||||
case pref.Uint32Kind, pref.Fixed32Kind:
|
||||
return pref.ValueOfUint32(0)
|
||||
case pref.Uint64Kind, pref.Fixed64Kind:
|
||||
return pref.ValueOfUint64(0)
|
||||
case pref.FloatKind:
|
||||
return pref.ValueOfFloat32(0)
|
||||
case pref.DoubleKind:
|
||||
return pref.ValueOfFloat64(0)
|
||||
case pref.StringKind:
|
||||
return pref.ValueOfString("")
|
||||
case pref.BytesKind:
|
||||
return pref.ValueOfBytes(nil)
|
||||
case pref.EnumKind:
|
||||
case protoreflect.BoolKind:
|
||||
return protoreflect.ValueOfBool(false)
|
||||
case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
|
||||
return protoreflect.ValueOfInt32(0)
|
||||
case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
|
||||
return protoreflect.ValueOfInt64(0)
|
||||
case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
|
||||
return protoreflect.ValueOfUint32(0)
|
||||
case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
|
||||
return protoreflect.ValueOfUint64(0)
|
||||
case protoreflect.FloatKind:
|
||||
return protoreflect.ValueOfFloat32(0)
|
||||
case protoreflect.DoubleKind:
|
||||
return protoreflect.ValueOfFloat64(0)
|
||||
case protoreflect.StringKind:
|
||||
return protoreflect.ValueOfString("")
|
||||
case protoreflect.BytesKind:
|
||||
return protoreflect.ValueOfBytes(nil)
|
||||
case protoreflect.EnumKind:
|
||||
if evs := fd.Enum().Values(); evs.Len() > 0 {
|
||||
return pref.ValueOfEnum(evs.Get(0).Number())
|
||||
return protoreflect.ValueOfEnum(evs.Get(0).Number())
|
||||
}
|
||||
return pref.ValueOfEnum(0)
|
||||
return protoreflect.ValueOfEnum(0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
36
go/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go
generated
vendored
36
go/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go
generated
vendored
@@ -10,7 +10,7 @@ import (
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/internal/genid"
|
||||
"google.golang.org/protobuf/internal/strs"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
// fileRaw is a data struct used when initializing a file descriptor from
|
||||
@@ -95,7 +95,7 @@ func (fd *File) unmarshalSeed(b []byte) {
|
||||
sb := getBuilder()
|
||||
defer putBuilder(sb)
|
||||
|
||||
var prevField pref.FieldNumber
|
||||
var prevField protoreflect.FieldNumber
|
||||
var numEnums, numMessages, numExtensions, numServices int
|
||||
var posEnums, posMessages, posExtensions, posServices int
|
||||
b0 := b
|
||||
@@ -110,16 +110,16 @@ func (fd *File) unmarshalSeed(b []byte) {
|
||||
case genid.FileDescriptorProto_Syntax_field_number:
|
||||
switch string(v) {
|
||||
case "proto2":
|
||||
fd.L1.Syntax = pref.Proto2
|
||||
fd.L1.Syntax = protoreflect.Proto2
|
||||
case "proto3":
|
||||
fd.L1.Syntax = pref.Proto3
|
||||
fd.L1.Syntax = protoreflect.Proto3
|
||||
default:
|
||||
panic("invalid syntax")
|
||||
}
|
||||
case genid.FileDescriptorProto_Name_field_number:
|
||||
fd.L1.Path = sb.MakeString(v)
|
||||
case genid.FileDescriptorProto_Package_field_number:
|
||||
fd.L1.Package = pref.FullName(sb.MakeString(v))
|
||||
fd.L1.Package = protoreflect.FullName(sb.MakeString(v))
|
||||
case genid.FileDescriptorProto_EnumType_field_number:
|
||||
if prevField != genid.FileDescriptorProto_EnumType_field_number {
|
||||
if numEnums > 0 {
|
||||
@@ -163,7 +163,7 @@ func (fd *File) unmarshalSeed(b []byte) {
|
||||
|
||||
// If syntax is missing, it is assumed to be proto2.
|
||||
if fd.L1.Syntax == 0 {
|
||||
fd.L1.Syntax = pref.Proto2
|
||||
fd.L1.Syntax = protoreflect.Proto2
|
||||
}
|
||||
|
||||
// Must allocate all declarations before parsing each descriptor type
|
||||
@@ -219,7 +219,7 @@ func (fd *File) unmarshalSeed(b []byte) {
|
||||
}
|
||||
}
|
||||
|
||||
func (ed *Enum) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd pref.Descriptor, i int) {
|
||||
func (ed *Enum) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) {
|
||||
ed.L0.ParentFile = pf
|
||||
ed.L0.Parent = pd
|
||||
ed.L0.Index = i
|
||||
@@ -271,12 +271,12 @@ func (ed *Enum) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd pref.Desc
|
||||
}
|
||||
}
|
||||
|
||||
func (md *Message) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd pref.Descriptor, i int) {
|
||||
func (md *Message) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) {
|
||||
md.L0.ParentFile = pf
|
||||
md.L0.Parent = pd
|
||||
md.L0.Index = i
|
||||
|
||||
var prevField pref.FieldNumber
|
||||
var prevField protoreflect.FieldNumber
|
||||
var numEnums, numMessages, numExtensions int
|
||||
var posEnums, posMessages, posExtensions int
|
||||
b0 := b
|
||||
@@ -387,7 +387,7 @@ func (md *Message) unmarshalSeedOptions(b []byte) {
|
||||
}
|
||||
}
|
||||
|
||||
func (xd *Extension) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd pref.Descriptor, i int) {
|
||||
func (xd *Extension) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) {
|
||||
xd.L0.ParentFile = pf
|
||||
xd.L0.Parent = pd
|
||||
xd.L0.Index = i
|
||||
@@ -401,11 +401,11 @@ func (xd *Extension) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd pref
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.FieldDescriptorProto_Number_field_number:
|
||||
xd.L1.Number = pref.FieldNumber(v)
|
||||
xd.L1.Number = protoreflect.FieldNumber(v)
|
||||
case genid.FieldDescriptorProto_Label_field_number:
|
||||
xd.L1.Cardinality = pref.Cardinality(v)
|
||||
xd.L1.Cardinality = protoreflect.Cardinality(v)
|
||||
case genid.FieldDescriptorProto_Type_field_number:
|
||||
xd.L1.Kind = pref.Kind(v)
|
||||
xd.L1.Kind = protoreflect.Kind(v)
|
||||
}
|
||||
case protowire.BytesType:
|
||||
v, m := protowire.ConsumeBytes(b)
|
||||
@@ -423,7 +423,7 @@ func (xd *Extension) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd pref
|
||||
}
|
||||
}
|
||||
|
||||
func (sd *Service) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd pref.Descriptor, i int) {
|
||||
func (sd *Service) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) {
|
||||
sd.L0.ParentFile = pf
|
||||
sd.L0.Parent = pd
|
||||
sd.L0.Index = i
|
||||
@@ -459,13 +459,13 @@ func putBuilder(b *strs.Builder) {
|
||||
|
||||
// makeFullName converts b to a protoreflect.FullName,
|
||||
// where b must start with a leading dot.
|
||||
func makeFullName(sb *strs.Builder, b []byte) pref.FullName {
|
||||
func makeFullName(sb *strs.Builder, b []byte) protoreflect.FullName {
|
||||
if len(b) == 0 || b[0] != '.' {
|
||||
panic("name reference must be fully qualified")
|
||||
}
|
||||
return pref.FullName(sb.MakeString(b[1:]))
|
||||
return protoreflect.FullName(sb.MakeString(b[1:]))
|
||||
}
|
||||
|
||||
func appendFullName(sb *strs.Builder, prefix pref.FullName, suffix []byte) pref.FullName {
|
||||
return sb.AppendFullName(prefix, pref.Name(strs.UnsafeString(suffix)))
|
||||
func appendFullName(sb *strs.Builder, prefix protoreflect.FullName, suffix []byte) protoreflect.FullName {
|
||||
return sb.AppendFullName(prefix, protoreflect.Name(strs.UnsafeString(suffix)))
|
||||
}
|
||||
|
||||
80
go/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go
generated
vendored
80
go/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go
generated
vendored
@@ -13,7 +13,7 @@ import (
|
||||
"google.golang.org/protobuf/internal/genid"
|
||||
"google.golang.org/protobuf/internal/strs"
|
||||
"google.golang.org/protobuf/proto"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
func (fd *File) lazyRawInit() {
|
||||
@@ -39,10 +39,10 @@ func (file *File) resolveMessages() {
|
||||
|
||||
// Resolve message field dependency.
|
||||
switch fd.L1.Kind {
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
fd.L1.Enum = file.resolveEnumDependency(fd.L1.Enum, listFieldDeps, depIdx)
|
||||
depIdx++
|
||||
case pref.MessageKind, pref.GroupKind:
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
fd.L1.Message = file.resolveMessageDependency(fd.L1.Message, listFieldDeps, depIdx)
|
||||
depIdx++
|
||||
}
|
||||
@@ -62,10 +62,10 @@ func (file *File) resolveExtensions() {
|
||||
|
||||
// Resolve extension field dependency.
|
||||
switch xd.L1.Kind {
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
xd.L2.Enum = file.resolveEnumDependency(xd.L2.Enum, listExtDeps, depIdx)
|
||||
depIdx++
|
||||
case pref.MessageKind, pref.GroupKind:
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
xd.L2.Message = file.resolveMessageDependency(xd.L2.Message, listExtDeps, depIdx)
|
||||
depIdx++
|
||||
}
|
||||
@@ -92,7 +92,7 @@ func (file *File) resolveServices() {
|
||||
}
|
||||
}
|
||||
|
||||
func (file *File) resolveEnumDependency(ed pref.EnumDescriptor, i, j int32) pref.EnumDescriptor {
|
||||
func (file *File) resolveEnumDependency(ed protoreflect.EnumDescriptor, i, j int32) protoreflect.EnumDescriptor {
|
||||
r := file.builder.FileRegistry
|
||||
if r, ok := r.(resolverByIndex); ok {
|
||||
if ed2 := r.FindEnumByIndex(i, j, file.allEnums, file.allMessages); ed2 != nil {
|
||||
@@ -105,12 +105,12 @@ func (file *File) resolveEnumDependency(ed pref.EnumDescriptor, i, j int32) pref
|
||||
}
|
||||
}
|
||||
if d, _ := r.FindDescriptorByName(ed.FullName()); d != nil {
|
||||
return d.(pref.EnumDescriptor)
|
||||
return d.(protoreflect.EnumDescriptor)
|
||||
}
|
||||
return ed
|
||||
}
|
||||
|
||||
func (file *File) resolveMessageDependency(md pref.MessageDescriptor, i, j int32) pref.MessageDescriptor {
|
||||
func (file *File) resolveMessageDependency(md protoreflect.MessageDescriptor, i, j int32) protoreflect.MessageDescriptor {
|
||||
r := file.builder.FileRegistry
|
||||
if r, ok := r.(resolverByIndex); ok {
|
||||
if md2 := r.FindMessageByIndex(i, j, file.allEnums, file.allMessages); md2 != nil {
|
||||
@@ -123,7 +123,7 @@ func (file *File) resolveMessageDependency(md pref.MessageDescriptor, i, j int32
|
||||
}
|
||||
}
|
||||
if d, _ := r.FindDescriptorByName(md.FullName()); d != nil {
|
||||
return d.(pref.MessageDescriptor)
|
||||
return d.(protoreflect.MessageDescriptor)
|
||||
}
|
||||
return md
|
||||
}
|
||||
@@ -158,7 +158,7 @@ func (fd *File) unmarshalFull(b []byte) {
|
||||
if imp == nil {
|
||||
imp = PlaceholderFile(path)
|
||||
}
|
||||
fd.L2.Imports = append(fd.L2.Imports, pref.FileImport{FileDescriptor: imp})
|
||||
fd.L2.Imports = append(fd.L2.Imports, protoreflect.FileImport{FileDescriptor: imp})
|
||||
case genid.FileDescriptorProto_EnumType_field_number:
|
||||
fd.L1.Enums.List[enumIdx].unmarshalFull(v, sb)
|
||||
enumIdx++
|
||||
@@ -199,7 +199,7 @@ func (ed *Enum) unmarshalFull(b []byte, sb *strs.Builder) {
|
||||
case genid.EnumDescriptorProto_Value_field_number:
|
||||
rawValues = append(rawValues, v)
|
||||
case genid.EnumDescriptorProto_ReservedName_field_number:
|
||||
ed.L2.ReservedNames.List = append(ed.L2.ReservedNames.List, pref.Name(sb.MakeString(v)))
|
||||
ed.L2.ReservedNames.List = append(ed.L2.ReservedNames.List, protoreflect.Name(sb.MakeString(v)))
|
||||
case genid.EnumDescriptorProto_ReservedRange_field_number:
|
||||
ed.L2.ReservedRanges.List = append(ed.L2.ReservedRanges.List, unmarshalEnumReservedRange(v))
|
||||
case genid.EnumDescriptorProto_Options_field_number:
|
||||
@@ -219,7 +219,7 @@ func (ed *Enum) unmarshalFull(b []byte, sb *strs.Builder) {
|
||||
ed.L2.Options = ed.L0.ParentFile.builder.optionsUnmarshaler(&descopts.Enum, rawOptions)
|
||||
}
|
||||
|
||||
func unmarshalEnumReservedRange(b []byte) (r [2]pref.EnumNumber) {
|
||||
func unmarshalEnumReservedRange(b []byte) (r [2]protoreflect.EnumNumber) {
|
||||
for len(b) > 0 {
|
||||
num, typ, n := protowire.ConsumeTag(b)
|
||||
b = b[n:]
|
||||
@@ -229,9 +229,9 @@ func unmarshalEnumReservedRange(b []byte) (r [2]pref.EnumNumber) {
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.EnumDescriptorProto_EnumReservedRange_Start_field_number:
|
||||
r[0] = pref.EnumNumber(v)
|
||||
r[0] = protoreflect.EnumNumber(v)
|
||||
case genid.EnumDescriptorProto_EnumReservedRange_End_field_number:
|
||||
r[1] = pref.EnumNumber(v)
|
||||
r[1] = protoreflect.EnumNumber(v)
|
||||
}
|
||||
default:
|
||||
m := protowire.ConsumeFieldValue(num, typ, b)
|
||||
@@ -241,7 +241,7 @@ func unmarshalEnumReservedRange(b []byte) (r [2]pref.EnumNumber) {
|
||||
return r
|
||||
}
|
||||
|
||||
func (vd *EnumValue) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd pref.Descriptor, i int) {
|
||||
func (vd *EnumValue) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) {
|
||||
vd.L0.ParentFile = pf
|
||||
vd.L0.Parent = pd
|
||||
vd.L0.Index = i
|
||||
@@ -256,7 +256,7 @@ func (vd *EnumValue) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd pref
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.EnumValueDescriptorProto_Number_field_number:
|
||||
vd.L1.Number = pref.EnumNumber(v)
|
||||
vd.L1.Number = protoreflect.EnumNumber(v)
|
||||
}
|
||||
case protowire.BytesType:
|
||||
v, m := protowire.ConsumeBytes(b)
|
||||
@@ -294,7 +294,7 @@ func (md *Message) unmarshalFull(b []byte, sb *strs.Builder) {
|
||||
case genid.DescriptorProto_OneofDecl_field_number:
|
||||
rawOneofs = append(rawOneofs, v)
|
||||
case genid.DescriptorProto_ReservedName_field_number:
|
||||
md.L2.ReservedNames.List = append(md.L2.ReservedNames.List, pref.Name(sb.MakeString(v)))
|
||||
md.L2.ReservedNames.List = append(md.L2.ReservedNames.List, protoreflect.Name(sb.MakeString(v)))
|
||||
case genid.DescriptorProto_ReservedRange_field_number:
|
||||
md.L2.ReservedRanges.List = append(md.L2.ReservedRanges.List, unmarshalMessageReservedRange(v))
|
||||
case genid.DescriptorProto_ExtensionRange_field_number:
|
||||
@@ -326,7 +326,7 @@ func (md *Message) unmarshalFull(b []byte, sb *strs.Builder) {
|
||||
for i, b := range rawFields {
|
||||
fd := &md.L2.Fields.List[i]
|
||||
fd.unmarshalFull(b, sb, md.L0.ParentFile, md, i)
|
||||
if fd.L1.Cardinality == pref.Required {
|
||||
if fd.L1.Cardinality == protoreflect.Required {
|
||||
md.L2.RequiredNumbers.List = append(md.L2.RequiredNumbers.List, fd.L1.Number)
|
||||
}
|
||||
}
|
||||
@@ -359,7 +359,7 @@ func (md *Message) unmarshalOptions(b []byte) {
|
||||
}
|
||||
}
|
||||
|
||||
func unmarshalMessageReservedRange(b []byte) (r [2]pref.FieldNumber) {
|
||||
func unmarshalMessageReservedRange(b []byte) (r [2]protoreflect.FieldNumber) {
|
||||
for len(b) > 0 {
|
||||
num, typ, n := protowire.ConsumeTag(b)
|
||||
b = b[n:]
|
||||
@@ -369,9 +369,9 @@ func unmarshalMessageReservedRange(b []byte) (r [2]pref.FieldNumber) {
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.DescriptorProto_ReservedRange_Start_field_number:
|
||||
r[0] = pref.FieldNumber(v)
|
||||
r[0] = protoreflect.FieldNumber(v)
|
||||
case genid.DescriptorProto_ReservedRange_End_field_number:
|
||||
r[1] = pref.FieldNumber(v)
|
||||
r[1] = protoreflect.FieldNumber(v)
|
||||
}
|
||||
default:
|
||||
m := protowire.ConsumeFieldValue(num, typ, b)
|
||||
@@ -381,7 +381,7 @@ func unmarshalMessageReservedRange(b []byte) (r [2]pref.FieldNumber) {
|
||||
return r
|
||||
}
|
||||
|
||||
func unmarshalMessageExtensionRange(b []byte) (r [2]pref.FieldNumber, rawOptions []byte) {
|
||||
func unmarshalMessageExtensionRange(b []byte) (r [2]protoreflect.FieldNumber, rawOptions []byte) {
|
||||
for len(b) > 0 {
|
||||
num, typ, n := protowire.ConsumeTag(b)
|
||||
b = b[n:]
|
||||
@@ -391,9 +391,9 @@ func unmarshalMessageExtensionRange(b []byte) (r [2]pref.FieldNumber, rawOptions
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.DescriptorProto_ExtensionRange_Start_field_number:
|
||||
r[0] = pref.FieldNumber(v)
|
||||
r[0] = protoreflect.FieldNumber(v)
|
||||
case genid.DescriptorProto_ExtensionRange_End_field_number:
|
||||
r[1] = pref.FieldNumber(v)
|
||||
r[1] = protoreflect.FieldNumber(v)
|
||||
}
|
||||
case protowire.BytesType:
|
||||
v, m := protowire.ConsumeBytes(b)
|
||||
@@ -410,7 +410,7 @@ func unmarshalMessageExtensionRange(b []byte) (r [2]pref.FieldNumber, rawOptions
|
||||
return r, rawOptions
|
||||
}
|
||||
|
||||
func (fd *Field) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd pref.Descriptor, i int) {
|
||||
func (fd *Field) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) {
|
||||
fd.L0.ParentFile = pf
|
||||
fd.L0.Parent = pd
|
||||
fd.L0.Index = i
|
||||
@@ -426,11 +426,11 @@ func (fd *Field) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd pref.Des
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.FieldDescriptorProto_Number_field_number:
|
||||
fd.L1.Number = pref.FieldNumber(v)
|
||||
fd.L1.Number = protoreflect.FieldNumber(v)
|
||||
case genid.FieldDescriptorProto_Label_field_number:
|
||||
fd.L1.Cardinality = pref.Cardinality(v)
|
||||
fd.L1.Cardinality = protoreflect.Cardinality(v)
|
||||
case genid.FieldDescriptorProto_Type_field_number:
|
||||
fd.L1.Kind = pref.Kind(v)
|
||||
fd.L1.Kind = protoreflect.Kind(v)
|
||||
case genid.FieldDescriptorProto_OneofIndex_field_number:
|
||||
// In Message.unmarshalFull, we allocate slices for both
|
||||
// the field and oneof descriptors before unmarshaling either
|
||||
@@ -453,7 +453,7 @@ func (fd *Field) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd pref.Des
|
||||
case genid.FieldDescriptorProto_JsonName_field_number:
|
||||
fd.L1.StringName.InitJSON(sb.MakeString(v))
|
||||
case genid.FieldDescriptorProto_DefaultValue_field_number:
|
||||
fd.L1.Default.val = pref.ValueOfBytes(v) // temporarily store as bytes; later resolved in resolveMessages
|
||||
fd.L1.Default.val = protoreflect.ValueOfBytes(v) // temporarily store as bytes; later resolved in resolveMessages
|
||||
case genid.FieldDescriptorProto_TypeName_field_number:
|
||||
rawTypeName = v
|
||||
case genid.FieldDescriptorProto_Options_field_number:
|
||||
@@ -468,9 +468,9 @@ func (fd *Field) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd pref.Des
|
||||
if rawTypeName != nil {
|
||||
name := makeFullName(sb, rawTypeName)
|
||||
switch fd.L1.Kind {
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
fd.L1.Enum = PlaceholderEnum(name)
|
||||
case pref.MessageKind, pref.GroupKind:
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
fd.L1.Message = PlaceholderMessage(name)
|
||||
}
|
||||
}
|
||||
@@ -504,7 +504,7 @@ func (fd *Field) unmarshalOptions(b []byte) {
|
||||
}
|
||||
}
|
||||
|
||||
func (od *Oneof) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd pref.Descriptor, i int) {
|
||||
func (od *Oneof) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) {
|
||||
od.L0.ParentFile = pf
|
||||
od.L0.Parent = pd
|
||||
od.L0.Index = i
|
||||
@@ -553,7 +553,7 @@ func (xd *Extension) unmarshalFull(b []byte, sb *strs.Builder) {
|
||||
case genid.FieldDescriptorProto_JsonName_field_number:
|
||||
xd.L2.StringName.InitJSON(sb.MakeString(v))
|
||||
case genid.FieldDescriptorProto_DefaultValue_field_number:
|
||||
xd.L2.Default.val = pref.ValueOfBytes(v) // temporarily store as bytes; later resolved in resolveExtensions
|
||||
xd.L2.Default.val = protoreflect.ValueOfBytes(v) // temporarily store as bytes; later resolved in resolveExtensions
|
||||
case genid.FieldDescriptorProto_TypeName_field_number:
|
||||
rawTypeName = v
|
||||
case genid.FieldDescriptorProto_Options_field_number:
|
||||
@@ -568,9 +568,9 @@ func (xd *Extension) unmarshalFull(b []byte, sb *strs.Builder) {
|
||||
if rawTypeName != nil {
|
||||
name := makeFullName(sb, rawTypeName)
|
||||
switch xd.L1.Kind {
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
xd.L2.Enum = PlaceholderEnum(name)
|
||||
case pref.MessageKind, pref.GroupKind:
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
xd.L2.Message = PlaceholderMessage(name)
|
||||
}
|
||||
}
|
||||
@@ -627,7 +627,7 @@ func (sd *Service) unmarshalFull(b []byte, sb *strs.Builder) {
|
||||
sd.L2.Options = sd.L0.ParentFile.builder.optionsUnmarshaler(&descopts.Service, rawOptions)
|
||||
}
|
||||
|
||||
func (md *Method) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd pref.Descriptor, i int) {
|
||||
func (md *Method) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd protoreflect.Descriptor, i int) {
|
||||
md.L0.ParentFile = pf
|
||||
md.L0.Parent = pd
|
||||
md.L0.Index = i
|
||||
@@ -680,18 +680,18 @@ func appendOptions(dst, src []byte) []byte {
|
||||
//
|
||||
// The type of message to unmarshal to is passed as a pointer since the
|
||||
// vars in descopts may not yet be populated at the time this function is called.
|
||||
func (db *Builder) optionsUnmarshaler(p *pref.ProtoMessage, b []byte) func() pref.ProtoMessage {
|
||||
func (db *Builder) optionsUnmarshaler(p *protoreflect.ProtoMessage, b []byte) func() protoreflect.ProtoMessage {
|
||||
if b == nil {
|
||||
return nil
|
||||
}
|
||||
var opts pref.ProtoMessage
|
||||
var opts protoreflect.ProtoMessage
|
||||
var once sync.Once
|
||||
return func() pref.ProtoMessage {
|
||||
return func() protoreflect.ProtoMessage {
|
||||
once.Do(func() {
|
||||
if *p == nil {
|
||||
panic("Descriptor.Options called without importing the descriptor package")
|
||||
}
|
||||
opts = reflect.New(reflect.TypeOf(*p).Elem()).Interface().(pref.ProtoMessage)
|
||||
opts = reflect.New(reflect.TypeOf(*p).Elem()).Interface().(protoreflect.ProtoMessage)
|
||||
if err := (proto.UnmarshalOptions{
|
||||
AllowPartial: true,
|
||||
Resolver: db.TypeResolver,
|
||||
|
||||
167
go/vendor/google.golang.org/protobuf/internal/filedesc/desc_list.go
generated
vendored
167
go/vendor/google.golang.org/protobuf/internal/filedesc/desc_list.go
generated
vendored
@@ -17,31 +17,30 @@ import (
|
||||
"google.golang.org/protobuf/internal/errors"
|
||||
"google.golang.org/protobuf/internal/pragma"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
type FileImports []pref.FileImport
|
||||
type FileImports []protoreflect.FileImport
|
||||
|
||||
func (p *FileImports) Len() int { return len(*p) }
|
||||
func (p *FileImports) Get(i int) pref.FileImport { return (*p)[i] }
|
||||
func (p *FileImports) Get(i int) protoreflect.FileImport { return (*p)[i] }
|
||||
func (p *FileImports) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
|
||||
func (p *FileImports) ProtoInternal(pragma.DoNotImplement) {}
|
||||
|
||||
type Names struct {
|
||||
List []pref.Name
|
||||
List []protoreflect.Name
|
||||
once sync.Once
|
||||
has map[pref.Name]int // protected by once
|
||||
has map[protoreflect.Name]int // protected by once
|
||||
}
|
||||
|
||||
func (p *Names) Len() int { return len(p.List) }
|
||||
func (p *Names) Get(i int) pref.Name { return p.List[i] }
|
||||
func (p *Names) Has(s pref.Name) bool { return p.lazyInit().has[s] > 0 }
|
||||
func (p *Names) Get(i int) protoreflect.Name { return p.List[i] }
|
||||
func (p *Names) Has(s protoreflect.Name) bool { return p.lazyInit().has[s] > 0 }
|
||||
func (p *Names) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
|
||||
func (p *Names) ProtoInternal(pragma.DoNotImplement) {}
|
||||
func (p *Names) lazyInit() *Names {
|
||||
p.once.Do(func() {
|
||||
if len(p.List) > 0 {
|
||||
p.has = make(map[pref.Name]int, len(p.List))
|
||||
p.has = make(map[protoreflect.Name]int, len(p.List))
|
||||
for _, s := range p.List {
|
||||
p.has[s] = p.has[s] + 1
|
||||
}
|
||||
@@ -67,14 +66,14 @@ func (p *Names) CheckValid() error {
|
||||
}
|
||||
|
||||
type EnumRanges struct {
|
||||
List [][2]pref.EnumNumber // start inclusive; end inclusive
|
||||
List [][2]protoreflect.EnumNumber // start inclusive; end inclusive
|
||||
once sync.Once
|
||||
sorted [][2]pref.EnumNumber // protected by once
|
||||
sorted [][2]protoreflect.EnumNumber // protected by once
|
||||
}
|
||||
|
||||
func (p *EnumRanges) Len() int { return len(p.List) }
|
||||
func (p *EnumRanges) Get(i int) [2]pref.EnumNumber { return p.List[i] }
|
||||
func (p *EnumRanges) Has(n pref.EnumNumber) bool {
|
||||
func (p *EnumRanges) Len() int { return len(p.List) }
|
||||
func (p *EnumRanges) Get(i int) [2]protoreflect.EnumNumber { return p.List[i] }
|
||||
func (p *EnumRanges) Has(n protoreflect.EnumNumber) bool {
|
||||
for ls := p.lazyInit().sorted; len(ls) > 0; {
|
||||
i := len(ls) / 2
|
||||
switch r := enumRange(ls[i]); {
|
||||
@@ -129,14 +128,14 @@ func (r enumRange) String() string {
|
||||
}
|
||||
|
||||
type FieldRanges struct {
|
||||
List [][2]pref.FieldNumber // start inclusive; end exclusive
|
||||
List [][2]protoreflect.FieldNumber // start inclusive; end exclusive
|
||||
once sync.Once
|
||||
sorted [][2]pref.FieldNumber // protected by once
|
||||
sorted [][2]protoreflect.FieldNumber // protected by once
|
||||
}
|
||||
|
||||
func (p *FieldRanges) Len() int { return len(p.List) }
|
||||
func (p *FieldRanges) Get(i int) [2]pref.FieldNumber { return p.List[i] }
|
||||
func (p *FieldRanges) Has(n pref.FieldNumber) bool {
|
||||
func (p *FieldRanges) Len() int { return len(p.List) }
|
||||
func (p *FieldRanges) Get(i int) [2]protoreflect.FieldNumber { return p.List[i] }
|
||||
func (p *FieldRanges) Has(n protoreflect.FieldNumber) bool {
|
||||
for ls := p.lazyInit().sorted; len(ls) > 0; {
|
||||
i := len(ls) / 2
|
||||
switch r := fieldRange(ls[i]); {
|
||||
@@ -221,17 +220,17 @@ func (r fieldRange) String() string {
|
||||
}
|
||||
|
||||
type FieldNumbers struct {
|
||||
List []pref.FieldNumber
|
||||
List []protoreflect.FieldNumber
|
||||
once sync.Once
|
||||
has map[pref.FieldNumber]struct{} // protected by once
|
||||
has map[protoreflect.FieldNumber]struct{} // protected by once
|
||||
}
|
||||
|
||||
func (p *FieldNumbers) Len() int { return len(p.List) }
|
||||
func (p *FieldNumbers) Get(i int) pref.FieldNumber { return p.List[i] }
|
||||
func (p *FieldNumbers) Has(n pref.FieldNumber) bool {
|
||||
func (p *FieldNumbers) Len() int { return len(p.List) }
|
||||
func (p *FieldNumbers) Get(i int) protoreflect.FieldNumber { return p.List[i] }
|
||||
func (p *FieldNumbers) Has(n protoreflect.FieldNumber) bool {
|
||||
p.once.Do(func() {
|
||||
if len(p.List) > 0 {
|
||||
p.has = make(map[pref.FieldNumber]struct{}, len(p.List))
|
||||
p.has = make(map[protoreflect.FieldNumber]struct{}, len(p.List))
|
||||
for _, n := range p.List {
|
||||
p.has[n] = struct{}{}
|
||||
}
|
||||
@@ -244,30 +243,38 @@ func (p *FieldNumbers) Format(s fmt.State, r rune) { descfmt.FormatList
|
||||
func (p *FieldNumbers) ProtoInternal(pragma.DoNotImplement) {}
|
||||
|
||||
type OneofFields struct {
|
||||
List []pref.FieldDescriptor
|
||||
List []protoreflect.FieldDescriptor
|
||||
once sync.Once
|
||||
byName map[pref.Name]pref.FieldDescriptor // protected by once
|
||||
byJSON map[string]pref.FieldDescriptor // protected by once
|
||||
byText map[string]pref.FieldDescriptor // protected by once
|
||||
byNum map[pref.FieldNumber]pref.FieldDescriptor // protected by once
|
||||
byName map[protoreflect.Name]protoreflect.FieldDescriptor // protected by once
|
||||
byJSON map[string]protoreflect.FieldDescriptor // protected by once
|
||||
byText map[string]protoreflect.FieldDescriptor // protected by once
|
||||
byNum map[protoreflect.FieldNumber]protoreflect.FieldDescriptor // protected by once
|
||||
}
|
||||
|
||||
func (p *OneofFields) Len() int { return len(p.List) }
|
||||
func (p *OneofFields) Get(i int) pref.FieldDescriptor { return p.List[i] }
|
||||
func (p *OneofFields) ByName(s pref.Name) pref.FieldDescriptor { return p.lazyInit().byName[s] }
|
||||
func (p *OneofFields) ByJSONName(s string) pref.FieldDescriptor { return p.lazyInit().byJSON[s] }
|
||||
func (p *OneofFields) ByTextName(s string) pref.FieldDescriptor { return p.lazyInit().byText[s] }
|
||||
func (p *OneofFields) ByNumber(n pref.FieldNumber) pref.FieldDescriptor { return p.lazyInit().byNum[n] }
|
||||
func (p *OneofFields) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
|
||||
func (p *OneofFields) ProtoInternal(pragma.DoNotImplement) {}
|
||||
func (p *OneofFields) Len() int { return len(p.List) }
|
||||
func (p *OneofFields) Get(i int) protoreflect.FieldDescriptor { return p.List[i] }
|
||||
func (p *OneofFields) ByName(s protoreflect.Name) protoreflect.FieldDescriptor {
|
||||
return p.lazyInit().byName[s]
|
||||
}
|
||||
func (p *OneofFields) ByJSONName(s string) protoreflect.FieldDescriptor {
|
||||
return p.lazyInit().byJSON[s]
|
||||
}
|
||||
func (p *OneofFields) ByTextName(s string) protoreflect.FieldDescriptor {
|
||||
return p.lazyInit().byText[s]
|
||||
}
|
||||
func (p *OneofFields) ByNumber(n protoreflect.FieldNumber) protoreflect.FieldDescriptor {
|
||||
return p.lazyInit().byNum[n]
|
||||
}
|
||||
func (p *OneofFields) Format(s fmt.State, r rune) { descfmt.FormatList(s, r, p) }
|
||||
func (p *OneofFields) ProtoInternal(pragma.DoNotImplement) {}
|
||||
|
||||
func (p *OneofFields) lazyInit() *OneofFields {
|
||||
p.once.Do(func() {
|
||||
if len(p.List) > 0 {
|
||||
p.byName = make(map[pref.Name]pref.FieldDescriptor, len(p.List))
|
||||
p.byJSON = make(map[string]pref.FieldDescriptor, len(p.List))
|
||||
p.byText = make(map[string]pref.FieldDescriptor, len(p.List))
|
||||
p.byNum = make(map[pref.FieldNumber]pref.FieldDescriptor, len(p.List))
|
||||
p.byName = make(map[protoreflect.Name]protoreflect.FieldDescriptor, len(p.List))
|
||||
p.byJSON = make(map[string]protoreflect.FieldDescriptor, len(p.List))
|
||||
p.byText = make(map[string]protoreflect.FieldDescriptor, len(p.List))
|
||||
p.byNum = make(map[protoreflect.FieldNumber]protoreflect.FieldDescriptor, len(p.List))
|
||||
for _, f := range p.List {
|
||||
// Field names and numbers are guaranteed to be unique.
|
||||
p.byName[f.Name()] = f
|
||||
@@ -284,123 +291,123 @@ type SourceLocations struct {
|
||||
// List is a list of SourceLocations.
|
||||
// The SourceLocation.Next field does not need to be populated
|
||||
// as it will be lazily populated upon first need.
|
||||
List []pref.SourceLocation
|
||||
List []protoreflect.SourceLocation
|
||||
|
||||
// File is the parent file descriptor that these locations are relative to.
|
||||
// If non-nil, ByDescriptor verifies that the provided descriptor
|
||||
// is a child of this file descriptor.
|
||||
File pref.FileDescriptor
|
||||
File protoreflect.FileDescriptor
|
||||
|
||||
once sync.Once
|
||||
byPath map[pathKey]int
|
||||
}
|
||||
|
||||
func (p *SourceLocations) Len() int { return len(p.List) }
|
||||
func (p *SourceLocations) Get(i int) pref.SourceLocation { return p.lazyInit().List[i] }
|
||||
func (p *SourceLocations) byKey(k pathKey) pref.SourceLocation {
|
||||
func (p *SourceLocations) Len() int { return len(p.List) }
|
||||
func (p *SourceLocations) Get(i int) protoreflect.SourceLocation { return p.lazyInit().List[i] }
|
||||
func (p *SourceLocations) byKey(k pathKey) protoreflect.SourceLocation {
|
||||
if i, ok := p.lazyInit().byPath[k]; ok {
|
||||
return p.List[i]
|
||||
}
|
||||
return pref.SourceLocation{}
|
||||
return protoreflect.SourceLocation{}
|
||||
}
|
||||
func (p *SourceLocations) ByPath(path pref.SourcePath) pref.SourceLocation {
|
||||
func (p *SourceLocations) ByPath(path protoreflect.SourcePath) protoreflect.SourceLocation {
|
||||
return p.byKey(newPathKey(path))
|
||||
}
|
||||
func (p *SourceLocations) ByDescriptor(desc pref.Descriptor) pref.SourceLocation {
|
||||
func (p *SourceLocations) ByDescriptor(desc protoreflect.Descriptor) protoreflect.SourceLocation {
|
||||
if p.File != nil && desc != nil && p.File != desc.ParentFile() {
|
||||
return pref.SourceLocation{} // mismatching parent files
|
||||
return protoreflect.SourceLocation{} // mismatching parent files
|
||||
}
|
||||
var pathArr [16]int32
|
||||
path := pathArr[:0]
|
||||
for {
|
||||
switch desc.(type) {
|
||||
case pref.FileDescriptor:
|
||||
case protoreflect.FileDescriptor:
|
||||
// Reverse the path since it was constructed in reverse.
|
||||
for i, j := 0, len(path)-1; i < j; i, j = i+1, j-1 {
|
||||
path[i], path[j] = path[j], path[i]
|
||||
}
|
||||
return p.byKey(newPathKey(path))
|
||||
case pref.MessageDescriptor:
|
||||
case protoreflect.MessageDescriptor:
|
||||
path = append(path, int32(desc.Index()))
|
||||
desc = desc.Parent()
|
||||
switch desc.(type) {
|
||||
case pref.FileDescriptor:
|
||||
case protoreflect.FileDescriptor:
|
||||
path = append(path, int32(genid.FileDescriptorProto_MessageType_field_number))
|
||||
case pref.MessageDescriptor:
|
||||
case protoreflect.MessageDescriptor:
|
||||
path = append(path, int32(genid.DescriptorProto_NestedType_field_number))
|
||||
default:
|
||||
return pref.SourceLocation{}
|
||||
return protoreflect.SourceLocation{}
|
||||
}
|
||||
case pref.FieldDescriptor:
|
||||
isExtension := desc.(pref.FieldDescriptor).IsExtension()
|
||||
case protoreflect.FieldDescriptor:
|
||||
isExtension := desc.(protoreflect.FieldDescriptor).IsExtension()
|
||||
path = append(path, int32(desc.Index()))
|
||||
desc = desc.Parent()
|
||||
if isExtension {
|
||||
switch desc.(type) {
|
||||
case pref.FileDescriptor:
|
||||
case protoreflect.FileDescriptor:
|
||||
path = append(path, int32(genid.FileDescriptorProto_Extension_field_number))
|
||||
case pref.MessageDescriptor:
|
||||
case protoreflect.MessageDescriptor:
|
||||
path = append(path, int32(genid.DescriptorProto_Extension_field_number))
|
||||
default:
|
||||
return pref.SourceLocation{}
|
||||
return protoreflect.SourceLocation{}
|
||||
}
|
||||
} else {
|
||||
switch desc.(type) {
|
||||
case pref.MessageDescriptor:
|
||||
case protoreflect.MessageDescriptor:
|
||||
path = append(path, int32(genid.DescriptorProto_Field_field_number))
|
||||
default:
|
||||
return pref.SourceLocation{}
|
||||
return protoreflect.SourceLocation{}
|
||||
}
|
||||
}
|
||||
case pref.OneofDescriptor:
|
||||
case protoreflect.OneofDescriptor:
|
||||
path = append(path, int32(desc.Index()))
|
||||
desc = desc.Parent()
|
||||
switch desc.(type) {
|
||||
case pref.MessageDescriptor:
|
||||
case protoreflect.MessageDescriptor:
|
||||
path = append(path, int32(genid.DescriptorProto_OneofDecl_field_number))
|
||||
default:
|
||||
return pref.SourceLocation{}
|
||||
return protoreflect.SourceLocation{}
|
||||
}
|
||||
case pref.EnumDescriptor:
|
||||
case protoreflect.EnumDescriptor:
|
||||
path = append(path, int32(desc.Index()))
|
||||
desc = desc.Parent()
|
||||
switch desc.(type) {
|
||||
case pref.FileDescriptor:
|
||||
case protoreflect.FileDescriptor:
|
||||
path = append(path, int32(genid.FileDescriptorProto_EnumType_field_number))
|
||||
case pref.MessageDescriptor:
|
||||
case protoreflect.MessageDescriptor:
|
||||
path = append(path, int32(genid.DescriptorProto_EnumType_field_number))
|
||||
default:
|
||||
return pref.SourceLocation{}
|
||||
return protoreflect.SourceLocation{}
|
||||
}
|
||||
case pref.EnumValueDescriptor:
|
||||
case protoreflect.EnumValueDescriptor:
|
||||
path = append(path, int32(desc.Index()))
|
||||
desc = desc.Parent()
|
||||
switch desc.(type) {
|
||||
case pref.EnumDescriptor:
|
||||
case protoreflect.EnumDescriptor:
|
||||
path = append(path, int32(genid.EnumDescriptorProto_Value_field_number))
|
||||
default:
|
||||
return pref.SourceLocation{}
|
||||
return protoreflect.SourceLocation{}
|
||||
}
|
||||
case pref.ServiceDescriptor:
|
||||
case protoreflect.ServiceDescriptor:
|
||||
path = append(path, int32(desc.Index()))
|
||||
desc = desc.Parent()
|
||||
switch desc.(type) {
|
||||
case pref.FileDescriptor:
|
||||
case protoreflect.FileDescriptor:
|
||||
path = append(path, int32(genid.FileDescriptorProto_Service_field_number))
|
||||
default:
|
||||
return pref.SourceLocation{}
|
||||
return protoreflect.SourceLocation{}
|
||||
}
|
||||
case pref.MethodDescriptor:
|
||||
case protoreflect.MethodDescriptor:
|
||||
path = append(path, int32(desc.Index()))
|
||||
desc = desc.Parent()
|
||||
switch desc.(type) {
|
||||
case pref.ServiceDescriptor:
|
||||
case protoreflect.ServiceDescriptor:
|
||||
path = append(path, int32(genid.ServiceDescriptorProto_Method_field_number))
|
||||
default:
|
||||
return pref.SourceLocation{}
|
||||
return protoreflect.SourceLocation{}
|
||||
}
|
||||
default:
|
||||
return pref.SourceLocation{}
|
||||
return protoreflect.SourceLocation{}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -435,7 +442,7 @@ type pathKey struct {
|
||||
str string // used if the path does not fit in arr
|
||||
}
|
||||
|
||||
func newPathKey(p pref.SourcePath) (k pathKey) {
|
||||
func newPathKey(p protoreflect.SourcePath) (k pathKey) {
|
||||
if len(p) < len(k.arr) {
|
||||
for i, ps := range p {
|
||||
if ps < 0 || math.MaxUint8 <= ps {
|
||||
|
||||
136
go/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go
generated
vendored
136
go/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go
generated
vendored
@@ -7,7 +7,7 @@ package filedesc
|
||||
import (
|
||||
"google.golang.org/protobuf/internal/descopts"
|
||||
"google.golang.org/protobuf/internal/pragma"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -30,78 +30,80 @@ var (
|
||||
// PlaceholderFile is a placeholder, representing only the file path.
|
||||
type PlaceholderFile string
|
||||
|
||||
func (f PlaceholderFile) ParentFile() pref.FileDescriptor { return f }
|
||||
func (f PlaceholderFile) Parent() pref.Descriptor { return nil }
|
||||
func (f PlaceholderFile) Index() int { return 0 }
|
||||
func (f PlaceholderFile) Syntax() pref.Syntax { return 0 }
|
||||
func (f PlaceholderFile) Name() pref.Name { return "" }
|
||||
func (f PlaceholderFile) FullName() pref.FullName { return "" }
|
||||
func (f PlaceholderFile) IsPlaceholder() bool { return true }
|
||||
func (f PlaceholderFile) Options() pref.ProtoMessage { return descopts.File }
|
||||
func (f PlaceholderFile) Path() string { return string(f) }
|
||||
func (f PlaceholderFile) Package() pref.FullName { return "" }
|
||||
func (f PlaceholderFile) Imports() pref.FileImports { return emptyFiles }
|
||||
func (f PlaceholderFile) Messages() pref.MessageDescriptors { return emptyMessages }
|
||||
func (f PlaceholderFile) Enums() pref.EnumDescriptors { return emptyEnums }
|
||||
func (f PlaceholderFile) Extensions() pref.ExtensionDescriptors { return emptyExtensions }
|
||||
func (f PlaceholderFile) Services() pref.ServiceDescriptors { return emptyServices }
|
||||
func (f PlaceholderFile) SourceLocations() pref.SourceLocations { return emptySourceLocations }
|
||||
func (f PlaceholderFile) ProtoType(pref.FileDescriptor) { return }
|
||||
func (f PlaceholderFile) ProtoInternal(pragma.DoNotImplement) { return }
|
||||
func (f PlaceholderFile) ParentFile() protoreflect.FileDescriptor { return f }
|
||||
func (f PlaceholderFile) Parent() protoreflect.Descriptor { return nil }
|
||||
func (f PlaceholderFile) Index() int { return 0 }
|
||||
func (f PlaceholderFile) Syntax() protoreflect.Syntax { return 0 }
|
||||
func (f PlaceholderFile) Name() protoreflect.Name { return "" }
|
||||
func (f PlaceholderFile) FullName() protoreflect.FullName { return "" }
|
||||
func (f PlaceholderFile) IsPlaceholder() bool { return true }
|
||||
func (f PlaceholderFile) Options() protoreflect.ProtoMessage { return descopts.File }
|
||||
func (f PlaceholderFile) Path() string { return string(f) }
|
||||
func (f PlaceholderFile) Package() protoreflect.FullName { return "" }
|
||||
func (f PlaceholderFile) Imports() protoreflect.FileImports { return emptyFiles }
|
||||
func (f PlaceholderFile) Messages() protoreflect.MessageDescriptors { return emptyMessages }
|
||||
func (f PlaceholderFile) Enums() protoreflect.EnumDescriptors { return emptyEnums }
|
||||
func (f PlaceholderFile) Extensions() protoreflect.ExtensionDescriptors { return emptyExtensions }
|
||||
func (f PlaceholderFile) Services() protoreflect.ServiceDescriptors { return emptyServices }
|
||||
func (f PlaceholderFile) SourceLocations() protoreflect.SourceLocations { return emptySourceLocations }
|
||||
func (f PlaceholderFile) ProtoType(protoreflect.FileDescriptor) { return }
|
||||
func (f PlaceholderFile) ProtoInternal(pragma.DoNotImplement) { return }
|
||||
|
||||
// PlaceholderEnum is a placeholder, representing only the full name.
|
||||
type PlaceholderEnum pref.FullName
|
||||
type PlaceholderEnum protoreflect.FullName
|
||||
|
||||
func (e PlaceholderEnum) ParentFile() pref.FileDescriptor { return nil }
|
||||
func (e PlaceholderEnum) Parent() pref.Descriptor { return nil }
|
||||
func (e PlaceholderEnum) Index() int { return 0 }
|
||||
func (e PlaceholderEnum) Syntax() pref.Syntax { return 0 }
|
||||
func (e PlaceholderEnum) Name() pref.Name { return pref.FullName(e).Name() }
|
||||
func (e PlaceholderEnum) FullName() pref.FullName { return pref.FullName(e) }
|
||||
func (e PlaceholderEnum) IsPlaceholder() bool { return true }
|
||||
func (e PlaceholderEnum) Options() pref.ProtoMessage { return descopts.Enum }
|
||||
func (e PlaceholderEnum) Values() pref.EnumValueDescriptors { return emptyEnumValues }
|
||||
func (e PlaceholderEnum) ReservedNames() pref.Names { return emptyNames }
|
||||
func (e PlaceholderEnum) ReservedRanges() pref.EnumRanges { return emptyEnumRanges }
|
||||
func (e PlaceholderEnum) ProtoType(pref.EnumDescriptor) { return }
|
||||
func (e PlaceholderEnum) ProtoInternal(pragma.DoNotImplement) { return }
|
||||
func (e PlaceholderEnum) ParentFile() protoreflect.FileDescriptor { return nil }
|
||||
func (e PlaceholderEnum) Parent() protoreflect.Descriptor { return nil }
|
||||
func (e PlaceholderEnum) Index() int { return 0 }
|
||||
func (e PlaceholderEnum) Syntax() protoreflect.Syntax { return 0 }
|
||||
func (e PlaceholderEnum) Name() protoreflect.Name { return protoreflect.FullName(e).Name() }
|
||||
func (e PlaceholderEnum) FullName() protoreflect.FullName { return protoreflect.FullName(e) }
|
||||
func (e PlaceholderEnum) IsPlaceholder() bool { return true }
|
||||
func (e PlaceholderEnum) Options() protoreflect.ProtoMessage { return descopts.Enum }
|
||||
func (e PlaceholderEnum) Values() protoreflect.EnumValueDescriptors { return emptyEnumValues }
|
||||
func (e PlaceholderEnum) ReservedNames() protoreflect.Names { return emptyNames }
|
||||
func (e PlaceholderEnum) ReservedRanges() protoreflect.EnumRanges { return emptyEnumRanges }
|
||||
func (e PlaceholderEnum) ProtoType(protoreflect.EnumDescriptor) { return }
|
||||
func (e PlaceholderEnum) ProtoInternal(pragma.DoNotImplement) { return }
|
||||
|
||||
// PlaceholderEnumValue is a placeholder, representing only the full name.
|
||||
type PlaceholderEnumValue pref.FullName
|
||||
type PlaceholderEnumValue protoreflect.FullName
|
||||
|
||||
func (e PlaceholderEnumValue) ParentFile() pref.FileDescriptor { return nil }
|
||||
func (e PlaceholderEnumValue) Parent() pref.Descriptor { return nil }
|
||||
func (e PlaceholderEnumValue) Index() int { return 0 }
|
||||
func (e PlaceholderEnumValue) Syntax() pref.Syntax { return 0 }
|
||||
func (e PlaceholderEnumValue) Name() pref.Name { return pref.FullName(e).Name() }
|
||||
func (e PlaceholderEnumValue) FullName() pref.FullName { return pref.FullName(e) }
|
||||
func (e PlaceholderEnumValue) IsPlaceholder() bool { return true }
|
||||
func (e PlaceholderEnumValue) Options() pref.ProtoMessage { return descopts.EnumValue }
|
||||
func (e PlaceholderEnumValue) Number() pref.EnumNumber { return 0 }
|
||||
func (e PlaceholderEnumValue) ProtoType(pref.EnumValueDescriptor) { return }
|
||||
func (e PlaceholderEnumValue) ProtoInternal(pragma.DoNotImplement) { return }
|
||||
func (e PlaceholderEnumValue) ParentFile() protoreflect.FileDescriptor { return nil }
|
||||
func (e PlaceholderEnumValue) Parent() protoreflect.Descriptor { return nil }
|
||||
func (e PlaceholderEnumValue) Index() int { return 0 }
|
||||
func (e PlaceholderEnumValue) Syntax() protoreflect.Syntax { return 0 }
|
||||
func (e PlaceholderEnumValue) Name() protoreflect.Name { return protoreflect.FullName(e).Name() }
|
||||
func (e PlaceholderEnumValue) FullName() protoreflect.FullName { return protoreflect.FullName(e) }
|
||||
func (e PlaceholderEnumValue) IsPlaceholder() bool { return true }
|
||||
func (e PlaceholderEnumValue) Options() protoreflect.ProtoMessage { return descopts.EnumValue }
|
||||
func (e PlaceholderEnumValue) Number() protoreflect.EnumNumber { return 0 }
|
||||
func (e PlaceholderEnumValue) ProtoType(protoreflect.EnumValueDescriptor) { return }
|
||||
func (e PlaceholderEnumValue) ProtoInternal(pragma.DoNotImplement) { return }
|
||||
|
||||
// PlaceholderMessage is a placeholder, representing only the full name.
|
||||
type PlaceholderMessage pref.FullName
|
||||
type PlaceholderMessage protoreflect.FullName
|
||||
|
||||
func (m PlaceholderMessage) ParentFile() pref.FileDescriptor { return nil }
|
||||
func (m PlaceholderMessage) Parent() pref.Descriptor { return nil }
|
||||
func (m PlaceholderMessage) Index() int { return 0 }
|
||||
func (m PlaceholderMessage) Syntax() pref.Syntax { return 0 }
|
||||
func (m PlaceholderMessage) Name() pref.Name { return pref.FullName(m).Name() }
|
||||
func (m PlaceholderMessage) FullName() pref.FullName { return pref.FullName(m) }
|
||||
func (m PlaceholderMessage) IsPlaceholder() bool { return true }
|
||||
func (m PlaceholderMessage) Options() pref.ProtoMessage { return descopts.Message }
|
||||
func (m PlaceholderMessage) IsMapEntry() bool { return false }
|
||||
func (m PlaceholderMessage) Fields() pref.FieldDescriptors { return emptyFields }
|
||||
func (m PlaceholderMessage) Oneofs() pref.OneofDescriptors { return emptyOneofs }
|
||||
func (m PlaceholderMessage) ReservedNames() pref.Names { return emptyNames }
|
||||
func (m PlaceholderMessage) ReservedRanges() pref.FieldRanges { return emptyFieldRanges }
|
||||
func (m PlaceholderMessage) RequiredNumbers() pref.FieldNumbers { return emptyFieldNumbers }
|
||||
func (m PlaceholderMessage) ExtensionRanges() pref.FieldRanges { return emptyFieldRanges }
|
||||
func (m PlaceholderMessage) ExtensionRangeOptions(int) pref.ProtoMessage { panic("index out of range") }
|
||||
func (m PlaceholderMessage) Messages() pref.MessageDescriptors { return emptyMessages }
|
||||
func (m PlaceholderMessage) Enums() pref.EnumDescriptors { return emptyEnums }
|
||||
func (m PlaceholderMessage) Extensions() pref.ExtensionDescriptors { return emptyExtensions }
|
||||
func (m PlaceholderMessage) ProtoType(pref.MessageDescriptor) { return }
|
||||
func (m PlaceholderMessage) ProtoInternal(pragma.DoNotImplement) { return }
|
||||
func (m PlaceholderMessage) ParentFile() protoreflect.FileDescriptor { return nil }
|
||||
func (m PlaceholderMessage) Parent() protoreflect.Descriptor { return nil }
|
||||
func (m PlaceholderMessage) Index() int { return 0 }
|
||||
func (m PlaceholderMessage) Syntax() protoreflect.Syntax { return 0 }
|
||||
func (m PlaceholderMessage) Name() protoreflect.Name { return protoreflect.FullName(m).Name() }
|
||||
func (m PlaceholderMessage) FullName() protoreflect.FullName { return protoreflect.FullName(m) }
|
||||
func (m PlaceholderMessage) IsPlaceholder() bool { return true }
|
||||
func (m PlaceholderMessage) Options() protoreflect.ProtoMessage { return descopts.Message }
|
||||
func (m PlaceholderMessage) IsMapEntry() bool { return false }
|
||||
func (m PlaceholderMessage) Fields() protoreflect.FieldDescriptors { return emptyFields }
|
||||
func (m PlaceholderMessage) Oneofs() protoreflect.OneofDescriptors { return emptyOneofs }
|
||||
func (m PlaceholderMessage) ReservedNames() protoreflect.Names { return emptyNames }
|
||||
func (m PlaceholderMessage) ReservedRanges() protoreflect.FieldRanges { return emptyFieldRanges }
|
||||
func (m PlaceholderMessage) RequiredNumbers() protoreflect.FieldNumbers { return emptyFieldNumbers }
|
||||
func (m PlaceholderMessage) ExtensionRanges() protoreflect.FieldRanges { return emptyFieldRanges }
|
||||
func (m PlaceholderMessage) ExtensionRangeOptions(int) protoreflect.ProtoMessage {
|
||||
panic("index out of range")
|
||||
}
|
||||
func (m PlaceholderMessage) Messages() protoreflect.MessageDescriptors { return emptyMessages }
|
||||
func (m PlaceholderMessage) Enums() protoreflect.EnumDescriptors { return emptyEnums }
|
||||
func (m PlaceholderMessage) Extensions() protoreflect.ExtensionDescriptors { return emptyExtensions }
|
||||
func (m PlaceholderMessage) ProtoType(protoreflect.MessageDescriptor) { return }
|
||||
func (m PlaceholderMessage) ProtoInternal(pragma.DoNotImplement) { return }
|
||||
|
||||
87
go/vendor/google.golang.org/protobuf/internal/filetype/build.go
generated
vendored
87
go/vendor/google.golang.org/protobuf/internal/filetype/build.go
generated
vendored
@@ -10,17 +10,16 @@ import (
|
||||
"reflect"
|
||||
|
||||
"google.golang.org/protobuf/internal/descopts"
|
||||
fdesc "google.golang.org/protobuf/internal/filedesc"
|
||||
"google.golang.org/protobuf/internal/filedesc"
|
||||
pimpl "google.golang.org/protobuf/internal/impl"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
preg "google.golang.org/protobuf/reflect/protoregistry"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
)
|
||||
|
||||
// Builder constructs type descriptors from a raw file descriptor
|
||||
// and associated Go types for each enum and message declaration.
|
||||
//
|
||||
//
|
||||
// Flattened Ordering
|
||||
// # Flattened Ordering
|
||||
//
|
||||
// The protobuf type system represents declarations as a tree. Certain nodes in
|
||||
// the tree require us to either associate it with a concrete Go type or to
|
||||
@@ -52,7 +51,7 @@ import (
|
||||
// that children themselves may have.
|
||||
type Builder struct {
|
||||
// File is the underlying file descriptor builder.
|
||||
File fdesc.Builder
|
||||
File filedesc.Builder
|
||||
|
||||
// GoTypes is a unique set of the Go types for all declarations and
|
||||
// dependencies. Each type is represented as a zero value of the Go type.
|
||||
@@ -108,22 +107,22 @@ type Builder struct {
|
||||
// TypeRegistry is the registry to register each type descriptor.
|
||||
// If nil, it uses protoregistry.GlobalTypes.
|
||||
TypeRegistry interface {
|
||||
RegisterMessage(pref.MessageType) error
|
||||
RegisterEnum(pref.EnumType) error
|
||||
RegisterExtension(pref.ExtensionType) error
|
||||
RegisterMessage(protoreflect.MessageType) error
|
||||
RegisterEnum(protoreflect.EnumType) error
|
||||
RegisterExtension(protoreflect.ExtensionType) error
|
||||
}
|
||||
}
|
||||
|
||||
// Out is the output of the builder.
|
||||
type Out struct {
|
||||
File pref.FileDescriptor
|
||||
File protoreflect.FileDescriptor
|
||||
}
|
||||
|
||||
func (tb Builder) Build() (out Out) {
|
||||
// Replace the resolver with one that resolves dependencies by index,
|
||||
// which is faster and more reliable than relying on the global registry.
|
||||
if tb.File.FileRegistry == nil {
|
||||
tb.File.FileRegistry = preg.GlobalFiles
|
||||
tb.File.FileRegistry = protoregistry.GlobalFiles
|
||||
}
|
||||
tb.File.FileRegistry = &resolverByIndex{
|
||||
goTypes: tb.GoTypes,
|
||||
@@ -133,7 +132,7 @@ func (tb Builder) Build() (out Out) {
|
||||
|
||||
// Initialize registry if unpopulated.
|
||||
if tb.TypeRegistry == nil {
|
||||
tb.TypeRegistry = preg.GlobalTypes
|
||||
tb.TypeRegistry = protoregistry.GlobalTypes
|
||||
}
|
||||
|
||||
fbOut := tb.File.Build()
|
||||
@@ -183,23 +182,23 @@ func (tb Builder) Build() (out Out) {
|
||||
for i := range fbOut.Messages {
|
||||
switch fbOut.Messages[i].Name() {
|
||||
case "FileOptions":
|
||||
descopts.File = messageGoTypes[i].(pref.ProtoMessage)
|
||||
descopts.File = messageGoTypes[i].(protoreflect.ProtoMessage)
|
||||
case "EnumOptions":
|
||||
descopts.Enum = messageGoTypes[i].(pref.ProtoMessage)
|
||||
descopts.Enum = messageGoTypes[i].(protoreflect.ProtoMessage)
|
||||
case "EnumValueOptions":
|
||||
descopts.EnumValue = messageGoTypes[i].(pref.ProtoMessage)
|
||||
descopts.EnumValue = messageGoTypes[i].(protoreflect.ProtoMessage)
|
||||
case "MessageOptions":
|
||||
descopts.Message = messageGoTypes[i].(pref.ProtoMessage)
|
||||
descopts.Message = messageGoTypes[i].(protoreflect.ProtoMessage)
|
||||
case "FieldOptions":
|
||||
descopts.Field = messageGoTypes[i].(pref.ProtoMessage)
|
||||
descopts.Field = messageGoTypes[i].(protoreflect.ProtoMessage)
|
||||
case "OneofOptions":
|
||||
descopts.Oneof = messageGoTypes[i].(pref.ProtoMessage)
|
||||
descopts.Oneof = messageGoTypes[i].(protoreflect.ProtoMessage)
|
||||
case "ExtensionRangeOptions":
|
||||
descopts.ExtensionRange = messageGoTypes[i].(pref.ProtoMessage)
|
||||
descopts.ExtensionRange = messageGoTypes[i].(protoreflect.ProtoMessage)
|
||||
case "ServiceOptions":
|
||||
descopts.Service = messageGoTypes[i].(pref.ProtoMessage)
|
||||
descopts.Service = messageGoTypes[i].(protoreflect.ProtoMessage)
|
||||
case "MethodOptions":
|
||||
descopts.Method = messageGoTypes[i].(pref.ProtoMessage)
|
||||
descopts.Method = messageGoTypes[i].(protoreflect.ProtoMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -216,11 +215,11 @@ func (tb Builder) Build() (out Out) {
|
||||
const listExtDeps = 2
|
||||
var goType reflect.Type
|
||||
switch fbOut.Extensions[i].L1.Kind {
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
j := depIdxs.Get(tb.DependencyIndexes, listExtDeps, depIdx)
|
||||
goType = reflect.TypeOf(tb.GoTypes[j])
|
||||
depIdx++
|
||||
case pref.MessageKind, pref.GroupKind:
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
j := depIdxs.Get(tb.DependencyIndexes, listExtDeps, depIdx)
|
||||
goType = reflect.TypeOf(tb.GoTypes[j])
|
||||
depIdx++
|
||||
@@ -242,22 +241,22 @@ func (tb Builder) Build() (out Out) {
|
||||
return out
|
||||
}
|
||||
|
||||
var goTypeForPBKind = map[pref.Kind]reflect.Type{
|
||||
pref.BoolKind: reflect.TypeOf(bool(false)),
|
||||
pref.Int32Kind: reflect.TypeOf(int32(0)),
|
||||
pref.Sint32Kind: reflect.TypeOf(int32(0)),
|
||||
pref.Sfixed32Kind: reflect.TypeOf(int32(0)),
|
||||
pref.Int64Kind: reflect.TypeOf(int64(0)),
|
||||
pref.Sint64Kind: reflect.TypeOf(int64(0)),
|
||||
pref.Sfixed64Kind: reflect.TypeOf(int64(0)),
|
||||
pref.Uint32Kind: reflect.TypeOf(uint32(0)),
|
||||
pref.Fixed32Kind: reflect.TypeOf(uint32(0)),
|
||||
pref.Uint64Kind: reflect.TypeOf(uint64(0)),
|
||||
pref.Fixed64Kind: reflect.TypeOf(uint64(0)),
|
||||
pref.FloatKind: reflect.TypeOf(float32(0)),
|
||||
pref.DoubleKind: reflect.TypeOf(float64(0)),
|
||||
pref.StringKind: reflect.TypeOf(string("")),
|
||||
pref.BytesKind: reflect.TypeOf([]byte(nil)),
|
||||
var goTypeForPBKind = map[protoreflect.Kind]reflect.Type{
|
||||
protoreflect.BoolKind: reflect.TypeOf(bool(false)),
|
||||
protoreflect.Int32Kind: reflect.TypeOf(int32(0)),
|
||||
protoreflect.Sint32Kind: reflect.TypeOf(int32(0)),
|
||||
protoreflect.Sfixed32Kind: reflect.TypeOf(int32(0)),
|
||||
protoreflect.Int64Kind: reflect.TypeOf(int64(0)),
|
||||
protoreflect.Sint64Kind: reflect.TypeOf(int64(0)),
|
||||
protoreflect.Sfixed64Kind: reflect.TypeOf(int64(0)),
|
||||
protoreflect.Uint32Kind: reflect.TypeOf(uint32(0)),
|
||||
protoreflect.Fixed32Kind: reflect.TypeOf(uint32(0)),
|
||||
protoreflect.Uint64Kind: reflect.TypeOf(uint64(0)),
|
||||
protoreflect.Fixed64Kind: reflect.TypeOf(uint64(0)),
|
||||
protoreflect.FloatKind: reflect.TypeOf(float32(0)),
|
||||
protoreflect.DoubleKind: reflect.TypeOf(float64(0)),
|
||||
protoreflect.StringKind: reflect.TypeOf(string("")),
|
||||
protoreflect.BytesKind: reflect.TypeOf([]byte(nil)),
|
||||
}
|
||||
|
||||
type depIdxs []int32
|
||||
@@ -274,13 +273,13 @@ type (
|
||||
fileRegistry
|
||||
}
|
||||
fileRegistry interface {
|
||||
FindFileByPath(string) (pref.FileDescriptor, error)
|
||||
FindDescriptorByName(pref.FullName) (pref.Descriptor, error)
|
||||
RegisterFile(pref.FileDescriptor) error
|
||||
FindFileByPath(string) (protoreflect.FileDescriptor, error)
|
||||
FindDescriptorByName(protoreflect.FullName) (protoreflect.Descriptor, error)
|
||||
RegisterFile(protoreflect.FileDescriptor) error
|
||||
}
|
||||
)
|
||||
|
||||
func (r *resolverByIndex) FindEnumByIndex(i, j int32, es []fdesc.Enum, ms []fdesc.Message) pref.EnumDescriptor {
|
||||
func (r *resolverByIndex) FindEnumByIndex(i, j int32, es []filedesc.Enum, ms []filedesc.Message) protoreflect.EnumDescriptor {
|
||||
if depIdx := int(r.depIdxs.Get(i, j)); int(depIdx) < len(es)+len(ms) {
|
||||
return &es[depIdx]
|
||||
} else {
|
||||
@@ -288,7 +287,7 @@ func (r *resolverByIndex) FindEnumByIndex(i, j int32, es []fdesc.Enum, ms []fdes
|
||||
}
|
||||
}
|
||||
|
||||
func (r *resolverByIndex) FindMessageByIndex(i, j int32, es []fdesc.Enum, ms []fdesc.Message) pref.MessageDescriptor {
|
||||
func (r *resolverByIndex) FindMessageByIndex(i, j int32, es []filedesc.Enum, ms []filedesc.Message) protoreflect.MessageDescriptor {
|
||||
if depIdx := int(r.depIdxs.Get(i, j)); depIdx < len(es)+len(ms) {
|
||||
return &ms[depIdx-len(es)]
|
||||
} else {
|
||||
|
||||
306
go/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go
generated
vendored
306
go/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go
generated
vendored
@@ -12,6 +12,12 @@ import (
|
||||
|
||||
const File_google_protobuf_descriptor_proto = "google/protobuf/descriptor.proto"
|
||||
|
||||
// Full and short names for google.protobuf.Edition.
|
||||
const (
|
||||
Edition_enum_fullname = "google.protobuf.Edition"
|
||||
Edition_enum_name = "Edition"
|
||||
)
|
||||
|
||||
// Names for google.protobuf.FileDescriptorSet.
|
||||
const (
|
||||
FileDescriptorSet_message_name protoreflect.Name = "FileDescriptorSet"
|
||||
@@ -50,6 +56,7 @@ const (
|
||||
FileDescriptorProto_Options_field_name protoreflect.Name = "options"
|
||||
FileDescriptorProto_SourceCodeInfo_field_name protoreflect.Name = "source_code_info"
|
||||
FileDescriptorProto_Syntax_field_name protoreflect.Name = "syntax"
|
||||
FileDescriptorProto_Edition_field_name protoreflect.Name = "edition"
|
||||
|
||||
FileDescriptorProto_Name_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.name"
|
||||
FileDescriptorProto_Package_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.package"
|
||||
@@ -63,6 +70,7 @@ const (
|
||||
FileDescriptorProto_Options_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.options"
|
||||
FileDescriptorProto_SourceCodeInfo_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.source_code_info"
|
||||
FileDescriptorProto_Syntax_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.syntax"
|
||||
FileDescriptorProto_Edition_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.edition"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.FileDescriptorProto.
|
||||
@@ -79,6 +87,7 @@ const (
|
||||
FileDescriptorProto_Options_field_number protoreflect.FieldNumber = 8
|
||||
FileDescriptorProto_SourceCodeInfo_field_number protoreflect.FieldNumber = 9
|
||||
FileDescriptorProto_Syntax_field_number protoreflect.FieldNumber = 12
|
||||
FileDescriptorProto_Edition_field_number protoreflect.FieldNumber = 14
|
||||
)
|
||||
|
||||
// Names for google.protobuf.DescriptorProto.
|
||||
@@ -180,13 +189,58 @@ const (
|
||||
// Field names for google.protobuf.ExtensionRangeOptions.
|
||||
const (
|
||||
ExtensionRangeOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
ExtensionRangeOptions_Declaration_field_name protoreflect.Name = "declaration"
|
||||
ExtensionRangeOptions_Features_field_name protoreflect.Name = "features"
|
||||
ExtensionRangeOptions_Verification_field_name protoreflect.Name = "verification"
|
||||
|
||||
ExtensionRangeOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.uninterpreted_option"
|
||||
ExtensionRangeOptions_Declaration_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.declaration"
|
||||
ExtensionRangeOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.features"
|
||||
ExtensionRangeOptions_Verification_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.verification"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.ExtensionRangeOptions.
|
||||
const (
|
||||
ExtensionRangeOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
ExtensionRangeOptions_Declaration_field_number protoreflect.FieldNumber = 2
|
||||
ExtensionRangeOptions_Features_field_number protoreflect.FieldNumber = 50
|
||||
ExtensionRangeOptions_Verification_field_number protoreflect.FieldNumber = 3
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.ExtensionRangeOptions.VerificationState.
|
||||
const (
|
||||
ExtensionRangeOptions_VerificationState_enum_fullname = "google.protobuf.ExtensionRangeOptions.VerificationState"
|
||||
ExtensionRangeOptions_VerificationState_enum_name = "VerificationState"
|
||||
)
|
||||
|
||||
// Names for google.protobuf.ExtensionRangeOptions.Declaration.
|
||||
const (
|
||||
ExtensionRangeOptions_Declaration_message_name protoreflect.Name = "Declaration"
|
||||
ExtensionRangeOptions_Declaration_message_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration"
|
||||
)
|
||||
|
||||
// Field names for google.protobuf.ExtensionRangeOptions.Declaration.
|
||||
const (
|
||||
ExtensionRangeOptions_Declaration_Number_field_name protoreflect.Name = "number"
|
||||
ExtensionRangeOptions_Declaration_FullName_field_name protoreflect.Name = "full_name"
|
||||
ExtensionRangeOptions_Declaration_Type_field_name protoreflect.Name = "type"
|
||||
ExtensionRangeOptions_Declaration_Reserved_field_name protoreflect.Name = "reserved"
|
||||
ExtensionRangeOptions_Declaration_Repeated_field_name protoreflect.Name = "repeated"
|
||||
|
||||
ExtensionRangeOptions_Declaration_Number_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.number"
|
||||
ExtensionRangeOptions_Declaration_FullName_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.full_name"
|
||||
ExtensionRangeOptions_Declaration_Type_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.type"
|
||||
ExtensionRangeOptions_Declaration_Reserved_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.reserved"
|
||||
ExtensionRangeOptions_Declaration_Repeated_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.repeated"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.ExtensionRangeOptions.Declaration.
|
||||
const (
|
||||
ExtensionRangeOptions_Declaration_Number_field_number protoreflect.FieldNumber = 1
|
||||
ExtensionRangeOptions_Declaration_FullName_field_number protoreflect.FieldNumber = 2
|
||||
ExtensionRangeOptions_Declaration_Type_field_number protoreflect.FieldNumber = 3
|
||||
ExtensionRangeOptions_Declaration_Reserved_field_number protoreflect.FieldNumber = 5
|
||||
ExtensionRangeOptions_Declaration_Repeated_field_number protoreflect.FieldNumber = 6
|
||||
)
|
||||
|
||||
// Names for google.protobuf.FieldDescriptorProto.
|
||||
@@ -430,6 +484,7 @@ const (
|
||||
FileOptions_PhpNamespace_field_name protoreflect.Name = "php_namespace"
|
||||
FileOptions_PhpMetadataNamespace_field_name protoreflect.Name = "php_metadata_namespace"
|
||||
FileOptions_RubyPackage_field_name protoreflect.Name = "ruby_package"
|
||||
FileOptions_Features_field_name protoreflect.Name = "features"
|
||||
FileOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
|
||||
FileOptions_JavaPackage_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.java_package"
|
||||
@@ -452,6 +507,7 @@ const (
|
||||
FileOptions_PhpNamespace_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.php_namespace"
|
||||
FileOptions_PhpMetadataNamespace_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.php_metadata_namespace"
|
||||
FileOptions_RubyPackage_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.ruby_package"
|
||||
FileOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.features"
|
||||
FileOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.uninterpreted_option"
|
||||
)
|
||||
|
||||
@@ -477,6 +533,7 @@ const (
|
||||
FileOptions_PhpNamespace_field_number protoreflect.FieldNumber = 41
|
||||
FileOptions_PhpMetadataNamespace_field_number protoreflect.FieldNumber = 44
|
||||
FileOptions_RubyPackage_field_number protoreflect.FieldNumber = 45
|
||||
FileOptions_Features_field_number protoreflect.FieldNumber = 50
|
||||
FileOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
)
|
||||
|
||||
@@ -494,26 +551,32 @@ const (
|
||||
|
||||
// Field names for google.protobuf.MessageOptions.
|
||||
const (
|
||||
MessageOptions_MessageSetWireFormat_field_name protoreflect.Name = "message_set_wire_format"
|
||||
MessageOptions_NoStandardDescriptorAccessor_field_name protoreflect.Name = "no_standard_descriptor_accessor"
|
||||
MessageOptions_Deprecated_field_name protoreflect.Name = "deprecated"
|
||||
MessageOptions_MapEntry_field_name protoreflect.Name = "map_entry"
|
||||
MessageOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
MessageOptions_MessageSetWireFormat_field_name protoreflect.Name = "message_set_wire_format"
|
||||
MessageOptions_NoStandardDescriptorAccessor_field_name protoreflect.Name = "no_standard_descriptor_accessor"
|
||||
MessageOptions_Deprecated_field_name protoreflect.Name = "deprecated"
|
||||
MessageOptions_MapEntry_field_name protoreflect.Name = "map_entry"
|
||||
MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_name protoreflect.Name = "deprecated_legacy_json_field_conflicts"
|
||||
MessageOptions_Features_field_name protoreflect.Name = "features"
|
||||
MessageOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
|
||||
MessageOptions_MessageSetWireFormat_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.message_set_wire_format"
|
||||
MessageOptions_NoStandardDescriptorAccessor_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.no_standard_descriptor_accessor"
|
||||
MessageOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.deprecated"
|
||||
MessageOptions_MapEntry_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.map_entry"
|
||||
MessageOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.uninterpreted_option"
|
||||
MessageOptions_MessageSetWireFormat_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.message_set_wire_format"
|
||||
MessageOptions_NoStandardDescriptorAccessor_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.no_standard_descriptor_accessor"
|
||||
MessageOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.deprecated"
|
||||
MessageOptions_MapEntry_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.map_entry"
|
||||
MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.deprecated_legacy_json_field_conflicts"
|
||||
MessageOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.features"
|
||||
MessageOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.uninterpreted_option"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.MessageOptions.
|
||||
const (
|
||||
MessageOptions_MessageSetWireFormat_field_number protoreflect.FieldNumber = 1
|
||||
MessageOptions_NoStandardDescriptorAccessor_field_number protoreflect.FieldNumber = 2
|
||||
MessageOptions_Deprecated_field_number protoreflect.FieldNumber = 3
|
||||
MessageOptions_MapEntry_field_number protoreflect.FieldNumber = 7
|
||||
MessageOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
MessageOptions_MessageSetWireFormat_field_number protoreflect.FieldNumber = 1
|
||||
MessageOptions_NoStandardDescriptorAccessor_field_number protoreflect.FieldNumber = 2
|
||||
MessageOptions_Deprecated_field_number protoreflect.FieldNumber = 3
|
||||
MessageOptions_MapEntry_field_number protoreflect.FieldNumber = 7
|
||||
MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_number protoreflect.FieldNumber = 11
|
||||
MessageOptions_Features_field_number protoreflect.FieldNumber = 12
|
||||
MessageOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
)
|
||||
|
||||
// Names for google.protobuf.FieldOptions.
|
||||
@@ -528,16 +591,28 @@ const (
|
||||
FieldOptions_Packed_field_name protoreflect.Name = "packed"
|
||||
FieldOptions_Jstype_field_name protoreflect.Name = "jstype"
|
||||
FieldOptions_Lazy_field_name protoreflect.Name = "lazy"
|
||||
FieldOptions_UnverifiedLazy_field_name protoreflect.Name = "unverified_lazy"
|
||||
FieldOptions_Deprecated_field_name protoreflect.Name = "deprecated"
|
||||
FieldOptions_Weak_field_name protoreflect.Name = "weak"
|
||||
FieldOptions_DebugRedact_field_name protoreflect.Name = "debug_redact"
|
||||
FieldOptions_Retention_field_name protoreflect.Name = "retention"
|
||||
FieldOptions_Targets_field_name protoreflect.Name = "targets"
|
||||
FieldOptions_EditionDefaults_field_name protoreflect.Name = "edition_defaults"
|
||||
FieldOptions_Features_field_name protoreflect.Name = "features"
|
||||
FieldOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
|
||||
FieldOptions_Ctype_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.ctype"
|
||||
FieldOptions_Packed_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.packed"
|
||||
FieldOptions_Jstype_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.jstype"
|
||||
FieldOptions_Lazy_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.lazy"
|
||||
FieldOptions_UnverifiedLazy_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.unverified_lazy"
|
||||
FieldOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.deprecated"
|
||||
FieldOptions_Weak_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.weak"
|
||||
FieldOptions_DebugRedact_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.debug_redact"
|
||||
FieldOptions_Retention_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.retention"
|
||||
FieldOptions_Targets_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.targets"
|
||||
FieldOptions_EditionDefaults_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.edition_defaults"
|
||||
FieldOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.features"
|
||||
FieldOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.uninterpreted_option"
|
||||
)
|
||||
|
||||
@@ -547,8 +622,14 @@ const (
|
||||
FieldOptions_Packed_field_number protoreflect.FieldNumber = 2
|
||||
FieldOptions_Jstype_field_number protoreflect.FieldNumber = 6
|
||||
FieldOptions_Lazy_field_number protoreflect.FieldNumber = 5
|
||||
FieldOptions_UnverifiedLazy_field_number protoreflect.FieldNumber = 15
|
||||
FieldOptions_Deprecated_field_number protoreflect.FieldNumber = 3
|
||||
FieldOptions_Weak_field_number protoreflect.FieldNumber = 10
|
||||
FieldOptions_DebugRedact_field_number protoreflect.FieldNumber = 16
|
||||
FieldOptions_Retention_field_number protoreflect.FieldNumber = 17
|
||||
FieldOptions_Targets_field_number protoreflect.FieldNumber = 19
|
||||
FieldOptions_EditionDefaults_field_number protoreflect.FieldNumber = 20
|
||||
FieldOptions_Features_field_number protoreflect.FieldNumber = 21
|
||||
FieldOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
)
|
||||
|
||||
@@ -564,6 +645,39 @@ const (
|
||||
FieldOptions_JSType_enum_name = "JSType"
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FieldOptions.OptionRetention.
|
||||
const (
|
||||
FieldOptions_OptionRetention_enum_fullname = "google.protobuf.FieldOptions.OptionRetention"
|
||||
FieldOptions_OptionRetention_enum_name = "OptionRetention"
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FieldOptions.OptionTargetType.
|
||||
const (
|
||||
FieldOptions_OptionTargetType_enum_fullname = "google.protobuf.FieldOptions.OptionTargetType"
|
||||
FieldOptions_OptionTargetType_enum_name = "OptionTargetType"
|
||||
)
|
||||
|
||||
// Names for google.protobuf.FieldOptions.EditionDefault.
|
||||
const (
|
||||
FieldOptions_EditionDefault_message_name protoreflect.Name = "EditionDefault"
|
||||
FieldOptions_EditionDefault_message_fullname protoreflect.FullName = "google.protobuf.FieldOptions.EditionDefault"
|
||||
)
|
||||
|
||||
// Field names for google.protobuf.FieldOptions.EditionDefault.
|
||||
const (
|
||||
FieldOptions_EditionDefault_Edition_field_name protoreflect.Name = "edition"
|
||||
FieldOptions_EditionDefault_Value_field_name protoreflect.Name = "value"
|
||||
|
||||
FieldOptions_EditionDefault_Edition_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.EditionDefault.edition"
|
||||
FieldOptions_EditionDefault_Value_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.EditionDefault.value"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.FieldOptions.EditionDefault.
|
||||
const (
|
||||
FieldOptions_EditionDefault_Edition_field_number protoreflect.FieldNumber = 3
|
||||
FieldOptions_EditionDefault_Value_field_number protoreflect.FieldNumber = 2
|
||||
)
|
||||
|
||||
// Names for google.protobuf.OneofOptions.
|
||||
const (
|
||||
OneofOptions_message_name protoreflect.Name = "OneofOptions"
|
||||
@@ -572,13 +686,16 @@ const (
|
||||
|
||||
// Field names for google.protobuf.OneofOptions.
|
||||
const (
|
||||
OneofOptions_Features_field_name protoreflect.Name = "features"
|
||||
OneofOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
|
||||
OneofOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.OneofOptions.features"
|
||||
OneofOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.OneofOptions.uninterpreted_option"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.OneofOptions.
|
||||
const (
|
||||
OneofOptions_Features_field_number protoreflect.FieldNumber = 1
|
||||
OneofOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
)
|
||||
|
||||
@@ -590,20 +707,26 @@ const (
|
||||
|
||||
// Field names for google.protobuf.EnumOptions.
|
||||
const (
|
||||
EnumOptions_AllowAlias_field_name protoreflect.Name = "allow_alias"
|
||||
EnumOptions_Deprecated_field_name protoreflect.Name = "deprecated"
|
||||
EnumOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
EnumOptions_AllowAlias_field_name protoreflect.Name = "allow_alias"
|
||||
EnumOptions_Deprecated_field_name protoreflect.Name = "deprecated"
|
||||
EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_name protoreflect.Name = "deprecated_legacy_json_field_conflicts"
|
||||
EnumOptions_Features_field_name protoreflect.Name = "features"
|
||||
EnumOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
|
||||
EnumOptions_AllowAlias_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.allow_alias"
|
||||
EnumOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.deprecated"
|
||||
EnumOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.uninterpreted_option"
|
||||
EnumOptions_AllowAlias_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.allow_alias"
|
||||
EnumOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.deprecated"
|
||||
EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.deprecated_legacy_json_field_conflicts"
|
||||
EnumOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.features"
|
||||
EnumOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.uninterpreted_option"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.EnumOptions.
|
||||
const (
|
||||
EnumOptions_AllowAlias_field_number protoreflect.FieldNumber = 2
|
||||
EnumOptions_Deprecated_field_number protoreflect.FieldNumber = 3
|
||||
EnumOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
EnumOptions_AllowAlias_field_number protoreflect.FieldNumber = 2
|
||||
EnumOptions_Deprecated_field_number protoreflect.FieldNumber = 3
|
||||
EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_number protoreflect.FieldNumber = 6
|
||||
EnumOptions_Features_field_number protoreflect.FieldNumber = 7
|
||||
EnumOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
)
|
||||
|
||||
// Names for google.protobuf.EnumValueOptions.
|
||||
@@ -615,15 +738,21 @@ const (
|
||||
// Field names for google.protobuf.EnumValueOptions.
|
||||
const (
|
||||
EnumValueOptions_Deprecated_field_name protoreflect.Name = "deprecated"
|
||||
EnumValueOptions_Features_field_name protoreflect.Name = "features"
|
||||
EnumValueOptions_DebugRedact_field_name protoreflect.Name = "debug_redact"
|
||||
EnumValueOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
|
||||
EnumValueOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.deprecated"
|
||||
EnumValueOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.features"
|
||||
EnumValueOptions_DebugRedact_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.debug_redact"
|
||||
EnumValueOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.uninterpreted_option"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.EnumValueOptions.
|
||||
const (
|
||||
EnumValueOptions_Deprecated_field_number protoreflect.FieldNumber = 1
|
||||
EnumValueOptions_Features_field_number protoreflect.FieldNumber = 2
|
||||
EnumValueOptions_DebugRedact_field_number protoreflect.FieldNumber = 3
|
||||
EnumValueOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
)
|
||||
|
||||
@@ -635,15 +764,18 @@ const (
|
||||
|
||||
// Field names for google.protobuf.ServiceOptions.
|
||||
const (
|
||||
ServiceOptions_Features_field_name protoreflect.Name = "features"
|
||||
ServiceOptions_Deprecated_field_name protoreflect.Name = "deprecated"
|
||||
ServiceOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
|
||||
ServiceOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.ServiceOptions.features"
|
||||
ServiceOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.ServiceOptions.deprecated"
|
||||
ServiceOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.ServiceOptions.uninterpreted_option"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.ServiceOptions.
|
||||
const (
|
||||
ServiceOptions_Features_field_number protoreflect.FieldNumber = 34
|
||||
ServiceOptions_Deprecated_field_number protoreflect.FieldNumber = 33
|
||||
ServiceOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
)
|
||||
@@ -658,10 +790,12 @@ const (
|
||||
const (
|
||||
MethodOptions_Deprecated_field_name protoreflect.Name = "deprecated"
|
||||
MethodOptions_IdempotencyLevel_field_name protoreflect.Name = "idempotency_level"
|
||||
MethodOptions_Features_field_name protoreflect.Name = "features"
|
||||
MethodOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
|
||||
MethodOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.deprecated"
|
||||
MethodOptions_IdempotencyLevel_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.idempotency_level"
|
||||
MethodOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.features"
|
||||
MethodOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.uninterpreted_option"
|
||||
)
|
||||
|
||||
@@ -669,6 +803,7 @@ const (
|
||||
const (
|
||||
MethodOptions_Deprecated_field_number protoreflect.FieldNumber = 33
|
||||
MethodOptions_IdempotencyLevel_field_number protoreflect.FieldNumber = 34
|
||||
MethodOptions_Features_field_number protoreflect.FieldNumber = 35
|
||||
MethodOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
)
|
||||
|
||||
@@ -735,6 +870,120 @@ const (
|
||||
UninterpretedOption_NamePart_IsExtension_field_number protoreflect.FieldNumber = 2
|
||||
)
|
||||
|
||||
// Names for google.protobuf.FeatureSet.
|
||||
const (
|
||||
FeatureSet_message_name protoreflect.Name = "FeatureSet"
|
||||
FeatureSet_message_fullname protoreflect.FullName = "google.protobuf.FeatureSet"
|
||||
)
|
||||
|
||||
// Field names for google.protobuf.FeatureSet.
|
||||
const (
|
||||
FeatureSet_FieldPresence_field_name protoreflect.Name = "field_presence"
|
||||
FeatureSet_EnumType_field_name protoreflect.Name = "enum_type"
|
||||
FeatureSet_RepeatedFieldEncoding_field_name protoreflect.Name = "repeated_field_encoding"
|
||||
FeatureSet_Utf8Validation_field_name protoreflect.Name = "utf8_validation"
|
||||
FeatureSet_MessageEncoding_field_name protoreflect.Name = "message_encoding"
|
||||
FeatureSet_JsonFormat_field_name protoreflect.Name = "json_format"
|
||||
|
||||
FeatureSet_FieldPresence_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.field_presence"
|
||||
FeatureSet_EnumType_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.enum_type"
|
||||
FeatureSet_RepeatedFieldEncoding_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.repeated_field_encoding"
|
||||
FeatureSet_Utf8Validation_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.utf8_validation"
|
||||
FeatureSet_MessageEncoding_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.message_encoding"
|
||||
FeatureSet_JsonFormat_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.json_format"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.FeatureSet.
|
||||
const (
|
||||
FeatureSet_FieldPresence_field_number protoreflect.FieldNumber = 1
|
||||
FeatureSet_EnumType_field_number protoreflect.FieldNumber = 2
|
||||
FeatureSet_RepeatedFieldEncoding_field_number protoreflect.FieldNumber = 3
|
||||
FeatureSet_Utf8Validation_field_number protoreflect.FieldNumber = 4
|
||||
FeatureSet_MessageEncoding_field_number protoreflect.FieldNumber = 5
|
||||
FeatureSet_JsonFormat_field_number protoreflect.FieldNumber = 6
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FeatureSet.FieldPresence.
|
||||
const (
|
||||
FeatureSet_FieldPresence_enum_fullname = "google.protobuf.FeatureSet.FieldPresence"
|
||||
FeatureSet_FieldPresence_enum_name = "FieldPresence"
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FeatureSet.EnumType.
|
||||
const (
|
||||
FeatureSet_EnumType_enum_fullname = "google.protobuf.FeatureSet.EnumType"
|
||||
FeatureSet_EnumType_enum_name = "EnumType"
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FeatureSet.RepeatedFieldEncoding.
|
||||
const (
|
||||
FeatureSet_RepeatedFieldEncoding_enum_fullname = "google.protobuf.FeatureSet.RepeatedFieldEncoding"
|
||||
FeatureSet_RepeatedFieldEncoding_enum_name = "RepeatedFieldEncoding"
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FeatureSet.Utf8Validation.
|
||||
const (
|
||||
FeatureSet_Utf8Validation_enum_fullname = "google.protobuf.FeatureSet.Utf8Validation"
|
||||
FeatureSet_Utf8Validation_enum_name = "Utf8Validation"
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FeatureSet.MessageEncoding.
|
||||
const (
|
||||
FeatureSet_MessageEncoding_enum_fullname = "google.protobuf.FeatureSet.MessageEncoding"
|
||||
FeatureSet_MessageEncoding_enum_name = "MessageEncoding"
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FeatureSet.JsonFormat.
|
||||
const (
|
||||
FeatureSet_JsonFormat_enum_fullname = "google.protobuf.FeatureSet.JsonFormat"
|
||||
FeatureSet_JsonFormat_enum_name = "JsonFormat"
|
||||
)
|
||||
|
||||
// Names for google.protobuf.FeatureSetDefaults.
|
||||
const (
|
||||
FeatureSetDefaults_message_name protoreflect.Name = "FeatureSetDefaults"
|
||||
FeatureSetDefaults_message_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults"
|
||||
)
|
||||
|
||||
// Field names for google.protobuf.FeatureSetDefaults.
|
||||
const (
|
||||
FeatureSetDefaults_Defaults_field_name protoreflect.Name = "defaults"
|
||||
FeatureSetDefaults_MinimumEdition_field_name protoreflect.Name = "minimum_edition"
|
||||
FeatureSetDefaults_MaximumEdition_field_name protoreflect.Name = "maximum_edition"
|
||||
|
||||
FeatureSetDefaults_Defaults_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.defaults"
|
||||
FeatureSetDefaults_MinimumEdition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.minimum_edition"
|
||||
FeatureSetDefaults_MaximumEdition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.maximum_edition"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.FeatureSetDefaults.
|
||||
const (
|
||||
FeatureSetDefaults_Defaults_field_number protoreflect.FieldNumber = 1
|
||||
FeatureSetDefaults_MinimumEdition_field_number protoreflect.FieldNumber = 4
|
||||
FeatureSetDefaults_MaximumEdition_field_number protoreflect.FieldNumber = 5
|
||||
)
|
||||
|
||||
// Names for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.
|
||||
const (
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_message_name protoreflect.Name = "FeatureSetEditionDefault"
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_message_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"
|
||||
)
|
||||
|
||||
// Field names for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.
|
||||
const (
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_name protoreflect.Name = "edition"
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_Features_field_name protoreflect.Name = "features"
|
||||
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition"
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_Features_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.
|
||||
const (
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_number protoreflect.FieldNumber = 3
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_Features_field_number protoreflect.FieldNumber = 2
|
||||
)
|
||||
|
||||
// Names for google.protobuf.SourceCodeInfo.
|
||||
const (
|
||||
SourceCodeInfo_message_name protoreflect.Name = "SourceCodeInfo"
|
||||
@@ -813,11 +1062,13 @@ const (
|
||||
GeneratedCodeInfo_Annotation_SourceFile_field_name protoreflect.Name = "source_file"
|
||||
GeneratedCodeInfo_Annotation_Begin_field_name protoreflect.Name = "begin"
|
||||
GeneratedCodeInfo_Annotation_End_field_name protoreflect.Name = "end"
|
||||
GeneratedCodeInfo_Annotation_Semantic_field_name protoreflect.Name = "semantic"
|
||||
|
||||
GeneratedCodeInfo_Annotation_Path_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.path"
|
||||
GeneratedCodeInfo_Annotation_SourceFile_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.source_file"
|
||||
GeneratedCodeInfo_Annotation_Begin_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.begin"
|
||||
GeneratedCodeInfo_Annotation_End_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.end"
|
||||
GeneratedCodeInfo_Annotation_Semantic_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.semantic"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.GeneratedCodeInfo.Annotation.
|
||||
@@ -826,4 +1077,11 @@ const (
|
||||
GeneratedCodeInfo_Annotation_SourceFile_field_number protoreflect.FieldNumber = 2
|
||||
GeneratedCodeInfo_Annotation_Begin_field_number protoreflect.FieldNumber = 3
|
||||
GeneratedCodeInfo_Annotation_End_field_number protoreflect.FieldNumber = 4
|
||||
GeneratedCodeInfo_Annotation_Semantic_field_number protoreflect.FieldNumber = 5
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.GeneratedCodeInfo.Annotation.Semantic.
|
||||
const (
|
||||
GeneratedCodeInfo_Annotation_Semantic_enum_fullname = "google.protobuf.GeneratedCodeInfo.Annotation.Semantic"
|
||||
GeneratedCodeInfo_Annotation_Semantic_enum_name = "Semantic"
|
||||
)
|
||||
|
||||
6
go/vendor/google.golang.org/protobuf/internal/genid/type_gen.go
generated
vendored
6
go/vendor/google.golang.org/protobuf/internal/genid/type_gen.go
generated
vendored
@@ -32,6 +32,7 @@ const (
|
||||
Type_Options_field_name protoreflect.Name = "options"
|
||||
Type_SourceContext_field_name protoreflect.Name = "source_context"
|
||||
Type_Syntax_field_name protoreflect.Name = "syntax"
|
||||
Type_Edition_field_name protoreflect.Name = "edition"
|
||||
|
||||
Type_Name_field_fullname protoreflect.FullName = "google.protobuf.Type.name"
|
||||
Type_Fields_field_fullname protoreflect.FullName = "google.protobuf.Type.fields"
|
||||
@@ -39,6 +40,7 @@ const (
|
||||
Type_Options_field_fullname protoreflect.FullName = "google.protobuf.Type.options"
|
||||
Type_SourceContext_field_fullname protoreflect.FullName = "google.protobuf.Type.source_context"
|
||||
Type_Syntax_field_fullname protoreflect.FullName = "google.protobuf.Type.syntax"
|
||||
Type_Edition_field_fullname protoreflect.FullName = "google.protobuf.Type.edition"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.Type.
|
||||
@@ -49,6 +51,7 @@ const (
|
||||
Type_Options_field_number protoreflect.FieldNumber = 4
|
||||
Type_SourceContext_field_number protoreflect.FieldNumber = 5
|
||||
Type_Syntax_field_number protoreflect.FieldNumber = 6
|
||||
Type_Edition_field_number protoreflect.FieldNumber = 7
|
||||
)
|
||||
|
||||
// Names for google.protobuf.Field.
|
||||
@@ -121,12 +124,14 @@ const (
|
||||
Enum_Options_field_name protoreflect.Name = "options"
|
||||
Enum_SourceContext_field_name protoreflect.Name = "source_context"
|
||||
Enum_Syntax_field_name protoreflect.Name = "syntax"
|
||||
Enum_Edition_field_name protoreflect.Name = "edition"
|
||||
|
||||
Enum_Name_field_fullname protoreflect.FullName = "google.protobuf.Enum.name"
|
||||
Enum_Enumvalue_field_fullname protoreflect.FullName = "google.protobuf.Enum.enumvalue"
|
||||
Enum_Options_field_fullname protoreflect.FullName = "google.protobuf.Enum.options"
|
||||
Enum_SourceContext_field_fullname protoreflect.FullName = "google.protobuf.Enum.source_context"
|
||||
Enum_Syntax_field_fullname protoreflect.FullName = "google.protobuf.Enum.syntax"
|
||||
Enum_Edition_field_fullname protoreflect.FullName = "google.protobuf.Enum.edition"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.Enum.
|
||||
@@ -136,6 +141,7 @@ const (
|
||||
Enum_Options_field_number protoreflect.FieldNumber = 3
|
||||
Enum_SourceContext_field_number protoreflect.FieldNumber = 4
|
||||
Enum_Syntax_field_number protoreflect.FieldNumber = 5
|
||||
Enum_Edition_field_number protoreflect.FieldNumber = 6
|
||||
)
|
||||
|
||||
// Names for google.protobuf.EnumValue.
|
||||
|
||||
42
go/vendor/google.golang.org/protobuf/internal/impl/api_export.go
generated
vendored
42
go/vendor/google.golang.org/protobuf/internal/impl/api_export.go
generated
vendored
@@ -12,8 +12,8 @@ import (
|
||||
"google.golang.org/protobuf/encoding/prototext"
|
||||
"google.golang.org/protobuf/internal/errors"
|
||||
"google.golang.org/protobuf/proto"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
piface "google.golang.org/protobuf/runtime/protoiface"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/runtime/protoiface"
|
||||
)
|
||||
|
||||
// Export is a zero-length named type that exists only to export a set of
|
||||
@@ -32,11 +32,11 @@ type enum = interface{}
|
||||
|
||||
// EnumOf returns the protoreflect.Enum interface over e.
|
||||
// It returns nil if e is nil.
|
||||
func (Export) EnumOf(e enum) pref.Enum {
|
||||
func (Export) EnumOf(e enum) protoreflect.Enum {
|
||||
switch e := e.(type) {
|
||||
case nil:
|
||||
return nil
|
||||
case pref.Enum:
|
||||
case protoreflect.Enum:
|
||||
return e
|
||||
default:
|
||||
return legacyWrapEnum(reflect.ValueOf(e))
|
||||
@@ -45,11 +45,11 @@ func (Export) EnumOf(e enum) pref.Enum {
|
||||
|
||||
// EnumDescriptorOf returns the protoreflect.EnumDescriptor for e.
|
||||
// It returns nil if e is nil.
|
||||
func (Export) EnumDescriptorOf(e enum) pref.EnumDescriptor {
|
||||
func (Export) EnumDescriptorOf(e enum) protoreflect.EnumDescriptor {
|
||||
switch e := e.(type) {
|
||||
case nil:
|
||||
return nil
|
||||
case pref.Enum:
|
||||
case protoreflect.Enum:
|
||||
return e.Descriptor()
|
||||
default:
|
||||
return LegacyLoadEnumDesc(reflect.TypeOf(e))
|
||||
@@ -58,11 +58,11 @@ func (Export) EnumDescriptorOf(e enum) pref.EnumDescriptor {
|
||||
|
||||
// EnumTypeOf returns the protoreflect.EnumType for e.
|
||||
// It returns nil if e is nil.
|
||||
func (Export) EnumTypeOf(e enum) pref.EnumType {
|
||||
func (Export) EnumTypeOf(e enum) protoreflect.EnumType {
|
||||
switch e := e.(type) {
|
||||
case nil:
|
||||
return nil
|
||||
case pref.Enum:
|
||||
case protoreflect.Enum:
|
||||
return e.Type()
|
||||
default:
|
||||
return legacyLoadEnumType(reflect.TypeOf(e))
|
||||
@@ -71,7 +71,7 @@ func (Export) EnumTypeOf(e enum) pref.EnumType {
|
||||
|
||||
// EnumStringOf returns the enum value as a string, either as the name if
|
||||
// the number is resolvable, or the number formatted as a string.
|
||||
func (Export) EnumStringOf(ed pref.EnumDescriptor, n pref.EnumNumber) string {
|
||||
func (Export) EnumStringOf(ed protoreflect.EnumDescriptor, n protoreflect.EnumNumber) string {
|
||||
ev := ed.Values().ByNumber(n)
|
||||
if ev != nil {
|
||||
return string(ev.Name())
|
||||
@@ -84,7 +84,7 @@ func (Export) EnumStringOf(ed pref.EnumDescriptor, n pref.EnumNumber) string {
|
||||
type message = interface{}
|
||||
|
||||
// legacyMessageWrapper wraps a v2 message as a v1 message.
|
||||
type legacyMessageWrapper struct{ m pref.ProtoMessage }
|
||||
type legacyMessageWrapper struct{ m protoreflect.ProtoMessage }
|
||||
|
||||
func (m legacyMessageWrapper) Reset() { proto.Reset(m.m) }
|
||||
func (m legacyMessageWrapper) String() string { return Export{}.MessageStringOf(m.m) }
|
||||
@@ -92,30 +92,30 @@ func (m legacyMessageWrapper) ProtoMessage() {}
|
||||
|
||||
// ProtoMessageV1Of converts either a v1 or v2 message to a v1 message.
|
||||
// It returns nil if m is nil.
|
||||
func (Export) ProtoMessageV1Of(m message) piface.MessageV1 {
|
||||
func (Export) ProtoMessageV1Of(m message) protoiface.MessageV1 {
|
||||
switch mv := m.(type) {
|
||||
case nil:
|
||||
return nil
|
||||
case piface.MessageV1:
|
||||
case protoiface.MessageV1:
|
||||
return mv
|
||||
case unwrapper:
|
||||
return Export{}.ProtoMessageV1Of(mv.protoUnwrap())
|
||||
case pref.ProtoMessage:
|
||||
case protoreflect.ProtoMessage:
|
||||
return legacyMessageWrapper{mv}
|
||||
default:
|
||||
panic(fmt.Sprintf("message %T is neither a v1 or v2 Message", m))
|
||||
}
|
||||
}
|
||||
|
||||
func (Export) protoMessageV2Of(m message) pref.ProtoMessage {
|
||||
func (Export) protoMessageV2Of(m message) protoreflect.ProtoMessage {
|
||||
switch mv := m.(type) {
|
||||
case nil:
|
||||
return nil
|
||||
case pref.ProtoMessage:
|
||||
case protoreflect.ProtoMessage:
|
||||
return mv
|
||||
case legacyMessageWrapper:
|
||||
return mv.m
|
||||
case piface.MessageV1:
|
||||
case protoiface.MessageV1:
|
||||
return nil
|
||||
default:
|
||||
panic(fmt.Sprintf("message %T is neither a v1 or v2 Message", m))
|
||||
@@ -124,7 +124,7 @@ func (Export) protoMessageV2Of(m message) pref.ProtoMessage {
|
||||
|
||||
// ProtoMessageV2Of converts either a v1 or v2 message to a v2 message.
|
||||
// It returns nil if m is nil.
|
||||
func (Export) ProtoMessageV2Of(m message) pref.ProtoMessage {
|
||||
func (Export) ProtoMessageV2Of(m message) protoreflect.ProtoMessage {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -136,7 +136,7 @@ func (Export) ProtoMessageV2Of(m message) pref.ProtoMessage {
|
||||
|
||||
// MessageOf returns the protoreflect.Message interface over m.
|
||||
// It returns nil if m is nil.
|
||||
func (Export) MessageOf(m message) pref.Message {
|
||||
func (Export) MessageOf(m message) protoreflect.Message {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -148,7 +148,7 @@ func (Export) MessageOf(m message) pref.Message {
|
||||
|
||||
// MessageDescriptorOf returns the protoreflect.MessageDescriptor for m.
|
||||
// It returns nil if m is nil.
|
||||
func (Export) MessageDescriptorOf(m message) pref.MessageDescriptor {
|
||||
func (Export) MessageDescriptorOf(m message) protoreflect.MessageDescriptor {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -160,7 +160,7 @@ func (Export) MessageDescriptorOf(m message) pref.MessageDescriptor {
|
||||
|
||||
// MessageTypeOf returns the protoreflect.MessageType for m.
|
||||
// It returns nil if m is nil.
|
||||
func (Export) MessageTypeOf(m message) pref.MessageType {
|
||||
func (Export) MessageTypeOf(m message) protoreflect.MessageType {
|
||||
if m == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -172,6 +172,6 @@ func (Export) MessageTypeOf(m message) pref.MessageType {
|
||||
|
||||
// MessageStringOf returns the message value as a string,
|
||||
// which is the message serialized in the protobuf text format.
|
||||
func (Export) MessageStringOf(m pref.ProtoMessage) string {
|
||||
func (Export) MessageStringOf(m protoreflect.ProtoMessage) string {
|
||||
return prototext.MarshalOptions{Multiline: false}.Format(m)
|
||||
}
|
||||
|
||||
12
go/vendor/google.golang.org/protobuf/internal/impl/checkinit.go
generated
vendored
12
go/vendor/google.golang.org/protobuf/internal/impl/checkinit.go
generated
vendored
@@ -8,18 +8,18 @@ import (
|
||||
"sync"
|
||||
|
||||
"google.golang.org/protobuf/internal/errors"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
piface "google.golang.org/protobuf/runtime/protoiface"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/runtime/protoiface"
|
||||
)
|
||||
|
||||
func (mi *MessageInfo) checkInitialized(in piface.CheckInitializedInput) (piface.CheckInitializedOutput, error) {
|
||||
func (mi *MessageInfo) checkInitialized(in protoiface.CheckInitializedInput) (protoiface.CheckInitializedOutput, error) {
|
||||
var p pointer
|
||||
if ms, ok := in.Message.(*messageState); ok {
|
||||
p = ms.pointer()
|
||||
} else {
|
||||
p = in.Message.(*messageReflectWrapper).pointer()
|
||||
}
|
||||
return piface.CheckInitializedOutput{}, mi.checkInitializedPointer(p)
|
||||
return protoiface.CheckInitializedOutput{}, mi.checkInitializedPointer(p)
|
||||
}
|
||||
|
||||
func (mi *MessageInfo) checkInitializedPointer(p pointer) error {
|
||||
@@ -90,7 +90,7 @@ var (
|
||||
// needsInitCheck reports whether a message needs to be checked for partial initialization.
|
||||
//
|
||||
// It returns true if the message transitively includes any required or extension fields.
|
||||
func needsInitCheck(md pref.MessageDescriptor) bool {
|
||||
func needsInitCheck(md protoreflect.MessageDescriptor) bool {
|
||||
if v, ok := needsInitCheckMap.Load(md); ok {
|
||||
if has, ok := v.(bool); ok {
|
||||
return has
|
||||
@@ -101,7 +101,7 @@ func needsInitCheck(md pref.MessageDescriptor) bool {
|
||||
return needsInitCheckLocked(md)
|
||||
}
|
||||
|
||||
func needsInitCheckLocked(md pref.MessageDescriptor) (has bool) {
|
||||
func needsInitCheckLocked(md protoreflect.MessageDescriptor) (has bool) {
|
||||
if v, ok := needsInitCheckMap.Load(md); ok {
|
||||
// If has is true, we've previously determined that this message
|
||||
// needs init checks.
|
||||
|
||||
36
go/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go
generated
vendored
36
go/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go
generated
vendored
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/internal/errors"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
type extensionFieldInfo struct {
|
||||
@@ -23,7 +23,7 @@ type extensionFieldInfo struct {
|
||||
|
||||
var legacyExtensionFieldInfoCache sync.Map // map[protoreflect.ExtensionType]*extensionFieldInfo
|
||||
|
||||
func getExtensionFieldInfo(xt pref.ExtensionType) *extensionFieldInfo {
|
||||
func getExtensionFieldInfo(xt protoreflect.ExtensionType) *extensionFieldInfo {
|
||||
if xi, ok := xt.(*ExtensionInfo); ok {
|
||||
xi.lazyInit()
|
||||
return xi.info
|
||||
@@ -32,7 +32,7 @@ func getExtensionFieldInfo(xt pref.ExtensionType) *extensionFieldInfo {
|
||||
}
|
||||
|
||||
// legacyLoadExtensionFieldInfo dynamically loads a *ExtensionInfo for xt.
|
||||
func legacyLoadExtensionFieldInfo(xt pref.ExtensionType) *extensionFieldInfo {
|
||||
func legacyLoadExtensionFieldInfo(xt protoreflect.ExtensionType) *extensionFieldInfo {
|
||||
if xi, ok := legacyExtensionFieldInfoCache.Load(xt); ok {
|
||||
return xi.(*extensionFieldInfo)
|
||||
}
|
||||
@@ -43,7 +43,7 @@ func legacyLoadExtensionFieldInfo(xt pref.ExtensionType) *extensionFieldInfo {
|
||||
return e
|
||||
}
|
||||
|
||||
func makeExtensionFieldInfo(xd pref.ExtensionDescriptor) *extensionFieldInfo {
|
||||
func makeExtensionFieldInfo(xd protoreflect.ExtensionDescriptor) *extensionFieldInfo {
|
||||
var wiretag uint64
|
||||
if !xd.IsPacked() {
|
||||
wiretag = protowire.EncodeTag(xd.Number(), wireTypes[xd.Kind()])
|
||||
@@ -59,10 +59,10 @@ func makeExtensionFieldInfo(xd pref.ExtensionDescriptor) *extensionFieldInfo {
|
||||
// This is true for composite types, where we pass in a message, list, or map to fill in,
|
||||
// and for enums, where we pass in a prototype value to specify the concrete enum type.
|
||||
switch xd.Kind() {
|
||||
case pref.MessageKind, pref.GroupKind, pref.EnumKind:
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind, protoreflect.EnumKind:
|
||||
e.unmarshalNeedsValue = true
|
||||
default:
|
||||
if xd.Cardinality() == pref.Repeated {
|
||||
if xd.Cardinality() == protoreflect.Repeated {
|
||||
e.unmarshalNeedsValue = true
|
||||
}
|
||||
}
|
||||
@@ -73,21 +73,21 @@ type lazyExtensionValue struct {
|
||||
atomicOnce uint32 // atomically set if value is valid
|
||||
mu sync.Mutex
|
||||
xi *extensionFieldInfo
|
||||
value pref.Value
|
||||
value protoreflect.Value
|
||||
b []byte
|
||||
fn func() pref.Value
|
||||
fn func() protoreflect.Value
|
||||
}
|
||||
|
||||
type ExtensionField struct {
|
||||
typ pref.ExtensionType
|
||||
typ protoreflect.ExtensionType
|
||||
|
||||
// value is either the value of GetValue,
|
||||
// or a *lazyExtensionValue that then returns the value of GetValue.
|
||||
value pref.Value
|
||||
value protoreflect.Value
|
||||
lazy *lazyExtensionValue
|
||||
}
|
||||
|
||||
func (f *ExtensionField) appendLazyBytes(xt pref.ExtensionType, xi *extensionFieldInfo, num protowire.Number, wtyp protowire.Type, b []byte) {
|
||||
func (f *ExtensionField) appendLazyBytes(xt protoreflect.ExtensionType, xi *extensionFieldInfo, num protowire.Number, wtyp protowire.Type, b []byte) {
|
||||
if f.lazy == nil {
|
||||
f.lazy = &lazyExtensionValue{xi: xi}
|
||||
}
|
||||
@@ -97,7 +97,7 @@ func (f *ExtensionField) appendLazyBytes(xt pref.ExtensionType, xi *extensionFie
|
||||
f.lazy.b = append(f.lazy.b, b...)
|
||||
}
|
||||
|
||||
func (f *ExtensionField) canLazy(xt pref.ExtensionType) bool {
|
||||
func (f *ExtensionField) canLazy(xt protoreflect.ExtensionType) bool {
|
||||
if f.typ == nil {
|
||||
return true
|
||||
}
|
||||
@@ -154,7 +154,7 @@ func (f *ExtensionField) lazyInit() {
|
||||
|
||||
// Set sets the type and value of the extension field.
|
||||
// This must not be called concurrently.
|
||||
func (f *ExtensionField) Set(t pref.ExtensionType, v pref.Value) {
|
||||
func (f *ExtensionField) Set(t protoreflect.ExtensionType, v protoreflect.Value) {
|
||||
f.typ = t
|
||||
f.value = v
|
||||
f.lazy = nil
|
||||
@@ -162,14 +162,14 @@ func (f *ExtensionField) Set(t pref.ExtensionType, v pref.Value) {
|
||||
|
||||
// SetLazy sets the type and a value that is to be lazily evaluated upon first use.
|
||||
// This must not be called concurrently.
|
||||
func (f *ExtensionField) SetLazy(t pref.ExtensionType, fn func() pref.Value) {
|
||||
func (f *ExtensionField) SetLazy(t protoreflect.ExtensionType, fn func() protoreflect.Value) {
|
||||
f.typ = t
|
||||
f.lazy = &lazyExtensionValue{fn: fn}
|
||||
}
|
||||
|
||||
// Value returns the value of the extension field.
|
||||
// This may be called concurrently.
|
||||
func (f *ExtensionField) Value() pref.Value {
|
||||
func (f *ExtensionField) Value() protoreflect.Value {
|
||||
if f.lazy != nil {
|
||||
if atomic.LoadUint32(&f.lazy.atomicOnce) == 0 {
|
||||
f.lazyInit()
|
||||
@@ -181,7 +181,7 @@ func (f *ExtensionField) Value() pref.Value {
|
||||
|
||||
// Type returns the type of the extension field.
|
||||
// This may be called concurrently.
|
||||
func (f ExtensionField) Type() pref.ExtensionType {
|
||||
func (f ExtensionField) Type() protoreflect.ExtensionType {
|
||||
return f.typ
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ func (f ExtensionField) IsSet() bool {
|
||||
|
||||
// IsLazy reports whether a field is lazily encoded.
|
||||
// It is exported for testing.
|
||||
func IsLazy(m pref.Message, fd pref.FieldDescriptor) bool {
|
||||
func IsLazy(m protoreflect.Message, fd protoreflect.FieldDescriptor) bool {
|
||||
var mi *MessageInfo
|
||||
var p pointer
|
||||
switch m := m.(type) {
|
||||
@@ -206,7 +206,7 @@ func IsLazy(m pref.Message, fd pref.FieldDescriptor) bool {
|
||||
default:
|
||||
return false
|
||||
}
|
||||
xd, ok := fd.(pref.ExtensionTypeDescriptor)
|
||||
xd, ok := fd.(protoreflect.ExtensionTypeDescriptor)
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
|
||||
90
go/vendor/google.golang.org/protobuf/internal/impl/codec_field.go
generated
vendored
90
go/vendor/google.golang.org/protobuf/internal/impl/codec_field.go
generated
vendored
@@ -12,9 +12,9 @@ import (
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/internal/errors"
|
||||
"google.golang.org/protobuf/proto"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
preg "google.golang.org/protobuf/reflect/protoregistry"
|
||||
piface "google.golang.org/protobuf/runtime/protoiface"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
"google.golang.org/protobuf/runtime/protoiface"
|
||||
)
|
||||
|
||||
type errInvalidUTF8 struct{}
|
||||
@@ -30,7 +30,7 @@ func (errInvalidUTF8) Unwrap() error { return errors.Error }
|
||||
// to the appropriate field-specific function as necessary.
|
||||
//
|
||||
// The unmarshal function is set on each field individually as usual.
|
||||
func (mi *MessageInfo) initOneofFieldCoders(od pref.OneofDescriptor, si structInfo) {
|
||||
func (mi *MessageInfo) initOneofFieldCoders(od protoreflect.OneofDescriptor, si structInfo) {
|
||||
fs := si.oneofsByName[od.Name()]
|
||||
ft := fs.Type
|
||||
oneofFields := make(map[reflect.Type]*coderFieldInfo)
|
||||
@@ -118,13 +118,13 @@ func (mi *MessageInfo) initOneofFieldCoders(od pref.OneofDescriptor, si structIn
|
||||
}
|
||||
}
|
||||
|
||||
func makeWeakMessageFieldCoder(fd pref.FieldDescriptor) pointerCoderFuncs {
|
||||
func makeWeakMessageFieldCoder(fd protoreflect.FieldDescriptor) pointerCoderFuncs {
|
||||
var once sync.Once
|
||||
var messageType pref.MessageType
|
||||
var messageType protoreflect.MessageType
|
||||
lazyInit := func() {
|
||||
once.Do(func() {
|
||||
messageName := fd.Message().FullName()
|
||||
messageType, _ = preg.GlobalTypes.FindMessageByName(messageName)
|
||||
messageType, _ = protoregistry.GlobalTypes.FindMessageByName(messageName)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ func makeWeakMessageFieldCoder(fd pref.FieldDescriptor) pointerCoderFuncs {
|
||||
}
|
||||
}
|
||||
|
||||
func makeMessageFieldCoder(fd pref.FieldDescriptor, ft reflect.Type) pointerCoderFuncs {
|
||||
func makeMessageFieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) pointerCoderFuncs {
|
||||
if mi := getMessageInfo(ft); mi != nil {
|
||||
funcs := pointerCoderFuncs{
|
||||
size: sizeMessageInfo,
|
||||
@@ -280,7 +280,7 @@ func consumeMessage(b []byte, m proto.Message, wtyp protowire.Type, opts unmarsh
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
o, err := opts.Options().UnmarshalState(piface.UnmarshalInput{
|
||||
o, err := opts.Options().UnmarshalState(protoiface.UnmarshalInput{
|
||||
Buf: v,
|
||||
Message: m.ProtoReflect(),
|
||||
})
|
||||
@@ -288,27 +288,27 @@ func consumeMessage(b []byte, m proto.Message, wtyp protowire.Type, opts unmarsh
|
||||
return out, err
|
||||
}
|
||||
out.n = n
|
||||
out.initialized = o.Flags&piface.UnmarshalInitialized != 0
|
||||
out.initialized = o.Flags&protoiface.UnmarshalInitialized != 0
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func sizeMessageValue(v pref.Value, tagsize int, opts marshalOptions) int {
|
||||
func sizeMessageValue(v protoreflect.Value, tagsize int, opts marshalOptions) int {
|
||||
m := v.Message().Interface()
|
||||
return sizeMessage(m, tagsize, opts)
|
||||
}
|
||||
|
||||
func appendMessageValue(b []byte, v pref.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
|
||||
func appendMessageValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
|
||||
m := v.Message().Interface()
|
||||
return appendMessage(b, m, wiretag, opts)
|
||||
}
|
||||
|
||||
func consumeMessageValue(b []byte, v pref.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (pref.Value, unmarshalOutput, error) {
|
||||
func consumeMessageValue(b []byte, v protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (protoreflect.Value, unmarshalOutput, error) {
|
||||
m := v.Message().Interface()
|
||||
out, err := consumeMessage(b, m, wtyp, opts)
|
||||
return v, out, err
|
||||
}
|
||||
|
||||
func isInitMessageValue(v pref.Value) error {
|
||||
func isInitMessageValue(v protoreflect.Value) error {
|
||||
m := v.Message().Interface()
|
||||
return proto.CheckInitialized(m)
|
||||
}
|
||||
@@ -321,17 +321,17 @@ var coderMessageValue = valueCoderFuncs{
|
||||
merge: mergeMessageValue,
|
||||
}
|
||||
|
||||
func sizeGroupValue(v pref.Value, tagsize int, opts marshalOptions) int {
|
||||
func sizeGroupValue(v protoreflect.Value, tagsize int, opts marshalOptions) int {
|
||||
m := v.Message().Interface()
|
||||
return sizeGroup(m, tagsize, opts)
|
||||
}
|
||||
|
||||
func appendGroupValue(b []byte, v pref.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
|
||||
func appendGroupValue(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
|
||||
m := v.Message().Interface()
|
||||
return appendGroup(b, m, wiretag, opts)
|
||||
}
|
||||
|
||||
func consumeGroupValue(b []byte, v pref.Value, num protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (pref.Value, unmarshalOutput, error) {
|
||||
func consumeGroupValue(b []byte, v protoreflect.Value, num protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (protoreflect.Value, unmarshalOutput, error) {
|
||||
m := v.Message().Interface()
|
||||
out, err := consumeGroup(b, m, num, wtyp, opts)
|
||||
return v, out, err
|
||||
@@ -345,7 +345,7 @@ var coderGroupValue = valueCoderFuncs{
|
||||
merge: mergeMessageValue,
|
||||
}
|
||||
|
||||
func makeGroupFieldCoder(fd pref.FieldDescriptor, ft reflect.Type) pointerCoderFuncs {
|
||||
func makeGroupFieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) pointerCoderFuncs {
|
||||
num := fd.Number()
|
||||
if mi := getMessageInfo(ft); mi != nil {
|
||||
funcs := pointerCoderFuncs{
|
||||
@@ -424,7 +424,7 @@ func consumeGroup(b []byte, m proto.Message, num protowire.Number, wtyp protowir
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
o, err := opts.Options().UnmarshalState(piface.UnmarshalInput{
|
||||
o, err := opts.Options().UnmarshalState(protoiface.UnmarshalInput{
|
||||
Buf: b,
|
||||
Message: m.ProtoReflect(),
|
||||
})
|
||||
@@ -432,11 +432,11 @@ func consumeGroup(b []byte, m proto.Message, num protowire.Number, wtyp protowir
|
||||
return out, err
|
||||
}
|
||||
out.n = n
|
||||
out.initialized = o.Flags&piface.UnmarshalInitialized != 0
|
||||
out.initialized = o.Flags&protoiface.UnmarshalInitialized != 0
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func makeMessageSliceFieldCoder(fd pref.FieldDescriptor, ft reflect.Type) pointerCoderFuncs {
|
||||
func makeMessageSliceFieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) pointerCoderFuncs {
|
||||
if mi := getMessageInfo(ft); mi != nil {
|
||||
funcs := pointerCoderFuncs{
|
||||
size: sizeMessageSliceInfo,
|
||||
@@ -555,7 +555,7 @@ func consumeMessageSlice(b []byte, p pointer, goType reflect.Type, wtyp protowir
|
||||
return out, errDecode
|
||||
}
|
||||
mp := reflect.New(goType.Elem())
|
||||
o, err := opts.Options().UnmarshalState(piface.UnmarshalInput{
|
||||
o, err := opts.Options().UnmarshalState(protoiface.UnmarshalInput{
|
||||
Buf: v,
|
||||
Message: asMessage(mp).ProtoReflect(),
|
||||
})
|
||||
@@ -564,7 +564,7 @@ func consumeMessageSlice(b []byte, p pointer, goType reflect.Type, wtyp protowir
|
||||
}
|
||||
p.AppendPointerSlice(pointerOfValue(mp))
|
||||
out.n = n
|
||||
out.initialized = o.Flags&piface.UnmarshalInitialized != 0
|
||||
out.initialized = o.Flags&protoiface.UnmarshalInitialized != 0
|
||||
return out, nil
|
||||
}
|
||||
|
||||
@@ -581,7 +581,7 @@ func isInitMessageSlice(p pointer, goType reflect.Type) error {
|
||||
|
||||
// Slices of messages
|
||||
|
||||
func sizeMessageSliceValue(listv pref.Value, tagsize int, opts marshalOptions) int {
|
||||
func sizeMessageSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) int {
|
||||
list := listv.List()
|
||||
n := 0
|
||||
for i, llen := 0, list.Len(); i < llen; i++ {
|
||||
@@ -591,7 +591,7 @@ func sizeMessageSliceValue(listv pref.Value, tagsize int, opts marshalOptions) i
|
||||
return n
|
||||
}
|
||||
|
||||
func appendMessageSliceValue(b []byte, listv pref.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
|
||||
func appendMessageSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
|
||||
list := listv.List()
|
||||
mopts := opts.Options()
|
||||
for i, llen := 0, list.Len(); i < llen; i++ {
|
||||
@@ -608,30 +608,30 @@ func appendMessageSliceValue(b []byte, listv pref.Value, wiretag uint64, opts ma
|
||||
return b, nil
|
||||
}
|
||||
|
||||
func consumeMessageSliceValue(b []byte, listv pref.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ pref.Value, out unmarshalOutput, err error) {
|
||||
func consumeMessageSliceValue(b []byte, listv protoreflect.Value, _ protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
|
||||
list := listv.List()
|
||||
if wtyp != protowire.BytesType {
|
||||
return pref.Value{}, out, errUnknown
|
||||
return protoreflect.Value{}, out, errUnknown
|
||||
}
|
||||
v, n := protowire.ConsumeBytes(b)
|
||||
if n < 0 {
|
||||
return pref.Value{}, out, errDecode
|
||||
return protoreflect.Value{}, out, errDecode
|
||||
}
|
||||
m := list.NewElement()
|
||||
o, err := opts.Options().UnmarshalState(piface.UnmarshalInput{
|
||||
o, err := opts.Options().UnmarshalState(protoiface.UnmarshalInput{
|
||||
Buf: v,
|
||||
Message: m.Message(),
|
||||
})
|
||||
if err != nil {
|
||||
return pref.Value{}, out, err
|
||||
return protoreflect.Value{}, out, err
|
||||
}
|
||||
list.Append(m)
|
||||
out.n = n
|
||||
out.initialized = o.Flags&piface.UnmarshalInitialized != 0
|
||||
out.initialized = o.Flags&protoiface.UnmarshalInitialized != 0
|
||||
return listv, out, nil
|
||||
}
|
||||
|
||||
func isInitMessageSliceValue(listv pref.Value) error {
|
||||
func isInitMessageSliceValue(listv protoreflect.Value) error {
|
||||
list := listv.List()
|
||||
for i, llen := 0, list.Len(); i < llen; i++ {
|
||||
m := list.Get(i).Message().Interface()
|
||||
@@ -650,7 +650,7 @@ var coderMessageSliceValue = valueCoderFuncs{
|
||||
merge: mergeMessageListValue,
|
||||
}
|
||||
|
||||
func sizeGroupSliceValue(listv pref.Value, tagsize int, opts marshalOptions) int {
|
||||
func sizeGroupSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) int {
|
||||
list := listv.List()
|
||||
n := 0
|
||||
for i, llen := 0, list.Len(); i < llen; i++ {
|
||||
@@ -660,7 +660,7 @@ func sizeGroupSliceValue(listv pref.Value, tagsize int, opts marshalOptions) int
|
||||
return n
|
||||
}
|
||||
|
||||
func appendGroupSliceValue(b []byte, listv pref.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
|
||||
func appendGroupSliceValue(b []byte, listv protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error) {
|
||||
list := listv.List()
|
||||
mopts := opts.Options()
|
||||
for i, llen := 0, list.Len(); i < llen; i++ {
|
||||
@@ -676,26 +676,26 @@ func appendGroupSliceValue(b []byte, listv pref.Value, wiretag uint64, opts mars
|
||||
return b, nil
|
||||
}
|
||||
|
||||
func consumeGroupSliceValue(b []byte, listv pref.Value, num protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ pref.Value, out unmarshalOutput, err error) {
|
||||
func consumeGroupSliceValue(b []byte, listv protoreflect.Value, num protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (_ protoreflect.Value, out unmarshalOutput, err error) {
|
||||
list := listv.List()
|
||||
if wtyp != protowire.StartGroupType {
|
||||
return pref.Value{}, out, errUnknown
|
||||
return protoreflect.Value{}, out, errUnknown
|
||||
}
|
||||
b, n := protowire.ConsumeGroup(num, b)
|
||||
if n < 0 {
|
||||
return pref.Value{}, out, errDecode
|
||||
return protoreflect.Value{}, out, errDecode
|
||||
}
|
||||
m := list.NewElement()
|
||||
o, err := opts.Options().UnmarshalState(piface.UnmarshalInput{
|
||||
o, err := opts.Options().UnmarshalState(protoiface.UnmarshalInput{
|
||||
Buf: b,
|
||||
Message: m.Message(),
|
||||
})
|
||||
if err != nil {
|
||||
return pref.Value{}, out, err
|
||||
return protoreflect.Value{}, out, err
|
||||
}
|
||||
list.Append(m)
|
||||
out.n = n
|
||||
out.initialized = o.Flags&piface.UnmarshalInitialized != 0
|
||||
out.initialized = o.Flags&protoiface.UnmarshalInitialized != 0
|
||||
return listv, out, nil
|
||||
}
|
||||
|
||||
@@ -707,7 +707,7 @@ var coderGroupSliceValue = valueCoderFuncs{
|
||||
merge: mergeMessageListValue,
|
||||
}
|
||||
|
||||
func makeGroupSliceFieldCoder(fd pref.FieldDescriptor, ft reflect.Type) pointerCoderFuncs {
|
||||
func makeGroupSliceFieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) pointerCoderFuncs {
|
||||
num := fd.Number()
|
||||
if mi := getMessageInfo(ft); mi != nil {
|
||||
funcs := pointerCoderFuncs{
|
||||
@@ -772,7 +772,7 @@ func consumeGroupSlice(b []byte, p pointer, num protowire.Number, wtyp protowire
|
||||
return out, errDecode
|
||||
}
|
||||
mp := reflect.New(goType.Elem())
|
||||
o, err := opts.Options().UnmarshalState(piface.UnmarshalInput{
|
||||
o, err := opts.Options().UnmarshalState(protoiface.UnmarshalInput{
|
||||
Buf: b,
|
||||
Message: asMessage(mp).ProtoReflect(),
|
||||
})
|
||||
@@ -781,7 +781,7 @@ func consumeGroupSlice(b []byte, p pointer, num protowire.Number, wtyp protowire
|
||||
}
|
||||
p.AppendPointerSlice(pointerOfValue(mp))
|
||||
out.n = n
|
||||
out.initialized = o.Flags&piface.UnmarshalInitialized != 0
|
||||
out.initialized = o.Flags&protoiface.UnmarshalInitialized != 0
|
||||
return out, nil
|
||||
}
|
||||
|
||||
@@ -822,8 +822,8 @@ func consumeGroupSliceInfo(b []byte, p pointer, wtyp protowire.Type, f *coderFie
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func asMessage(v reflect.Value) pref.ProtoMessage {
|
||||
if m, ok := v.Interface().(pref.ProtoMessage); ok {
|
||||
func asMessage(v reflect.Value) protoreflect.ProtoMessage {
|
||||
if m, ok := v.Interface().(protoreflect.ProtoMessage); ok {
|
||||
return m
|
||||
}
|
||||
return legacyWrapMessage(v).Interface()
|
||||
|
||||
113
go/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go
generated
vendored
113
go/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go
generated
vendored
@@ -162,11 +162,20 @@ func appendBoolSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions
|
||||
func consumeBoolSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
sp := p.BoolSlice()
|
||||
if wtyp == protowire.BytesType {
|
||||
s := *sp
|
||||
b, n := protowire.ConsumeBytes(b)
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
count := 0
|
||||
for _, v := range b {
|
||||
if v < 0x80 {
|
||||
count++
|
||||
}
|
||||
}
|
||||
if count > 0 {
|
||||
p.growBoolSlice(count)
|
||||
}
|
||||
s := *sp
|
||||
for len(b) > 0 {
|
||||
var v uint64
|
||||
var n int
|
||||
@@ -732,11 +741,20 @@ func appendInt32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOption
|
||||
func consumeInt32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
sp := p.Int32Slice()
|
||||
if wtyp == protowire.BytesType {
|
||||
s := *sp
|
||||
b, n := protowire.ConsumeBytes(b)
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
count := 0
|
||||
for _, v := range b {
|
||||
if v < 0x80 {
|
||||
count++
|
||||
}
|
||||
}
|
||||
if count > 0 {
|
||||
p.growInt32Slice(count)
|
||||
}
|
||||
s := *sp
|
||||
for len(b) > 0 {
|
||||
var v uint64
|
||||
var n int
|
||||
@@ -1138,11 +1156,20 @@ func appendSint32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio
|
||||
func consumeSint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
sp := p.Int32Slice()
|
||||
if wtyp == protowire.BytesType {
|
||||
s := *sp
|
||||
b, n := protowire.ConsumeBytes(b)
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
count := 0
|
||||
for _, v := range b {
|
||||
if v < 0x80 {
|
||||
count++
|
||||
}
|
||||
}
|
||||
if count > 0 {
|
||||
p.growInt32Slice(count)
|
||||
}
|
||||
s := *sp
|
||||
for len(b) > 0 {
|
||||
var v uint64
|
||||
var n int
|
||||
@@ -1544,11 +1571,20 @@ func appendUint32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio
|
||||
func consumeUint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
sp := p.Uint32Slice()
|
||||
if wtyp == protowire.BytesType {
|
||||
s := *sp
|
||||
b, n := protowire.ConsumeBytes(b)
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
count := 0
|
||||
for _, v := range b {
|
||||
if v < 0x80 {
|
||||
count++
|
||||
}
|
||||
}
|
||||
if count > 0 {
|
||||
p.growUint32Slice(count)
|
||||
}
|
||||
s := *sp
|
||||
for len(b) > 0 {
|
||||
var v uint64
|
||||
var n int
|
||||
@@ -1950,11 +1986,20 @@ func appendInt64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOption
|
||||
func consumeInt64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
sp := p.Int64Slice()
|
||||
if wtyp == protowire.BytesType {
|
||||
s := *sp
|
||||
b, n := protowire.ConsumeBytes(b)
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
count := 0
|
||||
for _, v := range b {
|
||||
if v < 0x80 {
|
||||
count++
|
||||
}
|
||||
}
|
||||
if count > 0 {
|
||||
p.growInt64Slice(count)
|
||||
}
|
||||
s := *sp
|
||||
for len(b) > 0 {
|
||||
var v uint64
|
||||
var n int
|
||||
@@ -2356,11 +2401,20 @@ func appendSint64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio
|
||||
func consumeSint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
sp := p.Int64Slice()
|
||||
if wtyp == protowire.BytesType {
|
||||
s := *sp
|
||||
b, n := protowire.ConsumeBytes(b)
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
count := 0
|
||||
for _, v := range b {
|
||||
if v < 0x80 {
|
||||
count++
|
||||
}
|
||||
}
|
||||
if count > 0 {
|
||||
p.growInt64Slice(count)
|
||||
}
|
||||
s := *sp
|
||||
for len(b) > 0 {
|
||||
var v uint64
|
||||
var n int
|
||||
@@ -2762,11 +2816,20 @@ func appendUint64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio
|
||||
func consumeUint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
sp := p.Uint64Slice()
|
||||
if wtyp == protowire.BytesType {
|
||||
s := *sp
|
||||
b, n := protowire.ConsumeBytes(b)
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
count := 0
|
||||
for _, v := range b {
|
||||
if v < 0x80 {
|
||||
count++
|
||||
}
|
||||
}
|
||||
if count > 0 {
|
||||
p.growUint64Slice(count)
|
||||
}
|
||||
s := *sp
|
||||
for len(b) > 0 {
|
||||
var v uint64
|
||||
var n int
|
||||
@@ -3145,11 +3208,15 @@ func appendSfixed32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOpt
|
||||
func consumeSfixed32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
sp := p.Int32Slice()
|
||||
if wtyp == protowire.BytesType {
|
||||
s := *sp
|
||||
b, n := protowire.ConsumeBytes(b)
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
count := len(b) / protowire.SizeFixed32()
|
||||
if count > 0 {
|
||||
p.growInt32Slice(count)
|
||||
}
|
||||
s := *sp
|
||||
for len(b) > 0 {
|
||||
v, n := protowire.ConsumeFixed32(b)
|
||||
if n < 0 {
|
||||
@@ -3461,11 +3528,15 @@ func appendFixed32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOpti
|
||||
func consumeFixed32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
sp := p.Uint32Slice()
|
||||
if wtyp == protowire.BytesType {
|
||||
s := *sp
|
||||
b, n := protowire.ConsumeBytes(b)
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
count := len(b) / protowire.SizeFixed32()
|
||||
if count > 0 {
|
||||
p.growUint32Slice(count)
|
||||
}
|
||||
s := *sp
|
||||
for len(b) > 0 {
|
||||
v, n := protowire.ConsumeFixed32(b)
|
||||
if n < 0 {
|
||||
@@ -3777,11 +3848,15 @@ func appendFloatSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOption
|
||||
func consumeFloatSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
sp := p.Float32Slice()
|
||||
if wtyp == protowire.BytesType {
|
||||
s := *sp
|
||||
b, n := protowire.ConsumeBytes(b)
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
count := len(b) / protowire.SizeFixed32()
|
||||
if count > 0 {
|
||||
p.growFloat32Slice(count)
|
||||
}
|
||||
s := *sp
|
||||
for len(b) > 0 {
|
||||
v, n := protowire.ConsumeFixed32(b)
|
||||
if n < 0 {
|
||||
@@ -4093,11 +4168,15 @@ func appendSfixed64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOpt
|
||||
func consumeSfixed64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
sp := p.Int64Slice()
|
||||
if wtyp == protowire.BytesType {
|
||||
s := *sp
|
||||
b, n := protowire.ConsumeBytes(b)
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
count := len(b) / protowire.SizeFixed64()
|
||||
if count > 0 {
|
||||
p.growInt64Slice(count)
|
||||
}
|
||||
s := *sp
|
||||
for len(b) > 0 {
|
||||
v, n := protowire.ConsumeFixed64(b)
|
||||
if n < 0 {
|
||||
@@ -4409,11 +4488,15 @@ func appendFixed64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOpti
|
||||
func consumeFixed64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
sp := p.Uint64Slice()
|
||||
if wtyp == protowire.BytesType {
|
||||
s := *sp
|
||||
b, n := protowire.ConsumeBytes(b)
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
count := len(b) / protowire.SizeFixed64()
|
||||
if count > 0 {
|
||||
p.growUint64Slice(count)
|
||||
}
|
||||
s := *sp
|
||||
for len(b) > 0 {
|
||||
v, n := protowire.ConsumeFixed64(b)
|
||||
if n < 0 {
|
||||
@@ -4725,11 +4808,15 @@ func appendDoubleSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio
|
||||
func consumeDoubleSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
sp := p.Float64Slice()
|
||||
if wtyp == protowire.BytesType {
|
||||
s := *sp
|
||||
b, n := protowire.ConsumeBytes(b)
|
||||
if n < 0 {
|
||||
return out, errDecode
|
||||
}
|
||||
count := len(b) / protowire.SizeFixed64()
|
||||
if count > 0 {
|
||||
p.growFloat64Slice(count)
|
||||
}
|
||||
s := *sp
|
||||
for len(b) > 0 {
|
||||
v, n := protowire.ConsumeFixed64(b)
|
||||
if n < 0 {
|
||||
|
||||
20
go/vendor/google.golang.org/protobuf/internal/impl/codec_map.go
generated
vendored
20
go/vendor/google.golang.org/protobuf/internal/impl/codec_map.go
generated
vendored
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/internal/genid"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
type mapInfo struct {
|
||||
@@ -19,12 +19,12 @@ type mapInfo struct {
|
||||
valWiretag uint64
|
||||
keyFuncs valueCoderFuncs
|
||||
valFuncs valueCoderFuncs
|
||||
keyZero pref.Value
|
||||
keyKind pref.Kind
|
||||
keyZero protoreflect.Value
|
||||
keyKind protoreflect.Kind
|
||||
conv *mapConverter
|
||||
}
|
||||
|
||||
func encoderFuncsForMap(fd pref.FieldDescriptor, ft reflect.Type) (valueMessage *MessageInfo, funcs pointerCoderFuncs) {
|
||||
func encoderFuncsForMap(fd protoreflect.FieldDescriptor, ft reflect.Type) (valueMessage *MessageInfo, funcs pointerCoderFuncs) {
|
||||
// TODO: Consider generating specialized map coders.
|
||||
keyField := fd.MapKey()
|
||||
valField := fd.MapValue()
|
||||
@@ -44,7 +44,7 @@ func encoderFuncsForMap(fd pref.FieldDescriptor, ft reflect.Type) (valueMessage
|
||||
keyKind: keyField.Kind(),
|
||||
conv: conv,
|
||||
}
|
||||
if valField.Kind() == pref.MessageKind {
|
||||
if valField.Kind() == protoreflect.MessageKind {
|
||||
valueMessage = getMessageInfo(ft.Elem())
|
||||
}
|
||||
|
||||
@@ -68,9 +68,9 @@ func encoderFuncsForMap(fd pref.FieldDescriptor, ft reflect.Type) (valueMessage
|
||||
},
|
||||
}
|
||||
switch valField.Kind() {
|
||||
case pref.MessageKind:
|
||||
case protoreflect.MessageKind:
|
||||
funcs.merge = mergeMapOfMessage
|
||||
case pref.BytesKind:
|
||||
case protoreflect.BytesKind:
|
||||
funcs.merge = mergeMapOfBytes
|
||||
default:
|
||||
funcs.merge = mergeMap
|
||||
@@ -135,7 +135,7 @@ func consumeMap(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo
|
||||
err := errUnknown
|
||||
switch num {
|
||||
case genid.MapEntry_Key_field_number:
|
||||
var v pref.Value
|
||||
var v protoreflect.Value
|
||||
var o unmarshalOutput
|
||||
v, o, err = mapi.keyFuncs.unmarshal(b, key, num, wtyp, opts)
|
||||
if err != nil {
|
||||
@@ -144,7 +144,7 @@ func consumeMap(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo
|
||||
key = v
|
||||
n = o.n
|
||||
case genid.MapEntry_Value_field_number:
|
||||
var v pref.Value
|
||||
var v protoreflect.Value
|
||||
var o unmarshalOutput
|
||||
v, o, err = mapi.valFuncs.unmarshal(b, val, num, wtyp, opts)
|
||||
if err != nil {
|
||||
@@ -192,7 +192,7 @@ func consumeMapOfMessage(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi
|
||||
err := errUnknown
|
||||
switch num {
|
||||
case 1:
|
||||
var v pref.Value
|
||||
var v protoreflect.Value
|
||||
var o unmarshalOutput
|
||||
v, o, err = mapi.keyFuncs.unmarshal(b, key, num, wtyp, opts)
|
||||
if err != nil {
|
||||
|
||||
30
go/vendor/google.golang.org/protobuf/internal/impl/codec_message.go
generated
vendored
30
go/vendor/google.golang.org/protobuf/internal/impl/codec_message.go
generated
vendored
@@ -12,15 +12,15 @@ import (
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/internal/encoding/messageset"
|
||||
"google.golang.org/protobuf/internal/order"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
piface "google.golang.org/protobuf/runtime/protoiface"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/runtime/protoiface"
|
||||
)
|
||||
|
||||
// coderMessageInfo contains per-message information used by the fast-path functions.
|
||||
// This is a different type from MessageInfo to keep MessageInfo as general-purpose as
|
||||
// possible.
|
||||
type coderMessageInfo struct {
|
||||
methods piface.Methods
|
||||
methods protoiface.Methods
|
||||
|
||||
orderedCoderFields []*coderFieldInfo
|
||||
denseCoderFields []*coderFieldInfo
|
||||
@@ -38,13 +38,13 @@ type coderFieldInfo struct {
|
||||
funcs pointerCoderFuncs // fast-path per-field functions
|
||||
mi *MessageInfo // field's message
|
||||
ft reflect.Type
|
||||
validation validationInfo // information used by message validation
|
||||
num pref.FieldNumber // field number
|
||||
offset offset // struct field offset
|
||||
wiretag uint64 // field tag (number + wire type)
|
||||
tagsize int // size of the varint-encoded tag
|
||||
isPointer bool // true if IsNil may be called on the struct field
|
||||
isRequired bool // true if field is required
|
||||
validation validationInfo // information used by message validation
|
||||
num protoreflect.FieldNumber // field number
|
||||
offset offset // struct field offset
|
||||
wiretag uint64 // field tag (number + wire type)
|
||||
tagsize int // size of the varint-encoded tag
|
||||
isPointer bool // true if IsNil may be called on the struct field
|
||||
isRequired bool // true if field is required
|
||||
}
|
||||
|
||||
func (mi *MessageInfo) makeCoderMethods(t reflect.Type, si structInfo) {
|
||||
@@ -125,8 +125,8 @@ func (mi *MessageInfo) makeCoderMethods(t reflect.Type, si structInfo) {
|
||||
funcs: funcs,
|
||||
mi: childMessage,
|
||||
validation: newFieldValidationInfo(mi, si, fd, ft),
|
||||
isPointer: fd.Cardinality() == pref.Repeated || fd.HasPresence(),
|
||||
isRequired: fd.Cardinality() == pref.Required,
|
||||
isPointer: fd.Cardinality() == protoreflect.Repeated || fd.HasPresence(),
|
||||
isRequired: fd.Cardinality() == protoreflect.Required,
|
||||
}
|
||||
mi.orderedCoderFields = append(mi.orderedCoderFields, cf)
|
||||
mi.coderFields[cf.num] = cf
|
||||
@@ -149,7 +149,7 @@ func (mi *MessageInfo) makeCoderMethods(t reflect.Type, si structInfo) {
|
||||
return mi.orderedCoderFields[i].num < mi.orderedCoderFields[j].num
|
||||
})
|
||||
|
||||
var maxDense pref.FieldNumber
|
||||
var maxDense protoreflect.FieldNumber
|
||||
for _, cf := range mi.orderedCoderFields {
|
||||
if cf.num >= 16 && cf.num >= 2*maxDense {
|
||||
break
|
||||
@@ -175,12 +175,12 @@ func (mi *MessageInfo) makeCoderMethods(t reflect.Type, si structInfo) {
|
||||
|
||||
mi.needsInitCheck = needsInitCheck(mi.Desc)
|
||||
if mi.methods.Marshal == nil && mi.methods.Size == nil {
|
||||
mi.methods.Flags |= piface.SupportMarshalDeterministic
|
||||
mi.methods.Flags |= protoiface.SupportMarshalDeterministic
|
||||
mi.methods.Marshal = mi.marshal
|
||||
mi.methods.Size = mi.size
|
||||
}
|
||||
if mi.methods.Unmarshal == nil {
|
||||
mi.methods.Flags |= piface.SupportUnmarshalDiscardUnknown
|
||||
mi.methods.Flags |= protoiface.SupportUnmarshalDiscardUnknown
|
||||
mi.methods.Unmarshal = mi.unmarshal
|
||||
}
|
||||
if mi.methods.CheckInitialized == nil {
|
||||
|
||||
290
go/vendor/google.golang.org/protobuf/internal/impl/codec_tables.go
generated
vendored
290
go/vendor/google.golang.org/protobuf/internal/impl/codec_tables.go
generated
vendored
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/internal/strs"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
// pointerCoderFuncs is a set of pointer encoding functions.
|
||||
@@ -25,83 +25,83 @@ type pointerCoderFuncs struct {
|
||||
|
||||
// valueCoderFuncs is a set of protoreflect.Value encoding functions.
|
||||
type valueCoderFuncs struct {
|
||||
size func(v pref.Value, tagsize int, opts marshalOptions) int
|
||||
marshal func(b []byte, v pref.Value, wiretag uint64, opts marshalOptions) ([]byte, error)
|
||||
unmarshal func(b []byte, v pref.Value, num protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (pref.Value, unmarshalOutput, error)
|
||||
isInit func(v pref.Value) error
|
||||
merge func(dst, src pref.Value, opts mergeOptions) pref.Value
|
||||
size func(v protoreflect.Value, tagsize int, opts marshalOptions) int
|
||||
marshal func(b []byte, v protoreflect.Value, wiretag uint64, opts marshalOptions) ([]byte, error)
|
||||
unmarshal func(b []byte, v protoreflect.Value, num protowire.Number, wtyp protowire.Type, opts unmarshalOptions) (protoreflect.Value, unmarshalOutput, error)
|
||||
isInit func(v protoreflect.Value) error
|
||||
merge func(dst, src protoreflect.Value, opts mergeOptions) protoreflect.Value
|
||||
}
|
||||
|
||||
// fieldCoder returns pointer functions for a field, used for operating on
|
||||
// struct fields.
|
||||
func fieldCoder(fd pref.FieldDescriptor, ft reflect.Type) (*MessageInfo, pointerCoderFuncs) {
|
||||
func fieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) (*MessageInfo, pointerCoderFuncs) {
|
||||
switch {
|
||||
case fd.IsMap():
|
||||
return encoderFuncsForMap(fd, ft)
|
||||
case fd.Cardinality() == pref.Repeated && !fd.IsPacked():
|
||||
case fd.Cardinality() == protoreflect.Repeated && !fd.IsPacked():
|
||||
// Repeated fields (not packed).
|
||||
if ft.Kind() != reflect.Slice {
|
||||
break
|
||||
}
|
||||
ft := ft.Elem()
|
||||
switch fd.Kind() {
|
||||
case pref.BoolKind:
|
||||
case protoreflect.BoolKind:
|
||||
if ft.Kind() == reflect.Bool {
|
||||
return nil, coderBoolSlice
|
||||
}
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderEnumSlice
|
||||
}
|
||||
case pref.Int32Kind:
|
||||
case protoreflect.Int32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderInt32Slice
|
||||
}
|
||||
case pref.Sint32Kind:
|
||||
case protoreflect.Sint32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderSint32Slice
|
||||
}
|
||||
case pref.Uint32Kind:
|
||||
case protoreflect.Uint32Kind:
|
||||
if ft.Kind() == reflect.Uint32 {
|
||||
return nil, coderUint32Slice
|
||||
}
|
||||
case pref.Int64Kind:
|
||||
case protoreflect.Int64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderInt64Slice
|
||||
}
|
||||
case pref.Sint64Kind:
|
||||
case protoreflect.Sint64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderSint64Slice
|
||||
}
|
||||
case pref.Uint64Kind:
|
||||
case protoreflect.Uint64Kind:
|
||||
if ft.Kind() == reflect.Uint64 {
|
||||
return nil, coderUint64Slice
|
||||
}
|
||||
case pref.Sfixed32Kind:
|
||||
case protoreflect.Sfixed32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderSfixed32Slice
|
||||
}
|
||||
case pref.Fixed32Kind:
|
||||
case protoreflect.Fixed32Kind:
|
||||
if ft.Kind() == reflect.Uint32 {
|
||||
return nil, coderFixed32Slice
|
||||
}
|
||||
case pref.FloatKind:
|
||||
case protoreflect.FloatKind:
|
||||
if ft.Kind() == reflect.Float32 {
|
||||
return nil, coderFloatSlice
|
||||
}
|
||||
case pref.Sfixed64Kind:
|
||||
case protoreflect.Sfixed64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderSfixed64Slice
|
||||
}
|
||||
case pref.Fixed64Kind:
|
||||
case protoreflect.Fixed64Kind:
|
||||
if ft.Kind() == reflect.Uint64 {
|
||||
return nil, coderFixed64Slice
|
||||
}
|
||||
case pref.DoubleKind:
|
||||
case protoreflect.DoubleKind:
|
||||
if ft.Kind() == reflect.Float64 {
|
||||
return nil, coderDoubleSlice
|
||||
}
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
if ft.Kind() == reflect.String && strs.EnforceUTF8(fd) {
|
||||
return nil, coderStringSliceValidateUTF8
|
||||
}
|
||||
@@ -114,19 +114,19 @@ func fieldCoder(fd pref.FieldDescriptor, ft reflect.Type) (*MessageInfo, pointer
|
||||
if ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8 {
|
||||
return nil, coderBytesSlice
|
||||
}
|
||||
case pref.BytesKind:
|
||||
case protoreflect.BytesKind:
|
||||
if ft.Kind() == reflect.String {
|
||||
return nil, coderStringSlice
|
||||
}
|
||||
if ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8 {
|
||||
return nil, coderBytesSlice
|
||||
}
|
||||
case pref.MessageKind:
|
||||
case protoreflect.MessageKind:
|
||||
return getMessageInfo(ft), makeMessageSliceFieldCoder(fd, ft)
|
||||
case pref.GroupKind:
|
||||
case protoreflect.GroupKind:
|
||||
return getMessageInfo(ft), makeGroupSliceFieldCoder(fd, ft)
|
||||
}
|
||||
case fd.Cardinality() == pref.Repeated && fd.IsPacked():
|
||||
case fd.Cardinality() == protoreflect.Repeated && fd.IsPacked():
|
||||
// Packed repeated fields.
|
||||
//
|
||||
// Only repeated fields of primitive numeric types
|
||||
@@ -136,128 +136,128 @@ func fieldCoder(fd pref.FieldDescriptor, ft reflect.Type) (*MessageInfo, pointer
|
||||
}
|
||||
ft := ft.Elem()
|
||||
switch fd.Kind() {
|
||||
case pref.BoolKind:
|
||||
case protoreflect.BoolKind:
|
||||
if ft.Kind() == reflect.Bool {
|
||||
return nil, coderBoolPackedSlice
|
||||
}
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderEnumPackedSlice
|
||||
}
|
||||
case pref.Int32Kind:
|
||||
case protoreflect.Int32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderInt32PackedSlice
|
||||
}
|
||||
case pref.Sint32Kind:
|
||||
case protoreflect.Sint32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderSint32PackedSlice
|
||||
}
|
||||
case pref.Uint32Kind:
|
||||
case protoreflect.Uint32Kind:
|
||||
if ft.Kind() == reflect.Uint32 {
|
||||
return nil, coderUint32PackedSlice
|
||||
}
|
||||
case pref.Int64Kind:
|
||||
case protoreflect.Int64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderInt64PackedSlice
|
||||
}
|
||||
case pref.Sint64Kind:
|
||||
case protoreflect.Sint64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderSint64PackedSlice
|
||||
}
|
||||
case pref.Uint64Kind:
|
||||
case protoreflect.Uint64Kind:
|
||||
if ft.Kind() == reflect.Uint64 {
|
||||
return nil, coderUint64PackedSlice
|
||||
}
|
||||
case pref.Sfixed32Kind:
|
||||
case protoreflect.Sfixed32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderSfixed32PackedSlice
|
||||
}
|
||||
case pref.Fixed32Kind:
|
||||
case protoreflect.Fixed32Kind:
|
||||
if ft.Kind() == reflect.Uint32 {
|
||||
return nil, coderFixed32PackedSlice
|
||||
}
|
||||
case pref.FloatKind:
|
||||
case protoreflect.FloatKind:
|
||||
if ft.Kind() == reflect.Float32 {
|
||||
return nil, coderFloatPackedSlice
|
||||
}
|
||||
case pref.Sfixed64Kind:
|
||||
case protoreflect.Sfixed64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderSfixed64PackedSlice
|
||||
}
|
||||
case pref.Fixed64Kind:
|
||||
case protoreflect.Fixed64Kind:
|
||||
if ft.Kind() == reflect.Uint64 {
|
||||
return nil, coderFixed64PackedSlice
|
||||
}
|
||||
case pref.DoubleKind:
|
||||
case protoreflect.DoubleKind:
|
||||
if ft.Kind() == reflect.Float64 {
|
||||
return nil, coderDoublePackedSlice
|
||||
}
|
||||
}
|
||||
case fd.Kind() == pref.MessageKind:
|
||||
case fd.Kind() == protoreflect.MessageKind:
|
||||
return getMessageInfo(ft), makeMessageFieldCoder(fd, ft)
|
||||
case fd.Kind() == pref.GroupKind:
|
||||
case fd.Kind() == protoreflect.GroupKind:
|
||||
return getMessageInfo(ft), makeGroupFieldCoder(fd, ft)
|
||||
case fd.Syntax() == pref.Proto3 && fd.ContainingOneof() == nil:
|
||||
case fd.Syntax() == protoreflect.Proto3 && fd.ContainingOneof() == nil:
|
||||
// Populated oneof fields always encode even if set to the zero value,
|
||||
// which normally are not encoded in proto3.
|
||||
switch fd.Kind() {
|
||||
case pref.BoolKind:
|
||||
case protoreflect.BoolKind:
|
||||
if ft.Kind() == reflect.Bool {
|
||||
return nil, coderBoolNoZero
|
||||
}
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderEnumNoZero
|
||||
}
|
||||
case pref.Int32Kind:
|
||||
case protoreflect.Int32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderInt32NoZero
|
||||
}
|
||||
case pref.Sint32Kind:
|
||||
case protoreflect.Sint32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderSint32NoZero
|
||||
}
|
||||
case pref.Uint32Kind:
|
||||
case protoreflect.Uint32Kind:
|
||||
if ft.Kind() == reflect.Uint32 {
|
||||
return nil, coderUint32NoZero
|
||||
}
|
||||
case pref.Int64Kind:
|
||||
case protoreflect.Int64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderInt64NoZero
|
||||
}
|
||||
case pref.Sint64Kind:
|
||||
case protoreflect.Sint64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderSint64NoZero
|
||||
}
|
||||
case pref.Uint64Kind:
|
||||
case protoreflect.Uint64Kind:
|
||||
if ft.Kind() == reflect.Uint64 {
|
||||
return nil, coderUint64NoZero
|
||||
}
|
||||
case pref.Sfixed32Kind:
|
||||
case protoreflect.Sfixed32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderSfixed32NoZero
|
||||
}
|
||||
case pref.Fixed32Kind:
|
||||
case protoreflect.Fixed32Kind:
|
||||
if ft.Kind() == reflect.Uint32 {
|
||||
return nil, coderFixed32NoZero
|
||||
}
|
||||
case pref.FloatKind:
|
||||
case protoreflect.FloatKind:
|
||||
if ft.Kind() == reflect.Float32 {
|
||||
return nil, coderFloatNoZero
|
||||
}
|
||||
case pref.Sfixed64Kind:
|
||||
case protoreflect.Sfixed64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderSfixed64NoZero
|
||||
}
|
||||
case pref.Fixed64Kind:
|
||||
case protoreflect.Fixed64Kind:
|
||||
if ft.Kind() == reflect.Uint64 {
|
||||
return nil, coderFixed64NoZero
|
||||
}
|
||||
case pref.DoubleKind:
|
||||
case protoreflect.DoubleKind:
|
||||
if ft.Kind() == reflect.Float64 {
|
||||
return nil, coderDoubleNoZero
|
||||
}
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
if ft.Kind() == reflect.String && strs.EnforceUTF8(fd) {
|
||||
return nil, coderStringNoZeroValidateUTF8
|
||||
}
|
||||
@@ -270,7 +270,7 @@ func fieldCoder(fd pref.FieldDescriptor, ft reflect.Type) (*MessageInfo, pointer
|
||||
if ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8 {
|
||||
return nil, coderBytesNoZero
|
||||
}
|
||||
case pref.BytesKind:
|
||||
case protoreflect.BytesKind:
|
||||
if ft.Kind() == reflect.String {
|
||||
return nil, coderStringNoZero
|
||||
}
|
||||
@@ -281,133 +281,133 @@ func fieldCoder(fd pref.FieldDescriptor, ft reflect.Type) (*MessageInfo, pointer
|
||||
case ft.Kind() == reflect.Ptr:
|
||||
ft := ft.Elem()
|
||||
switch fd.Kind() {
|
||||
case pref.BoolKind:
|
||||
case protoreflect.BoolKind:
|
||||
if ft.Kind() == reflect.Bool {
|
||||
return nil, coderBoolPtr
|
||||
}
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderEnumPtr
|
||||
}
|
||||
case pref.Int32Kind:
|
||||
case protoreflect.Int32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderInt32Ptr
|
||||
}
|
||||
case pref.Sint32Kind:
|
||||
case protoreflect.Sint32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderSint32Ptr
|
||||
}
|
||||
case pref.Uint32Kind:
|
||||
case protoreflect.Uint32Kind:
|
||||
if ft.Kind() == reflect.Uint32 {
|
||||
return nil, coderUint32Ptr
|
||||
}
|
||||
case pref.Int64Kind:
|
||||
case protoreflect.Int64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderInt64Ptr
|
||||
}
|
||||
case pref.Sint64Kind:
|
||||
case protoreflect.Sint64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderSint64Ptr
|
||||
}
|
||||
case pref.Uint64Kind:
|
||||
case protoreflect.Uint64Kind:
|
||||
if ft.Kind() == reflect.Uint64 {
|
||||
return nil, coderUint64Ptr
|
||||
}
|
||||
case pref.Sfixed32Kind:
|
||||
case protoreflect.Sfixed32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderSfixed32Ptr
|
||||
}
|
||||
case pref.Fixed32Kind:
|
||||
case protoreflect.Fixed32Kind:
|
||||
if ft.Kind() == reflect.Uint32 {
|
||||
return nil, coderFixed32Ptr
|
||||
}
|
||||
case pref.FloatKind:
|
||||
case protoreflect.FloatKind:
|
||||
if ft.Kind() == reflect.Float32 {
|
||||
return nil, coderFloatPtr
|
||||
}
|
||||
case pref.Sfixed64Kind:
|
||||
case protoreflect.Sfixed64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderSfixed64Ptr
|
||||
}
|
||||
case pref.Fixed64Kind:
|
||||
case protoreflect.Fixed64Kind:
|
||||
if ft.Kind() == reflect.Uint64 {
|
||||
return nil, coderFixed64Ptr
|
||||
}
|
||||
case pref.DoubleKind:
|
||||
case protoreflect.DoubleKind:
|
||||
if ft.Kind() == reflect.Float64 {
|
||||
return nil, coderDoublePtr
|
||||
}
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
if ft.Kind() == reflect.String && strs.EnforceUTF8(fd) {
|
||||
return nil, coderStringPtrValidateUTF8
|
||||
}
|
||||
if ft.Kind() == reflect.String {
|
||||
return nil, coderStringPtr
|
||||
}
|
||||
case pref.BytesKind:
|
||||
case protoreflect.BytesKind:
|
||||
if ft.Kind() == reflect.String {
|
||||
return nil, coderStringPtr
|
||||
}
|
||||
}
|
||||
default:
|
||||
switch fd.Kind() {
|
||||
case pref.BoolKind:
|
||||
case protoreflect.BoolKind:
|
||||
if ft.Kind() == reflect.Bool {
|
||||
return nil, coderBool
|
||||
}
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderEnum
|
||||
}
|
||||
case pref.Int32Kind:
|
||||
case protoreflect.Int32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderInt32
|
||||
}
|
||||
case pref.Sint32Kind:
|
||||
case protoreflect.Sint32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderSint32
|
||||
}
|
||||
case pref.Uint32Kind:
|
||||
case protoreflect.Uint32Kind:
|
||||
if ft.Kind() == reflect.Uint32 {
|
||||
return nil, coderUint32
|
||||
}
|
||||
case pref.Int64Kind:
|
||||
case protoreflect.Int64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderInt64
|
||||
}
|
||||
case pref.Sint64Kind:
|
||||
case protoreflect.Sint64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderSint64
|
||||
}
|
||||
case pref.Uint64Kind:
|
||||
case protoreflect.Uint64Kind:
|
||||
if ft.Kind() == reflect.Uint64 {
|
||||
return nil, coderUint64
|
||||
}
|
||||
case pref.Sfixed32Kind:
|
||||
case protoreflect.Sfixed32Kind:
|
||||
if ft.Kind() == reflect.Int32 {
|
||||
return nil, coderSfixed32
|
||||
}
|
||||
case pref.Fixed32Kind:
|
||||
case protoreflect.Fixed32Kind:
|
||||
if ft.Kind() == reflect.Uint32 {
|
||||
return nil, coderFixed32
|
||||
}
|
||||
case pref.FloatKind:
|
||||
case protoreflect.FloatKind:
|
||||
if ft.Kind() == reflect.Float32 {
|
||||
return nil, coderFloat
|
||||
}
|
||||
case pref.Sfixed64Kind:
|
||||
case protoreflect.Sfixed64Kind:
|
||||
if ft.Kind() == reflect.Int64 {
|
||||
return nil, coderSfixed64
|
||||
}
|
||||
case pref.Fixed64Kind:
|
||||
case protoreflect.Fixed64Kind:
|
||||
if ft.Kind() == reflect.Uint64 {
|
||||
return nil, coderFixed64
|
||||
}
|
||||
case pref.DoubleKind:
|
||||
case protoreflect.DoubleKind:
|
||||
if ft.Kind() == reflect.Float64 {
|
||||
return nil, coderDouble
|
||||
}
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
if ft.Kind() == reflect.String && strs.EnforceUTF8(fd) {
|
||||
return nil, coderStringValidateUTF8
|
||||
}
|
||||
@@ -420,7 +420,7 @@ func fieldCoder(fd pref.FieldDescriptor, ft reflect.Type) (*MessageInfo, pointer
|
||||
if ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8 {
|
||||
return nil, coderBytes
|
||||
}
|
||||
case pref.BytesKind:
|
||||
case protoreflect.BytesKind:
|
||||
if ft.Kind() == reflect.String {
|
||||
return nil, coderString
|
||||
}
|
||||
@@ -434,122 +434,122 @@ func fieldCoder(fd pref.FieldDescriptor, ft reflect.Type) (*MessageInfo, pointer
|
||||
|
||||
// encoderFuncsForValue returns value functions for a field, used for
|
||||
// extension values and map encoding.
|
||||
func encoderFuncsForValue(fd pref.FieldDescriptor) valueCoderFuncs {
|
||||
func encoderFuncsForValue(fd protoreflect.FieldDescriptor) valueCoderFuncs {
|
||||
switch {
|
||||
case fd.Cardinality() == pref.Repeated && !fd.IsPacked():
|
||||
case fd.Cardinality() == protoreflect.Repeated && !fd.IsPacked():
|
||||
switch fd.Kind() {
|
||||
case pref.BoolKind:
|
||||
case protoreflect.BoolKind:
|
||||
return coderBoolSliceValue
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
return coderEnumSliceValue
|
||||
case pref.Int32Kind:
|
||||
case protoreflect.Int32Kind:
|
||||
return coderInt32SliceValue
|
||||
case pref.Sint32Kind:
|
||||
case protoreflect.Sint32Kind:
|
||||
return coderSint32SliceValue
|
||||
case pref.Uint32Kind:
|
||||
case protoreflect.Uint32Kind:
|
||||
return coderUint32SliceValue
|
||||
case pref.Int64Kind:
|
||||
case protoreflect.Int64Kind:
|
||||
return coderInt64SliceValue
|
||||
case pref.Sint64Kind:
|
||||
case protoreflect.Sint64Kind:
|
||||
return coderSint64SliceValue
|
||||
case pref.Uint64Kind:
|
||||
case protoreflect.Uint64Kind:
|
||||
return coderUint64SliceValue
|
||||
case pref.Sfixed32Kind:
|
||||
case protoreflect.Sfixed32Kind:
|
||||
return coderSfixed32SliceValue
|
||||
case pref.Fixed32Kind:
|
||||
case protoreflect.Fixed32Kind:
|
||||
return coderFixed32SliceValue
|
||||
case pref.FloatKind:
|
||||
case protoreflect.FloatKind:
|
||||
return coderFloatSliceValue
|
||||
case pref.Sfixed64Kind:
|
||||
case protoreflect.Sfixed64Kind:
|
||||
return coderSfixed64SliceValue
|
||||
case pref.Fixed64Kind:
|
||||
case protoreflect.Fixed64Kind:
|
||||
return coderFixed64SliceValue
|
||||
case pref.DoubleKind:
|
||||
case protoreflect.DoubleKind:
|
||||
return coderDoubleSliceValue
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
// We don't have a UTF-8 validating coder for repeated string fields.
|
||||
// Value coders are used for extensions and maps.
|
||||
// Extensions are never proto3, and maps never contain lists.
|
||||
return coderStringSliceValue
|
||||
case pref.BytesKind:
|
||||
case protoreflect.BytesKind:
|
||||
return coderBytesSliceValue
|
||||
case pref.MessageKind:
|
||||
case protoreflect.MessageKind:
|
||||
return coderMessageSliceValue
|
||||
case pref.GroupKind:
|
||||
case protoreflect.GroupKind:
|
||||
return coderGroupSliceValue
|
||||
}
|
||||
case fd.Cardinality() == pref.Repeated && fd.IsPacked():
|
||||
case fd.Cardinality() == protoreflect.Repeated && fd.IsPacked():
|
||||
switch fd.Kind() {
|
||||
case pref.BoolKind:
|
||||
case protoreflect.BoolKind:
|
||||
return coderBoolPackedSliceValue
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
return coderEnumPackedSliceValue
|
||||
case pref.Int32Kind:
|
||||
case protoreflect.Int32Kind:
|
||||
return coderInt32PackedSliceValue
|
||||
case pref.Sint32Kind:
|
||||
case protoreflect.Sint32Kind:
|
||||
return coderSint32PackedSliceValue
|
||||
case pref.Uint32Kind:
|
||||
case protoreflect.Uint32Kind:
|
||||
return coderUint32PackedSliceValue
|
||||
case pref.Int64Kind:
|
||||
case protoreflect.Int64Kind:
|
||||
return coderInt64PackedSliceValue
|
||||
case pref.Sint64Kind:
|
||||
case protoreflect.Sint64Kind:
|
||||
return coderSint64PackedSliceValue
|
||||
case pref.Uint64Kind:
|
||||
case protoreflect.Uint64Kind:
|
||||
return coderUint64PackedSliceValue
|
||||
case pref.Sfixed32Kind:
|
||||
case protoreflect.Sfixed32Kind:
|
||||
return coderSfixed32PackedSliceValue
|
||||
case pref.Fixed32Kind:
|
||||
case protoreflect.Fixed32Kind:
|
||||
return coderFixed32PackedSliceValue
|
||||
case pref.FloatKind:
|
||||
case protoreflect.FloatKind:
|
||||
return coderFloatPackedSliceValue
|
||||
case pref.Sfixed64Kind:
|
||||
case protoreflect.Sfixed64Kind:
|
||||
return coderSfixed64PackedSliceValue
|
||||
case pref.Fixed64Kind:
|
||||
case protoreflect.Fixed64Kind:
|
||||
return coderFixed64PackedSliceValue
|
||||
case pref.DoubleKind:
|
||||
case protoreflect.DoubleKind:
|
||||
return coderDoublePackedSliceValue
|
||||
}
|
||||
default:
|
||||
switch fd.Kind() {
|
||||
default:
|
||||
case pref.BoolKind:
|
||||
case protoreflect.BoolKind:
|
||||
return coderBoolValue
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
return coderEnumValue
|
||||
case pref.Int32Kind:
|
||||
case protoreflect.Int32Kind:
|
||||
return coderInt32Value
|
||||
case pref.Sint32Kind:
|
||||
case protoreflect.Sint32Kind:
|
||||
return coderSint32Value
|
||||
case pref.Uint32Kind:
|
||||
case protoreflect.Uint32Kind:
|
||||
return coderUint32Value
|
||||
case pref.Int64Kind:
|
||||
case protoreflect.Int64Kind:
|
||||
return coderInt64Value
|
||||
case pref.Sint64Kind:
|
||||
case protoreflect.Sint64Kind:
|
||||
return coderSint64Value
|
||||
case pref.Uint64Kind:
|
||||
case protoreflect.Uint64Kind:
|
||||
return coderUint64Value
|
||||
case pref.Sfixed32Kind:
|
||||
case protoreflect.Sfixed32Kind:
|
||||
return coderSfixed32Value
|
||||
case pref.Fixed32Kind:
|
||||
case protoreflect.Fixed32Kind:
|
||||
return coderFixed32Value
|
||||
case pref.FloatKind:
|
||||
case protoreflect.FloatKind:
|
||||
return coderFloatValue
|
||||
case pref.Sfixed64Kind:
|
||||
case protoreflect.Sfixed64Kind:
|
||||
return coderSfixed64Value
|
||||
case pref.Fixed64Kind:
|
||||
case protoreflect.Fixed64Kind:
|
||||
return coderFixed64Value
|
||||
case pref.DoubleKind:
|
||||
case protoreflect.DoubleKind:
|
||||
return coderDoubleValue
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
if strs.EnforceUTF8(fd) {
|
||||
return coderStringValueValidateUTF8
|
||||
}
|
||||
return coderStringValue
|
||||
case pref.BytesKind:
|
||||
case protoreflect.BytesKind:
|
||||
return coderBytesValue
|
||||
case pref.MessageKind:
|
||||
case protoreflect.MessageKind:
|
||||
return coderMessageValue
|
||||
case pref.GroupKind:
|
||||
case protoreflect.GroupKind:
|
||||
return coderGroupValue
|
||||
}
|
||||
}
|
||||
|
||||
229
go/vendor/google.golang.org/protobuf/internal/impl/convert.go
generated
vendored
229
go/vendor/google.golang.org/protobuf/internal/impl/convert.go
generated
vendored
@@ -8,7 +8,7 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
// unwrapper unwraps the value to the underlying value.
|
||||
@@ -20,13 +20,13 @@ type unwrapper interface {
|
||||
// A Converter coverts to/from Go reflect.Value types and protobuf protoreflect.Value types.
|
||||
type Converter interface {
|
||||
// PBValueOf converts a reflect.Value to a protoreflect.Value.
|
||||
PBValueOf(reflect.Value) pref.Value
|
||||
PBValueOf(reflect.Value) protoreflect.Value
|
||||
|
||||
// GoValueOf converts a protoreflect.Value to a reflect.Value.
|
||||
GoValueOf(pref.Value) reflect.Value
|
||||
GoValueOf(protoreflect.Value) reflect.Value
|
||||
|
||||
// IsValidPB returns whether a protoreflect.Value is compatible with this type.
|
||||
IsValidPB(pref.Value) bool
|
||||
IsValidPB(protoreflect.Value) bool
|
||||
|
||||
// IsValidGo returns whether a reflect.Value is compatible with this type.
|
||||
IsValidGo(reflect.Value) bool
|
||||
@@ -34,12 +34,12 @@ type Converter interface {
|
||||
// New returns a new field value.
|
||||
// For scalars, it returns the default value of the field.
|
||||
// For composite types, it returns a new mutable value.
|
||||
New() pref.Value
|
||||
New() protoreflect.Value
|
||||
|
||||
// Zero returns a new field value.
|
||||
// For scalars, it returns the default value of the field.
|
||||
// For composite types, it returns an immutable, empty value.
|
||||
Zero() pref.Value
|
||||
Zero() protoreflect.Value
|
||||
}
|
||||
|
||||
// NewConverter matches a Go type with a protobuf field and returns a Converter
|
||||
@@ -50,7 +50,7 @@ type Converter interface {
|
||||
// This matcher deliberately supports a wider range of Go types than what
|
||||
// protoc-gen-go historically generated to be able to automatically wrap some
|
||||
// v1 messages generated by other forks of protoc-gen-go.
|
||||
func NewConverter(t reflect.Type, fd pref.FieldDescriptor) Converter {
|
||||
func NewConverter(t reflect.Type, fd protoreflect.FieldDescriptor) Converter {
|
||||
switch {
|
||||
case fd.IsList():
|
||||
return newListConverter(t, fd)
|
||||
@@ -59,7 +59,6 @@ func NewConverter(t reflect.Type, fd pref.FieldDescriptor) Converter {
|
||||
default:
|
||||
return newSingularConverter(t, fd)
|
||||
}
|
||||
panic(fmt.Sprintf("invalid Go type %v for field %v", t, fd.FullName()))
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -76,68 +75,68 @@ var (
|
||||
)
|
||||
|
||||
var (
|
||||
boolZero = pref.ValueOfBool(false)
|
||||
int32Zero = pref.ValueOfInt32(0)
|
||||
int64Zero = pref.ValueOfInt64(0)
|
||||
uint32Zero = pref.ValueOfUint32(0)
|
||||
uint64Zero = pref.ValueOfUint64(0)
|
||||
float32Zero = pref.ValueOfFloat32(0)
|
||||
float64Zero = pref.ValueOfFloat64(0)
|
||||
stringZero = pref.ValueOfString("")
|
||||
bytesZero = pref.ValueOfBytes(nil)
|
||||
boolZero = protoreflect.ValueOfBool(false)
|
||||
int32Zero = protoreflect.ValueOfInt32(0)
|
||||
int64Zero = protoreflect.ValueOfInt64(0)
|
||||
uint32Zero = protoreflect.ValueOfUint32(0)
|
||||
uint64Zero = protoreflect.ValueOfUint64(0)
|
||||
float32Zero = protoreflect.ValueOfFloat32(0)
|
||||
float64Zero = protoreflect.ValueOfFloat64(0)
|
||||
stringZero = protoreflect.ValueOfString("")
|
||||
bytesZero = protoreflect.ValueOfBytes(nil)
|
||||
)
|
||||
|
||||
func newSingularConverter(t reflect.Type, fd pref.FieldDescriptor) Converter {
|
||||
defVal := func(fd pref.FieldDescriptor, zero pref.Value) pref.Value {
|
||||
if fd.Cardinality() == pref.Repeated {
|
||||
func newSingularConverter(t reflect.Type, fd protoreflect.FieldDescriptor) Converter {
|
||||
defVal := func(fd protoreflect.FieldDescriptor, zero protoreflect.Value) protoreflect.Value {
|
||||
if fd.Cardinality() == protoreflect.Repeated {
|
||||
// Default isn't defined for repeated fields.
|
||||
return zero
|
||||
}
|
||||
return fd.Default()
|
||||
}
|
||||
switch fd.Kind() {
|
||||
case pref.BoolKind:
|
||||
case protoreflect.BoolKind:
|
||||
if t.Kind() == reflect.Bool {
|
||||
return &boolConverter{t, defVal(fd, boolZero)}
|
||||
}
|
||||
case pref.Int32Kind, pref.Sint32Kind, pref.Sfixed32Kind:
|
||||
case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
|
||||
if t.Kind() == reflect.Int32 {
|
||||
return &int32Converter{t, defVal(fd, int32Zero)}
|
||||
}
|
||||
case pref.Int64Kind, pref.Sint64Kind, pref.Sfixed64Kind:
|
||||
case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
|
||||
if t.Kind() == reflect.Int64 {
|
||||
return &int64Converter{t, defVal(fd, int64Zero)}
|
||||
}
|
||||
case pref.Uint32Kind, pref.Fixed32Kind:
|
||||
case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
|
||||
if t.Kind() == reflect.Uint32 {
|
||||
return &uint32Converter{t, defVal(fd, uint32Zero)}
|
||||
}
|
||||
case pref.Uint64Kind, pref.Fixed64Kind:
|
||||
case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
|
||||
if t.Kind() == reflect.Uint64 {
|
||||
return &uint64Converter{t, defVal(fd, uint64Zero)}
|
||||
}
|
||||
case pref.FloatKind:
|
||||
case protoreflect.FloatKind:
|
||||
if t.Kind() == reflect.Float32 {
|
||||
return &float32Converter{t, defVal(fd, float32Zero)}
|
||||
}
|
||||
case pref.DoubleKind:
|
||||
case protoreflect.DoubleKind:
|
||||
if t.Kind() == reflect.Float64 {
|
||||
return &float64Converter{t, defVal(fd, float64Zero)}
|
||||
}
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
if t.Kind() == reflect.String || (t.Kind() == reflect.Slice && t.Elem() == byteType) {
|
||||
return &stringConverter{t, defVal(fd, stringZero)}
|
||||
}
|
||||
case pref.BytesKind:
|
||||
case protoreflect.BytesKind:
|
||||
if t.Kind() == reflect.String || (t.Kind() == reflect.Slice && t.Elem() == byteType) {
|
||||
return &bytesConverter{t, defVal(fd, bytesZero)}
|
||||
}
|
||||
case pref.EnumKind:
|
||||
case protoreflect.EnumKind:
|
||||
// Handle enums, which must be a named int32 type.
|
||||
if t.Kind() == reflect.Int32 {
|
||||
return newEnumConverter(t, fd)
|
||||
}
|
||||
case pref.MessageKind, pref.GroupKind:
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
return newMessageConverter(t)
|
||||
}
|
||||
panic(fmt.Sprintf("invalid Go type %v for field %v", t, fd.FullName()))
|
||||
@@ -145,184 +144,184 @@ func newSingularConverter(t reflect.Type, fd pref.FieldDescriptor) Converter {
|
||||
|
||||
type boolConverter struct {
|
||||
goType reflect.Type
|
||||
def pref.Value
|
||||
def protoreflect.Value
|
||||
}
|
||||
|
||||
func (c *boolConverter) PBValueOf(v reflect.Value) pref.Value {
|
||||
func (c *boolConverter) PBValueOf(v reflect.Value) protoreflect.Value {
|
||||
if v.Type() != c.goType {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType))
|
||||
}
|
||||
return pref.ValueOfBool(v.Bool())
|
||||
return protoreflect.ValueOfBool(v.Bool())
|
||||
}
|
||||
func (c *boolConverter) GoValueOf(v pref.Value) reflect.Value {
|
||||
func (c *boolConverter) GoValueOf(v protoreflect.Value) reflect.Value {
|
||||
return reflect.ValueOf(v.Bool()).Convert(c.goType)
|
||||
}
|
||||
func (c *boolConverter) IsValidPB(v pref.Value) bool {
|
||||
func (c *boolConverter) IsValidPB(v protoreflect.Value) bool {
|
||||
_, ok := v.Interface().(bool)
|
||||
return ok
|
||||
}
|
||||
func (c *boolConverter) IsValidGo(v reflect.Value) bool {
|
||||
return v.IsValid() && v.Type() == c.goType
|
||||
}
|
||||
func (c *boolConverter) New() pref.Value { return c.def }
|
||||
func (c *boolConverter) Zero() pref.Value { return c.def }
|
||||
func (c *boolConverter) New() protoreflect.Value { return c.def }
|
||||
func (c *boolConverter) Zero() protoreflect.Value { return c.def }
|
||||
|
||||
type int32Converter struct {
|
||||
goType reflect.Type
|
||||
def pref.Value
|
||||
def protoreflect.Value
|
||||
}
|
||||
|
||||
func (c *int32Converter) PBValueOf(v reflect.Value) pref.Value {
|
||||
func (c *int32Converter) PBValueOf(v reflect.Value) protoreflect.Value {
|
||||
if v.Type() != c.goType {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType))
|
||||
}
|
||||
return pref.ValueOfInt32(int32(v.Int()))
|
||||
return protoreflect.ValueOfInt32(int32(v.Int()))
|
||||
}
|
||||
func (c *int32Converter) GoValueOf(v pref.Value) reflect.Value {
|
||||
func (c *int32Converter) GoValueOf(v protoreflect.Value) reflect.Value {
|
||||
return reflect.ValueOf(int32(v.Int())).Convert(c.goType)
|
||||
}
|
||||
func (c *int32Converter) IsValidPB(v pref.Value) bool {
|
||||
func (c *int32Converter) IsValidPB(v protoreflect.Value) bool {
|
||||
_, ok := v.Interface().(int32)
|
||||
return ok
|
||||
}
|
||||
func (c *int32Converter) IsValidGo(v reflect.Value) bool {
|
||||
return v.IsValid() && v.Type() == c.goType
|
||||
}
|
||||
func (c *int32Converter) New() pref.Value { return c.def }
|
||||
func (c *int32Converter) Zero() pref.Value { return c.def }
|
||||
func (c *int32Converter) New() protoreflect.Value { return c.def }
|
||||
func (c *int32Converter) Zero() protoreflect.Value { return c.def }
|
||||
|
||||
type int64Converter struct {
|
||||
goType reflect.Type
|
||||
def pref.Value
|
||||
def protoreflect.Value
|
||||
}
|
||||
|
||||
func (c *int64Converter) PBValueOf(v reflect.Value) pref.Value {
|
||||
func (c *int64Converter) PBValueOf(v reflect.Value) protoreflect.Value {
|
||||
if v.Type() != c.goType {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType))
|
||||
}
|
||||
return pref.ValueOfInt64(int64(v.Int()))
|
||||
return protoreflect.ValueOfInt64(int64(v.Int()))
|
||||
}
|
||||
func (c *int64Converter) GoValueOf(v pref.Value) reflect.Value {
|
||||
func (c *int64Converter) GoValueOf(v protoreflect.Value) reflect.Value {
|
||||
return reflect.ValueOf(int64(v.Int())).Convert(c.goType)
|
||||
}
|
||||
func (c *int64Converter) IsValidPB(v pref.Value) bool {
|
||||
func (c *int64Converter) IsValidPB(v protoreflect.Value) bool {
|
||||
_, ok := v.Interface().(int64)
|
||||
return ok
|
||||
}
|
||||
func (c *int64Converter) IsValidGo(v reflect.Value) bool {
|
||||
return v.IsValid() && v.Type() == c.goType
|
||||
}
|
||||
func (c *int64Converter) New() pref.Value { return c.def }
|
||||
func (c *int64Converter) Zero() pref.Value { return c.def }
|
||||
func (c *int64Converter) New() protoreflect.Value { return c.def }
|
||||
func (c *int64Converter) Zero() protoreflect.Value { return c.def }
|
||||
|
||||
type uint32Converter struct {
|
||||
goType reflect.Type
|
||||
def pref.Value
|
||||
def protoreflect.Value
|
||||
}
|
||||
|
||||
func (c *uint32Converter) PBValueOf(v reflect.Value) pref.Value {
|
||||
func (c *uint32Converter) PBValueOf(v reflect.Value) protoreflect.Value {
|
||||
if v.Type() != c.goType {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType))
|
||||
}
|
||||
return pref.ValueOfUint32(uint32(v.Uint()))
|
||||
return protoreflect.ValueOfUint32(uint32(v.Uint()))
|
||||
}
|
||||
func (c *uint32Converter) GoValueOf(v pref.Value) reflect.Value {
|
||||
func (c *uint32Converter) GoValueOf(v protoreflect.Value) reflect.Value {
|
||||
return reflect.ValueOf(uint32(v.Uint())).Convert(c.goType)
|
||||
}
|
||||
func (c *uint32Converter) IsValidPB(v pref.Value) bool {
|
||||
func (c *uint32Converter) IsValidPB(v protoreflect.Value) bool {
|
||||
_, ok := v.Interface().(uint32)
|
||||
return ok
|
||||
}
|
||||
func (c *uint32Converter) IsValidGo(v reflect.Value) bool {
|
||||
return v.IsValid() && v.Type() == c.goType
|
||||
}
|
||||
func (c *uint32Converter) New() pref.Value { return c.def }
|
||||
func (c *uint32Converter) Zero() pref.Value { return c.def }
|
||||
func (c *uint32Converter) New() protoreflect.Value { return c.def }
|
||||
func (c *uint32Converter) Zero() protoreflect.Value { return c.def }
|
||||
|
||||
type uint64Converter struct {
|
||||
goType reflect.Type
|
||||
def pref.Value
|
||||
def protoreflect.Value
|
||||
}
|
||||
|
||||
func (c *uint64Converter) PBValueOf(v reflect.Value) pref.Value {
|
||||
func (c *uint64Converter) PBValueOf(v reflect.Value) protoreflect.Value {
|
||||
if v.Type() != c.goType {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType))
|
||||
}
|
||||
return pref.ValueOfUint64(uint64(v.Uint()))
|
||||
return protoreflect.ValueOfUint64(uint64(v.Uint()))
|
||||
}
|
||||
func (c *uint64Converter) GoValueOf(v pref.Value) reflect.Value {
|
||||
func (c *uint64Converter) GoValueOf(v protoreflect.Value) reflect.Value {
|
||||
return reflect.ValueOf(uint64(v.Uint())).Convert(c.goType)
|
||||
}
|
||||
func (c *uint64Converter) IsValidPB(v pref.Value) bool {
|
||||
func (c *uint64Converter) IsValidPB(v protoreflect.Value) bool {
|
||||
_, ok := v.Interface().(uint64)
|
||||
return ok
|
||||
}
|
||||
func (c *uint64Converter) IsValidGo(v reflect.Value) bool {
|
||||
return v.IsValid() && v.Type() == c.goType
|
||||
}
|
||||
func (c *uint64Converter) New() pref.Value { return c.def }
|
||||
func (c *uint64Converter) Zero() pref.Value { return c.def }
|
||||
func (c *uint64Converter) New() protoreflect.Value { return c.def }
|
||||
func (c *uint64Converter) Zero() protoreflect.Value { return c.def }
|
||||
|
||||
type float32Converter struct {
|
||||
goType reflect.Type
|
||||
def pref.Value
|
||||
def protoreflect.Value
|
||||
}
|
||||
|
||||
func (c *float32Converter) PBValueOf(v reflect.Value) pref.Value {
|
||||
func (c *float32Converter) PBValueOf(v reflect.Value) protoreflect.Value {
|
||||
if v.Type() != c.goType {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType))
|
||||
}
|
||||
return pref.ValueOfFloat32(float32(v.Float()))
|
||||
return protoreflect.ValueOfFloat32(float32(v.Float()))
|
||||
}
|
||||
func (c *float32Converter) GoValueOf(v pref.Value) reflect.Value {
|
||||
func (c *float32Converter) GoValueOf(v protoreflect.Value) reflect.Value {
|
||||
return reflect.ValueOf(float32(v.Float())).Convert(c.goType)
|
||||
}
|
||||
func (c *float32Converter) IsValidPB(v pref.Value) bool {
|
||||
func (c *float32Converter) IsValidPB(v protoreflect.Value) bool {
|
||||
_, ok := v.Interface().(float32)
|
||||
return ok
|
||||
}
|
||||
func (c *float32Converter) IsValidGo(v reflect.Value) bool {
|
||||
return v.IsValid() && v.Type() == c.goType
|
||||
}
|
||||
func (c *float32Converter) New() pref.Value { return c.def }
|
||||
func (c *float32Converter) Zero() pref.Value { return c.def }
|
||||
func (c *float32Converter) New() protoreflect.Value { return c.def }
|
||||
func (c *float32Converter) Zero() protoreflect.Value { return c.def }
|
||||
|
||||
type float64Converter struct {
|
||||
goType reflect.Type
|
||||
def pref.Value
|
||||
def protoreflect.Value
|
||||
}
|
||||
|
||||
func (c *float64Converter) PBValueOf(v reflect.Value) pref.Value {
|
||||
func (c *float64Converter) PBValueOf(v reflect.Value) protoreflect.Value {
|
||||
if v.Type() != c.goType {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType))
|
||||
}
|
||||
return pref.ValueOfFloat64(float64(v.Float()))
|
||||
return protoreflect.ValueOfFloat64(float64(v.Float()))
|
||||
}
|
||||
func (c *float64Converter) GoValueOf(v pref.Value) reflect.Value {
|
||||
func (c *float64Converter) GoValueOf(v protoreflect.Value) reflect.Value {
|
||||
return reflect.ValueOf(float64(v.Float())).Convert(c.goType)
|
||||
}
|
||||
func (c *float64Converter) IsValidPB(v pref.Value) bool {
|
||||
func (c *float64Converter) IsValidPB(v protoreflect.Value) bool {
|
||||
_, ok := v.Interface().(float64)
|
||||
return ok
|
||||
}
|
||||
func (c *float64Converter) IsValidGo(v reflect.Value) bool {
|
||||
return v.IsValid() && v.Type() == c.goType
|
||||
}
|
||||
func (c *float64Converter) New() pref.Value { return c.def }
|
||||
func (c *float64Converter) Zero() pref.Value { return c.def }
|
||||
func (c *float64Converter) New() protoreflect.Value { return c.def }
|
||||
func (c *float64Converter) Zero() protoreflect.Value { return c.def }
|
||||
|
||||
type stringConverter struct {
|
||||
goType reflect.Type
|
||||
def pref.Value
|
||||
def protoreflect.Value
|
||||
}
|
||||
|
||||
func (c *stringConverter) PBValueOf(v reflect.Value) pref.Value {
|
||||
func (c *stringConverter) PBValueOf(v reflect.Value) protoreflect.Value {
|
||||
if v.Type() != c.goType {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType))
|
||||
}
|
||||
return pref.ValueOfString(v.Convert(stringType).String())
|
||||
return protoreflect.ValueOfString(v.Convert(stringType).String())
|
||||
}
|
||||
func (c *stringConverter) GoValueOf(v pref.Value) reflect.Value {
|
||||
func (c *stringConverter) GoValueOf(v protoreflect.Value) reflect.Value {
|
||||
// pref.Value.String never panics, so we go through an interface
|
||||
// conversion here to check the type.
|
||||
s := v.Interface().(string)
|
||||
@@ -331,71 +330,71 @@ func (c *stringConverter) GoValueOf(v pref.Value) reflect.Value {
|
||||
}
|
||||
return reflect.ValueOf(s).Convert(c.goType)
|
||||
}
|
||||
func (c *stringConverter) IsValidPB(v pref.Value) bool {
|
||||
func (c *stringConverter) IsValidPB(v protoreflect.Value) bool {
|
||||
_, ok := v.Interface().(string)
|
||||
return ok
|
||||
}
|
||||
func (c *stringConverter) IsValidGo(v reflect.Value) bool {
|
||||
return v.IsValid() && v.Type() == c.goType
|
||||
}
|
||||
func (c *stringConverter) New() pref.Value { return c.def }
|
||||
func (c *stringConverter) Zero() pref.Value { return c.def }
|
||||
func (c *stringConverter) New() protoreflect.Value { return c.def }
|
||||
func (c *stringConverter) Zero() protoreflect.Value { return c.def }
|
||||
|
||||
type bytesConverter struct {
|
||||
goType reflect.Type
|
||||
def pref.Value
|
||||
def protoreflect.Value
|
||||
}
|
||||
|
||||
func (c *bytesConverter) PBValueOf(v reflect.Value) pref.Value {
|
||||
func (c *bytesConverter) PBValueOf(v reflect.Value) protoreflect.Value {
|
||||
if v.Type() != c.goType {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType))
|
||||
}
|
||||
if c.goType.Kind() == reflect.String && v.Len() == 0 {
|
||||
return pref.ValueOfBytes(nil) // ensure empty string is []byte(nil)
|
||||
return protoreflect.ValueOfBytes(nil) // ensure empty string is []byte(nil)
|
||||
}
|
||||
return pref.ValueOfBytes(v.Convert(bytesType).Bytes())
|
||||
return protoreflect.ValueOfBytes(v.Convert(bytesType).Bytes())
|
||||
}
|
||||
func (c *bytesConverter) GoValueOf(v pref.Value) reflect.Value {
|
||||
func (c *bytesConverter) GoValueOf(v protoreflect.Value) reflect.Value {
|
||||
return reflect.ValueOf(v.Bytes()).Convert(c.goType)
|
||||
}
|
||||
func (c *bytesConverter) IsValidPB(v pref.Value) bool {
|
||||
func (c *bytesConverter) IsValidPB(v protoreflect.Value) bool {
|
||||
_, ok := v.Interface().([]byte)
|
||||
return ok
|
||||
}
|
||||
func (c *bytesConverter) IsValidGo(v reflect.Value) bool {
|
||||
return v.IsValid() && v.Type() == c.goType
|
||||
}
|
||||
func (c *bytesConverter) New() pref.Value { return c.def }
|
||||
func (c *bytesConverter) Zero() pref.Value { return c.def }
|
||||
func (c *bytesConverter) New() protoreflect.Value { return c.def }
|
||||
func (c *bytesConverter) Zero() protoreflect.Value { return c.def }
|
||||
|
||||
type enumConverter struct {
|
||||
goType reflect.Type
|
||||
def pref.Value
|
||||
def protoreflect.Value
|
||||
}
|
||||
|
||||
func newEnumConverter(goType reflect.Type, fd pref.FieldDescriptor) Converter {
|
||||
var def pref.Value
|
||||
if fd.Cardinality() == pref.Repeated {
|
||||
def = pref.ValueOfEnum(fd.Enum().Values().Get(0).Number())
|
||||
func newEnumConverter(goType reflect.Type, fd protoreflect.FieldDescriptor) Converter {
|
||||
var def protoreflect.Value
|
||||
if fd.Cardinality() == protoreflect.Repeated {
|
||||
def = protoreflect.ValueOfEnum(fd.Enum().Values().Get(0).Number())
|
||||
} else {
|
||||
def = fd.Default()
|
||||
}
|
||||
return &enumConverter{goType, def}
|
||||
}
|
||||
|
||||
func (c *enumConverter) PBValueOf(v reflect.Value) pref.Value {
|
||||
func (c *enumConverter) PBValueOf(v reflect.Value) protoreflect.Value {
|
||||
if v.Type() != c.goType {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType))
|
||||
}
|
||||
return pref.ValueOfEnum(pref.EnumNumber(v.Int()))
|
||||
return protoreflect.ValueOfEnum(protoreflect.EnumNumber(v.Int()))
|
||||
}
|
||||
|
||||
func (c *enumConverter) GoValueOf(v pref.Value) reflect.Value {
|
||||
func (c *enumConverter) GoValueOf(v protoreflect.Value) reflect.Value {
|
||||
return reflect.ValueOf(v.Enum()).Convert(c.goType)
|
||||
}
|
||||
|
||||
func (c *enumConverter) IsValidPB(v pref.Value) bool {
|
||||
_, ok := v.Interface().(pref.EnumNumber)
|
||||
func (c *enumConverter) IsValidPB(v protoreflect.Value) bool {
|
||||
_, ok := v.Interface().(protoreflect.EnumNumber)
|
||||
return ok
|
||||
}
|
||||
|
||||
@@ -403,11 +402,11 @@ func (c *enumConverter) IsValidGo(v reflect.Value) bool {
|
||||
return v.IsValid() && v.Type() == c.goType
|
||||
}
|
||||
|
||||
func (c *enumConverter) New() pref.Value {
|
||||
func (c *enumConverter) New() protoreflect.Value {
|
||||
return c.def
|
||||
}
|
||||
|
||||
func (c *enumConverter) Zero() pref.Value {
|
||||
func (c *enumConverter) Zero() protoreflect.Value {
|
||||
return c.def
|
||||
}
|
||||
|
||||
@@ -419,7 +418,7 @@ func newMessageConverter(goType reflect.Type) Converter {
|
||||
return &messageConverter{goType}
|
||||
}
|
||||
|
||||
func (c *messageConverter) PBValueOf(v reflect.Value) pref.Value {
|
||||
func (c *messageConverter) PBValueOf(v reflect.Value) protoreflect.Value {
|
||||
if v.Type() != c.goType {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType))
|
||||
}
|
||||
@@ -430,13 +429,13 @@ func (c *messageConverter) PBValueOf(v reflect.Value) pref.Value {
|
||||
v = reflect.Zero(reflect.PtrTo(v.Type()))
|
||||
}
|
||||
}
|
||||
if m, ok := v.Interface().(pref.ProtoMessage); ok {
|
||||
return pref.ValueOfMessage(m.ProtoReflect())
|
||||
if m, ok := v.Interface().(protoreflect.ProtoMessage); ok {
|
||||
return protoreflect.ValueOfMessage(m.ProtoReflect())
|
||||
}
|
||||
return pref.ValueOfMessage(legacyWrapMessage(v))
|
||||
return protoreflect.ValueOfMessage(legacyWrapMessage(v))
|
||||
}
|
||||
|
||||
func (c *messageConverter) GoValueOf(v pref.Value) reflect.Value {
|
||||
func (c *messageConverter) GoValueOf(v protoreflect.Value) reflect.Value {
|
||||
m := v.Message()
|
||||
var rv reflect.Value
|
||||
if u, ok := m.(unwrapper); ok {
|
||||
@@ -460,7 +459,7 @@ func (c *messageConverter) GoValueOf(v pref.Value) reflect.Value {
|
||||
return rv
|
||||
}
|
||||
|
||||
func (c *messageConverter) IsValidPB(v pref.Value) bool {
|
||||
func (c *messageConverter) IsValidPB(v protoreflect.Value) bool {
|
||||
m := v.Message()
|
||||
var rv reflect.Value
|
||||
if u, ok := m.(unwrapper); ok {
|
||||
@@ -478,14 +477,14 @@ func (c *messageConverter) IsValidGo(v reflect.Value) bool {
|
||||
return v.IsValid() && v.Type() == c.goType
|
||||
}
|
||||
|
||||
func (c *messageConverter) New() pref.Value {
|
||||
func (c *messageConverter) New() protoreflect.Value {
|
||||
if c.isNonPointer() {
|
||||
return c.PBValueOf(reflect.New(c.goType).Elem())
|
||||
}
|
||||
return c.PBValueOf(reflect.New(c.goType.Elem()))
|
||||
}
|
||||
|
||||
func (c *messageConverter) Zero() pref.Value {
|
||||
func (c *messageConverter) Zero() protoreflect.Value {
|
||||
return c.PBValueOf(reflect.Zero(c.goType))
|
||||
}
|
||||
|
||||
|
||||
42
go/vendor/google.golang.org/protobuf/internal/impl/convert_list.go
generated
vendored
42
go/vendor/google.golang.org/protobuf/internal/impl/convert_list.go
generated
vendored
@@ -8,10 +8,10 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
func newListConverter(t reflect.Type, fd pref.FieldDescriptor) Converter {
|
||||
func newListConverter(t reflect.Type, fd protoreflect.FieldDescriptor) Converter {
|
||||
switch {
|
||||
case t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Slice:
|
||||
return &listPtrConverter{t, newSingularConverter(t.Elem().Elem(), fd)}
|
||||
@@ -26,16 +26,16 @@ type listConverter struct {
|
||||
c Converter
|
||||
}
|
||||
|
||||
func (c *listConverter) PBValueOf(v reflect.Value) pref.Value {
|
||||
func (c *listConverter) PBValueOf(v reflect.Value) protoreflect.Value {
|
||||
if v.Type() != c.goType {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType))
|
||||
}
|
||||
pv := reflect.New(c.goType)
|
||||
pv.Elem().Set(v)
|
||||
return pref.ValueOfList(&listReflect{pv, c.c})
|
||||
return protoreflect.ValueOfList(&listReflect{pv, c.c})
|
||||
}
|
||||
|
||||
func (c *listConverter) GoValueOf(v pref.Value) reflect.Value {
|
||||
func (c *listConverter) GoValueOf(v protoreflect.Value) reflect.Value {
|
||||
rv := v.List().(*listReflect).v
|
||||
if rv.IsNil() {
|
||||
return reflect.Zero(c.goType)
|
||||
@@ -43,7 +43,7 @@ func (c *listConverter) GoValueOf(v pref.Value) reflect.Value {
|
||||
return rv.Elem()
|
||||
}
|
||||
|
||||
func (c *listConverter) IsValidPB(v pref.Value) bool {
|
||||
func (c *listConverter) IsValidPB(v protoreflect.Value) bool {
|
||||
list, ok := v.Interface().(*listReflect)
|
||||
if !ok {
|
||||
return false
|
||||
@@ -55,12 +55,12 @@ func (c *listConverter) IsValidGo(v reflect.Value) bool {
|
||||
return v.IsValid() && v.Type() == c.goType
|
||||
}
|
||||
|
||||
func (c *listConverter) New() pref.Value {
|
||||
return pref.ValueOfList(&listReflect{reflect.New(c.goType), c.c})
|
||||
func (c *listConverter) New() protoreflect.Value {
|
||||
return protoreflect.ValueOfList(&listReflect{reflect.New(c.goType), c.c})
|
||||
}
|
||||
|
||||
func (c *listConverter) Zero() pref.Value {
|
||||
return pref.ValueOfList(&listReflect{reflect.Zero(reflect.PtrTo(c.goType)), c.c})
|
||||
func (c *listConverter) Zero() protoreflect.Value {
|
||||
return protoreflect.ValueOfList(&listReflect{reflect.Zero(reflect.PtrTo(c.goType)), c.c})
|
||||
}
|
||||
|
||||
type listPtrConverter struct {
|
||||
@@ -68,18 +68,18 @@ type listPtrConverter struct {
|
||||
c Converter
|
||||
}
|
||||
|
||||
func (c *listPtrConverter) PBValueOf(v reflect.Value) pref.Value {
|
||||
func (c *listPtrConverter) PBValueOf(v reflect.Value) protoreflect.Value {
|
||||
if v.Type() != c.goType {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType))
|
||||
}
|
||||
return pref.ValueOfList(&listReflect{v, c.c})
|
||||
return protoreflect.ValueOfList(&listReflect{v, c.c})
|
||||
}
|
||||
|
||||
func (c *listPtrConverter) GoValueOf(v pref.Value) reflect.Value {
|
||||
func (c *listPtrConverter) GoValueOf(v protoreflect.Value) reflect.Value {
|
||||
return v.List().(*listReflect).v
|
||||
}
|
||||
|
||||
func (c *listPtrConverter) IsValidPB(v pref.Value) bool {
|
||||
func (c *listPtrConverter) IsValidPB(v protoreflect.Value) bool {
|
||||
list, ok := v.Interface().(*listReflect)
|
||||
if !ok {
|
||||
return false
|
||||
@@ -91,11 +91,11 @@ func (c *listPtrConverter) IsValidGo(v reflect.Value) bool {
|
||||
return v.IsValid() && v.Type() == c.goType
|
||||
}
|
||||
|
||||
func (c *listPtrConverter) New() pref.Value {
|
||||
func (c *listPtrConverter) New() protoreflect.Value {
|
||||
return c.PBValueOf(reflect.New(c.goType.Elem()))
|
||||
}
|
||||
|
||||
func (c *listPtrConverter) Zero() pref.Value {
|
||||
func (c *listPtrConverter) Zero() protoreflect.Value {
|
||||
return c.PBValueOf(reflect.Zero(c.goType))
|
||||
}
|
||||
|
||||
@@ -110,16 +110,16 @@ func (ls *listReflect) Len() int {
|
||||
}
|
||||
return ls.v.Elem().Len()
|
||||
}
|
||||
func (ls *listReflect) Get(i int) pref.Value {
|
||||
func (ls *listReflect) Get(i int) protoreflect.Value {
|
||||
return ls.conv.PBValueOf(ls.v.Elem().Index(i))
|
||||
}
|
||||
func (ls *listReflect) Set(i int, v pref.Value) {
|
||||
func (ls *listReflect) Set(i int, v protoreflect.Value) {
|
||||
ls.v.Elem().Index(i).Set(ls.conv.GoValueOf(v))
|
||||
}
|
||||
func (ls *listReflect) Append(v pref.Value) {
|
||||
func (ls *listReflect) Append(v protoreflect.Value) {
|
||||
ls.v.Elem().Set(reflect.Append(ls.v.Elem(), ls.conv.GoValueOf(v)))
|
||||
}
|
||||
func (ls *listReflect) AppendMutable() pref.Value {
|
||||
func (ls *listReflect) AppendMutable() protoreflect.Value {
|
||||
if _, ok := ls.conv.(*messageConverter); !ok {
|
||||
panic("invalid AppendMutable on list with non-message type")
|
||||
}
|
||||
@@ -130,7 +130,7 @@ func (ls *listReflect) AppendMutable() pref.Value {
|
||||
func (ls *listReflect) Truncate(i int) {
|
||||
ls.v.Elem().Set(ls.v.Elem().Slice(0, i))
|
||||
}
|
||||
func (ls *listReflect) NewElement() pref.Value {
|
||||
func (ls *listReflect) NewElement() protoreflect.Value {
|
||||
return ls.conv.New()
|
||||
}
|
||||
func (ls *listReflect) IsValid() bool {
|
||||
|
||||
32
go/vendor/google.golang.org/protobuf/internal/impl/convert_map.go
generated
vendored
32
go/vendor/google.golang.org/protobuf/internal/impl/convert_map.go
generated
vendored
@@ -8,7 +8,7 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
type mapConverter struct {
|
||||
@@ -16,7 +16,7 @@ type mapConverter struct {
|
||||
keyConv, valConv Converter
|
||||
}
|
||||
|
||||
func newMapConverter(t reflect.Type, fd pref.FieldDescriptor) *mapConverter {
|
||||
func newMapConverter(t reflect.Type, fd protoreflect.FieldDescriptor) *mapConverter {
|
||||
if t.Kind() != reflect.Map {
|
||||
panic(fmt.Sprintf("invalid Go type %v for field %v", t, fd.FullName()))
|
||||
}
|
||||
@@ -27,18 +27,18 @@ func newMapConverter(t reflect.Type, fd pref.FieldDescriptor) *mapConverter {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *mapConverter) PBValueOf(v reflect.Value) pref.Value {
|
||||
func (c *mapConverter) PBValueOf(v reflect.Value) protoreflect.Value {
|
||||
if v.Type() != c.goType {
|
||||
panic(fmt.Sprintf("invalid type: got %v, want %v", v.Type(), c.goType))
|
||||
}
|
||||
return pref.ValueOfMap(&mapReflect{v, c.keyConv, c.valConv})
|
||||
return protoreflect.ValueOfMap(&mapReflect{v, c.keyConv, c.valConv})
|
||||
}
|
||||
|
||||
func (c *mapConverter) GoValueOf(v pref.Value) reflect.Value {
|
||||
func (c *mapConverter) GoValueOf(v protoreflect.Value) reflect.Value {
|
||||
return v.Map().(*mapReflect).v
|
||||
}
|
||||
|
||||
func (c *mapConverter) IsValidPB(v pref.Value) bool {
|
||||
func (c *mapConverter) IsValidPB(v protoreflect.Value) bool {
|
||||
mapv, ok := v.Interface().(*mapReflect)
|
||||
if !ok {
|
||||
return false
|
||||
@@ -50,11 +50,11 @@ func (c *mapConverter) IsValidGo(v reflect.Value) bool {
|
||||
return v.IsValid() && v.Type() == c.goType
|
||||
}
|
||||
|
||||
func (c *mapConverter) New() pref.Value {
|
||||
func (c *mapConverter) New() protoreflect.Value {
|
||||
return c.PBValueOf(reflect.MakeMap(c.goType))
|
||||
}
|
||||
|
||||
func (c *mapConverter) Zero() pref.Value {
|
||||
func (c *mapConverter) Zero() protoreflect.Value {
|
||||
return c.PBValueOf(reflect.Zero(c.goType))
|
||||
}
|
||||
|
||||
@@ -67,29 +67,29 @@ type mapReflect struct {
|
||||
func (ms *mapReflect) Len() int {
|
||||
return ms.v.Len()
|
||||
}
|
||||
func (ms *mapReflect) Has(k pref.MapKey) bool {
|
||||
func (ms *mapReflect) Has(k protoreflect.MapKey) bool {
|
||||
rk := ms.keyConv.GoValueOf(k.Value())
|
||||
rv := ms.v.MapIndex(rk)
|
||||
return rv.IsValid()
|
||||
}
|
||||
func (ms *mapReflect) Get(k pref.MapKey) pref.Value {
|
||||
func (ms *mapReflect) Get(k protoreflect.MapKey) protoreflect.Value {
|
||||
rk := ms.keyConv.GoValueOf(k.Value())
|
||||
rv := ms.v.MapIndex(rk)
|
||||
if !rv.IsValid() {
|
||||
return pref.Value{}
|
||||
return protoreflect.Value{}
|
||||
}
|
||||
return ms.valConv.PBValueOf(rv)
|
||||
}
|
||||
func (ms *mapReflect) Set(k pref.MapKey, v pref.Value) {
|
||||
func (ms *mapReflect) Set(k protoreflect.MapKey, v protoreflect.Value) {
|
||||
rk := ms.keyConv.GoValueOf(k.Value())
|
||||
rv := ms.valConv.GoValueOf(v)
|
||||
ms.v.SetMapIndex(rk, rv)
|
||||
}
|
||||
func (ms *mapReflect) Clear(k pref.MapKey) {
|
||||
func (ms *mapReflect) Clear(k protoreflect.MapKey) {
|
||||
rk := ms.keyConv.GoValueOf(k.Value())
|
||||
ms.v.SetMapIndex(rk, reflect.Value{})
|
||||
}
|
||||
func (ms *mapReflect) Mutable(k pref.MapKey) pref.Value {
|
||||
func (ms *mapReflect) Mutable(k protoreflect.MapKey) protoreflect.Value {
|
||||
if _, ok := ms.valConv.(*messageConverter); !ok {
|
||||
panic("invalid Mutable on map with non-message value type")
|
||||
}
|
||||
@@ -100,7 +100,7 @@ func (ms *mapReflect) Mutable(k pref.MapKey) pref.Value {
|
||||
}
|
||||
return v
|
||||
}
|
||||
func (ms *mapReflect) Range(f func(pref.MapKey, pref.Value) bool) {
|
||||
func (ms *mapReflect) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) {
|
||||
iter := mapRange(ms.v)
|
||||
for iter.Next() {
|
||||
k := ms.keyConv.PBValueOf(iter.Key()).MapKey()
|
||||
@@ -110,7 +110,7 @@ func (ms *mapReflect) Range(f func(pref.MapKey, pref.Value) bool) {
|
||||
}
|
||||
}
|
||||
}
|
||||
func (ms *mapReflect) NewValue() pref.Value {
|
||||
func (ms *mapReflect) NewValue() protoreflect.Value {
|
||||
return ms.valConv.New()
|
||||
}
|
||||
func (ms *mapReflect) IsValid() bool {
|
||||
|
||||
21
go/vendor/google.golang.org/protobuf/internal/impl/decode.go
generated
vendored
21
go/vendor/google.golang.org/protobuf/internal/impl/decode.go
generated
vendored
@@ -12,9 +12,8 @@ import (
|
||||
"google.golang.org/protobuf/internal/flags"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
preg "google.golang.org/protobuf/reflect/protoregistry"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
"google.golang.org/protobuf/runtime/protoiface"
|
||||
piface "google.golang.org/protobuf/runtime/protoiface"
|
||||
)
|
||||
|
||||
var errDecode = errors.New("cannot parse invalid wire-format data")
|
||||
@@ -38,14 +37,16 @@ func (o unmarshalOptions) Options() proto.UnmarshalOptions {
|
||||
}
|
||||
}
|
||||
|
||||
func (o unmarshalOptions) DiscardUnknown() bool { return o.flags&piface.UnmarshalDiscardUnknown != 0 }
|
||||
func (o unmarshalOptions) DiscardUnknown() bool {
|
||||
return o.flags&protoiface.UnmarshalDiscardUnknown != 0
|
||||
}
|
||||
|
||||
func (o unmarshalOptions) IsDefault() bool {
|
||||
return o.flags == 0 && o.resolver == preg.GlobalTypes
|
||||
return o.flags == 0 && o.resolver == protoregistry.GlobalTypes
|
||||
}
|
||||
|
||||
var lazyUnmarshalOptions = unmarshalOptions{
|
||||
resolver: preg.GlobalTypes,
|
||||
resolver: protoregistry.GlobalTypes,
|
||||
depth: protowire.DefaultRecursionLimit,
|
||||
}
|
||||
|
||||
@@ -55,7 +56,7 @@ type unmarshalOutput struct {
|
||||
}
|
||||
|
||||
// unmarshal is protoreflect.Methods.Unmarshal.
|
||||
func (mi *MessageInfo) unmarshal(in piface.UnmarshalInput) (piface.UnmarshalOutput, error) {
|
||||
func (mi *MessageInfo) unmarshal(in protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
||||
var p pointer
|
||||
if ms, ok := in.Message.(*messageState); ok {
|
||||
p = ms.pointer()
|
||||
@@ -67,11 +68,11 @@ func (mi *MessageInfo) unmarshal(in piface.UnmarshalInput) (piface.UnmarshalOutp
|
||||
resolver: in.Resolver,
|
||||
depth: in.Depth,
|
||||
})
|
||||
var flags piface.UnmarshalOutputFlags
|
||||
var flags protoiface.UnmarshalOutputFlags
|
||||
if out.initialized {
|
||||
flags |= piface.UnmarshalInitialized
|
||||
flags |= protoiface.UnmarshalInitialized
|
||||
}
|
||||
return piface.UnmarshalOutput{
|
||||
return protoiface.UnmarshalOutput{
|
||||
Flags: flags,
|
||||
}, err
|
||||
}
|
||||
@@ -210,7 +211,7 @@ func (mi *MessageInfo) unmarshalExtension(b []byte, num protowire.Number, wtyp p
|
||||
var err error
|
||||
xt, err = opts.resolver.FindExtensionByNumber(mi.Desc.FullName(), num)
|
||||
if err != nil {
|
||||
if err == preg.NotFound {
|
||||
if err == protoregistry.NotFound {
|
||||
return out, errUnknown
|
||||
}
|
||||
return out, errors.New("%v: unable to resolve extension %v: %v", mi.Desc.FullName(), num, err)
|
||||
|
||||
10
go/vendor/google.golang.org/protobuf/internal/impl/enum.go
generated
vendored
10
go/vendor/google.golang.org/protobuf/internal/impl/enum.go
generated
vendored
@@ -7,15 +7,15 @@ package impl
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
type EnumInfo struct {
|
||||
GoReflectType reflect.Type // int32 kind
|
||||
Desc pref.EnumDescriptor
|
||||
Desc protoreflect.EnumDescriptor
|
||||
}
|
||||
|
||||
func (t *EnumInfo) New(n pref.EnumNumber) pref.Enum {
|
||||
return reflect.ValueOf(n).Convert(t.GoReflectType).Interface().(pref.Enum)
|
||||
func (t *EnumInfo) New(n protoreflect.EnumNumber) protoreflect.Enum {
|
||||
return reflect.ValueOf(n).Convert(t.GoReflectType).Interface().(protoreflect.Enum)
|
||||
}
|
||||
func (t *EnumInfo) Descriptor() pref.EnumDescriptor { return t.Desc }
|
||||
func (t *EnumInfo) Descriptor() protoreflect.EnumDescriptor { return t.Desc }
|
||||
|
||||
26
go/vendor/google.golang.org/protobuf/internal/impl/extension.go
generated
vendored
26
go/vendor/google.golang.org/protobuf/internal/impl/extension.go
generated
vendored
@@ -9,8 +9,8 @@ import (
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
piface "google.golang.org/protobuf/runtime/protoiface"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/runtime/protoiface"
|
||||
)
|
||||
|
||||
// ExtensionInfo implements ExtensionType.
|
||||
@@ -45,7 +45,7 @@ type ExtensionInfo struct {
|
||||
// since the message may no longer implement the MessageV1 interface.
|
||||
//
|
||||
// Deprecated: Use the ExtendedType method instead.
|
||||
ExtendedType piface.MessageV1
|
||||
ExtendedType protoiface.MessageV1
|
||||
|
||||
// ExtensionType is the zero value of the extension type.
|
||||
//
|
||||
@@ -83,31 +83,31 @@ const (
|
||||
extensionInfoFullInit = 2
|
||||
)
|
||||
|
||||
func InitExtensionInfo(xi *ExtensionInfo, xd pref.ExtensionDescriptor, goType reflect.Type) {
|
||||
func InitExtensionInfo(xi *ExtensionInfo, xd protoreflect.ExtensionDescriptor, goType reflect.Type) {
|
||||
xi.goType = goType
|
||||
xi.desc = extensionTypeDescriptor{xd, xi}
|
||||
xi.init = extensionInfoDescInit
|
||||
}
|
||||
|
||||
func (xi *ExtensionInfo) New() pref.Value {
|
||||
func (xi *ExtensionInfo) New() protoreflect.Value {
|
||||
return xi.lazyInit().New()
|
||||
}
|
||||
func (xi *ExtensionInfo) Zero() pref.Value {
|
||||
func (xi *ExtensionInfo) Zero() protoreflect.Value {
|
||||
return xi.lazyInit().Zero()
|
||||
}
|
||||
func (xi *ExtensionInfo) ValueOf(v interface{}) pref.Value {
|
||||
func (xi *ExtensionInfo) ValueOf(v interface{}) protoreflect.Value {
|
||||
return xi.lazyInit().PBValueOf(reflect.ValueOf(v))
|
||||
}
|
||||
func (xi *ExtensionInfo) InterfaceOf(v pref.Value) interface{} {
|
||||
func (xi *ExtensionInfo) InterfaceOf(v protoreflect.Value) interface{} {
|
||||
return xi.lazyInit().GoValueOf(v).Interface()
|
||||
}
|
||||
func (xi *ExtensionInfo) IsValidValue(v pref.Value) bool {
|
||||
func (xi *ExtensionInfo) IsValidValue(v protoreflect.Value) bool {
|
||||
return xi.lazyInit().IsValidPB(v)
|
||||
}
|
||||
func (xi *ExtensionInfo) IsValidInterface(v interface{}) bool {
|
||||
return xi.lazyInit().IsValidGo(reflect.ValueOf(v))
|
||||
}
|
||||
func (xi *ExtensionInfo) TypeDescriptor() pref.ExtensionTypeDescriptor {
|
||||
func (xi *ExtensionInfo) TypeDescriptor() protoreflect.ExtensionTypeDescriptor {
|
||||
if atomic.LoadUint32(&xi.init) < extensionInfoDescInit {
|
||||
xi.lazyInitSlow()
|
||||
}
|
||||
@@ -144,13 +144,13 @@ func (xi *ExtensionInfo) lazyInitSlow() {
|
||||
}
|
||||
|
||||
type extensionTypeDescriptor struct {
|
||||
pref.ExtensionDescriptor
|
||||
protoreflect.ExtensionDescriptor
|
||||
xi *ExtensionInfo
|
||||
}
|
||||
|
||||
func (xtd *extensionTypeDescriptor) Type() pref.ExtensionType {
|
||||
func (xtd *extensionTypeDescriptor) Type() protoreflect.ExtensionType {
|
||||
return xtd.xi
|
||||
}
|
||||
func (xtd *extensionTypeDescriptor) Descriptor() pref.ExtensionDescriptor {
|
||||
func (xtd *extensionTypeDescriptor) Descriptor() protoreflect.ExtensionDescriptor {
|
||||
return xtd.ExtensionDescriptor
|
||||
}
|
||||
|
||||
57
go/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go
generated
vendored
57
go/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go
generated
vendored
@@ -13,13 +13,12 @@ import (
|
||||
"google.golang.org/protobuf/internal/filedesc"
|
||||
"google.golang.org/protobuf/internal/strs"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
// legacyEnumName returns the name of enums used in legacy code.
|
||||
// It is neither the protobuf full name nor the qualified Go name,
|
||||
// but rather an odd hybrid of both.
|
||||
func legacyEnumName(ed pref.EnumDescriptor) string {
|
||||
func legacyEnumName(ed protoreflect.EnumDescriptor) string {
|
||||
var protoPkg string
|
||||
enumName := string(ed.FullName())
|
||||
if fd := ed.ParentFile(); fd != nil {
|
||||
@@ -34,68 +33,68 @@ func legacyEnumName(ed pref.EnumDescriptor) string {
|
||||
|
||||
// legacyWrapEnum wraps v as a protoreflect.Enum,
|
||||
// where v must be a int32 kind and not implement the v2 API already.
|
||||
func legacyWrapEnum(v reflect.Value) pref.Enum {
|
||||
func legacyWrapEnum(v reflect.Value) protoreflect.Enum {
|
||||
et := legacyLoadEnumType(v.Type())
|
||||
return et.New(pref.EnumNumber(v.Int()))
|
||||
return et.New(protoreflect.EnumNumber(v.Int()))
|
||||
}
|
||||
|
||||
var legacyEnumTypeCache sync.Map // map[reflect.Type]protoreflect.EnumType
|
||||
|
||||
// legacyLoadEnumType dynamically loads a protoreflect.EnumType for t,
|
||||
// where t must be an int32 kind and not implement the v2 API already.
|
||||
func legacyLoadEnumType(t reflect.Type) pref.EnumType {
|
||||
func legacyLoadEnumType(t reflect.Type) protoreflect.EnumType {
|
||||
// Fast-path: check if a EnumType is cached for this concrete type.
|
||||
if et, ok := legacyEnumTypeCache.Load(t); ok {
|
||||
return et.(pref.EnumType)
|
||||
return et.(protoreflect.EnumType)
|
||||
}
|
||||
|
||||
// Slow-path: derive enum descriptor and initialize EnumType.
|
||||
var et pref.EnumType
|
||||
var et protoreflect.EnumType
|
||||
ed := LegacyLoadEnumDesc(t)
|
||||
et = &legacyEnumType{
|
||||
desc: ed,
|
||||
goType: t,
|
||||
}
|
||||
if et, ok := legacyEnumTypeCache.LoadOrStore(t, et); ok {
|
||||
return et.(pref.EnumType)
|
||||
return et.(protoreflect.EnumType)
|
||||
}
|
||||
return et
|
||||
}
|
||||
|
||||
type legacyEnumType struct {
|
||||
desc pref.EnumDescriptor
|
||||
desc protoreflect.EnumDescriptor
|
||||
goType reflect.Type
|
||||
m sync.Map // map[protoreflect.EnumNumber]proto.Enum
|
||||
}
|
||||
|
||||
func (t *legacyEnumType) New(n pref.EnumNumber) pref.Enum {
|
||||
func (t *legacyEnumType) New(n protoreflect.EnumNumber) protoreflect.Enum {
|
||||
if e, ok := t.m.Load(n); ok {
|
||||
return e.(pref.Enum)
|
||||
return e.(protoreflect.Enum)
|
||||
}
|
||||
e := &legacyEnumWrapper{num: n, pbTyp: t, goTyp: t.goType}
|
||||
t.m.Store(n, e)
|
||||
return e
|
||||
}
|
||||
func (t *legacyEnumType) Descriptor() pref.EnumDescriptor {
|
||||
func (t *legacyEnumType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return t.desc
|
||||
}
|
||||
|
||||
type legacyEnumWrapper struct {
|
||||
num pref.EnumNumber
|
||||
pbTyp pref.EnumType
|
||||
num protoreflect.EnumNumber
|
||||
pbTyp protoreflect.EnumType
|
||||
goTyp reflect.Type
|
||||
}
|
||||
|
||||
func (e *legacyEnumWrapper) Descriptor() pref.EnumDescriptor {
|
||||
func (e *legacyEnumWrapper) Descriptor() protoreflect.EnumDescriptor {
|
||||
return e.pbTyp.Descriptor()
|
||||
}
|
||||
func (e *legacyEnumWrapper) Type() pref.EnumType {
|
||||
func (e *legacyEnumWrapper) Type() protoreflect.EnumType {
|
||||
return e.pbTyp
|
||||
}
|
||||
func (e *legacyEnumWrapper) Number() pref.EnumNumber {
|
||||
func (e *legacyEnumWrapper) Number() protoreflect.EnumNumber {
|
||||
return e.num
|
||||
}
|
||||
func (e *legacyEnumWrapper) ProtoReflect() pref.Enum {
|
||||
func (e *legacyEnumWrapper) ProtoReflect() protoreflect.Enum {
|
||||
return e
|
||||
}
|
||||
func (e *legacyEnumWrapper) protoUnwrap() interface{} {
|
||||
@@ -105,8 +104,8 @@ func (e *legacyEnumWrapper) protoUnwrap() interface{} {
|
||||
}
|
||||
|
||||
var (
|
||||
_ pref.Enum = (*legacyEnumWrapper)(nil)
|
||||
_ unwrapper = (*legacyEnumWrapper)(nil)
|
||||
_ protoreflect.Enum = (*legacyEnumWrapper)(nil)
|
||||
_ unwrapper = (*legacyEnumWrapper)(nil)
|
||||
)
|
||||
|
||||
var legacyEnumDescCache sync.Map // map[reflect.Type]protoreflect.EnumDescriptor
|
||||
@@ -115,15 +114,15 @@ var legacyEnumDescCache sync.Map // map[reflect.Type]protoreflect.EnumDescriptor
|
||||
// which must be an int32 kind and not implement the v2 API already.
|
||||
//
|
||||
// This is exported for testing purposes.
|
||||
func LegacyLoadEnumDesc(t reflect.Type) pref.EnumDescriptor {
|
||||
func LegacyLoadEnumDesc(t reflect.Type) protoreflect.EnumDescriptor {
|
||||
// Fast-path: check if an EnumDescriptor is cached for this concrete type.
|
||||
if ed, ok := legacyEnumDescCache.Load(t); ok {
|
||||
return ed.(pref.EnumDescriptor)
|
||||
return ed.(protoreflect.EnumDescriptor)
|
||||
}
|
||||
|
||||
// Slow-path: initialize EnumDescriptor from the raw descriptor.
|
||||
ev := reflect.Zero(t).Interface()
|
||||
if _, ok := ev.(pref.Enum); ok {
|
||||
if _, ok := ev.(protoreflect.Enum); ok {
|
||||
panic(fmt.Sprintf("%v already implements proto.Enum", t))
|
||||
}
|
||||
edV1, ok := ev.(enumV1)
|
||||
@@ -132,7 +131,7 @@ func LegacyLoadEnumDesc(t reflect.Type) pref.EnumDescriptor {
|
||||
}
|
||||
b, idxs := edV1.EnumDescriptor()
|
||||
|
||||
var ed pref.EnumDescriptor
|
||||
var ed protoreflect.EnumDescriptor
|
||||
if len(idxs) == 1 {
|
||||
ed = legacyLoadFileDesc(b).Enums().Get(idxs[0])
|
||||
} else {
|
||||
@@ -158,10 +157,10 @@ var aberrantEnumDescCache sync.Map // map[reflect.Type]protoreflect.EnumDescript
|
||||
// We are unable to use the global enum registry since it is
|
||||
// unfortunately keyed by the protobuf full name, which we also do not know.
|
||||
// Thus, this produces some bogus enum descriptor based on the Go type name.
|
||||
func aberrantLoadEnumDesc(t reflect.Type) pref.EnumDescriptor {
|
||||
func aberrantLoadEnumDesc(t reflect.Type) protoreflect.EnumDescriptor {
|
||||
// Fast-path: check if an EnumDescriptor is cached for this concrete type.
|
||||
if ed, ok := aberrantEnumDescCache.Load(t); ok {
|
||||
return ed.(pref.EnumDescriptor)
|
||||
return ed.(protoreflect.EnumDescriptor)
|
||||
}
|
||||
|
||||
// Slow-path: construct a bogus, but unique EnumDescriptor.
|
||||
@@ -182,7 +181,7 @@ func aberrantLoadEnumDesc(t reflect.Type) pref.EnumDescriptor {
|
||||
// An exhaustive query is clearly impractical, but can be best-effort.
|
||||
|
||||
if ed, ok := aberrantEnumDescCache.LoadOrStore(t, ed); ok {
|
||||
return ed.(pref.EnumDescriptor)
|
||||
return ed.(protoreflect.EnumDescriptor)
|
||||
}
|
||||
return ed
|
||||
}
|
||||
@@ -192,7 +191,7 @@ func aberrantLoadEnumDesc(t reflect.Type) pref.EnumDescriptor {
|
||||
// It should be sufficiently unique within a program.
|
||||
//
|
||||
// This is exported for testing purposes.
|
||||
func AberrantDeriveFullName(t reflect.Type) pref.FullName {
|
||||
func AberrantDeriveFullName(t reflect.Type) protoreflect.FullName {
|
||||
sanitize := func(r rune) rune {
|
||||
switch {
|
||||
case r == '/':
|
||||
@@ -215,5 +214,5 @@ func AberrantDeriveFullName(t reflect.Type) pref.FullName {
|
||||
ss[i] = "x" + s
|
||||
}
|
||||
}
|
||||
return pref.FullName(strings.Join(ss, "."))
|
||||
return protoreflect.FullName(strings.Join(ss, "."))
|
||||
}
|
||||
|
||||
18
go/vendor/google.golang.org/protobuf/internal/impl/legacy_export.go
generated
vendored
18
go/vendor/google.golang.org/protobuf/internal/impl/legacy_export.go
generated
vendored
@@ -12,21 +12,21 @@ import (
|
||||
"reflect"
|
||||
|
||||
"google.golang.org/protobuf/internal/errors"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
piface "google.golang.org/protobuf/runtime/protoiface"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/runtime/protoiface"
|
||||
)
|
||||
|
||||
// These functions exist to support exported APIs in generated protobufs.
|
||||
// While these are deprecated, they cannot be removed for compatibility reasons.
|
||||
|
||||
// LegacyEnumName returns the name of enums used in legacy code.
|
||||
func (Export) LegacyEnumName(ed pref.EnumDescriptor) string {
|
||||
func (Export) LegacyEnumName(ed protoreflect.EnumDescriptor) string {
|
||||
return legacyEnumName(ed)
|
||||
}
|
||||
|
||||
// LegacyMessageTypeOf returns the protoreflect.MessageType for m,
|
||||
// with name used as the message name if necessary.
|
||||
func (Export) LegacyMessageTypeOf(m piface.MessageV1, name pref.FullName) pref.MessageType {
|
||||
func (Export) LegacyMessageTypeOf(m protoiface.MessageV1, name protoreflect.FullName) protoreflect.MessageType {
|
||||
if mv := (Export{}).protoMessageV2Of(m); mv != nil {
|
||||
return mv.ProtoReflect().Type()
|
||||
}
|
||||
@@ -36,9 +36,9 @@ func (Export) LegacyMessageTypeOf(m piface.MessageV1, name pref.FullName) pref.M
|
||||
// UnmarshalJSONEnum unmarshals an enum from a JSON-encoded input.
|
||||
// The input can either be a string representing the enum value by name,
|
||||
// or a number representing the enum number itself.
|
||||
func (Export) UnmarshalJSONEnum(ed pref.EnumDescriptor, b []byte) (pref.EnumNumber, error) {
|
||||
func (Export) UnmarshalJSONEnum(ed protoreflect.EnumDescriptor, b []byte) (protoreflect.EnumNumber, error) {
|
||||
if b[0] == '"' {
|
||||
var name pref.Name
|
||||
var name protoreflect.Name
|
||||
if err := json.Unmarshal(b, &name); err != nil {
|
||||
return 0, errors.New("invalid input for enum %v: %s", ed.FullName(), b)
|
||||
}
|
||||
@@ -48,7 +48,7 @@ func (Export) UnmarshalJSONEnum(ed pref.EnumDescriptor, b []byte) (pref.EnumNumb
|
||||
}
|
||||
return ev.Number(), nil
|
||||
} else {
|
||||
var num pref.EnumNumber
|
||||
var num protoreflect.EnumNumber
|
||||
if err := json.Unmarshal(b, &num); err != nil {
|
||||
return 0, errors.New("invalid input for enum %v: %s", ed.FullName(), b)
|
||||
}
|
||||
@@ -81,8 +81,8 @@ func (Export) CompressGZIP(in []byte) (out []byte) {
|
||||
blockHeader[0] = 0x01 // final bit per RFC 1951, section 3.2.3.
|
||||
blockSize = len(in)
|
||||
}
|
||||
binary.LittleEndian.PutUint16(blockHeader[1:3], uint16(blockSize)^0x0000)
|
||||
binary.LittleEndian.PutUint16(blockHeader[3:5], uint16(blockSize)^0xffff)
|
||||
binary.LittleEndian.PutUint16(blockHeader[1:3], uint16(blockSize))
|
||||
binary.LittleEndian.PutUint16(blockHeader[3:5], ^uint16(blockSize))
|
||||
out = append(out, blockHeader[:]...)
|
||||
out = append(out, in[:blockSize]...)
|
||||
in = in[blockSize:]
|
||||
|
||||
100
go/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go
generated
vendored
100
go/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go
generated
vendored
@@ -12,16 +12,16 @@ import (
|
||||
ptag "google.golang.org/protobuf/internal/encoding/tag"
|
||||
"google.golang.org/protobuf/internal/filedesc"
|
||||
"google.golang.org/protobuf/internal/pragma"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
preg "google.golang.org/protobuf/reflect/protoregistry"
|
||||
piface "google.golang.org/protobuf/runtime/protoiface"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
"google.golang.org/protobuf/runtime/protoiface"
|
||||
)
|
||||
|
||||
func (xi *ExtensionInfo) initToLegacy() {
|
||||
xd := xi.desc
|
||||
var parent piface.MessageV1
|
||||
var parent protoiface.MessageV1
|
||||
messageName := xd.ContainingMessage().FullName()
|
||||
if mt, _ := preg.GlobalTypes.FindMessageByName(messageName); mt != nil {
|
||||
if mt, _ := protoregistry.GlobalTypes.FindMessageByName(messageName); mt != nil {
|
||||
// Create a new parent message and unwrap it if possible.
|
||||
mv := mt.New().Interface()
|
||||
t := reflect.TypeOf(mv)
|
||||
@@ -31,7 +31,7 @@ func (xi *ExtensionInfo) initToLegacy() {
|
||||
|
||||
// Check whether the message implements the legacy v1 Message interface.
|
||||
mz := reflect.Zero(t).Interface()
|
||||
if mz, ok := mz.(piface.MessageV1); ok {
|
||||
if mz, ok := mz.(protoiface.MessageV1); ok {
|
||||
parent = mz
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ func (xi *ExtensionInfo) initToLegacy() {
|
||||
|
||||
// Reconstruct the legacy enum full name.
|
||||
var enumName string
|
||||
if xd.Kind() == pref.EnumKind {
|
||||
if xd.Kind() == protoreflect.EnumKind {
|
||||
enumName = legacyEnumName(xd.Enum())
|
||||
}
|
||||
|
||||
@@ -77,16 +77,16 @@ func (xi *ExtensionInfo) initFromLegacy() {
|
||||
// field number is specified. In such a case, use a placeholder.
|
||||
if xi.ExtendedType == nil || xi.ExtensionType == nil {
|
||||
xd := placeholderExtension{
|
||||
name: pref.FullName(xi.Name),
|
||||
number: pref.FieldNumber(xi.Field),
|
||||
name: protoreflect.FullName(xi.Name),
|
||||
number: protoreflect.FieldNumber(xi.Field),
|
||||
}
|
||||
xi.desc = extensionTypeDescriptor{xd, xi}
|
||||
return
|
||||
}
|
||||
|
||||
// Resolve enum or message dependencies.
|
||||
var ed pref.EnumDescriptor
|
||||
var md pref.MessageDescriptor
|
||||
var ed protoreflect.EnumDescriptor
|
||||
var md protoreflect.MessageDescriptor
|
||||
t := reflect.TypeOf(xi.ExtensionType)
|
||||
isOptional := t.Kind() == reflect.Ptr && t.Elem().Kind() != reflect.Struct
|
||||
isRepeated := t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8
|
||||
@@ -94,18 +94,18 @@ func (xi *ExtensionInfo) initFromLegacy() {
|
||||
t = t.Elem()
|
||||
}
|
||||
switch v := reflect.Zero(t).Interface().(type) {
|
||||
case pref.Enum:
|
||||
case protoreflect.Enum:
|
||||
ed = v.Descriptor()
|
||||
case enumV1:
|
||||
ed = LegacyLoadEnumDesc(t)
|
||||
case pref.ProtoMessage:
|
||||
case protoreflect.ProtoMessage:
|
||||
md = v.ProtoReflect().Descriptor()
|
||||
case messageV1:
|
||||
md = LegacyLoadMessageDesc(t)
|
||||
}
|
||||
|
||||
// Derive basic field information from the struct tag.
|
||||
var evs pref.EnumValueDescriptors
|
||||
var evs protoreflect.EnumValueDescriptors
|
||||
if ed != nil {
|
||||
evs = ed.Values()
|
||||
}
|
||||
@@ -114,8 +114,8 @@ func (xi *ExtensionInfo) initFromLegacy() {
|
||||
// Construct a v2 ExtensionType.
|
||||
xd := &filedesc.Extension{L2: new(filedesc.ExtensionL2)}
|
||||
xd.L0.ParentFile = filedesc.SurrogateProto2
|
||||
xd.L0.FullName = pref.FullName(xi.Name)
|
||||
xd.L1.Number = pref.FieldNumber(xi.Field)
|
||||
xd.L0.FullName = protoreflect.FullName(xi.Name)
|
||||
xd.L1.Number = protoreflect.FieldNumber(xi.Field)
|
||||
xd.L1.Cardinality = fd.L1.Cardinality
|
||||
xd.L1.Kind = fd.L1.Kind
|
||||
xd.L2.IsPacked = fd.L1.IsPacked
|
||||
@@ -138,39 +138,39 @@ func (xi *ExtensionInfo) initFromLegacy() {
|
||||
}
|
||||
|
||||
type placeholderExtension struct {
|
||||
name pref.FullName
|
||||
number pref.FieldNumber
|
||||
name protoreflect.FullName
|
||||
number protoreflect.FieldNumber
|
||||
}
|
||||
|
||||
func (x placeholderExtension) ParentFile() pref.FileDescriptor { return nil }
|
||||
func (x placeholderExtension) Parent() pref.Descriptor { return nil }
|
||||
func (x placeholderExtension) Index() int { return 0 }
|
||||
func (x placeholderExtension) Syntax() pref.Syntax { return 0 }
|
||||
func (x placeholderExtension) Name() pref.Name { return x.name.Name() }
|
||||
func (x placeholderExtension) FullName() pref.FullName { return x.name }
|
||||
func (x placeholderExtension) IsPlaceholder() bool { return true }
|
||||
func (x placeholderExtension) Options() pref.ProtoMessage { return descopts.Field }
|
||||
func (x placeholderExtension) Number() pref.FieldNumber { return x.number }
|
||||
func (x placeholderExtension) Cardinality() pref.Cardinality { return 0 }
|
||||
func (x placeholderExtension) Kind() pref.Kind { return 0 }
|
||||
func (x placeholderExtension) HasJSONName() bool { return false }
|
||||
func (x placeholderExtension) JSONName() string { return "[" + string(x.name) + "]" }
|
||||
func (x placeholderExtension) TextName() string { return "[" + string(x.name) + "]" }
|
||||
func (x placeholderExtension) HasPresence() bool { return false }
|
||||
func (x placeholderExtension) HasOptionalKeyword() bool { return false }
|
||||
func (x placeholderExtension) IsExtension() bool { return true }
|
||||
func (x placeholderExtension) IsWeak() bool { return false }
|
||||
func (x placeholderExtension) IsPacked() bool { return false }
|
||||
func (x placeholderExtension) IsList() bool { return false }
|
||||
func (x placeholderExtension) IsMap() bool { return false }
|
||||
func (x placeholderExtension) MapKey() pref.FieldDescriptor { return nil }
|
||||
func (x placeholderExtension) MapValue() pref.FieldDescriptor { return nil }
|
||||
func (x placeholderExtension) HasDefault() bool { return false }
|
||||
func (x placeholderExtension) Default() pref.Value { return pref.Value{} }
|
||||
func (x placeholderExtension) DefaultEnumValue() pref.EnumValueDescriptor { return nil }
|
||||
func (x placeholderExtension) ContainingOneof() pref.OneofDescriptor { return nil }
|
||||
func (x placeholderExtension) ContainingMessage() pref.MessageDescriptor { return nil }
|
||||
func (x placeholderExtension) Enum() pref.EnumDescriptor { return nil }
|
||||
func (x placeholderExtension) Message() pref.MessageDescriptor { return nil }
|
||||
func (x placeholderExtension) ProtoType(pref.FieldDescriptor) { return }
|
||||
func (x placeholderExtension) ProtoInternal(pragma.DoNotImplement) { return }
|
||||
func (x placeholderExtension) ParentFile() protoreflect.FileDescriptor { return nil }
|
||||
func (x placeholderExtension) Parent() protoreflect.Descriptor { return nil }
|
||||
func (x placeholderExtension) Index() int { return 0 }
|
||||
func (x placeholderExtension) Syntax() protoreflect.Syntax { return 0 }
|
||||
func (x placeholderExtension) Name() protoreflect.Name { return x.name.Name() }
|
||||
func (x placeholderExtension) FullName() protoreflect.FullName { return x.name }
|
||||
func (x placeholderExtension) IsPlaceholder() bool { return true }
|
||||
func (x placeholderExtension) Options() protoreflect.ProtoMessage { return descopts.Field }
|
||||
func (x placeholderExtension) Number() protoreflect.FieldNumber { return x.number }
|
||||
func (x placeholderExtension) Cardinality() protoreflect.Cardinality { return 0 }
|
||||
func (x placeholderExtension) Kind() protoreflect.Kind { return 0 }
|
||||
func (x placeholderExtension) HasJSONName() bool { return false }
|
||||
func (x placeholderExtension) JSONName() string { return "[" + string(x.name) + "]" }
|
||||
func (x placeholderExtension) TextName() string { return "[" + string(x.name) + "]" }
|
||||
func (x placeholderExtension) HasPresence() bool { return false }
|
||||
func (x placeholderExtension) HasOptionalKeyword() bool { return false }
|
||||
func (x placeholderExtension) IsExtension() bool { return true }
|
||||
func (x placeholderExtension) IsWeak() bool { return false }
|
||||
func (x placeholderExtension) IsPacked() bool { return false }
|
||||
func (x placeholderExtension) IsList() bool { return false }
|
||||
func (x placeholderExtension) IsMap() bool { return false }
|
||||
func (x placeholderExtension) MapKey() protoreflect.FieldDescriptor { return nil }
|
||||
func (x placeholderExtension) MapValue() protoreflect.FieldDescriptor { return nil }
|
||||
func (x placeholderExtension) HasDefault() bool { return false }
|
||||
func (x placeholderExtension) Default() protoreflect.Value { return protoreflect.Value{} }
|
||||
func (x placeholderExtension) DefaultEnumValue() protoreflect.EnumValueDescriptor { return nil }
|
||||
func (x placeholderExtension) ContainingOneof() protoreflect.OneofDescriptor { return nil }
|
||||
func (x placeholderExtension) ContainingMessage() protoreflect.MessageDescriptor { return nil }
|
||||
func (x placeholderExtension) Enum() protoreflect.EnumDescriptor { return nil }
|
||||
func (x placeholderExtension) Message() protoreflect.MessageDescriptor { return nil }
|
||||
func (x placeholderExtension) ProtoType(protoreflect.FieldDescriptor) { return }
|
||||
func (x placeholderExtension) ProtoInternal(pragma.DoNotImplement) { return }
|
||||
|
||||
141
go/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go
generated
vendored
141
go/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go
generated
vendored
@@ -16,14 +16,12 @@ import (
|
||||
"google.golang.org/protobuf/internal/filedesc"
|
||||
"google.golang.org/protobuf/internal/strs"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/runtime/protoiface"
|
||||
piface "google.golang.org/protobuf/runtime/protoiface"
|
||||
)
|
||||
|
||||
// legacyWrapMessage wraps v as a protoreflect.Message,
|
||||
// where v must be a *struct kind and not implement the v2 API already.
|
||||
func legacyWrapMessage(v reflect.Value) pref.Message {
|
||||
func legacyWrapMessage(v reflect.Value) protoreflect.Message {
|
||||
t := v.Type()
|
||||
if t.Kind() != reflect.Ptr || t.Elem().Kind() != reflect.Struct {
|
||||
return aberrantMessage{v: v}
|
||||
@@ -35,7 +33,7 @@ func legacyWrapMessage(v reflect.Value) pref.Message {
|
||||
// legacyLoadMessageType dynamically loads a protoreflect.Type for t,
|
||||
// where t must be not implement the v2 API already.
|
||||
// The provided name is used if it cannot be determined from the message.
|
||||
func legacyLoadMessageType(t reflect.Type, name pref.FullName) protoreflect.MessageType {
|
||||
func legacyLoadMessageType(t reflect.Type, name protoreflect.FullName) protoreflect.MessageType {
|
||||
if t.Kind() != reflect.Ptr || t.Elem().Kind() != reflect.Struct {
|
||||
return aberrantMessageType{t}
|
||||
}
|
||||
@@ -47,7 +45,7 @@ var legacyMessageTypeCache sync.Map // map[reflect.Type]*MessageInfo
|
||||
// legacyLoadMessageInfo dynamically loads a *MessageInfo for t,
|
||||
// where t must be a *struct kind and not implement the v2 API already.
|
||||
// The provided name is used if it cannot be determined from the message.
|
||||
func legacyLoadMessageInfo(t reflect.Type, name pref.FullName) *MessageInfo {
|
||||
func legacyLoadMessageInfo(t reflect.Type, name protoreflect.FullName) *MessageInfo {
|
||||
// Fast-path: check if a MessageInfo is cached for this concrete type.
|
||||
if mt, ok := legacyMessageTypeCache.Load(t); ok {
|
||||
return mt.(*MessageInfo)
|
||||
@@ -68,7 +66,7 @@ func legacyLoadMessageInfo(t reflect.Type, name pref.FullName) *MessageInfo {
|
||||
// supports deterministic serialization or not, but this
|
||||
// preserves the v1 implementation's behavior of always
|
||||
// calling Marshal methods when present.
|
||||
mi.methods.Flags |= piface.SupportMarshalDeterministic
|
||||
mi.methods.Flags |= protoiface.SupportMarshalDeterministic
|
||||
}
|
||||
if _, hasUnmarshal = v.(legacyUnmarshaler); hasUnmarshal {
|
||||
mi.methods.Unmarshal = legacyUnmarshal
|
||||
@@ -89,18 +87,18 @@ var legacyMessageDescCache sync.Map // map[reflect.Type]protoreflect.MessageDesc
|
||||
// which should be a *struct kind and must not implement the v2 API already.
|
||||
//
|
||||
// This is exported for testing purposes.
|
||||
func LegacyLoadMessageDesc(t reflect.Type) pref.MessageDescriptor {
|
||||
func LegacyLoadMessageDesc(t reflect.Type) protoreflect.MessageDescriptor {
|
||||
return legacyLoadMessageDesc(t, "")
|
||||
}
|
||||
func legacyLoadMessageDesc(t reflect.Type, name pref.FullName) pref.MessageDescriptor {
|
||||
func legacyLoadMessageDesc(t reflect.Type, name protoreflect.FullName) protoreflect.MessageDescriptor {
|
||||
// Fast-path: check if a MessageDescriptor is cached for this concrete type.
|
||||
if mi, ok := legacyMessageDescCache.Load(t); ok {
|
||||
return mi.(pref.MessageDescriptor)
|
||||
return mi.(protoreflect.MessageDescriptor)
|
||||
}
|
||||
|
||||
// Slow-path: initialize MessageDescriptor from the raw descriptor.
|
||||
mv := reflect.Zero(t).Interface()
|
||||
if _, ok := mv.(pref.ProtoMessage); ok {
|
||||
if _, ok := mv.(protoreflect.ProtoMessage); ok {
|
||||
panic(fmt.Sprintf("%v already implements proto.Message", t))
|
||||
}
|
||||
mdV1, ok := mv.(messageV1)
|
||||
@@ -164,7 +162,7 @@ var (
|
||||
//
|
||||
// This is a best-effort derivation of the message descriptor using the protobuf
|
||||
// tags on the struct fields.
|
||||
func aberrantLoadMessageDesc(t reflect.Type, name pref.FullName) pref.MessageDescriptor {
|
||||
func aberrantLoadMessageDesc(t reflect.Type, name protoreflect.FullName) protoreflect.MessageDescriptor {
|
||||
aberrantMessageDescLock.Lock()
|
||||
defer aberrantMessageDescLock.Unlock()
|
||||
if aberrantMessageDescCache == nil {
|
||||
@@ -172,7 +170,7 @@ func aberrantLoadMessageDesc(t reflect.Type, name pref.FullName) pref.MessageDes
|
||||
}
|
||||
return aberrantLoadMessageDescReentrant(t, name)
|
||||
}
|
||||
func aberrantLoadMessageDescReentrant(t reflect.Type, name pref.FullName) pref.MessageDescriptor {
|
||||
func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName) protoreflect.MessageDescriptor {
|
||||
// Fast-path: check if an MessageDescriptor is cached for this concrete type.
|
||||
if md, ok := aberrantMessageDescCache[t]; ok {
|
||||
return md
|
||||
@@ -208,13 +206,18 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name pref.FullName) pref.M
|
||||
|
||||
// Obtain a list of oneof wrapper types.
|
||||
var oneofWrappers []reflect.Type
|
||||
for _, method := range []string{"XXX_OneofFuncs", "XXX_OneofWrappers"} {
|
||||
if fn, ok := t.MethodByName(method); ok {
|
||||
for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) {
|
||||
if vs, ok := v.Interface().([]interface{}); ok {
|
||||
for _, v := range vs {
|
||||
oneofWrappers = append(oneofWrappers, reflect.TypeOf(v))
|
||||
}
|
||||
methods := make([]reflect.Method, 0, 2)
|
||||
if m, ok := t.MethodByName("XXX_OneofFuncs"); ok {
|
||||
methods = append(methods, m)
|
||||
}
|
||||
if m, ok := t.MethodByName("XXX_OneofWrappers"); ok {
|
||||
methods = append(methods, m)
|
||||
}
|
||||
for _, fn := range methods {
|
||||
for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) {
|
||||
if vs, ok := v.Interface().([]interface{}); ok {
|
||||
for _, v := range vs {
|
||||
oneofWrappers = append(oneofWrappers, reflect.TypeOf(v))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -225,9 +228,9 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name pref.FullName) pref.M
|
||||
vs := fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))})[0]
|
||||
for i := 0; i < vs.Len(); i++ {
|
||||
v := vs.Index(i)
|
||||
md.L2.ExtensionRanges.List = append(md.L2.ExtensionRanges.List, [2]pref.FieldNumber{
|
||||
pref.FieldNumber(v.FieldByName("Start").Int()),
|
||||
pref.FieldNumber(v.FieldByName("End").Int() + 1),
|
||||
md.L2.ExtensionRanges.List = append(md.L2.ExtensionRanges.List, [2]protoreflect.FieldNumber{
|
||||
protoreflect.FieldNumber(v.FieldByName("Start").Int()),
|
||||
protoreflect.FieldNumber(v.FieldByName("End").Int() + 1),
|
||||
})
|
||||
md.L2.ExtensionRangeOptions = append(md.L2.ExtensionRangeOptions, nil)
|
||||
}
|
||||
@@ -245,7 +248,7 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name pref.FullName) pref.M
|
||||
n := len(md.L2.Oneofs.List)
|
||||
md.L2.Oneofs.List = append(md.L2.Oneofs.List, filedesc.Oneof{})
|
||||
od := &md.L2.Oneofs.List[n]
|
||||
od.L0.FullName = md.FullName().Append(pref.Name(tag))
|
||||
od.L0.FullName = md.FullName().Append(protoreflect.Name(tag))
|
||||
od.L0.ParentFile = md.L0.ParentFile
|
||||
od.L0.Parent = md
|
||||
od.L0.Index = n
|
||||
@@ -267,14 +270,14 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name pref.FullName) pref.M
|
||||
return md
|
||||
}
|
||||
|
||||
func aberrantDeriveMessageName(t reflect.Type, name pref.FullName) pref.FullName {
|
||||
func aberrantDeriveMessageName(t reflect.Type, name protoreflect.FullName) protoreflect.FullName {
|
||||
if name.IsValid() {
|
||||
return name
|
||||
}
|
||||
func() {
|
||||
defer func() { recover() }() // swallow possible nil panics
|
||||
if m, ok := reflect.Zero(t).Interface().(interface{ XXX_MessageName() string }); ok {
|
||||
name = pref.FullName(m.XXX_MessageName())
|
||||
name = protoreflect.FullName(m.XXX_MessageName())
|
||||
}
|
||||
}()
|
||||
if name.IsValid() {
|
||||
@@ -305,7 +308,7 @@ func aberrantAppendField(md *filedesc.Message, goType reflect.Type, tag, tagKey,
|
||||
fd.L0.Index = n
|
||||
|
||||
if fd.L1.IsWeak || fd.L1.HasPacked {
|
||||
fd.L1.Options = func() pref.ProtoMessage {
|
||||
fd.L1.Options = func() protoreflect.ProtoMessage {
|
||||
opts := descopts.Field.ProtoReflect().New()
|
||||
if fd.L1.IsWeak {
|
||||
opts.Set(opts.Descriptor().Fields().ByName("weak"), protoreflect.ValueOfBool(true))
|
||||
@@ -318,17 +321,17 @@ func aberrantAppendField(md *filedesc.Message, goType reflect.Type, tag, tagKey,
|
||||
}
|
||||
|
||||
// Populate Enum and Message.
|
||||
if fd.Enum() == nil && fd.Kind() == pref.EnumKind {
|
||||
if fd.Enum() == nil && fd.Kind() == protoreflect.EnumKind {
|
||||
switch v := reflect.Zero(t).Interface().(type) {
|
||||
case pref.Enum:
|
||||
case protoreflect.Enum:
|
||||
fd.L1.Enum = v.Descriptor()
|
||||
default:
|
||||
fd.L1.Enum = LegacyLoadEnumDesc(t)
|
||||
}
|
||||
}
|
||||
if fd.Message() == nil && (fd.Kind() == pref.MessageKind || fd.Kind() == pref.GroupKind) {
|
||||
if fd.Message() == nil && (fd.Kind() == protoreflect.MessageKind || fd.Kind() == protoreflect.GroupKind) {
|
||||
switch v := reflect.Zero(t).Interface().(type) {
|
||||
case pref.ProtoMessage:
|
||||
case protoreflect.ProtoMessage:
|
||||
fd.L1.Message = v.ProtoReflect().Descriptor()
|
||||
case messageV1:
|
||||
fd.L1.Message = LegacyLoadMessageDesc(t)
|
||||
@@ -337,13 +340,13 @@ func aberrantAppendField(md *filedesc.Message, goType reflect.Type, tag, tagKey,
|
||||
n := len(md.L1.Messages.List)
|
||||
md.L1.Messages.List = append(md.L1.Messages.List, filedesc.Message{L2: new(filedesc.MessageL2)})
|
||||
md2 := &md.L1.Messages.List[n]
|
||||
md2.L0.FullName = md.FullName().Append(pref.Name(strs.MapEntryName(string(fd.Name()))))
|
||||
md2.L0.FullName = md.FullName().Append(protoreflect.Name(strs.MapEntryName(string(fd.Name()))))
|
||||
md2.L0.ParentFile = md.L0.ParentFile
|
||||
md2.L0.Parent = md
|
||||
md2.L0.Index = n
|
||||
|
||||
md2.L1.IsMapEntry = true
|
||||
md2.L2.Options = func() pref.ProtoMessage {
|
||||
md2.L2.Options = func() protoreflect.ProtoMessage {
|
||||
opts := descopts.Message.ProtoReflect().New()
|
||||
opts.Set(opts.Descriptor().Fields().ByName("map_entry"), protoreflect.ValueOfBool(true))
|
||||
return opts.Interface()
|
||||
@@ -364,8 +367,8 @@ type placeholderEnumValues struct {
|
||||
protoreflect.EnumValueDescriptors
|
||||
}
|
||||
|
||||
func (placeholderEnumValues) ByNumber(n pref.EnumNumber) pref.EnumValueDescriptor {
|
||||
return filedesc.PlaceholderEnumValue(pref.FullName(fmt.Sprintf("UNKNOWN_%d", n)))
|
||||
func (placeholderEnumValues) ByNumber(n protoreflect.EnumNumber) protoreflect.EnumValueDescriptor {
|
||||
return filedesc.PlaceholderEnumValue(protoreflect.FullName(fmt.Sprintf("UNKNOWN_%d", n)))
|
||||
}
|
||||
|
||||
// legacyMarshaler is the proto.Marshaler interface superseded by protoiface.Methoder.
|
||||
@@ -383,7 +386,7 @@ type legacyMerger interface {
|
||||
Merge(protoiface.MessageV1)
|
||||
}
|
||||
|
||||
var aberrantProtoMethods = &piface.Methods{
|
||||
var aberrantProtoMethods = &protoiface.Methods{
|
||||
Marshal: legacyMarshal,
|
||||
Unmarshal: legacyUnmarshal,
|
||||
Merge: legacyMerge,
|
||||
@@ -392,40 +395,40 @@ var aberrantProtoMethods = &piface.Methods{
|
||||
// supports deterministic serialization or not, but this
|
||||
// preserves the v1 implementation's behavior of always
|
||||
// calling Marshal methods when present.
|
||||
Flags: piface.SupportMarshalDeterministic,
|
||||
Flags: protoiface.SupportMarshalDeterministic,
|
||||
}
|
||||
|
||||
func legacyMarshal(in piface.MarshalInput) (piface.MarshalOutput, error) {
|
||||
func legacyMarshal(in protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
||||
v := in.Message.(unwrapper).protoUnwrap()
|
||||
marshaler, ok := v.(legacyMarshaler)
|
||||
if !ok {
|
||||
return piface.MarshalOutput{}, errors.New("%T does not implement Marshal", v)
|
||||
return protoiface.MarshalOutput{}, errors.New("%T does not implement Marshal", v)
|
||||
}
|
||||
out, err := marshaler.Marshal()
|
||||
if in.Buf != nil {
|
||||
out = append(in.Buf, out...)
|
||||
}
|
||||
return piface.MarshalOutput{
|
||||
return protoiface.MarshalOutput{
|
||||
Buf: out,
|
||||
}, err
|
||||
}
|
||||
|
||||
func legacyUnmarshal(in piface.UnmarshalInput) (piface.UnmarshalOutput, error) {
|
||||
func legacyUnmarshal(in protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
||||
v := in.Message.(unwrapper).protoUnwrap()
|
||||
unmarshaler, ok := v.(legacyUnmarshaler)
|
||||
if !ok {
|
||||
return piface.UnmarshalOutput{}, errors.New("%T does not implement Unmarshal", v)
|
||||
return protoiface.UnmarshalOutput{}, errors.New("%T does not implement Unmarshal", v)
|
||||
}
|
||||
return piface.UnmarshalOutput{}, unmarshaler.Unmarshal(in.Buf)
|
||||
return protoiface.UnmarshalOutput{}, unmarshaler.Unmarshal(in.Buf)
|
||||
}
|
||||
|
||||
func legacyMerge(in piface.MergeInput) piface.MergeOutput {
|
||||
func legacyMerge(in protoiface.MergeInput) protoiface.MergeOutput {
|
||||
// Check whether this supports the legacy merger.
|
||||
dstv := in.Destination.(unwrapper).protoUnwrap()
|
||||
merger, ok := dstv.(legacyMerger)
|
||||
if ok {
|
||||
merger.Merge(Export{}.ProtoMessageV1Of(in.Source))
|
||||
return piface.MergeOutput{Flags: piface.MergeComplete}
|
||||
return protoiface.MergeOutput{Flags: protoiface.MergeComplete}
|
||||
}
|
||||
|
||||
// If legacy merger is unavailable, implement merge in terms of
|
||||
@@ -433,29 +436,29 @@ func legacyMerge(in piface.MergeInput) piface.MergeOutput {
|
||||
srcv := in.Source.(unwrapper).protoUnwrap()
|
||||
marshaler, ok := srcv.(legacyMarshaler)
|
||||
if !ok {
|
||||
return piface.MergeOutput{}
|
||||
return protoiface.MergeOutput{}
|
||||
}
|
||||
dstv = in.Destination.(unwrapper).protoUnwrap()
|
||||
unmarshaler, ok := dstv.(legacyUnmarshaler)
|
||||
if !ok {
|
||||
return piface.MergeOutput{}
|
||||
return protoiface.MergeOutput{}
|
||||
}
|
||||
if !in.Source.IsValid() {
|
||||
// Legacy Marshal methods may not function on nil messages.
|
||||
// Check for a typed nil source only after we confirm that
|
||||
// legacy Marshal/Unmarshal methods are present, for
|
||||
// consistency.
|
||||
return piface.MergeOutput{Flags: piface.MergeComplete}
|
||||
return protoiface.MergeOutput{Flags: protoiface.MergeComplete}
|
||||
}
|
||||
b, err := marshaler.Marshal()
|
||||
if err != nil {
|
||||
return piface.MergeOutput{}
|
||||
return protoiface.MergeOutput{}
|
||||
}
|
||||
err = unmarshaler.Unmarshal(b)
|
||||
if err != nil {
|
||||
return piface.MergeOutput{}
|
||||
return protoiface.MergeOutput{}
|
||||
}
|
||||
return piface.MergeOutput{Flags: piface.MergeComplete}
|
||||
return protoiface.MergeOutput{Flags: protoiface.MergeComplete}
|
||||
}
|
||||
|
||||
// aberrantMessageType implements MessageType for all types other than pointer-to-struct.
|
||||
@@ -463,19 +466,19 @@ type aberrantMessageType struct {
|
||||
t reflect.Type
|
||||
}
|
||||
|
||||
func (mt aberrantMessageType) New() pref.Message {
|
||||
func (mt aberrantMessageType) New() protoreflect.Message {
|
||||
if mt.t.Kind() == reflect.Ptr {
|
||||
return aberrantMessage{reflect.New(mt.t.Elem())}
|
||||
}
|
||||
return aberrantMessage{reflect.Zero(mt.t)}
|
||||
}
|
||||
func (mt aberrantMessageType) Zero() pref.Message {
|
||||
func (mt aberrantMessageType) Zero() protoreflect.Message {
|
||||
return aberrantMessage{reflect.Zero(mt.t)}
|
||||
}
|
||||
func (mt aberrantMessageType) GoType() reflect.Type {
|
||||
return mt.t
|
||||
}
|
||||
func (mt aberrantMessageType) Descriptor() pref.MessageDescriptor {
|
||||
func (mt aberrantMessageType) Descriptor() protoreflect.MessageDescriptor {
|
||||
return LegacyLoadMessageDesc(mt.t)
|
||||
}
|
||||
|
||||
@@ -499,56 +502,56 @@ func (m aberrantMessage) Reset() {
|
||||
}
|
||||
}
|
||||
|
||||
func (m aberrantMessage) ProtoReflect() pref.Message {
|
||||
func (m aberrantMessage) ProtoReflect() protoreflect.Message {
|
||||
return m
|
||||
}
|
||||
|
||||
func (m aberrantMessage) Descriptor() pref.MessageDescriptor {
|
||||
func (m aberrantMessage) Descriptor() protoreflect.MessageDescriptor {
|
||||
return LegacyLoadMessageDesc(m.v.Type())
|
||||
}
|
||||
func (m aberrantMessage) Type() pref.MessageType {
|
||||
func (m aberrantMessage) Type() protoreflect.MessageType {
|
||||
return aberrantMessageType{m.v.Type()}
|
||||
}
|
||||
func (m aberrantMessage) New() pref.Message {
|
||||
func (m aberrantMessage) New() protoreflect.Message {
|
||||
if m.v.Type().Kind() == reflect.Ptr {
|
||||
return aberrantMessage{reflect.New(m.v.Type().Elem())}
|
||||
}
|
||||
return aberrantMessage{reflect.Zero(m.v.Type())}
|
||||
}
|
||||
func (m aberrantMessage) Interface() pref.ProtoMessage {
|
||||
func (m aberrantMessage) Interface() protoreflect.ProtoMessage {
|
||||
return m
|
||||
}
|
||||
func (m aberrantMessage) Range(f func(pref.FieldDescriptor, pref.Value) bool) {
|
||||
func (m aberrantMessage) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
return
|
||||
}
|
||||
func (m aberrantMessage) Has(pref.FieldDescriptor) bool {
|
||||
func (m aberrantMessage) Has(protoreflect.FieldDescriptor) bool {
|
||||
return false
|
||||
}
|
||||
func (m aberrantMessage) Clear(pref.FieldDescriptor) {
|
||||
func (m aberrantMessage) Clear(protoreflect.FieldDescriptor) {
|
||||
panic("invalid Message.Clear on " + string(m.Descriptor().FullName()))
|
||||
}
|
||||
func (m aberrantMessage) Get(fd pref.FieldDescriptor) pref.Value {
|
||||
func (m aberrantMessage) Get(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
if fd.Default().IsValid() {
|
||||
return fd.Default()
|
||||
}
|
||||
panic("invalid Message.Get on " + string(m.Descriptor().FullName()))
|
||||
}
|
||||
func (m aberrantMessage) Set(pref.FieldDescriptor, pref.Value) {
|
||||
func (m aberrantMessage) Set(protoreflect.FieldDescriptor, protoreflect.Value) {
|
||||
panic("invalid Message.Set on " + string(m.Descriptor().FullName()))
|
||||
}
|
||||
func (m aberrantMessage) Mutable(pref.FieldDescriptor) pref.Value {
|
||||
func (m aberrantMessage) Mutable(protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
panic("invalid Message.Mutable on " + string(m.Descriptor().FullName()))
|
||||
}
|
||||
func (m aberrantMessage) NewField(pref.FieldDescriptor) pref.Value {
|
||||
func (m aberrantMessage) NewField(protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
panic("invalid Message.NewField on " + string(m.Descriptor().FullName()))
|
||||
}
|
||||
func (m aberrantMessage) WhichOneof(pref.OneofDescriptor) pref.FieldDescriptor {
|
||||
func (m aberrantMessage) WhichOneof(protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||
panic("invalid Message.WhichOneof descriptor on " + string(m.Descriptor().FullName()))
|
||||
}
|
||||
func (m aberrantMessage) GetUnknown() pref.RawFields {
|
||||
func (m aberrantMessage) GetUnknown() protoreflect.RawFields {
|
||||
return nil
|
||||
}
|
||||
func (m aberrantMessage) SetUnknown(pref.RawFields) {
|
||||
func (m aberrantMessage) SetUnknown(protoreflect.RawFields) {
|
||||
// SetUnknown discards its input on messages which don't support unknown field storage.
|
||||
}
|
||||
func (m aberrantMessage) IsValid() bool {
|
||||
@@ -557,7 +560,7 @@ func (m aberrantMessage) IsValid() bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
func (m aberrantMessage) ProtoMethods() *piface.Methods {
|
||||
func (m aberrantMessage) ProtoMethods() *protoiface.Methods {
|
||||
return aberrantProtoMethods
|
||||
}
|
||||
func (m aberrantMessage) protoUnwrap() interface{} {
|
||||
|
||||
32
go/vendor/google.golang.org/protobuf/internal/impl/merge.go
generated
vendored
32
go/vendor/google.golang.org/protobuf/internal/impl/merge.go
generated
vendored
@@ -9,8 +9,8 @@ import (
|
||||
"reflect"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
piface "google.golang.org/protobuf/runtime/protoiface"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/runtime/protoiface"
|
||||
)
|
||||
|
||||
type mergeOptions struct{}
|
||||
@@ -20,17 +20,17 @@ func (o mergeOptions) Merge(dst, src proto.Message) {
|
||||
}
|
||||
|
||||
// merge is protoreflect.Methods.Merge.
|
||||
func (mi *MessageInfo) merge(in piface.MergeInput) piface.MergeOutput {
|
||||
func (mi *MessageInfo) merge(in protoiface.MergeInput) protoiface.MergeOutput {
|
||||
dp, ok := mi.getPointer(in.Destination)
|
||||
if !ok {
|
||||
return piface.MergeOutput{}
|
||||
return protoiface.MergeOutput{}
|
||||
}
|
||||
sp, ok := mi.getPointer(in.Source)
|
||||
if !ok {
|
||||
return piface.MergeOutput{}
|
||||
return protoiface.MergeOutput{}
|
||||
}
|
||||
mi.mergePointer(dp, sp, mergeOptions{})
|
||||
return piface.MergeOutput{Flags: piface.MergeComplete}
|
||||
return protoiface.MergeOutput{Flags: protoiface.MergeComplete}
|
||||
}
|
||||
|
||||
func (mi *MessageInfo) mergePointer(dst, src pointer, opts mergeOptions) {
|
||||
@@ -64,7 +64,7 @@ func (mi *MessageInfo) mergePointer(dst, src pointer, opts mergeOptions) {
|
||||
continue
|
||||
}
|
||||
dx := (*dext)[num]
|
||||
var dv pref.Value
|
||||
var dv protoreflect.Value
|
||||
if dx.Type() == sx.Type() {
|
||||
dv = dx.Value()
|
||||
}
|
||||
@@ -85,15 +85,15 @@ func (mi *MessageInfo) mergePointer(dst, src pointer, opts mergeOptions) {
|
||||
}
|
||||
}
|
||||
|
||||
func mergeScalarValue(dst, src pref.Value, opts mergeOptions) pref.Value {
|
||||
func mergeScalarValue(dst, src protoreflect.Value, opts mergeOptions) protoreflect.Value {
|
||||
return src
|
||||
}
|
||||
|
||||
func mergeBytesValue(dst, src pref.Value, opts mergeOptions) pref.Value {
|
||||
return pref.ValueOfBytes(append(emptyBuf[:], src.Bytes()...))
|
||||
func mergeBytesValue(dst, src protoreflect.Value, opts mergeOptions) protoreflect.Value {
|
||||
return protoreflect.ValueOfBytes(append(emptyBuf[:], src.Bytes()...))
|
||||
}
|
||||
|
||||
func mergeListValue(dst, src pref.Value, opts mergeOptions) pref.Value {
|
||||
func mergeListValue(dst, src protoreflect.Value, opts mergeOptions) protoreflect.Value {
|
||||
dstl := dst.List()
|
||||
srcl := src.List()
|
||||
for i, llen := 0, srcl.Len(); i < llen; i++ {
|
||||
@@ -102,29 +102,29 @@ func mergeListValue(dst, src pref.Value, opts mergeOptions) pref.Value {
|
||||
return dst
|
||||
}
|
||||
|
||||
func mergeBytesListValue(dst, src pref.Value, opts mergeOptions) pref.Value {
|
||||
func mergeBytesListValue(dst, src protoreflect.Value, opts mergeOptions) protoreflect.Value {
|
||||
dstl := dst.List()
|
||||
srcl := src.List()
|
||||
for i, llen := 0, srcl.Len(); i < llen; i++ {
|
||||
sb := srcl.Get(i).Bytes()
|
||||
db := append(emptyBuf[:], sb...)
|
||||
dstl.Append(pref.ValueOfBytes(db))
|
||||
dstl.Append(protoreflect.ValueOfBytes(db))
|
||||
}
|
||||
return dst
|
||||
}
|
||||
|
||||
func mergeMessageListValue(dst, src pref.Value, opts mergeOptions) pref.Value {
|
||||
func mergeMessageListValue(dst, src protoreflect.Value, opts mergeOptions) protoreflect.Value {
|
||||
dstl := dst.List()
|
||||
srcl := src.List()
|
||||
for i, llen := 0, srcl.Len(); i < llen; i++ {
|
||||
sm := srcl.Get(i).Message()
|
||||
dm := proto.Clone(sm.Interface()).ProtoReflect()
|
||||
dstl.Append(pref.ValueOfMessage(dm))
|
||||
dstl.Append(protoreflect.ValueOfMessage(dm))
|
||||
}
|
||||
return dst
|
||||
}
|
||||
|
||||
func mergeMessageValue(dst, src pref.Value, opts mergeOptions) pref.Value {
|
||||
func mergeMessageValue(dst, src protoreflect.Value, opts mergeOptions) protoreflect.Value {
|
||||
opts.Merge(dst.Message().Interface(), src.Message().Interface())
|
||||
return dst
|
||||
}
|
||||
|
||||
58
go/vendor/google.golang.org/protobuf/internal/impl/message.go
generated
vendored
58
go/vendor/google.golang.org/protobuf/internal/impl/message.go
generated
vendored
@@ -14,8 +14,7 @@ import (
|
||||
|
||||
"google.golang.org/protobuf/internal/genid"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
preg "google.golang.org/protobuf/reflect/protoregistry"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
)
|
||||
|
||||
// MessageInfo provides protobuf related functionality for a given Go type
|
||||
@@ -29,7 +28,7 @@ type MessageInfo struct {
|
||||
GoReflectType reflect.Type // pointer to struct
|
||||
|
||||
// Desc is the underlying message descriptor type and must be populated.
|
||||
Desc pref.MessageDescriptor
|
||||
Desc protoreflect.MessageDescriptor
|
||||
|
||||
// Exporter must be provided in a purego environment in order to provide
|
||||
// access to unexported fields.
|
||||
@@ -54,7 +53,7 @@ type exporter func(v interface{}, i int) interface{}
|
||||
// is generated by our implementation of protoc-gen-go (for v2 and on).
|
||||
// If it is unable to obtain a MessageInfo, it returns nil.
|
||||
func getMessageInfo(mt reflect.Type) *MessageInfo {
|
||||
m, ok := reflect.Zero(mt).Interface().(pref.ProtoMessage)
|
||||
m, ok := reflect.Zero(mt).Interface().(protoreflect.ProtoMessage)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
@@ -97,7 +96,7 @@ func (mi *MessageInfo) initOnce() {
|
||||
// getPointer returns the pointer for a message, which should be of
|
||||
// the type of the MessageInfo. If the message is of a different type,
|
||||
// it returns ok==false.
|
||||
func (mi *MessageInfo) getPointer(m pref.Message) (p pointer, ok bool) {
|
||||
func (mi *MessageInfo) getPointer(m protoreflect.Message) (p pointer, ok bool) {
|
||||
switch m := m.(type) {
|
||||
case *messageState:
|
||||
return m.pointer(), m.messageInfo() == mi
|
||||
@@ -134,10 +133,10 @@ type structInfo struct {
|
||||
extensionOffset offset
|
||||
extensionType reflect.Type
|
||||
|
||||
fieldsByNumber map[pref.FieldNumber]reflect.StructField
|
||||
oneofsByName map[pref.Name]reflect.StructField
|
||||
oneofWrappersByType map[reflect.Type]pref.FieldNumber
|
||||
oneofWrappersByNumber map[pref.FieldNumber]reflect.Type
|
||||
fieldsByNumber map[protoreflect.FieldNumber]reflect.StructField
|
||||
oneofsByName map[protoreflect.Name]reflect.StructField
|
||||
oneofWrappersByType map[reflect.Type]protoreflect.FieldNumber
|
||||
oneofWrappersByNumber map[protoreflect.FieldNumber]reflect.Type
|
||||
}
|
||||
|
||||
func (mi *MessageInfo) makeStructInfo(t reflect.Type) structInfo {
|
||||
@@ -147,10 +146,10 @@ func (mi *MessageInfo) makeStructInfo(t reflect.Type) structInfo {
|
||||
unknownOffset: invalidOffset,
|
||||
extensionOffset: invalidOffset,
|
||||
|
||||
fieldsByNumber: map[pref.FieldNumber]reflect.StructField{},
|
||||
oneofsByName: map[pref.Name]reflect.StructField{},
|
||||
oneofWrappersByType: map[reflect.Type]pref.FieldNumber{},
|
||||
oneofWrappersByNumber: map[pref.FieldNumber]reflect.Type{},
|
||||
fieldsByNumber: map[protoreflect.FieldNumber]reflect.StructField{},
|
||||
oneofsByName: map[protoreflect.Name]reflect.StructField{},
|
||||
oneofWrappersByType: map[reflect.Type]protoreflect.FieldNumber{},
|
||||
oneofWrappersByNumber: map[protoreflect.FieldNumber]reflect.Type{},
|
||||
}
|
||||
|
||||
fieldLoop:
|
||||
@@ -180,12 +179,12 @@ fieldLoop:
|
||||
for _, s := range strings.Split(f.Tag.Get("protobuf"), ",") {
|
||||
if len(s) > 0 && strings.Trim(s, "0123456789") == "" {
|
||||
n, _ := strconv.ParseUint(s, 10, 64)
|
||||
si.fieldsByNumber[pref.FieldNumber(n)] = f
|
||||
si.fieldsByNumber[protoreflect.FieldNumber(n)] = f
|
||||
continue fieldLoop
|
||||
}
|
||||
}
|
||||
if s := f.Tag.Get("protobuf_oneof"); len(s) > 0 {
|
||||
si.oneofsByName[pref.Name(s)] = f
|
||||
si.oneofsByName[protoreflect.Name(s)] = f
|
||||
continue fieldLoop
|
||||
}
|
||||
}
|
||||
@@ -193,12 +192,17 @@ fieldLoop:
|
||||
|
||||
// Derive a mapping of oneof wrappers to fields.
|
||||
oneofWrappers := mi.OneofWrappers
|
||||
for _, method := range []string{"XXX_OneofFuncs", "XXX_OneofWrappers"} {
|
||||
if fn, ok := reflect.PtrTo(t).MethodByName(method); ok {
|
||||
for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) {
|
||||
if vs, ok := v.Interface().([]interface{}); ok {
|
||||
oneofWrappers = vs
|
||||
}
|
||||
methods := make([]reflect.Method, 0, 2)
|
||||
if m, ok := reflect.PtrTo(t).MethodByName("XXX_OneofFuncs"); ok {
|
||||
methods = append(methods, m)
|
||||
}
|
||||
if m, ok := reflect.PtrTo(t).MethodByName("XXX_OneofWrappers"); ok {
|
||||
methods = append(methods, m)
|
||||
}
|
||||
for _, fn := range methods {
|
||||
for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) {
|
||||
if vs, ok := v.Interface().([]interface{}); ok {
|
||||
oneofWrappers = vs
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,8 +212,8 @@ fieldLoop:
|
||||
for _, s := range strings.Split(f.Tag.Get("protobuf"), ",") {
|
||||
if len(s) > 0 && strings.Trim(s, "0123456789") == "" {
|
||||
n, _ := strconv.ParseUint(s, 10, 64)
|
||||
si.oneofWrappersByType[tf] = pref.FieldNumber(n)
|
||||
si.oneofWrappersByNumber[pref.FieldNumber(n)] = tf
|
||||
si.oneofWrappersByType[tf] = protoreflect.FieldNumber(n)
|
||||
si.oneofWrappersByNumber[protoreflect.FieldNumber(n)] = tf
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -219,7 +223,11 @@ fieldLoop:
|
||||
}
|
||||
|
||||
func (mi *MessageInfo) New() protoreflect.Message {
|
||||
return mi.MessageOf(reflect.New(mi.GoReflectType.Elem()).Interface())
|
||||
m := reflect.New(mi.GoReflectType.Elem()).Interface()
|
||||
if r, ok := m.(protoreflect.ProtoMessage); ok {
|
||||
return r.ProtoReflect()
|
||||
}
|
||||
return mi.MessageOf(m)
|
||||
}
|
||||
func (mi *MessageInfo) Zero() protoreflect.Message {
|
||||
return mi.MessageOf(reflect.Zero(mi.GoReflectType).Interface())
|
||||
@@ -237,7 +245,7 @@ func (mi *MessageInfo) Message(i int) protoreflect.MessageType {
|
||||
fd := mi.Desc.Fields().Get(i)
|
||||
switch {
|
||||
case fd.IsWeak():
|
||||
mt, _ := preg.GlobalTypes.FindMessageByName(fd.Message().FullName())
|
||||
mt, _ := protoregistry.GlobalTypes.FindMessageByName(fd.Message().FullName())
|
||||
return mt
|
||||
case fd.IsMap():
|
||||
return mapEntryType{fd.Message(), mi.fieldTypes[fd.Number()]}
|
||||
|
||||
74
go/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go
generated
vendored
74
go/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go
generated
vendored
@@ -10,17 +10,17 @@ import (
|
||||
|
||||
"google.golang.org/protobuf/internal/detrand"
|
||||
"google.golang.org/protobuf/internal/pragma"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
type reflectMessageInfo struct {
|
||||
fields map[pref.FieldNumber]*fieldInfo
|
||||
oneofs map[pref.Name]*oneofInfo
|
||||
fields map[protoreflect.FieldNumber]*fieldInfo
|
||||
oneofs map[protoreflect.Name]*oneofInfo
|
||||
|
||||
// fieldTypes contains the zero value of an enum or message field.
|
||||
// For lists, it contains the element type.
|
||||
// For maps, it contains the entry value type.
|
||||
fieldTypes map[pref.FieldNumber]interface{}
|
||||
fieldTypes map[protoreflect.FieldNumber]interface{}
|
||||
|
||||
// denseFields is a subset of fields where:
|
||||
// 0 < fieldDesc.Number() < len(denseFields)
|
||||
@@ -30,8 +30,8 @@ type reflectMessageInfo struct {
|
||||
// rangeInfos is a list of all fields (not belonging to a oneof) and oneofs.
|
||||
rangeInfos []interface{} // either *fieldInfo or *oneofInfo
|
||||
|
||||
getUnknown func(pointer) pref.RawFields
|
||||
setUnknown func(pointer, pref.RawFields)
|
||||
getUnknown func(pointer) protoreflect.RawFields
|
||||
setUnknown func(pointer, protoreflect.RawFields)
|
||||
extensionMap func(pointer) *extensionMap
|
||||
|
||||
nilMessage atomicNilMessage
|
||||
@@ -52,7 +52,7 @@ func (mi *MessageInfo) makeReflectFuncs(t reflect.Type, si structInfo) {
|
||||
// This code assumes that the struct is well-formed and panics if there are
|
||||
// any discrepancies.
|
||||
func (mi *MessageInfo) makeKnownFieldsFunc(si structInfo) {
|
||||
mi.fields = map[pref.FieldNumber]*fieldInfo{}
|
||||
mi.fields = map[protoreflect.FieldNumber]*fieldInfo{}
|
||||
md := mi.Desc
|
||||
fds := md.Fields()
|
||||
for i := 0; i < fds.Len(); i++ {
|
||||
@@ -82,7 +82,7 @@ func (mi *MessageInfo) makeKnownFieldsFunc(si structInfo) {
|
||||
mi.fields[fd.Number()] = &fi
|
||||
}
|
||||
|
||||
mi.oneofs = map[pref.Name]*oneofInfo{}
|
||||
mi.oneofs = map[protoreflect.Name]*oneofInfo{}
|
||||
for i := 0; i < md.Oneofs().Len(); i++ {
|
||||
od := md.Oneofs().Get(i)
|
||||
mi.oneofs[od.Name()] = makeOneofInfo(od, si, mi.Exporter)
|
||||
@@ -117,13 +117,13 @@ func (mi *MessageInfo) makeUnknownFieldsFunc(t reflect.Type, si structInfo) {
|
||||
switch {
|
||||
case si.unknownOffset.IsValid() && si.unknownType == unknownFieldsAType:
|
||||
// Handle as []byte.
|
||||
mi.getUnknown = func(p pointer) pref.RawFields {
|
||||
mi.getUnknown = func(p pointer) protoreflect.RawFields {
|
||||
if p.IsNil() {
|
||||
return nil
|
||||
}
|
||||
return *p.Apply(mi.unknownOffset).Bytes()
|
||||
}
|
||||
mi.setUnknown = func(p pointer, b pref.RawFields) {
|
||||
mi.setUnknown = func(p pointer, b protoreflect.RawFields) {
|
||||
if p.IsNil() {
|
||||
panic("invalid SetUnknown on nil Message")
|
||||
}
|
||||
@@ -131,7 +131,7 @@ func (mi *MessageInfo) makeUnknownFieldsFunc(t reflect.Type, si structInfo) {
|
||||
}
|
||||
case si.unknownOffset.IsValid() && si.unknownType == unknownFieldsBType:
|
||||
// Handle as *[]byte.
|
||||
mi.getUnknown = func(p pointer) pref.RawFields {
|
||||
mi.getUnknown = func(p pointer) protoreflect.RawFields {
|
||||
if p.IsNil() {
|
||||
return nil
|
||||
}
|
||||
@@ -141,7 +141,7 @@ func (mi *MessageInfo) makeUnknownFieldsFunc(t reflect.Type, si structInfo) {
|
||||
}
|
||||
return **bp
|
||||
}
|
||||
mi.setUnknown = func(p pointer, b pref.RawFields) {
|
||||
mi.setUnknown = func(p pointer, b protoreflect.RawFields) {
|
||||
if p.IsNil() {
|
||||
panic("invalid SetUnknown on nil Message")
|
||||
}
|
||||
@@ -152,10 +152,10 @@ func (mi *MessageInfo) makeUnknownFieldsFunc(t reflect.Type, si structInfo) {
|
||||
**bp = b
|
||||
}
|
||||
default:
|
||||
mi.getUnknown = func(pointer) pref.RawFields {
|
||||
mi.getUnknown = func(pointer) protoreflect.RawFields {
|
||||
return nil
|
||||
}
|
||||
mi.setUnknown = func(p pointer, _ pref.RawFields) {
|
||||
mi.setUnknown = func(p pointer, _ protoreflect.RawFields) {
|
||||
if p.IsNil() {
|
||||
panic("invalid SetUnknown on nil Message")
|
||||
}
|
||||
@@ -224,7 +224,7 @@ func (mi *MessageInfo) makeFieldTypes(si structInfo) {
|
||||
}
|
||||
if ft != nil {
|
||||
if mi.fieldTypes == nil {
|
||||
mi.fieldTypes = make(map[pref.FieldNumber]interface{})
|
||||
mi.fieldTypes = make(map[protoreflect.FieldNumber]interface{})
|
||||
}
|
||||
mi.fieldTypes[fd.Number()] = reflect.Zero(ft).Interface()
|
||||
}
|
||||
@@ -233,7 +233,7 @@ func (mi *MessageInfo) makeFieldTypes(si structInfo) {
|
||||
|
||||
type extensionMap map[int32]ExtensionField
|
||||
|
||||
func (m *extensionMap) Range(f func(pref.FieldDescriptor, pref.Value) bool) {
|
||||
func (m *extensionMap) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
if m != nil {
|
||||
for _, x := range *m {
|
||||
xd := x.Type().TypeDescriptor()
|
||||
@@ -247,7 +247,7 @@ func (m *extensionMap) Range(f func(pref.FieldDescriptor, pref.Value) bool) {
|
||||
}
|
||||
}
|
||||
}
|
||||
func (m *extensionMap) Has(xt pref.ExtensionType) (ok bool) {
|
||||
func (m *extensionMap) Has(xt protoreflect.ExtensionType) (ok bool) {
|
||||
if m == nil {
|
||||
return false
|
||||
}
|
||||
@@ -266,10 +266,10 @@ func (m *extensionMap) Has(xt pref.ExtensionType) (ok bool) {
|
||||
}
|
||||
return true
|
||||
}
|
||||
func (m *extensionMap) Clear(xt pref.ExtensionType) {
|
||||
func (m *extensionMap) Clear(xt protoreflect.ExtensionType) {
|
||||
delete(*m, int32(xt.TypeDescriptor().Number()))
|
||||
}
|
||||
func (m *extensionMap) Get(xt pref.ExtensionType) pref.Value {
|
||||
func (m *extensionMap) Get(xt protoreflect.ExtensionType) protoreflect.Value {
|
||||
xd := xt.TypeDescriptor()
|
||||
if m != nil {
|
||||
if x, ok := (*m)[int32(xd.Number())]; ok {
|
||||
@@ -278,7 +278,7 @@ func (m *extensionMap) Get(xt pref.ExtensionType) pref.Value {
|
||||
}
|
||||
return xt.Zero()
|
||||
}
|
||||
func (m *extensionMap) Set(xt pref.ExtensionType, v pref.Value) {
|
||||
func (m *extensionMap) Set(xt protoreflect.ExtensionType, v protoreflect.Value) {
|
||||
xd := xt.TypeDescriptor()
|
||||
isValid := true
|
||||
switch {
|
||||
@@ -302,9 +302,9 @@ func (m *extensionMap) Set(xt pref.ExtensionType, v pref.Value) {
|
||||
x.Set(xt, v)
|
||||
(*m)[int32(xd.Number())] = x
|
||||
}
|
||||
func (m *extensionMap) Mutable(xt pref.ExtensionType) pref.Value {
|
||||
func (m *extensionMap) Mutable(xt protoreflect.ExtensionType) protoreflect.Value {
|
||||
xd := xt.TypeDescriptor()
|
||||
if xd.Kind() != pref.MessageKind && xd.Kind() != pref.GroupKind && !xd.IsList() && !xd.IsMap() {
|
||||
if xd.Kind() != protoreflect.MessageKind && xd.Kind() != protoreflect.GroupKind && !xd.IsList() && !xd.IsMap() {
|
||||
panic("invalid Mutable on field with non-composite type")
|
||||
}
|
||||
if x, ok := (*m)[int32(xd.Number())]; ok {
|
||||
@@ -320,7 +320,6 @@ func (m *extensionMap) Mutable(xt pref.ExtensionType) pref.Value {
|
||||
// in an allocation-free way without needing to have a shadow Go type generated
|
||||
// for every message type. This technique only works using unsafe.
|
||||
//
|
||||
//
|
||||
// Example generated code:
|
||||
//
|
||||
// type M struct {
|
||||
@@ -351,12 +350,11 @@ func (m *extensionMap) Mutable(xt pref.ExtensionType) pref.Value {
|
||||
// It has access to the message info as its first field, and a pointer to the
|
||||
// MessageState is identical to a pointer to the concrete message value.
|
||||
//
|
||||
//
|
||||
// Requirements:
|
||||
// • The type M must implement protoreflect.ProtoMessage.
|
||||
// • The address of m must not be nil.
|
||||
// • The address of m and the address of m.state must be equal,
|
||||
// even though they are different Go types.
|
||||
// - The type M must implement protoreflect.ProtoMessage.
|
||||
// - The address of m must not be nil.
|
||||
// - The address of m and the address of m.state must be equal,
|
||||
// even though they are different Go types.
|
||||
type MessageState struct {
|
||||
pragma.NoUnkeyedLiterals
|
||||
pragma.DoNotCompare
|
||||
@@ -368,8 +366,8 @@ type MessageState struct {
|
||||
type messageState MessageState
|
||||
|
||||
var (
|
||||
_ pref.Message = (*messageState)(nil)
|
||||
_ unwrapper = (*messageState)(nil)
|
||||
_ protoreflect.Message = (*messageState)(nil)
|
||||
_ unwrapper = (*messageState)(nil)
|
||||
)
|
||||
|
||||
// messageDataType is a tuple of a pointer to the message data and
|
||||
@@ -387,16 +385,16 @@ type (
|
||||
)
|
||||
|
||||
var (
|
||||
_ pref.Message = (*messageReflectWrapper)(nil)
|
||||
_ unwrapper = (*messageReflectWrapper)(nil)
|
||||
_ pref.ProtoMessage = (*messageIfaceWrapper)(nil)
|
||||
_ unwrapper = (*messageIfaceWrapper)(nil)
|
||||
_ protoreflect.Message = (*messageReflectWrapper)(nil)
|
||||
_ unwrapper = (*messageReflectWrapper)(nil)
|
||||
_ protoreflect.ProtoMessage = (*messageIfaceWrapper)(nil)
|
||||
_ unwrapper = (*messageIfaceWrapper)(nil)
|
||||
)
|
||||
|
||||
// MessageOf returns a reflective view over a message. The input must be a
|
||||
// pointer to a named Go struct. If the provided type has a ProtoReflect method,
|
||||
// it must be implemented by calling this method.
|
||||
func (mi *MessageInfo) MessageOf(m interface{}) pref.Message {
|
||||
func (mi *MessageInfo) MessageOf(m interface{}) protoreflect.Message {
|
||||
if reflect.TypeOf(m) != mi.GoReflectType {
|
||||
panic(fmt.Sprintf("type mismatch: got %T, want %v", m, mi.GoReflectType))
|
||||
}
|
||||
@@ -421,7 +419,7 @@ func (m *messageIfaceWrapper) Reset() {
|
||||
rv.Elem().Set(reflect.Zero(rv.Type().Elem()))
|
||||
}
|
||||
}
|
||||
func (m *messageIfaceWrapper) ProtoReflect() pref.Message {
|
||||
func (m *messageIfaceWrapper) ProtoReflect() protoreflect.Message {
|
||||
return (*messageReflectWrapper)(m)
|
||||
}
|
||||
func (m *messageIfaceWrapper) protoUnwrap() interface{} {
|
||||
@@ -430,7 +428,7 @@ func (m *messageIfaceWrapper) protoUnwrap() interface{} {
|
||||
|
||||
// checkField verifies that the provided field descriptor is valid.
|
||||
// Exactly one of the returned values is populated.
|
||||
func (mi *MessageInfo) checkField(fd pref.FieldDescriptor) (*fieldInfo, pref.ExtensionType) {
|
||||
func (mi *MessageInfo) checkField(fd protoreflect.FieldDescriptor) (*fieldInfo, protoreflect.ExtensionType) {
|
||||
var fi *fieldInfo
|
||||
if n := fd.Number(); 0 < n && int(n) < len(mi.denseFields) {
|
||||
fi = mi.denseFields[n]
|
||||
@@ -455,7 +453,7 @@ func (mi *MessageInfo) checkField(fd pref.FieldDescriptor) (*fieldInfo, pref.Ext
|
||||
if !mi.Desc.ExtensionRanges().Has(fd.Number()) {
|
||||
panic(fmt.Sprintf("extension %v extends %v outside the extension range", fd.FullName(), mi.Desc.FullName()))
|
||||
}
|
||||
xtd, ok := fd.(pref.ExtensionTypeDescriptor)
|
||||
xtd, ok := fd.(protoreflect.ExtensionTypeDescriptor)
|
||||
if !ok {
|
||||
panic(fmt.Sprintf("extension %v does not implement protoreflect.ExtensionTypeDescriptor", fd.FullName()))
|
||||
}
|
||||
|
||||
118
go/vendor/google.golang.org/protobuf/internal/impl/message_reflect_field.go
generated
vendored
118
go/vendor/google.golang.org/protobuf/internal/impl/message_reflect_field.go
generated
vendored
@@ -11,24 +11,24 @@ import (
|
||||
"sync"
|
||||
|
||||
"google.golang.org/protobuf/internal/flags"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
preg "google.golang.org/protobuf/reflect/protoregistry"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
)
|
||||
|
||||
type fieldInfo struct {
|
||||
fieldDesc pref.FieldDescriptor
|
||||
fieldDesc protoreflect.FieldDescriptor
|
||||
|
||||
// These fields are used for protobuf reflection support.
|
||||
has func(pointer) bool
|
||||
clear func(pointer)
|
||||
get func(pointer) pref.Value
|
||||
set func(pointer, pref.Value)
|
||||
mutable func(pointer) pref.Value
|
||||
newMessage func() pref.Message
|
||||
newField func() pref.Value
|
||||
get func(pointer) protoreflect.Value
|
||||
set func(pointer, protoreflect.Value)
|
||||
mutable func(pointer) protoreflect.Value
|
||||
newMessage func() protoreflect.Message
|
||||
newField func() protoreflect.Value
|
||||
}
|
||||
|
||||
func fieldInfoForMissing(fd pref.FieldDescriptor) fieldInfo {
|
||||
func fieldInfoForMissing(fd protoreflect.FieldDescriptor) fieldInfo {
|
||||
// This never occurs for generated message types.
|
||||
// It implies that a hand-crafted type has missing Go fields
|
||||
// for specific protobuf message fields.
|
||||
@@ -40,19 +40,19 @@ func fieldInfoForMissing(fd pref.FieldDescriptor) fieldInfo {
|
||||
clear: func(p pointer) {
|
||||
panic("missing Go struct field for " + string(fd.FullName()))
|
||||
},
|
||||
get: func(p pointer) pref.Value {
|
||||
get: func(p pointer) protoreflect.Value {
|
||||
return fd.Default()
|
||||
},
|
||||
set: func(p pointer, v pref.Value) {
|
||||
set: func(p pointer, v protoreflect.Value) {
|
||||
panic("missing Go struct field for " + string(fd.FullName()))
|
||||
},
|
||||
mutable: func(p pointer) pref.Value {
|
||||
mutable: func(p pointer) protoreflect.Value {
|
||||
panic("missing Go struct field for " + string(fd.FullName()))
|
||||
},
|
||||
newMessage: func() pref.Message {
|
||||
newMessage: func() protoreflect.Message {
|
||||
panic("missing Go struct field for " + string(fd.FullName()))
|
||||
},
|
||||
newField: func() pref.Value {
|
||||
newField: func() protoreflect.Value {
|
||||
if v := fd.Default(); v.IsValid() {
|
||||
return v
|
||||
}
|
||||
@@ -61,7 +61,7 @@ func fieldInfoForMissing(fd pref.FieldDescriptor) fieldInfo {
|
||||
}
|
||||
}
|
||||
|
||||
func fieldInfoForOneof(fd pref.FieldDescriptor, fs reflect.StructField, x exporter, ot reflect.Type) fieldInfo {
|
||||
func fieldInfoForOneof(fd protoreflect.FieldDescriptor, fs reflect.StructField, x exporter, ot reflect.Type) fieldInfo {
|
||||
ft := fs.Type
|
||||
if ft.Kind() != reflect.Interface {
|
||||
panic(fmt.Sprintf("field %v has invalid type: got %v, want interface kind", fd.FullName(), ft))
|
||||
@@ -102,7 +102,7 @@ func fieldInfoForOneof(fd pref.FieldDescriptor, fs reflect.StructField, x export
|
||||
}
|
||||
rv.Set(reflect.Zero(rv.Type()))
|
||||
},
|
||||
get: func(p pointer) pref.Value {
|
||||
get: func(p pointer) protoreflect.Value {
|
||||
if p.IsNil() {
|
||||
return conv.Zero()
|
||||
}
|
||||
@@ -113,7 +113,7 @@ func fieldInfoForOneof(fd pref.FieldDescriptor, fs reflect.StructField, x export
|
||||
rv = rv.Elem().Elem().Field(0)
|
||||
return conv.PBValueOf(rv)
|
||||
},
|
||||
set: func(p pointer, v pref.Value) {
|
||||
set: func(p pointer, v protoreflect.Value) {
|
||||
rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem()
|
||||
if rv.IsNil() || rv.Elem().Type().Elem() != ot || rv.Elem().IsNil() {
|
||||
rv.Set(reflect.New(ot))
|
||||
@@ -121,7 +121,7 @@ func fieldInfoForOneof(fd pref.FieldDescriptor, fs reflect.StructField, x export
|
||||
rv = rv.Elem().Elem().Field(0)
|
||||
rv.Set(conv.GoValueOf(v))
|
||||
},
|
||||
mutable: func(p pointer) pref.Value {
|
||||
mutable: func(p pointer) protoreflect.Value {
|
||||
if !isMessage {
|
||||
panic(fmt.Sprintf("field %v with invalid Mutable call on field with non-composite type", fd.FullName()))
|
||||
}
|
||||
@@ -131,20 +131,20 @@ func fieldInfoForOneof(fd pref.FieldDescriptor, fs reflect.StructField, x export
|
||||
}
|
||||
rv = rv.Elem().Elem().Field(0)
|
||||
if rv.Kind() == reflect.Ptr && rv.IsNil() {
|
||||
rv.Set(conv.GoValueOf(pref.ValueOfMessage(conv.New().Message())))
|
||||
rv.Set(conv.GoValueOf(protoreflect.ValueOfMessage(conv.New().Message())))
|
||||
}
|
||||
return conv.PBValueOf(rv)
|
||||
},
|
||||
newMessage: func() pref.Message {
|
||||
newMessage: func() protoreflect.Message {
|
||||
return conv.New().Message()
|
||||
},
|
||||
newField: func() pref.Value {
|
||||
newField: func() protoreflect.Value {
|
||||
return conv.New()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func fieldInfoForMap(fd pref.FieldDescriptor, fs reflect.StructField, x exporter) fieldInfo {
|
||||
func fieldInfoForMap(fd protoreflect.FieldDescriptor, fs reflect.StructField, x exporter) fieldInfo {
|
||||
ft := fs.Type
|
||||
if ft.Kind() != reflect.Map {
|
||||
panic(fmt.Sprintf("field %v has invalid type: got %v, want map kind", fd.FullName(), ft))
|
||||
@@ -166,7 +166,7 @@ func fieldInfoForMap(fd pref.FieldDescriptor, fs reflect.StructField, x exporter
|
||||
rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem()
|
||||
rv.Set(reflect.Zero(rv.Type()))
|
||||
},
|
||||
get: func(p pointer) pref.Value {
|
||||
get: func(p pointer) protoreflect.Value {
|
||||
if p.IsNil() {
|
||||
return conv.Zero()
|
||||
}
|
||||
@@ -176,7 +176,7 @@ func fieldInfoForMap(fd pref.FieldDescriptor, fs reflect.StructField, x exporter
|
||||
}
|
||||
return conv.PBValueOf(rv)
|
||||
},
|
||||
set: func(p pointer, v pref.Value) {
|
||||
set: func(p pointer, v protoreflect.Value) {
|
||||
rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem()
|
||||
pv := conv.GoValueOf(v)
|
||||
if pv.IsNil() {
|
||||
@@ -184,20 +184,20 @@ func fieldInfoForMap(fd pref.FieldDescriptor, fs reflect.StructField, x exporter
|
||||
}
|
||||
rv.Set(pv)
|
||||
},
|
||||
mutable: func(p pointer) pref.Value {
|
||||
mutable: func(p pointer) protoreflect.Value {
|
||||
v := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem()
|
||||
if v.IsNil() {
|
||||
v.Set(reflect.MakeMap(fs.Type))
|
||||
}
|
||||
return conv.PBValueOf(v)
|
||||
},
|
||||
newField: func() pref.Value {
|
||||
newField: func() protoreflect.Value {
|
||||
return conv.New()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func fieldInfoForList(fd pref.FieldDescriptor, fs reflect.StructField, x exporter) fieldInfo {
|
||||
func fieldInfoForList(fd protoreflect.FieldDescriptor, fs reflect.StructField, x exporter) fieldInfo {
|
||||
ft := fs.Type
|
||||
if ft.Kind() != reflect.Slice {
|
||||
panic(fmt.Sprintf("field %v has invalid type: got %v, want slice kind", fd.FullName(), ft))
|
||||
@@ -219,7 +219,7 @@ func fieldInfoForList(fd pref.FieldDescriptor, fs reflect.StructField, x exporte
|
||||
rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem()
|
||||
rv.Set(reflect.Zero(rv.Type()))
|
||||
},
|
||||
get: func(p pointer) pref.Value {
|
||||
get: func(p pointer) protoreflect.Value {
|
||||
if p.IsNil() {
|
||||
return conv.Zero()
|
||||
}
|
||||
@@ -229,7 +229,7 @@ func fieldInfoForList(fd pref.FieldDescriptor, fs reflect.StructField, x exporte
|
||||
}
|
||||
return conv.PBValueOf(rv)
|
||||
},
|
||||
set: func(p pointer, v pref.Value) {
|
||||
set: func(p pointer, v protoreflect.Value) {
|
||||
rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem()
|
||||
pv := conv.GoValueOf(v)
|
||||
if pv.IsNil() {
|
||||
@@ -237,11 +237,11 @@ func fieldInfoForList(fd pref.FieldDescriptor, fs reflect.StructField, x exporte
|
||||
}
|
||||
rv.Set(pv.Elem())
|
||||
},
|
||||
mutable: func(p pointer) pref.Value {
|
||||
mutable: func(p pointer) protoreflect.Value {
|
||||
v := p.Apply(fieldOffset).AsValueOf(fs.Type)
|
||||
return conv.PBValueOf(v)
|
||||
},
|
||||
newField: func() pref.Value {
|
||||
newField: func() protoreflect.Value {
|
||||
return conv.New()
|
||||
},
|
||||
}
|
||||
@@ -252,7 +252,7 @@ var (
|
||||
emptyBytes = reflect.ValueOf([]byte{})
|
||||
)
|
||||
|
||||
func fieldInfoForScalar(fd pref.FieldDescriptor, fs reflect.StructField, x exporter) fieldInfo {
|
||||
func fieldInfoForScalar(fd protoreflect.FieldDescriptor, fs reflect.StructField, x exporter) fieldInfo {
|
||||
ft := fs.Type
|
||||
nullable := fd.HasPresence()
|
||||
isBytes := ft.Kind() == reflect.Slice && ft.Elem().Kind() == reflect.Uint8
|
||||
@@ -300,7 +300,7 @@ func fieldInfoForScalar(fd pref.FieldDescriptor, fs reflect.StructField, x expor
|
||||
rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem()
|
||||
rv.Set(reflect.Zero(rv.Type()))
|
||||
},
|
||||
get: func(p pointer) pref.Value {
|
||||
get: func(p pointer) protoreflect.Value {
|
||||
if p.IsNil() {
|
||||
return conv.Zero()
|
||||
}
|
||||
@@ -315,7 +315,7 @@ func fieldInfoForScalar(fd pref.FieldDescriptor, fs reflect.StructField, x expor
|
||||
}
|
||||
return conv.PBValueOf(rv)
|
||||
},
|
||||
set: func(p pointer, v pref.Value) {
|
||||
set: func(p pointer, v protoreflect.Value) {
|
||||
rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem()
|
||||
if nullable && rv.Kind() == reflect.Ptr {
|
||||
if rv.IsNil() {
|
||||
@@ -332,23 +332,23 @@ func fieldInfoForScalar(fd pref.FieldDescriptor, fs reflect.StructField, x expor
|
||||
}
|
||||
}
|
||||
},
|
||||
newField: func() pref.Value {
|
||||
newField: func() protoreflect.Value {
|
||||
return conv.New()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func fieldInfoForWeakMessage(fd pref.FieldDescriptor, weakOffset offset) fieldInfo {
|
||||
func fieldInfoForWeakMessage(fd protoreflect.FieldDescriptor, weakOffset offset) fieldInfo {
|
||||
if !flags.ProtoLegacy {
|
||||
panic("no support for proto1 weak fields")
|
||||
}
|
||||
|
||||
var once sync.Once
|
||||
var messageType pref.MessageType
|
||||
var messageType protoreflect.MessageType
|
||||
lazyInit := func() {
|
||||
once.Do(func() {
|
||||
messageName := fd.Message().FullName()
|
||||
messageType, _ = preg.GlobalTypes.FindMessageByName(messageName)
|
||||
messageType, _ = protoregistry.GlobalTypes.FindMessageByName(messageName)
|
||||
if messageType == nil {
|
||||
panic(fmt.Sprintf("weak message %v for field %v is not linked in", messageName, fd.FullName()))
|
||||
}
|
||||
@@ -368,18 +368,18 @@ func fieldInfoForWeakMessage(fd pref.FieldDescriptor, weakOffset offset) fieldIn
|
||||
clear: func(p pointer) {
|
||||
p.Apply(weakOffset).WeakFields().clear(num)
|
||||
},
|
||||
get: func(p pointer) pref.Value {
|
||||
get: func(p pointer) protoreflect.Value {
|
||||
lazyInit()
|
||||
if p.IsNil() {
|
||||
return pref.ValueOfMessage(messageType.Zero())
|
||||
return protoreflect.ValueOfMessage(messageType.Zero())
|
||||
}
|
||||
m, ok := p.Apply(weakOffset).WeakFields().get(num)
|
||||
if !ok {
|
||||
return pref.ValueOfMessage(messageType.Zero())
|
||||
return protoreflect.ValueOfMessage(messageType.Zero())
|
||||
}
|
||||
return pref.ValueOfMessage(m.ProtoReflect())
|
||||
return protoreflect.ValueOfMessage(m.ProtoReflect())
|
||||
},
|
||||
set: func(p pointer, v pref.Value) {
|
||||
set: func(p pointer, v protoreflect.Value) {
|
||||
lazyInit()
|
||||
m := v.Message()
|
||||
if m.Descriptor() != messageType.Descriptor() {
|
||||
@@ -390,7 +390,7 @@ func fieldInfoForWeakMessage(fd pref.FieldDescriptor, weakOffset offset) fieldIn
|
||||
}
|
||||
p.Apply(weakOffset).WeakFields().set(num, m.Interface())
|
||||
},
|
||||
mutable: func(p pointer) pref.Value {
|
||||
mutable: func(p pointer) protoreflect.Value {
|
||||
lazyInit()
|
||||
fs := p.Apply(weakOffset).WeakFields()
|
||||
m, ok := fs.get(num)
|
||||
@@ -398,20 +398,20 @@ func fieldInfoForWeakMessage(fd pref.FieldDescriptor, weakOffset offset) fieldIn
|
||||
m = messageType.New().Interface()
|
||||
fs.set(num, m)
|
||||
}
|
||||
return pref.ValueOfMessage(m.ProtoReflect())
|
||||
return protoreflect.ValueOfMessage(m.ProtoReflect())
|
||||
},
|
||||
newMessage: func() pref.Message {
|
||||
newMessage: func() protoreflect.Message {
|
||||
lazyInit()
|
||||
return messageType.New()
|
||||
},
|
||||
newField: func() pref.Value {
|
||||
newField: func() protoreflect.Value {
|
||||
lazyInit()
|
||||
return pref.ValueOfMessage(messageType.New())
|
||||
return protoreflect.ValueOfMessage(messageType.New())
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func fieldInfoForMessage(fd pref.FieldDescriptor, fs reflect.StructField, x exporter) fieldInfo {
|
||||
func fieldInfoForMessage(fd protoreflect.FieldDescriptor, fs reflect.StructField, x exporter) fieldInfo {
|
||||
ft := fs.Type
|
||||
conv := NewConverter(ft, fd)
|
||||
|
||||
@@ -433,47 +433,47 @@ func fieldInfoForMessage(fd pref.FieldDescriptor, fs reflect.StructField, x expo
|
||||
rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem()
|
||||
rv.Set(reflect.Zero(rv.Type()))
|
||||
},
|
||||
get: func(p pointer) pref.Value {
|
||||
get: func(p pointer) protoreflect.Value {
|
||||
if p.IsNil() {
|
||||
return conv.Zero()
|
||||
}
|
||||
rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem()
|
||||
return conv.PBValueOf(rv)
|
||||
},
|
||||
set: func(p pointer, v pref.Value) {
|
||||
set: func(p pointer, v protoreflect.Value) {
|
||||
rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem()
|
||||
rv.Set(conv.GoValueOf(v))
|
||||
if fs.Type.Kind() == reflect.Ptr && rv.IsNil() {
|
||||
panic(fmt.Sprintf("field %v has invalid nil pointer", fd.FullName()))
|
||||
}
|
||||
},
|
||||
mutable: func(p pointer) pref.Value {
|
||||
mutable: func(p pointer) protoreflect.Value {
|
||||
rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem()
|
||||
if fs.Type.Kind() == reflect.Ptr && rv.IsNil() {
|
||||
rv.Set(conv.GoValueOf(conv.New()))
|
||||
}
|
||||
return conv.PBValueOf(rv)
|
||||
},
|
||||
newMessage: func() pref.Message {
|
||||
newMessage: func() protoreflect.Message {
|
||||
return conv.New().Message()
|
||||
},
|
||||
newField: func() pref.Value {
|
||||
newField: func() protoreflect.Value {
|
||||
return conv.New()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
type oneofInfo struct {
|
||||
oneofDesc pref.OneofDescriptor
|
||||
which func(pointer) pref.FieldNumber
|
||||
oneofDesc protoreflect.OneofDescriptor
|
||||
which func(pointer) protoreflect.FieldNumber
|
||||
}
|
||||
|
||||
func makeOneofInfo(od pref.OneofDescriptor, si structInfo, x exporter) *oneofInfo {
|
||||
func makeOneofInfo(od protoreflect.OneofDescriptor, si structInfo, x exporter) *oneofInfo {
|
||||
oi := &oneofInfo{oneofDesc: od}
|
||||
if od.IsSynthetic() {
|
||||
fs := si.fieldsByNumber[od.Fields().Get(0).Number()]
|
||||
fieldOffset := offsetOf(fs, x)
|
||||
oi.which = func(p pointer) pref.FieldNumber {
|
||||
oi.which = func(p pointer) protoreflect.FieldNumber {
|
||||
if p.IsNil() {
|
||||
return 0
|
||||
}
|
||||
@@ -486,7 +486,7 @@ func makeOneofInfo(od pref.OneofDescriptor, si structInfo, x exporter) *oneofInf
|
||||
} else {
|
||||
fs := si.oneofsByName[od.Name()]
|
||||
fieldOffset := offsetOf(fs, x)
|
||||
oi.which = func(p pointer) pref.FieldNumber {
|
||||
oi.which = func(p pointer) protoreflect.FieldNumber {
|
||||
if p.IsNil() {
|
||||
return 0
|
||||
}
|
||||
|
||||
36
go/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go
generated
vendored
36
go/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go
generated
vendored
@@ -159,6 +159,42 @@ func (p pointer) SetPointer(v pointer) {
|
||||
p.v.Elem().Set(v.v)
|
||||
}
|
||||
|
||||
func growSlice(p pointer, addCap int) {
|
||||
// TODO: Once we only support Go 1.20 and newer, use reflect.Grow.
|
||||
in := p.v.Elem()
|
||||
out := reflect.MakeSlice(in.Type(), in.Len(), in.Len()+addCap)
|
||||
reflect.Copy(out, in)
|
||||
p.v.Elem().Set(out)
|
||||
}
|
||||
|
||||
func (p pointer) growBoolSlice(addCap int) {
|
||||
growSlice(p, addCap)
|
||||
}
|
||||
|
||||
func (p pointer) growInt32Slice(addCap int) {
|
||||
growSlice(p, addCap)
|
||||
}
|
||||
|
||||
func (p pointer) growUint32Slice(addCap int) {
|
||||
growSlice(p, addCap)
|
||||
}
|
||||
|
||||
func (p pointer) growInt64Slice(addCap int) {
|
||||
growSlice(p, addCap)
|
||||
}
|
||||
|
||||
func (p pointer) growUint64Slice(addCap int) {
|
||||
growSlice(p, addCap)
|
||||
}
|
||||
|
||||
func (p pointer) growFloat64Slice(addCap int) {
|
||||
growSlice(p, addCap)
|
||||
}
|
||||
|
||||
func (p pointer) growFloat32Slice(addCap int) {
|
||||
growSlice(p, addCap)
|
||||
}
|
||||
|
||||
func (Export) MessageStateOf(p Pointer) *messageState { panic("not supported") }
|
||||
func (ms *messageState) pointer() pointer { panic("not supported") }
|
||||
func (ms *messageState) messageInfo() *MessageInfo { panic("not supported") }
|
||||
|
||||
40
go/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go
generated
vendored
40
go/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go
generated
vendored
@@ -138,6 +138,46 @@ func (p pointer) SetPointer(v pointer) {
|
||||
*(*unsafe.Pointer)(p.p) = (unsafe.Pointer)(v.p)
|
||||
}
|
||||
|
||||
func (p pointer) growBoolSlice(addCap int) {
|
||||
sp := p.BoolSlice()
|
||||
s := make([]bool, 0, addCap+len(*sp))
|
||||
s = s[:len(*sp)]
|
||||
copy(s, *sp)
|
||||
*sp = s
|
||||
}
|
||||
|
||||
func (p pointer) growInt32Slice(addCap int) {
|
||||
sp := p.Int32Slice()
|
||||
s := make([]int32, 0, addCap+len(*sp))
|
||||
s = s[:len(*sp)]
|
||||
copy(s, *sp)
|
||||
*sp = s
|
||||
}
|
||||
|
||||
func (p pointer) growUint32Slice(addCap int) {
|
||||
p.growInt32Slice(addCap)
|
||||
}
|
||||
|
||||
func (p pointer) growFloat32Slice(addCap int) {
|
||||
p.growInt32Slice(addCap)
|
||||
}
|
||||
|
||||
func (p pointer) growInt64Slice(addCap int) {
|
||||
sp := p.Int64Slice()
|
||||
s := make([]int64, 0, addCap+len(*sp))
|
||||
s = s[:len(*sp)]
|
||||
copy(s, *sp)
|
||||
*sp = s
|
||||
}
|
||||
|
||||
func (p pointer) growUint64Slice(addCap int) {
|
||||
p.growInt64Slice(addCap)
|
||||
}
|
||||
|
||||
func (p pointer) growFloat64Slice(addCap int) {
|
||||
p.growInt64Slice(addCap)
|
||||
}
|
||||
|
||||
// Static check that MessageState does not exceed the size of a pointer.
|
||||
const _ = uint(unsafe.Sizeof(unsafe.Pointer(nil)) - unsafe.Sizeof(MessageState{}))
|
||||
|
||||
|
||||
50
go/vendor/google.golang.org/protobuf/internal/impl/validate.go
generated
vendored
50
go/vendor/google.golang.org/protobuf/internal/impl/validate.go
generated
vendored
@@ -16,9 +16,9 @@ import (
|
||||
"google.golang.org/protobuf/internal/flags"
|
||||
"google.golang.org/protobuf/internal/genid"
|
||||
"google.golang.org/protobuf/internal/strs"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
preg "google.golang.org/protobuf/reflect/protoregistry"
|
||||
piface "google.golang.org/protobuf/runtime/protoiface"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
"google.golang.org/protobuf/runtime/protoiface"
|
||||
)
|
||||
|
||||
// ValidationStatus is the result of validating the wire-format encoding of a message.
|
||||
@@ -56,20 +56,20 @@ func (v ValidationStatus) String() string {
|
||||
// of the message type.
|
||||
//
|
||||
// This function is exposed for testing.
|
||||
func Validate(mt pref.MessageType, in piface.UnmarshalInput) (out piface.UnmarshalOutput, _ ValidationStatus) {
|
||||
func Validate(mt protoreflect.MessageType, in protoiface.UnmarshalInput) (out protoiface.UnmarshalOutput, _ ValidationStatus) {
|
||||
mi, ok := mt.(*MessageInfo)
|
||||
if !ok {
|
||||
return out, ValidationUnknown
|
||||
}
|
||||
if in.Resolver == nil {
|
||||
in.Resolver = preg.GlobalTypes
|
||||
in.Resolver = protoregistry.GlobalTypes
|
||||
}
|
||||
o, st := mi.validate(in.Buf, 0, unmarshalOptions{
|
||||
flags: in.Flags,
|
||||
resolver: in.Resolver,
|
||||
})
|
||||
if o.initialized {
|
||||
out.Flags |= piface.UnmarshalInitialized
|
||||
out.Flags |= protoiface.UnmarshalInitialized
|
||||
}
|
||||
return out, st
|
||||
}
|
||||
@@ -106,22 +106,22 @@ const (
|
||||
validationTypeMessageSetItem
|
||||
)
|
||||
|
||||
func newFieldValidationInfo(mi *MessageInfo, si structInfo, fd pref.FieldDescriptor, ft reflect.Type) validationInfo {
|
||||
func newFieldValidationInfo(mi *MessageInfo, si structInfo, fd protoreflect.FieldDescriptor, ft reflect.Type) validationInfo {
|
||||
var vi validationInfo
|
||||
switch {
|
||||
case fd.ContainingOneof() != nil && !fd.ContainingOneof().IsSynthetic():
|
||||
switch fd.Kind() {
|
||||
case pref.MessageKind:
|
||||
case protoreflect.MessageKind:
|
||||
vi.typ = validationTypeMessage
|
||||
if ot, ok := si.oneofWrappersByNumber[fd.Number()]; ok {
|
||||
vi.mi = getMessageInfo(ot.Field(0).Type)
|
||||
}
|
||||
case pref.GroupKind:
|
||||
case protoreflect.GroupKind:
|
||||
vi.typ = validationTypeGroup
|
||||
if ot, ok := si.oneofWrappersByNumber[fd.Number()]; ok {
|
||||
vi.mi = getMessageInfo(ot.Field(0).Type)
|
||||
}
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
if strs.EnforceUTF8(fd) {
|
||||
vi.typ = validationTypeUTF8String
|
||||
}
|
||||
@@ -129,7 +129,7 @@ func newFieldValidationInfo(mi *MessageInfo, si structInfo, fd pref.FieldDescrip
|
||||
default:
|
||||
vi = newValidationInfo(fd, ft)
|
||||
}
|
||||
if fd.Cardinality() == pref.Required {
|
||||
if fd.Cardinality() == protoreflect.Required {
|
||||
// Avoid overflow. The required field check is done with a 64-bit mask, with
|
||||
// any message containing more than 64 required fields always reported as
|
||||
// potentially uninitialized, so it is not important to get a precise count
|
||||
@@ -142,22 +142,22 @@ func newFieldValidationInfo(mi *MessageInfo, si structInfo, fd pref.FieldDescrip
|
||||
return vi
|
||||
}
|
||||
|
||||
func newValidationInfo(fd pref.FieldDescriptor, ft reflect.Type) validationInfo {
|
||||
func newValidationInfo(fd protoreflect.FieldDescriptor, ft reflect.Type) validationInfo {
|
||||
var vi validationInfo
|
||||
switch {
|
||||
case fd.IsList():
|
||||
switch fd.Kind() {
|
||||
case pref.MessageKind:
|
||||
case protoreflect.MessageKind:
|
||||
vi.typ = validationTypeMessage
|
||||
if ft.Kind() == reflect.Slice {
|
||||
vi.mi = getMessageInfo(ft.Elem())
|
||||
}
|
||||
case pref.GroupKind:
|
||||
case protoreflect.GroupKind:
|
||||
vi.typ = validationTypeGroup
|
||||
if ft.Kind() == reflect.Slice {
|
||||
vi.mi = getMessageInfo(ft.Elem())
|
||||
}
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
vi.typ = validationTypeBytes
|
||||
if strs.EnforceUTF8(fd) {
|
||||
vi.typ = validationTypeUTF8String
|
||||
@@ -175,33 +175,33 @@ func newValidationInfo(fd pref.FieldDescriptor, ft reflect.Type) validationInfo
|
||||
case fd.IsMap():
|
||||
vi.typ = validationTypeMap
|
||||
switch fd.MapKey().Kind() {
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
if strs.EnforceUTF8(fd) {
|
||||
vi.keyType = validationTypeUTF8String
|
||||
}
|
||||
}
|
||||
switch fd.MapValue().Kind() {
|
||||
case pref.MessageKind:
|
||||
case protoreflect.MessageKind:
|
||||
vi.valType = validationTypeMessage
|
||||
if ft.Kind() == reflect.Map {
|
||||
vi.mi = getMessageInfo(ft.Elem())
|
||||
}
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
if strs.EnforceUTF8(fd) {
|
||||
vi.valType = validationTypeUTF8String
|
||||
}
|
||||
}
|
||||
default:
|
||||
switch fd.Kind() {
|
||||
case pref.MessageKind:
|
||||
case protoreflect.MessageKind:
|
||||
vi.typ = validationTypeMessage
|
||||
if !fd.IsWeak() {
|
||||
vi.mi = getMessageInfo(ft)
|
||||
}
|
||||
case pref.GroupKind:
|
||||
case protoreflect.GroupKind:
|
||||
vi.typ = validationTypeGroup
|
||||
vi.mi = getMessageInfo(ft)
|
||||
case pref.StringKind:
|
||||
case protoreflect.StringKind:
|
||||
vi.typ = validationTypeBytes
|
||||
if strs.EnforceUTF8(fd) {
|
||||
vi.typ = validationTypeUTF8String
|
||||
@@ -314,11 +314,11 @@ State:
|
||||
break
|
||||
}
|
||||
messageName := fd.Message().FullName()
|
||||
messageType, err := preg.GlobalTypes.FindMessageByName(messageName)
|
||||
messageType, err := protoregistry.GlobalTypes.FindMessageByName(messageName)
|
||||
switch err {
|
||||
case nil:
|
||||
vi.mi, _ = messageType.(*MessageInfo)
|
||||
case preg.NotFound:
|
||||
case protoregistry.NotFound:
|
||||
vi.typ = validationTypeBytes
|
||||
default:
|
||||
return out, ValidationUnknown
|
||||
@@ -335,7 +335,7 @@ State:
|
||||
// unmarshaling to begin failing. Supporting this requires some way to
|
||||
// determine if the resolver is frozen.
|
||||
xt, err := opts.resolver.FindExtensionByNumber(st.mi.Desc.FullName(), num)
|
||||
if err != nil && err != preg.NotFound {
|
||||
if err != nil && err != protoregistry.NotFound {
|
||||
return out, ValidationUnknown
|
||||
}
|
||||
if err == nil {
|
||||
@@ -513,7 +513,7 @@ State:
|
||||
}
|
||||
xt, err := opts.resolver.FindExtensionByNumber(st.mi.Desc.FullName(), typeid)
|
||||
switch {
|
||||
case err == preg.NotFound:
|
||||
case err == protoregistry.NotFound:
|
||||
b = b[n:]
|
||||
case err != nil:
|
||||
return out, ValidationUnknown
|
||||
|
||||
16
go/vendor/google.golang.org/protobuf/internal/impl/weak.go
generated
vendored
16
go/vendor/google.golang.org/protobuf/internal/impl/weak.go
generated
vendored
@@ -7,7 +7,7 @@ package impl
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
)
|
||||
|
||||
@@ -17,32 +17,32 @@ import (
|
||||
// defined directly on it.
|
||||
type weakFields WeakFields
|
||||
|
||||
func (w weakFields) get(num pref.FieldNumber) (pref.ProtoMessage, bool) {
|
||||
func (w weakFields) get(num protoreflect.FieldNumber) (protoreflect.ProtoMessage, bool) {
|
||||
m, ok := w[int32(num)]
|
||||
return m, ok
|
||||
}
|
||||
|
||||
func (w *weakFields) set(num pref.FieldNumber, m pref.ProtoMessage) {
|
||||
func (w *weakFields) set(num protoreflect.FieldNumber, m protoreflect.ProtoMessage) {
|
||||
if *w == nil {
|
||||
*w = make(weakFields)
|
||||
}
|
||||
(*w)[int32(num)] = m
|
||||
}
|
||||
|
||||
func (w *weakFields) clear(num pref.FieldNumber) {
|
||||
func (w *weakFields) clear(num protoreflect.FieldNumber) {
|
||||
delete(*w, int32(num))
|
||||
}
|
||||
|
||||
func (Export) HasWeak(w WeakFields, num pref.FieldNumber) bool {
|
||||
func (Export) HasWeak(w WeakFields, num protoreflect.FieldNumber) bool {
|
||||
_, ok := w[int32(num)]
|
||||
return ok
|
||||
}
|
||||
|
||||
func (Export) ClearWeak(w *WeakFields, num pref.FieldNumber) {
|
||||
func (Export) ClearWeak(w *WeakFields, num protoreflect.FieldNumber) {
|
||||
delete(*w, int32(num))
|
||||
}
|
||||
|
||||
func (Export) GetWeak(w WeakFields, num pref.FieldNumber, name pref.FullName) pref.ProtoMessage {
|
||||
func (Export) GetWeak(w WeakFields, num protoreflect.FieldNumber, name protoreflect.FullName) protoreflect.ProtoMessage {
|
||||
if m, ok := w[int32(num)]; ok {
|
||||
return m
|
||||
}
|
||||
@@ -53,7 +53,7 @@ func (Export) GetWeak(w WeakFields, num pref.FieldNumber, name pref.FullName) pr
|
||||
return mt.Zero().Interface()
|
||||
}
|
||||
|
||||
func (Export) SetWeak(w *WeakFields, num pref.FieldNumber, name pref.FullName, m pref.ProtoMessage) {
|
||||
func (Export) SetWeak(w *WeakFields, num protoreflect.FieldNumber, name protoreflect.FullName, m protoreflect.ProtoMessage) {
|
||||
if m != nil {
|
||||
mt, _ := protoregistry.GlobalTypes.FindMessageByName(name)
|
||||
if mt == nil {
|
||||
|
||||
18
go/vendor/google.golang.org/protobuf/internal/order/order.go
generated
vendored
18
go/vendor/google.golang.org/protobuf/internal/order/order.go
generated
vendored
@@ -5,12 +5,12 @@
|
||||
package order
|
||||
|
||||
import (
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
// FieldOrder specifies the ordering to visit message fields.
|
||||
// It is a function that reports whether x is ordered before y.
|
||||
type FieldOrder func(x, y pref.FieldDescriptor) bool
|
||||
type FieldOrder func(x, y protoreflect.FieldDescriptor) bool
|
||||
|
||||
var (
|
||||
// AnyFieldOrder specifies no specific field ordering.
|
||||
@@ -18,9 +18,9 @@ var (
|
||||
|
||||
// LegacyFieldOrder sorts fields in the same ordering as emitted by
|
||||
// wire serialization in the github.com/golang/protobuf implementation.
|
||||
LegacyFieldOrder FieldOrder = func(x, y pref.FieldDescriptor) bool {
|
||||
LegacyFieldOrder FieldOrder = func(x, y protoreflect.FieldDescriptor) bool {
|
||||
ox, oy := x.ContainingOneof(), y.ContainingOneof()
|
||||
inOneof := func(od pref.OneofDescriptor) bool {
|
||||
inOneof := func(od protoreflect.OneofDescriptor) bool {
|
||||
return od != nil && !od.IsSynthetic()
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ var (
|
||||
return !inOneof(ox) && inOneof(oy)
|
||||
}
|
||||
// Fields in disjoint oneof sets are sorted by declaration index.
|
||||
if ox != nil && oy != nil && ox != oy {
|
||||
if inOneof(ox) && inOneof(oy) && ox != oy {
|
||||
return ox.Index() < oy.Index()
|
||||
}
|
||||
// Fields sorted by field number.
|
||||
@@ -41,14 +41,14 @@ var (
|
||||
}
|
||||
|
||||
// NumberFieldOrder sorts fields by their field number.
|
||||
NumberFieldOrder FieldOrder = func(x, y pref.FieldDescriptor) bool {
|
||||
NumberFieldOrder FieldOrder = func(x, y protoreflect.FieldDescriptor) bool {
|
||||
return x.Number() < y.Number()
|
||||
}
|
||||
|
||||
// IndexNameFieldOrder sorts non-extension fields before extension fields.
|
||||
// Non-extensions are sorted according to their declaration index.
|
||||
// Extensions are sorted according to their full name.
|
||||
IndexNameFieldOrder FieldOrder = func(x, y pref.FieldDescriptor) bool {
|
||||
IndexNameFieldOrder FieldOrder = func(x, y protoreflect.FieldDescriptor) bool {
|
||||
// Non-extension fields sort before extension fields.
|
||||
if x.IsExtension() != y.IsExtension() {
|
||||
return !x.IsExtension() && y.IsExtension()
|
||||
@@ -64,7 +64,7 @@ var (
|
||||
|
||||
// KeyOrder specifies the ordering to visit map entries.
|
||||
// It is a function that reports whether x is ordered before y.
|
||||
type KeyOrder func(x, y pref.MapKey) bool
|
||||
type KeyOrder func(x, y protoreflect.MapKey) bool
|
||||
|
||||
var (
|
||||
// AnyKeyOrder specifies no specific key ordering.
|
||||
@@ -72,7 +72,7 @@ var (
|
||||
|
||||
// GenericKeyOrder sorts false before true, numeric keys in ascending order,
|
||||
// and strings in lexicographical ordering according to UTF-8 codepoints.
|
||||
GenericKeyOrder KeyOrder = func(x, y pref.MapKey) bool {
|
||||
GenericKeyOrder KeyOrder = func(x, y protoreflect.MapKey) bool {
|
||||
switch x.Interface().(type) {
|
||||
case bool:
|
||||
return !x.Bool() && y.Bool()
|
||||
|
||||
22
go/vendor/google.golang.org/protobuf/internal/order/range.go
generated
vendored
22
go/vendor/google.golang.org/protobuf/internal/order/range.go
generated
vendored
@@ -9,12 +9,12 @@ import (
|
||||
"sort"
|
||||
"sync"
|
||||
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
type messageField struct {
|
||||
fd pref.FieldDescriptor
|
||||
v pref.Value
|
||||
fd protoreflect.FieldDescriptor
|
||||
v protoreflect.Value
|
||||
}
|
||||
|
||||
var messageFieldPool = sync.Pool{
|
||||
@@ -25,8 +25,8 @@ type (
|
||||
// FieldRnger is an interface for visiting all fields in a message.
|
||||
// The protoreflect.Message type implements this interface.
|
||||
FieldRanger interface{ Range(VisitField) }
|
||||
// VisitField is called everytime a message field is visited.
|
||||
VisitField = func(pref.FieldDescriptor, pref.Value) bool
|
||||
// VisitField is called every time a message field is visited.
|
||||
VisitField = func(protoreflect.FieldDescriptor, protoreflect.Value) bool
|
||||
)
|
||||
|
||||
// RangeFields iterates over the fields of fs according to the specified order.
|
||||
@@ -47,7 +47,7 @@ func RangeFields(fs FieldRanger, less FieldOrder, fn VisitField) {
|
||||
}()
|
||||
|
||||
// Collect all fields in the message and sort them.
|
||||
fs.Range(func(fd pref.FieldDescriptor, v pref.Value) bool {
|
||||
fs.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {
|
||||
fields = append(fields, messageField{fd, v})
|
||||
return true
|
||||
})
|
||||
@@ -64,8 +64,8 @@ func RangeFields(fs FieldRanger, less FieldOrder, fn VisitField) {
|
||||
}
|
||||
|
||||
type mapEntry struct {
|
||||
k pref.MapKey
|
||||
v pref.Value
|
||||
k protoreflect.MapKey
|
||||
v protoreflect.Value
|
||||
}
|
||||
|
||||
var mapEntryPool = sync.Pool{
|
||||
@@ -76,8 +76,8 @@ type (
|
||||
// EntryRanger is an interface for visiting all fields in a message.
|
||||
// The protoreflect.Map type implements this interface.
|
||||
EntryRanger interface{ Range(VisitEntry) }
|
||||
// VisitEntry is called everytime a map entry is visited.
|
||||
VisitEntry = func(pref.MapKey, pref.Value) bool
|
||||
// VisitEntry is called every time a map entry is visited.
|
||||
VisitEntry = func(protoreflect.MapKey, protoreflect.Value) bool
|
||||
)
|
||||
|
||||
// RangeEntries iterates over the entries of es according to the specified order.
|
||||
@@ -98,7 +98,7 @@ func RangeEntries(es EntryRanger, less KeyOrder, fn VisitEntry) {
|
||||
}()
|
||||
|
||||
// Collect all entries in the map and sort them.
|
||||
es.Range(func(k pref.MapKey, v pref.Value) bool {
|
||||
es.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool {
|
||||
entries = append(entries, mapEntry{k, v})
|
||||
return true
|
||||
})
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !purego && !appengine
|
||||
// +build !purego,!appengine
|
||||
//go:build !purego && !appengine && !go1.21
|
||||
// +build !purego,!appengine,!go1.21
|
||||
|
||||
package strs
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -59,7 +59,7 @@ type Builder struct {
|
||||
|
||||
// AppendFullName is equivalent to protoreflect.FullName.Append,
|
||||
// but optimized for large batches where each name has a shared lifetime.
|
||||
func (sb *Builder) AppendFullName(prefix pref.FullName, name pref.Name) pref.FullName {
|
||||
func (sb *Builder) AppendFullName(prefix protoreflect.FullName, name protoreflect.Name) protoreflect.FullName {
|
||||
n := len(prefix) + len(".") + len(name)
|
||||
if len(prefix) == 0 {
|
||||
n -= len(".")
|
||||
@@ -68,7 +68,7 @@ func (sb *Builder) AppendFullName(prefix pref.FullName, name pref.Name) pref.Ful
|
||||
sb.buf = append(sb.buf, prefix...)
|
||||
sb.buf = append(sb.buf, '.')
|
||||
sb.buf = append(sb.buf, name...)
|
||||
return pref.FullName(sb.last(n))
|
||||
return protoreflect.FullName(sb.last(n))
|
||||
}
|
||||
|
||||
// MakeString is equivalent to string(b), but optimized for large batches
|
||||
@@ -87,7 +87,7 @@ func (sb *Builder) grow(n int) {
|
||||
// Unlike strings.Builder, we do not need to copy over the contents
|
||||
// of the old buffer since our builder provides no API for
|
||||
// retrieving previously created strings.
|
||||
sb.buf = make([]byte, 2*(cap(sb.buf)+n))
|
||||
sb.buf = make([]byte, 0, 2*(cap(sb.buf)+n))
|
||||
}
|
||||
|
||||
func (sb *Builder) last(n int) string {
|
||||
74
go/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go121.go
generated
vendored
Normal file
74
go/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go121.go
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !purego && !appengine && go1.21
|
||||
// +build !purego,!appengine,go1.21
|
||||
|
||||
package strs
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
// UnsafeString returns an unsafe string reference of b.
|
||||
// The caller must treat the input slice as immutable.
|
||||
//
|
||||
// WARNING: Use carefully. The returned result must not leak to the end user
|
||||
// unless the input slice is provably immutable.
|
||||
func UnsafeString(b []byte) string {
|
||||
return unsafe.String(unsafe.SliceData(b), len(b))
|
||||
}
|
||||
|
||||
// UnsafeBytes returns an unsafe bytes slice reference of s.
|
||||
// The caller must treat returned slice as immutable.
|
||||
//
|
||||
// WARNING: Use carefully. The returned result must not leak to the end user.
|
||||
func UnsafeBytes(s string) []byte {
|
||||
return unsafe.Slice(unsafe.StringData(s), len(s))
|
||||
}
|
||||
|
||||
// Builder builds a set of strings with shared lifetime.
|
||||
// This differs from strings.Builder, which is for building a single string.
|
||||
type Builder struct {
|
||||
buf []byte
|
||||
}
|
||||
|
||||
// AppendFullName is equivalent to protoreflect.FullName.Append,
|
||||
// but optimized for large batches where each name has a shared lifetime.
|
||||
func (sb *Builder) AppendFullName(prefix protoreflect.FullName, name protoreflect.Name) protoreflect.FullName {
|
||||
n := len(prefix) + len(".") + len(name)
|
||||
if len(prefix) == 0 {
|
||||
n -= len(".")
|
||||
}
|
||||
sb.grow(n)
|
||||
sb.buf = append(sb.buf, prefix...)
|
||||
sb.buf = append(sb.buf, '.')
|
||||
sb.buf = append(sb.buf, name...)
|
||||
return protoreflect.FullName(sb.last(n))
|
||||
}
|
||||
|
||||
// MakeString is equivalent to string(b), but optimized for large batches
|
||||
// with a shared lifetime.
|
||||
func (sb *Builder) MakeString(b []byte) string {
|
||||
sb.grow(len(b))
|
||||
sb.buf = append(sb.buf, b...)
|
||||
return sb.last(len(b))
|
||||
}
|
||||
|
||||
func (sb *Builder) grow(n int) {
|
||||
if cap(sb.buf)-len(sb.buf) >= n {
|
||||
return
|
||||
}
|
||||
|
||||
// Unlike strings.Builder, we do not need to copy over the contents
|
||||
// of the old buffer since our builder provides no API for
|
||||
// retrieving previously created strings.
|
||||
sb.buf = make([]byte, 0, 2*(cap(sb.buf)+n))
|
||||
}
|
||||
|
||||
func (sb *Builder) last(n int) string {
|
||||
return UnsafeString(sb.buf[len(sb.buf)-n:])
|
||||
}
|
||||
54
go/vendor/google.golang.org/protobuf/internal/version/version.go
generated
vendored
54
go/vendor/google.golang.org/protobuf/internal/version/version.go
generated
vendored
@@ -12,47 +12,46 @@ import (
|
||||
|
||||
// These constants determine the current version of this module.
|
||||
//
|
||||
//
|
||||
// For our release process, we enforce the following rules:
|
||||
// * Tagged releases use a tag that is identical to String.
|
||||
// * Tagged releases never reference a commit where the String
|
||||
// contains "devel".
|
||||
// * The set of all commits in this repository where String
|
||||
// does not contain "devel" must have a unique String.
|
||||
//
|
||||
// - Tagged releases use a tag that is identical to String.
|
||||
// - Tagged releases never reference a commit where the String
|
||||
// contains "devel".
|
||||
// - The set of all commits in this repository where String
|
||||
// does not contain "devel" must have a unique String.
|
||||
//
|
||||
// Steps for tagging a new release:
|
||||
// 1. Create a new CL.
|
||||
//
|
||||
// 2. Update Minor, Patch, and/or PreRelease as necessary.
|
||||
// PreRelease must not contain the string "devel".
|
||||
// 1. Create a new CL.
|
||||
//
|
||||
// 3. Since the last released minor version, have there been any changes to
|
||||
// generator that relies on new functionality in the runtime?
|
||||
// If yes, then increment RequiredGenerated.
|
||||
// 2. Update Minor, Patch, and/or PreRelease as necessary.
|
||||
// PreRelease must not contain the string "devel".
|
||||
//
|
||||
// 4. Since the last released minor version, have there been any changes to
|
||||
// the runtime that removes support for old .pb.go source code?
|
||||
// If yes, then increment SupportMinimum.
|
||||
// 3. Since the last released minor version, have there been any changes to
|
||||
// generator that relies on new functionality in the runtime?
|
||||
// If yes, then increment RequiredGenerated.
|
||||
//
|
||||
// 5. Send out the CL for review and submit it.
|
||||
// Note that the next CL in step 8 must be submitted after this CL
|
||||
// without any other CLs in-between.
|
||||
// 4. Since the last released minor version, have there been any changes to
|
||||
// the runtime that removes support for old .pb.go source code?
|
||||
// If yes, then increment SupportMinimum.
|
||||
//
|
||||
// 6. Tag a new version, where the tag is is the current String.
|
||||
// 5. Send out the CL for review and submit it.
|
||||
// Note that the next CL in step 8 must be submitted after this CL
|
||||
// without any other CLs in-between.
|
||||
//
|
||||
// 7. Write release notes for all notable changes
|
||||
// between this release and the last release.
|
||||
// 6. Tag a new version, where the tag is is the current String.
|
||||
//
|
||||
// 8. Create a new CL.
|
||||
// 7. Write release notes for all notable changes
|
||||
// between this release and the last release.
|
||||
//
|
||||
// 9. Update PreRelease to include the string "devel".
|
||||
// For example: "" -> "devel" or "rc.1" -> "rc.1.devel"
|
||||
// 8. Create a new CL.
|
||||
//
|
||||
// 10. Send out the CL for review and submit it.
|
||||
// 9. Update PreRelease to include the string "devel".
|
||||
// For example: "" -> "devel" or "rc.1" -> "rc.1.devel"
|
||||
//
|
||||
// 10. Send out the CL for review and submit it.
|
||||
const (
|
||||
Major = 1
|
||||
Minor = 28
|
||||
Minor = 32
|
||||
Patch = 0
|
||||
PreRelease = ""
|
||||
)
|
||||
@@ -60,6 +59,7 @@ const (
|
||||
// String formats the version string for this module in semver format.
|
||||
//
|
||||
// Examples:
|
||||
//
|
||||
// v1.20.1
|
||||
// v1.21.0-rc.1
|
||||
func String() string {
|
||||
|
||||
5
go/vendor/google.golang.org/protobuf/proto/decode.go
generated
vendored
5
go/vendor/google.golang.org/protobuf/proto/decode.go
generated
vendored
@@ -19,7 +19,8 @@ import (
|
||||
// UnmarshalOptions configures the unmarshaler.
|
||||
//
|
||||
// Example usage:
|
||||
// err := UnmarshalOptions{DiscardUnknown: true}.Unmarshal(b, m)
|
||||
//
|
||||
// err := UnmarshalOptions{DiscardUnknown: true}.Unmarshal(b, m)
|
||||
type UnmarshalOptions struct {
|
||||
pragma.NoUnkeyedLiterals
|
||||
|
||||
@@ -68,7 +69,7 @@ func (o UnmarshalOptions) Unmarshal(b []byte, m Message) error {
|
||||
// UnmarshalState parses a wire-format message and places the result in m.
|
||||
//
|
||||
// This method permits fine-grained control over the unmarshaler.
|
||||
// Most users should use Unmarshal instead.
|
||||
// Most users should use [Unmarshal] instead.
|
||||
func (o UnmarshalOptions) UnmarshalState(in protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
|
||||
if o.RecursionLimit == 0 {
|
||||
o.RecursionLimit = protowire.DefaultRecursionLimit
|
||||
|
||||
82
go/vendor/google.golang.org/protobuf/proto/doc.go
generated
vendored
82
go/vendor/google.golang.org/protobuf/proto/doc.go
generated
vendored
@@ -5,89 +5,81 @@
|
||||
// Package proto provides functions operating on protocol buffer messages.
|
||||
//
|
||||
// For documentation on protocol buffers in general, see:
|
||||
//
|
||||
// https://developers.google.com/protocol-buffers
|
||||
// https://protobuf.dev.
|
||||
//
|
||||
// For a tutorial on using protocol buffers with Go, see:
|
||||
//
|
||||
// https://developers.google.com/protocol-buffers/docs/gotutorial
|
||||
// https://protobuf.dev/getting-started/gotutorial.
|
||||
//
|
||||
// For a guide to generated Go protocol buffer code, see:
|
||||
// https://protobuf.dev/reference/go/go-generated.
|
||||
//
|
||||
// https://developers.google.com/protocol-buffers/docs/reference/go-generated
|
||||
//
|
||||
//
|
||||
// Binary serialization
|
||||
// # Binary serialization
|
||||
//
|
||||
// This package contains functions to convert to and from the wire format,
|
||||
// an efficient binary serialization of protocol buffers.
|
||||
//
|
||||
// • Size reports the size of a message in the wire format.
|
||||
// - [Size] reports the size of a message in the wire format.
|
||||
//
|
||||
// • Marshal converts a message to the wire format.
|
||||
// The MarshalOptions type provides more control over wire marshaling.
|
||||
// - [Marshal] converts a message to the wire format.
|
||||
// The [MarshalOptions] type provides more control over wire marshaling.
|
||||
//
|
||||
// • Unmarshal converts a message from the wire format.
|
||||
// The UnmarshalOptions type provides more control over wire unmarshaling.
|
||||
// - [Unmarshal] converts a message from the wire format.
|
||||
// The [UnmarshalOptions] type provides more control over wire unmarshaling.
|
||||
//
|
||||
// # Basic message operations
|
||||
//
|
||||
// Basic message operations
|
||||
// - [Clone] makes a deep copy of a message.
|
||||
//
|
||||
// • Clone makes a deep copy of a message.
|
||||
// - [Merge] merges the content of a message into another.
|
||||
//
|
||||
// • Merge merges the content of a message into another.
|
||||
// - [Equal] compares two messages. For more control over comparisons
|
||||
// and detailed reporting of differences, see package
|
||||
// [google.golang.org/protobuf/testing/protocmp].
|
||||
//
|
||||
// • Equal compares two messages. For more control over comparisons
|
||||
// and detailed reporting of differences, see package
|
||||
// "google.golang.org/protobuf/testing/protocmp".
|
||||
// - [Reset] clears the content of a message.
|
||||
//
|
||||
// • Reset clears the content of a message.
|
||||
// - [CheckInitialized] reports whether all required fields in a message are set.
|
||||
//
|
||||
// • CheckInitialized reports whether all required fields in a message are set.
|
||||
//
|
||||
//
|
||||
// Optional scalar constructors
|
||||
// # Optional scalar constructors
|
||||
//
|
||||
// The API for some generated messages represents optional scalar fields
|
||||
// as pointers to a value. For example, an optional string field has the
|
||||
// Go type *string.
|
||||
//
|
||||
// • Bool, Int32, Int64, Uint32, Uint64, Float32, Float64, and String
|
||||
// take a value and return a pointer to a new instance of it,
|
||||
// to simplify construction of optional field values.
|
||||
// - [Bool], [Int32], [Int64], [Uint32], [Uint64], [Float32], [Float64], and [String]
|
||||
// take a value and return a pointer to a new instance of it,
|
||||
// to simplify construction of optional field values.
|
||||
//
|
||||
// Generated enum types usually have an Enum method which performs the
|
||||
// same operation.
|
||||
//
|
||||
// Optional scalar fields are only supported in proto2.
|
||||
//
|
||||
// # Extension accessors
|
||||
//
|
||||
// Extension accessors
|
||||
//
|
||||
// • HasExtension, GetExtension, SetExtension, and ClearExtension
|
||||
// access extension field values in a protocol buffer message.
|
||||
// - [HasExtension], [GetExtension], [SetExtension], and [ClearExtension]
|
||||
// access extension field values in a protocol buffer message.
|
||||
//
|
||||
// Extension fields are only supported in proto2.
|
||||
//
|
||||
// # Related packages
|
||||
//
|
||||
// Related packages
|
||||
// - Package [google.golang.org/protobuf/encoding/protojson] converts messages to
|
||||
// and from JSON.
|
||||
//
|
||||
// • Package "google.golang.org/protobuf/encoding/protojson" converts messages to
|
||||
// and from JSON.
|
||||
// - Package [google.golang.org/protobuf/encoding/prototext] converts messages to
|
||||
// and from the text format.
|
||||
//
|
||||
// • Package "google.golang.org/protobuf/encoding/prototext" converts messages to
|
||||
// and from the text format.
|
||||
// - Package [google.golang.org/protobuf/reflect/protoreflect] provides a
|
||||
// reflection interface for protocol buffer data types.
|
||||
//
|
||||
// • Package "google.golang.org/protobuf/reflect/protoreflect" provides a
|
||||
// reflection interface for protocol buffer data types.
|
||||
// - Package [google.golang.org/protobuf/testing/protocmp] provides features
|
||||
// to compare protocol buffer messages with the [github.com/google/go-cmp/cmp]
|
||||
// package.
|
||||
//
|
||||
// • Package "google.golang.org/protobuf/testing/protocmp" provides features
|
||||
// to compare protocol buffer messages with the "github.com/google/go-cmp/cmp"
|
||||
// package.
|
||||
//
|
||||
// • Package "google.golang.org/protobuf/types/dynamicpb" provides a dynamic
|
||||
// message type, suitable for working with messages where the protocol buffer
|
||||
// type is only known at runtime.
|
||||
// - Package [google.golang.org/protobuf/types/dynamicpb] provides a dynamic
|
||||
// message type, suitable for working with messages where the protocol buffer
|
||||
// type is only known at runtime.
|
||||
//
|
||||
// This module contains additional packages for more specialized use cases.
|
||||
// Consult the individual package documentation for details.
|
||||
|
||||
7
go/vendor/google.golang.org/protobuf/proto/encode.go
generated
vendored
7
go/vendor/google.golang.org/protobuf/proto/encode.go
generated
vendored
@@ -16,7 +16,8 @@ import (
|
||||
// MarshalOptions configures the marshaler.
|
||||
//
|
||||
// Example usage:
|
||||
// b, err := MarshalOptions{Deterministic: true}.Marshal(m)
|
||||
//
|
||||
// b, err := MarshalOptions{Deterministic: true}.Marshal(m)
|
||||
type MarshalOptions struct {
|
||||
pragma.NoUnkeyedLiterals
|
||||
|
||||
@@ -101,7 +102,9 @@ func (o MarshalOptions) Marshal(m Message) ([]byte, error) {
|
||||
// otherwise it returns a non-nil empty buffer.
|
||||
//
|
||||
// This is to assist the edge-case where user-code does the following:
|
||||
//
|
||||
// m1.OptionalBytes, _ = proto.Marshal(m2)
|
||||
//
|
||||
// where they expect the proto2 "optional_bytes" field to be populated
|
||||
// if any only if m2 is a valid message.
|
||||
func emptyBytesForMessage(m Message) []byte {
|
||||
@@ -126,7 +129,7 @@ func (o MarshalOptions) MarshalAppend(b []byte, m Message) ([]byte, error) {
|
||||
// MarshalState returns the wire-format encoding of a message.
|
||||
//
|
||||
// This method permits fine-grained control over the marshaler.
|
||||
// Most users should use Marshal instead.
|
||||
// Most users should use [Marshal] instead.
|
||||
func (o MarshalOptions) MarshalState(in protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
|
||||
return o.marshal(in.Buf, in.Message)
|
||||
}
|
||||
|
||||
178
go/vendor/google.golang.org/protobuf/proto/equal.go
generated
vendored
178
go/vendor/google.golang.org/protobuf/proto/equal.go
generated
vendored
@@ -5,163 +5,53 @@
|
||||
package proto
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"math"
|
||||
"reflect"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
pref "google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
// Equal reports whether two messages are equal.
|
||||
// If two messages marshal to the same bytes under deterministic serialization,
|
||||
// then Equal is guaranteed to report true.
|
||||
// Equal reports whether two messages are equal,
|
||||
// by recursively comparing the fields of the message.
|
||||
//
|
||||
// Two messages are equal if they belong to the same message descriptor,
|
||||
// have the same set of populated known and extension field values,
|
||||
// and the same set of unknown fields values. If either of the top-level
|
||||
// messages are invalid, then Equal reports true only if both are invalid.
|
||||
// - Bytes fields are equal if they contain identical bytes.
|
||||
// Empty bytes (regardless of nil-ness) are considered equal.
|
||||
//
|
||||
// Scalar values are compared with the equivalent of the == operator in Go,
|
||||
// except bytes values which are compared using bytes.Equal and
|
||||
// floating point values which specially treat NaNs as equal.
|
||||
// Message values are compared by recursively calling Equal.
|
||||
// Lists are equal if each element value is also equal.
|
||||
// Maps are equal if they have the same set of keys, where the pair of values
|
||||
// for each key is also equal.
|
||||
// - Floating-point fields are equal if they contain the same value.
|
||||
// Unlike the == operator, a NaN is equal to another NaN.
|
||||
//
|
||||
// - Other scalar fields are equal if they contain the same value.
|
||||
//
|
||||
// - Message fields are equal if they have
|
||||
// the same set of populated known and extension field values, and
|
||||
// the same set of unknown fields values.
|
||||
//
|
||||
// - Lists are equal if they are the same length and
|
||||
// each corresponding element is equal.
|
||||
//
|
||||
// - Maps are equal if they have the same set of keys and
|
||||
// the corresponding value for each key is equal.
|
||||
//
|
||||
// An invalid message is not equal to a valid message.
|
||||
// An invalid message is only equal to another invalid message of the
|
||||
// same type. An invalid message often corresponds to a nil pointer
|
||||
// of the concrete message type. For example, (*pb.M)(nil) is not equal
|
||||
// to &pb.M{}.
|
||||
// If two valid messages marshal to the same bytes under deterministic
|
||||
// serialization, then Equal is guaranteed to report true.
|
||||
func Equal(x, y Message) bool {
|
||||
if x == nil || y == nil {
|
||||
return x == nil && y == nil
|
||||
}
|
||||
if reflect.TypeOf(x).Kind() == reflect.Ptr && x == y {
|
||||
// Avoid an expensive comparison if both inputs are identical pointers.
|
||||
return true
|
||||
}
|
||||
mx := x.ProtoReflect()
|
||||
my := y.ProtoReflect()
|
||||
if mx.IsValid() != my.IsValid() {
|
||||
return false
|
||||
}
|
||||
return equalMessage(mx, my)
|
||||
}
|
||||
|
||||
// equalMessage compares two messages.
|
||||
func equalMessage(mx, my pref.Message) bool {
|
||||
if mx.Descriptor() != my.Descriptor() {
|
||||
return false
|
||||
}
|
||||
|
||||
nx := 0
|
||||
equal := true
|
||||
mx.Range(func(fd pref.FieldDescriptor, vx pref.Value) bool {
|
||||
nx++
|
||||
vy := my.Get(fd)
|
||||
equal = my.Has(fd) && equalField(fd, vx, vy)
|
||||
return equal
|
||||
})
|
||||
if !equal {
|
||||
return false
|
||||
}
|
||||
ny := 0
|
||||
my.Range(func(fd pref.FieldDescriptor, vx pref.Value) bool {
|
||||
ny++
|
||||
return true
|
||||
})
|
||||
if nx != ny {
|
||||
return false
|
||||
}
|
||||
|
||||
return equalUnknown(mx.GetUnknown(), my.GetUnknown())
|
||||
}
|
||||
|
||||
// equalField compares two fields.
|
||||
func equalField(fd pref.FieldDescriptor, x, y pref.Value) bool {
|
||||
switch {
|
||||
case fd.IsList():
|
||||
return equalList(fd, x.List(), y.List())
|
||||
case fd.IsMap():
|
||||
return equalMap(fd, x.Map(), y.Map())
|
||||
default:
|
||||
return equalValue(fd, x, y)
|
||||
}
|
||||
}
|
||||
|
||||
// equalMap compares two maps.
|
||||
func equalMap(fd pref.FieldDescriptor, x, y pref.Map) bool {
|
||||
if x.Len() != y.Len() {
|
||||
return false
|
||||
}
|
||||
equal := true
|
||||
x.Range(func(k pref.MapKey, vx pref.Value) bool {
|
||||
vy := y.Get(k)
|
||||
equal = y.Has(k) && equalValue(fd.MapValue(), vx, vy)
|
||||
return equal
|
||||
})
|
||||
return equal
|
||||
}
|
||||
|
||||
// equalList compares two lists.
|
||||
func equalList(fd pref.FieldDescriptor, x, y pref.List) bool {
|
||||
if x.Len() != y.Len() {
|
||||
return false
|
||||
}
|
||||
for i := x.Len() - 1; i >= 0; i-- {
|
||||
if !equalValue(fd, x.Get(i), y.Get(i)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// equalValue compares two singular values.
|
||||
func equalValue(fd pref.FieldDescriptor, x, y pref.Value) bool {
|
||||
switch fd.Kind() {
|
||||
case pref.BoolKind:
|
||||
return x.Bool() == y.Bool()
|
||||
case pref.EnumKind:
|
||||
return x.Enum() == y.Enum()
|
||||
case pref.Int32Kind, pref.Sint32Kind,
|
||||
pref.Int64Kind, pref.Sint64Kind,
|
||||
pref.Sfixed32Kind, pref.Sfixed64Kind:
|
||||
return x.Int() == y.Int()
|
||||
case pref.Uint32Kind, pref.Uint64Kind,
|
||||
pref.Fixed32Kind, pref.Fixed64Kind:
|
||||
return x.Uint() == y.Uint()
|
||||
case pref.FloatKind, pref.DoubleKind:
|
||||
fx := x.Float()
|
||||
fy := y.Float()
|
||||
if math.IsNaN(fx) || math.IsNaN(fy) {
|
||||
return math.IsNaN(fx) && math.IsNaN(fy)
|
||||
}
|
||||
return fx == fy
|
||||
case pref.StringKind:
|
||||
return x.String() == y.String()
|
||||
case pref.BytesKind:
|
||||
return bytes.Equal(x.Bytes(), y.Bytes())
|
||||
case pref.MessageKind, pref.GroupKind:
|
||||
return equalMessage(x.Message(), y.Message())
|
||||
default:
|
||||
return x.Interface() == y.Interface()
|
||||
}
|
||||
}
|
||||
|
||||
// equalUnknown compares unknown fields by direct comparison on the raw bytes
|
||||
// of each individual field number.
|
||||
func equalUnknown(x, y pref.RawFields) bool {
|
||||
if len(x) != len(y) {
|
||||
return false
|
||||
}
|
||||
if bytes.Equal([]byte(x), []byte(y)) {
|
||||
return true
|
||||
}
|
||||
|
||||
mx := make(map[pref.FieldNumber]pref.RawFields)
|
||||
my := make(map[pref.FieldNumber]pref.RawFields)
|
||||
for len(x) > 0 {
|
||||
fnum, _, n := protowire.ConsumeField(x)
|
||||
mx[fnum] = append(mx[fnum], x[:n]...)
|
||||
x = x[n:]
|
||||
}
|
||||
for len(y) > 0 {
|
||||
fnum, _, n := protowire.ConsumeField(y)
|
||||
my[fnum] = append(my[fnum], y[:n]...)
|
||||
y = y[n:]
|
||||
}
|
||||
return reflect.DeepEqual(mx, my)
|
||||
vx := protoreflect.ValueOfMessage(mx)
|
||||
vy := protoreflect.ValueOfMessage(my)
|
||||
return vx.Equal(vy)
|
||||
}
|
||||
|
||||
2
go/vendor/google.golang.org/protobuf/proto/extension.go
generated
vendored
2
go/vendor/google.golang.org/protobuf/proto/extension.go
generated
vendored
@@ -26,7 +26,7 @@ func HasExtension(m Message, xt protoreflect.ExtensionType) bool {
|
||||
}
|
||||
|
||||
// ClearExtension clears an extension field such that subsequent
|
||||
// HasExtension calls return false.
|
||||
// [HasExtension] calls return false.
|
||||
// It panics if m is invalid or if xt does not extend m.
|
||||
func ClearExtension(m Message, xt protoreflect.ExtensionType) {
|
||||
m.ProtoReflect().Clear(xt.TypeDescriptor())
|
||||
|
||||
2
go/vendor/google.golang.org/protobuf/proto/merge.go
generated
vendored
2
go/vendor/google.golang.org/protobuf/proto/merge.go
generated
vendored
@@ -21,7 +21,7 @@ import (
|
||||
// The unknown fields of src are appended to the unknown fields of dst.
|
||||
//
|
||||
// It is semantically equivalent to unmarshaling the encoded form of src
|
||||
// into dst with the UnmarshalOptions.Merge option specified.
|
||||
// into dst with the [UnmarshalOptions.Merge] option specified.
|
||||
func Merge(dst, src Message) {
|
||||
// TODO: Should nil src be treated as semantically equivalent to a
|
||||
// untyped, read-only, empty message? What about a nil dst?
|
||||
|
||||
18
go/vendor/google.golang.org/protobuf/proto/proto.go
generated
vendored
18
go/vendor/google.golang.org/protobuf/proto/proto.go
generated
vendored
@@ -15,18 +15,20 @@ import (
|
||||
// protobuf module that accept a Message, except where otherwise specified.
|
||||
//
|
||||
// This is the v2 interface definition for protobuf messages.
|
||||
// The v1 interface definition is "github.com/golang/protobuf/proto".Message.
|
||||
// The v1 interface definition is [github.com/golang/protobuf/proto.Message].
|
||||
//
|
||||
// To convert a v1 message to a v2 message,
|
||||
// use "github.com/golang/protobuf/proto".MessageV2.
|
||||
// To convert a v2 message to a v1 message,
|
||||
// use "github.com/golang/protobuf/proto".MessageV1.
|
||||
// - To convert a v1 message to a v2 message,
|
||||
// use [google.golang.org/protobuf/protoadapt.MessageV2Of].
|
||||
// - To convert a v2 message to a v1 message,
|
||||
// use [google.golang.org/protobuf/protoadapt.MessageV1Of].
|
||||
type Message = protoreflect.ProtoMessage
|
||||
|
||||
// Error matches all errors produced by packages in the protobuf module.
|
||||
// Error matches all errors produced by packages in the protobuf module
|
||||
// according to [errors.Is].
|
||||
//
|
||||
// That is, errors.Is(err, Error) reports whether an error is produced
|
||||
// by this module.
|
||||
// Example usage:
|
||||
//
|
||||
// if errors.Is(err, proto.Error) { ... }
|
||||
var Error error
|
||||
|
||||
func init() {
|
||||
|
||||
10
go/vendor/google.golang.org/protobuf/proto/size.go
generated
vendored
10
go/vendor/google.golang.org/protobuf/proto/size.go
generated
vendored
@@ -73,23 +73,27 @@ func (o MarshalOptions) sizeField(fd protoreflect.FieldDescriptor, value protore
|
||||
}
|
||||
|
||||
func (o MarshalOptions) sizeList(num protowire.Number, fd protoreflect.FieldDescriptor, list protoreflect.List) (size int) {
|
||||
sizeTag := protowire.SizeTag(num)
|
||||
|
||||
if fd.IsPacked() && list.Len() > 0 {
|
||||
content := 0
|
||||
for i, llen := 0, list.Len(); i < llen; i++ {
|
||||
content += o.sizeSingular(num, fd.Kind(), list.Get(i))
|
||||
}
|
||||
return protowire.SizeTag(num) + protowire.SizeBytes(content)
|
||||
return sizeTag + protowire.SizeBytes(content)
|
||||
}
|
||||
|
||||
for i, llen := 0, list.Len(); i < llen; i++ {
|
||||
size += protowire.SizeTag(num) + o.sizeSingular(num, fd.Kind(), list.Get(i))
|
||||
size += sizeTag + o.sizeSingular(num, fd.Kind(), list.Get(i))
|
||||
}
|
||||
return size
|
||||
}
|
||||
|
||||
func (o MarshalOptions) sizeMap(num protowire.Number, fd protoreflect.FieldDescriptor, mapv protoreflect.Map) (size int) {
|
||||
sizeTag := protowire.SizeTag(num)
|
||||
|
||||
mapv.Range(func(key protoreflect.MapKey, value protoreflect.Value) bool {
|
||||
size += protowire.SizeTag(num)
|
||||
size += sizeTag
|
||||
size += protowire.SizeBytes(o.sizeField(fd.MapKey(), key.Value()) + o.sizeField(fd.MapValue(), value))
|
||||
return true
|
||||
})
|
||||
|
||||
87
go/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go
generated
vendored
87
go/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go
generated
vendored
@@ -8,60 +8,55 @@
|
||||
// defined in proto source files and value interfaces which provide the
|
||||
// ability to examine and manipulate the contents of messages.
|
||||
//
|
||||
// # Protocol Buffer Descriptors
|
||||
//
|
||||
// Protocol Buffer Descriptors
|
||||
//
|
||||
// Protobuf descriptors (e.g., EnumDescriptor or MessageDescriptor)
|
||||
// Protobuf descriptors (e.g., [EnumDescriptor] or [MessageDescriptor])
|
||||
// are immutable objects that represent protobuf type information.
|
||||
// They are wrappers around the messages declared in descriptor.proto.
|
||||
// Protobuf descriptors alone lack any information regarding Go types.
|
||||
//
|
||||
// Enums and messages generated by this module implement Enum and ProtoMessage,
|
||||
// Enums and messages generated by this module implement [Enum] and [ProtoMessage],
|
||||
// where the Descriptor and ProtoReflect.Descriptor accessors respectively
|
||||
// return the protobuf descriptor for the values.
|
||||
//
|
||||
// The protobuf descriptor interfaces are not meant to be implemented by
|
||||
// user code since they might need to be extended in the future to support
|
||||
// additions to the protobuf language.
|
||||
// The "google.golang.org/protobuf/reflect/protodesc" package converts between
|
||||
// The [google.golang.org/protobuf/reflect/protodesc] package converts between
|
||||
// google.protobuf.DescriptorProto messages and protobuf descriptors.
|
||||
//
|
||||
// # Go Type Descriptors
|
||||
//
|
||||
// Go Type Descriptors
|
||||
//
|
||||
// A type descriptor (e.g., EnumType or MessageType) is a constructor for
|
||||
// A type descriptor (e.g., [EnumType] or [MessageType]) is a constructor for
|
||||
// a concrete Go type that represents the associated protobuf descriptor.
|
||||
// There is commonly a one-to-one relationship between protobuf descriptors and
|
||||
// Go type descriptors, but it can potentially be a one-to-many relationship.
|
||||
//
|
||||
// Enums and messages generated by this module implement Enum and ProtoMessage,
|
||||
// Enums and messages generated by this module implement [Enum] and [ProtoMessage],
|
||||
// where the Type and ProtoReflect.Type accessors respectively
|
||||
// return the protobuf descriptor for the values.
|
||||
//
|
||||
// The "google.golang.org/protobuf/types/dynamicpb" package can be used to
|
||||
// The [google.golang.org/protobuf/types/dynamicpb] package can be used to
|
||||
// create Go type descriptors from protobuf descriptors.
|
||||
//
|
||||
// # Value Interfaces
|
||||
//
|
||||
// Value Interfaces
|
||||
//
|
||||
// The Enum and Message interfaces provide a reflective view over an
|
||||
// The [Enum] and [Message] interfaces provide a reflective view over an
|
||||
// enum or message instance. For enums, it provides the ability to retrieve
|
||||
// the enum value number for any concrete enum type. For messages, it provides
|
||||
// the ability to access or manipulate fields of the message.
|
||||
//
|
||||
// To convert a proto.Message to a protoreflect.Message, use the
|
||||
// To convert a [google.golang.org/protobuf/proto.Message] to a [protoreflect.Message], use the
|
||||
// former's ProtoReflect method. Since the ProtoReflect method is new to the
|
||||
// v2 message interface, it may not be present on older message implementations.
|
||||
// The "github.com/golang/protobuf/proto".MessageReflect function can be used
|
||||
// The [github.com/golang/protobuf/proto.MessageReflect] function can be used
|
||||
// to obtain a reflective view on older messages.
|
||||
//
|
||||
//
|
||||
// Relationships
|
||||
// # Relationships
|
||||
//
|
||||
// The following diagrams demonstrate the relationships between
|
||||
// various types declared in this package.
|
||||
//
|
||||
//
|
||||
// ┌───────────────────────────────────┐
|
||||
// V │
|
||||
// ┌────────────── New(n) ─────────────┐ │
|
||||
@@ -76,13 +71,12 @@
|
||||
// │ │
|
||||
// └────────────────── Type() ───────┘
|
||||
//
|
||||
// • An EnumType describes a concrete Go enum type.
|
||||
// • An [EnumType] describes a concrete Go enum type.
|
||||
// It has an EnumDescriptor and can construct an Enum instance.
|
||||
//
|
||||
// • An EnumDescriptor describes an abstract protobuf enum type.
|
||||
//
|
||||
// • An Enum is a concrete enum instance. Generated enums implement Enum.
|
||||
// • An [EnumDescriptor] describes an abstract protobuf enum type.
|
||||
//
|
||||
// • An [Enum] is a concrete enum instance. Generated enums implement Enum.
|
||||
//
|
||||
// ┌──────────────── New() ─────────────────┐
|
||||
// │ │
|
||||
@@ -96,14 +90,26 @@
|
||||
// │ │
|
||||
// └─────────────────── Type() ─────────┘
|
||||
//
|
||||
// • A MessageType describes a concrete Go message type.
|
||||
// It has a MessageDescriptor and can construct a Message instance.
|
||||
// • A [MessageType] describes a concrete Go message type.
|
||||
// It has a [MessageDescriptor] and can construct a [Message] instance.
|
||||
// Just as how Go's [reflect.Type] is a reflective description of a Go type,
|
||||
// a [MessageType] is a reflective description of a Go type for a protobuf message.
|
||||
//
|
||||
// • A MessageDescriptor describes an abstract protobuf message type.
|
||||
//
|
||||
// • A Message is a concrete message instance. Generated messages implement
|
||||
// ProtoMessage, which can convert to/from a Message.
|
||||
// • A [MessageDescriptor] describes an abstract protobuf message type.
|
||||
// It has no understanding of Go types. In order to construct a [MessageType]
|
||||
// from just a [MessageDescriptor], you can consider looking up the message type
|
||||
// in the global registry using the FindMessageByName method on
|
||||
// [google.golang.org/protobuf/reflect/protoregistry.GlobalTypes]
|
||||
// or constructing a dynamic [MessageType] using
|
||||
// [google.golang.org/protobuf/types/dynamicpb.NewMessageType].
|
||||
//
|
||||
// • A [Message] is a reflective view over a concrete message instance.
|
||||
// Generated messages implement [ProtoMessage], which can convert to a [Message].
|
||||
// Just as how Go's [reflect.Value] is a reflective view over a Go value,
|
||||
// a [Message] is a reflective view over a concrete protobuf message instance.
|
||||
// Using Go reflection as an analogy, the [ProtoMessage.ProtoReflect] method is similar to
|
||||
// calling [reflect.ValueOf], and the [Message.Interface] method is similar to
|
||||
// calling [reflect.Value.Interface].
|
||||
//
|
||||
// ┌── TypeDescriptor() ──┐ ┌───── Descriptor() ─────┐
|
||||
// │ V │ V
|
||||
@@ -115,15 +121,15 @@
|
||||
// │ │
|
||||
// └────── implements ────────┘
|
||||
//
|
||||
// • An ExtensionType describes a concrete Go implementation of an extension.
|
||||
// It has an ExtensionTypeDescriptor and can convert to/from
|
||||
// abstract Values and Go values.
|
||||
// • An [ExtensionType] describes a concrete Go implementation of an extension.
|
||||
// It has an [ExtensionTypeDescriptor] and can convert to/from
|
||||
// an abstract [Value] and a Go value.
|
||||
//
|
||||
// • An ExtensionTypeDescriptor is an ExtensionDescriptor
|
||||
// which also has an ExtensionType.
|
||||
// • An [ExtensionTypeDescriptor] is an [ExtensionDescriptor]
|
||||
// which also has an [ExtensionType].
|
||||
//
|
||||
// • An ExtensionDescriptor describes an abstract protobuf extension field and
|
||||
// may not always be an ExtensionTypeDescriptor.
|
||||
// • An [ExtensionDescriptor] describes an abstract protobuf extension field and
|
||||
// may not always be an [ExtensionTypeDescriptor].
|
||||
package protoreflect
|
||||
|
||||
import (
|
||||
@@ -138,7 +144,7 @@ type doNotImplement pragma.DoNotImplement
|
||||
|
||||
// ProtoMessage is the top-level interface that all proto messages implement.
|
||||
// This is declared in the protoreflect package to avoid a cyclic dependency;
|
||||
// use the proto.Message type instead, which aliases this type.
|
||||
// use the [google.golang.org/protobuf/proto.Message] type instead, which aliases this type.
|
||||
type ProtoMessage interface{ ProtoReflect() Message }
|
||||
|
||||
// Syntax is the language version of the proto file.
|
||||
@@ -147,8 +153,9 @@ type Syntax syntax
|
||||
type syntax int8 // keep exact type opaque as the int type may change
|
||||
|
||||
const (
|
||||
Proto2 Syntax = 2
|
||||
Proto3 Syntax = 3
|
||||
Proto2 Syntax = 2
|
||||
Proto3 Syntax = 3
|
||||
Editions Syntax = 4
|
||||
)
|
||||
|
||||
// IsValid reports whether the syntax is valid.
|
||||
@@ -432,7 +439,7 @@ type Names interface {
|
||||
// FullName is a qualified name that uniquely identifies a proto declaration.
|
||||
// A qualified name is the concatenation of the proto package along with the
|
||||
// fully-declared name (i.e., name of parent preceding the name of the child),
|
||||
// with a '.' delimiter placed between each Name.
|
||||
// with a '.' delimiter placed between each [Name].
|
||||
//
|
||||
// This should not have any leading or trailing dots.
|
||||
type FullName string // e.g., "google.protobuf.Field.Kind"
|
||||
@@ -476,7 +483,7 @@ func isLetterDigit(c byte) bool {
|
||||
}
|
||||
|
||||
// Name returns the short name, which is the last identifier segment.
|
||||
// A single segment FullName is the Name itself.
|
||||
// A single segment FullName is the [Name] itself.
|
||||
func (n FullName) Name() Name {
|
||||
if i := strings.LastIndexByte(string(n), '.'); i >= 0 {
|
||||
return Name(n[i+1:])
|
||||
|
||||
1
go/vendor/google.golang.org/protobuf/reflect/protoreflect/source.go
generated
vendored
1
go/vendor/google.golang.org/protobuf/reflect/protoreflect/source.go
generated
vendored
@@ -87,6 +87,7 @@ func (p1 SourcePath) Equal(p2 SourcePath) bool {
|
||||
// in a future version of this module.
|
||||
//
|
||||
// Example output:
|
||||
//
|
||||
// .message_type[6].nested_type[15].field[3]
|
||||
func (p SourcePath) String() string {
|
||||
b := p.appendFileDescriptorProto(nil)
|
||||
|
||||
93
go/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go
generated
vendored
93
go/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go
generated
vendored
@@ -35,6 +35,8 @@ func (p *SourcePath) appendFileDescriptorProto(b []byte) []byte {
|
||||
b = p.appendSingularField(b, "source_code_info", (*SourcePath).appendSourceCodeInfo)
|
||||
case 12:
|
||||
b = p.appendSingularField(b, "syntax", nil)
|
||||
case 14:
|
||||
b = p.appendSingularField(b, "edition", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -178,6 +180,8 @@ func (p *SourcePath) appendFileOptions(b []byte) []byte {
|
||||
b = p.appendSingularField(b, "php_metadata_namespace", nil)
|
||||
case 45:
|
||||
b = p.appendSingularField(b, "ruby_package", nil)
|
||||
case 50:
|
||||
b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
@@ -236,6 +240,10 @@ func (p *SourcePath) appendMessageOptions(b []byte) []byte {
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 7:
|
||||
b = p.appendSingularField(b, "map_entry", nil)
|
||||
case 11:
|
||||
b = p.appendSingularField(b, "deprecated_legacy_json_field_conflicts", nil)
|
||||
case 12:
|
||||
b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
@@ -279,6 +287,10 @@ func (p *SourcePath) appendEnumOptions(b []byte) []byte {
|
||||
b = p.appendSingularField(b, "allow_alias", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 6:
|
||||
b = p.appendSingularField(b, "deprecated_legacy_json_field_conflicts", nil)
|
||||
case 7:
|
||||
b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
@@ -324,6 +336,8 @@ func (p *SourcePath) appendServiceOptions(b []byte) []byte {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 34:
|
||||
b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
|
||||
case 33:
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 999:
|
||||
@@ -345,16 +359,49 @@ func (p *SourcePath) appendFieldOptions(b []byte) []byte {
|
||||
b = p.appendSingularField(b, "jstype", nil)
|
||||
case 5:
|
||||
b = p.appendSingularField(b, "lazy", nil)
|
||||
case 15:
|
||||
b = p.appendSingularField(b, "unverified_lazy", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 10:
|
||||
b = p.appendSingularField(b, "weak", nil)
|
||||
case 16:
|
||||
b = p.appendSingularField(b, "debug_redact", nil)
|
||||
case 17:
|
||||
b = p.appendSingularField(b, "retention", nil)
|
||||
case 19:
|
||||
b = p.appendRepeatedField(b, "targets", nil)
|
||||
case 20:
|
||||
b = p.appendRepeatedField(b, "edition_defaults", (*SourcePath).appendFieldOptions_EditionDefault)
|
||||
case 21:
|
||||
b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendFeatureSet(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "field_presence", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "enum_type", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "repeated_field_encoding", nil)
|
||||
case 4:
|
||||
b = p.appendSingularField(b, "utf8_validation", nil)
|
||||
case 5:
|
||||
b = p.appendSingularField(b, "message_encoding", nil)
|
||||
case 6:
|
||||
b = p.appendSingularField(b, "json_format", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendUninterpretedOption(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
@@ -404,6 +451,12 @@ func (p *SourcePath) appendExtensionRangeOptions(b []byte) []byte {
|
||||
switch (*p)[0] {
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
case 2:
|
||||
b = p.appendRepeatedField(b, "declaration", (*SourcePath).appendExtensionRangeOptions_Declaration)
|
||||
case 50:
|
||||
b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "verification", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -413,6 +466,8 @@ func (p *SourcePath) appendOneofOptions(b []byte) []byte {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
@@ -426,6 +481,10 @@ func (p *SourcePath) appendEnumValueOptions(b []byte) []byte {
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "debug_redact", nil)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
@@ -441,12 +500,27 @@ func (p *SourcePath) appendMethodOptions(b []byte) []byte {
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 34:
|
||||
b = p.appendSingularField(b, "idempotency_level", nil)
|
||||
case 35:
|
||||
b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendFieldOptions_EditionDefault(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "edition", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "value", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendUninterpretedOption_NamePart(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
@@ -459,3 +533,22 @@ func (p *SourcePath) appendUninterpretedOption_NamePart(b []byte) []byte {
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendExtensionRangeOptions_Declaration(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "number", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "full_name", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "type", nil)
|
||||
case 5:
|
||||
b = p.appendSingularField(b, "reserved", nil)
|
||||
case 6:
|
||||
b = p.appendSingularField(b, "repeated", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
45
go/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go
generated
vendored
45
go/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go
generated
vendored
@@ -12,7 +12,7 @@ package protoreflect
|
||||
// exactly identical. However, it is possible for the same semantically
|
||||
// identical proto type to be represented by multiple type descriptors.
|
||||
//
|
||||
// For example, suppose we have t1 and t2 which are both MessageDescriptors.
|
||||
// For example, suppose we have t1 and t2 which are both an [MessageDescriptor].
|
||||
// If t1 == t2, then the types are definitely equal and all accessors return
|
||||
// the same information. However, if t1 != t2, then it is still possible that
|
||||
// they still represent the same proto type (e.g., t1.FullName == t2.FullName).
|
||||
@@ -115,7 +115,7 @@ type Descriptor interface {
|
||||
// corresponds with the google.protobuf.FileDescriptorProto message.
|
||||
//
|
||||
// Top-level declarations:
|
||||
// EnumDescriptor, MessageDescriptor, FieldDescriptor, and/or ServiceDescriptor.
|
||||
// [EnumDescriptor], [MessageDescriptor], [FieldDescriptor], and/or [ServiceDescriptor].
|
||||
type FileDescriptor interface {
|
||||
Descriptor // Descriptor.FullName is identical to Package
|
||||
|
||||
@@ -180,8 +180,8 @@ type FileImport struct {
|
||||
// corresponds with the google.protobuf.DescriptorProto message.
|
||||
//
|
||||
// Nested declarations:
|
||||
// FieldDescriptor, OneofDescriptor, FieldDescriptor, EnumDescriptor,
|
||||
// and/or MessageDescriptor.
|
||||
// [FieldDescriptor], [OneofDescriptor], [FieldDescriptor], [EnumDescriptor],
|
||||
// and/or [MessageDescriptor].
|
||||
type MessageDescriptor interface {
|
||||
Descriptor
|
||||
|
||||
@@ -214,7 +214,7 @@ type MessageDescriptor interface {
|
||||
ExtensionRanges() FieldRanges
|
||||
// ExtensionRangeOptions returns the ith extension range options.
|
||||
//
|
||||
// To avoid a dependency cycle, this method returns a proto.Message value,
|
||||
// To avoid a dependency cycle, this method returns a proto.Message] value,
|
||||
// which always contains a google.protobuf.ExtensionRangeOptions message.
|
||||
// This method returns a typed nil-pointer if no options are present.
|
||||
// The caller must import the descriptorpb package to use this.
|
||||
@@ -231,9 +231,9 @@ type MessageDescriptor interface {
|
||||
}
|
||||
type isMessageDescriptor interface{ ProtoType(MessageDescriptor) }
|
||||
|
||||
// MessageType encapsulates a MessageDescriptor with a concrete Go implementation.
|
||||
// MessageType encapsulates a [MessageDescriptor] with a concrete Go implementation.
|
||||
// It is recommended that implementations of this interface also implement the
|
||||
// MessageFieldTypes interface.
|
||||
// [MessageFieldTypes] interface.
|
||||
type MessageType interface {
|
||||
// New returns a newly allocated empty message.
|
||||
// It may return nil for synthetic messages representing a map entry.
|
||||
@@ -249,19 +249,19 @@ type MessageType interface {
|
||||
Descriptor() MessageDescriptor
|
||||
}
|
||||
|
||||
// MessageFieldTypes extends a MessageType by providing type information
|
||||
// MessageFieldTypes extends a [MessageType] by providing type information
|
||||
// regarding enums and messages referenced by the message fields.
|
||||
type MessageFieldTypes interface {
|
||||
MessageType
|
||||
|
||||
// Enum returns the EnumType for the ith field in Descriptor.Fields.
|
||||
// Enum returns the EnumType for the ith field in MessageDescriptor.Fields.
|
||||
// It returns nil if the ith field is not an enum kind.
|
||||
// It panics if out of bounds.
|
||||
//
|
||||
// Invariant: mt.Enum(i).Descriptor() == mt.Descriptor().Fields(i).Enum()
|
||||
Enum(i int) EnumType
|
||||
|
||||
// Message returns the MessageType for the ith field in Descriptor.Fields.
|
||||
// Message returns the MessageType for the ith field in MessageDescriptor.Fields.
|
||||
// It returns nil if the ith field is not a message or group kind.
|
||||
// It panics if out of bounds.
|
||||
//
|
||||
@@ -286,8 +286,8 @@ type MessageDescriptors interface {
|
||||
// corresponds with the google.protobuf.FieldDescriptorProto message.
|
||||
//
|
||||
// It is used for both normal fields defined within the parent message
|
||||
// (e.g., MessageDescriptor.Fields) and fields that extend some remote message
|
||||
// (e.g., FileDescriptor.Extensions or MessageDescriptor.Extensions).
|
||||
// (e.g., [MessageDescriptor.Fields]) and fields that extend some remote message
|
||||
// (e.g., [FileDescriptor.Extensions] or [MessageDescriptor.Extensions]).
|
||||
type FieldDescriptor interface {
|
||||
Descriptor
|
||||
|
||||
@@ -344,7 +344,7 @@ type FieldDescriptor interface {
|
||||
// IsMap reports whether this field represents a map,
|
||||
// where the value type for the associated field is a Map.
|
||||
// It is equivalent to checking whether Cardinality is Repeated,
|
||||
// that the Kind is MessageKind, and that Message.IsMapEntry reports true.
|
||||
// that the Kind is MessageKind, and that MessageDescriptor.IsMapEntry reports true.
|
||||
IsMap() bool
|
||||
|
||||
// MapKey returns the field descriptor for the key in the map entry.
|
||||
@@ -419,7 +419,7 @@ type OneofDescriptor interface {
|
||||
|
||||
// IsSynthetic reports whether this is a synthetic oneof created to support
|
||||
// proto3 optional semantics. If true, Fields contains exactly one field
|
||||
// with HasOptionalKeyword specified.
|
||||
// with FieldDescriptor.HasOptionalKeyword specified.
|
||||
IsSynthetic() bool
|
||||
|
||||
// Fields is a list of fields belonging to this oneof.
|
||||
@@ -442,10 +442,10 @@ type OneofDescriptors interface {
|
||||
doNotImplement
|
||||
}
|
||||
|
||||
// ExtensionDescriptor is an alias of FieldDescriptor for documentation.
|
||||
// ExtensionDescriptor is an alias of [FieldDescriptor] for documentation.
|
||||
type ExtensionDescriptor = FieldDescriptor
|
||||
|
||||
// ExtensionTypeDescriptor is an ExtensionDescriptor with an associated ExtensionType.
|
||||
// ExtensionTypeDescriptor is an [ExtensionDescriptor] with an associated [ExtensionType].
|
||||
type ExtensionTypeDescriptor interface {
|
||||
ExtensionDescriptor
|
||||
|
||||
@@ -470,16 +470,17 @@ type ExtensionDescriptors interface {
|
||||
doNotImplement
|
||||
}
|
||||
|
||||
// ExtensionType encapsulates an ExtensionDescriptor with a concrete
|
||||
// ExtensionType encapsulates an [ExtensionDescriptor] with a concrete
|
||||
// Go implementation. The nested field descriptor must be for a extension field.
|
||||
//
|
||||
// While a normal field is a member of the parent message that it is declared
|
||||
// within (see Descriptor.Parent), an extension field is a member of some other
|
||||
// target message (see ExtensionDescriptor.Extendee) and may have no
|
||||
// within (see [Descriptor.Parent]), an extension field is a member of some other
|
||||
// target message (see [FieldDescriptor.ContainingMessage]) and may have no
|
||||
// relationship with the parent. However, the full name of an extension field is
|
||||
// relative to the parent that it is declared within.
|
||||
//
|
||||
// For example:
|
||||
//
|
||||
// syntax = "proto2";
|
||||
// package example;
|
||||
// message FooMessage {
|
||||
@@ -531,7 +532,7 @@ type ExtensionType interface {
|
||||
// corresponds with the google.protobuf.EnumDescriptorProto message.
|
||||
//
|
||||
// Nested declarations:
|
||||
// EnumValueDescriptor.
|
||||
// [EnumValueDescriptor].
|
||||
type EnumDescriptor interface {
|
||||
Descriptor
|
||||
|
||||
@@ -547,7 +548,7 @@ type EnumDescriptor interface {
|
||||
}
|
||||
type isEnumDescriptor interface{ ProtoType(EnumDescriptor) }
|
||||
|
||||
// EnumType encapsulates an EnumDescriptor with a concrete Go implementation.
|
||||
// EnumType encapsulates an [EnumDescriptor] with a concrete Go implementation.
|
||||
type EnumType interface {
|
||||
// New returns an instance of this enum type with its value set to n.
|
||||
New(n EnumNumber) Enum
|
||||
@@ -609,7 +610,7 @@ type EnumValueDescriptors interface {
|
||||
// ServiceDescriptor describes a service and
|
||||
// corresponds with the google.protobuf.ServiceDescriptorProto message.
|
||||
//
|
||||
// Nested declarations: MethodDescriptor.
|
||||
// Nested declarations: [MethodDescriptor].
|
||||
type ServiceDescriptor interface {
|
||||
Descriptor
|
||||
|
||||
|
||||
26
go/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go
generated
vendored
26
go/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go
generated
vendored
@@ -27,16 +27,16 @@ type Enum interface {
|
||||
// Message is a reflective interface for a concrete message value,
|
||||
// encapsulating both type and value information for the message.
|
||||
//
|
||||
// Accessor/mutators for individual fields are keyed by FieldDescriptor.
|
||||
// Accessor/mutators for individual fields are keyed by [FieldDescriptor].
|
||||
// For non-extension fields, the descriptor must exactly match the
|
||||
// field known by the parent message.
|
||||
// For extension fields, the descriptor must implement ExtensionTypeDescriptor,
|
||||
// extend the parent message (i.e., have the same message FullName), and
|
||||
// For extension fields, the descriptor must implement [ExtensionTypeDescriptor],
|
||||
// extend the parent message (i.e., have the same message [FullName]), and
|
||||
// be within the parent's extension range.
|
||||
//
|
||||
// Each field Value can be a scalar or a composite type (Message, List, or Map).
|
||||
// See Value for the Go types associated with a FieldDescriptor.
|
||||
// Providing a Value that is invalid or of an incorrect type panics.
|
||||
// Each field [Value] can be a scalar or a composite type ([Message], [List], or [Map]).
|
||||
// See [Value] for the Go types associated with a [FieldDescriptor].
|
||||
// Providing a [Value] that is invalid or of an incorrect type panics.
|
||||
type Message interface {
|
||||
// Descriptor returns message descriptor, which contains only the protobuf
|
||||
// type information for the message.
|
||||
@@ -148,11 +148,11 @@ type Message interface {
|
||||
// be preserved in marshaling or other operations.
|
||||
IsValid() bool
|
||||
|
||||
// ProtoMethods returns optional fast-path implementions of various operations.
|
||||
// ProtoMethods returns optional fast-path implementations of various operations.
|
||||
// This method may return nil.
|
||||
//
|
||||
// The returned methods type is identical to
|
||||
// "google.golang.org/protobuf/runtime/protoiface".Methods.
|
||||
// google.golang.org/protobuf/runtime/protoiface.Methods.
|
||||
// Consult the protoiface package documentation for details.
|
||||
ProtoMethods() *methods
|
||||
}
|
||||
@@ -175,8 +175,8 @@ func (b RawFields) IsValid() bool {
|
||||
}
|
||||
|
||||
// List is a zero-indexed, ordered list.
|
||||
// The element Value type is determined by FieldDescriptor.Kind.
|
||||
// Providing a Value that is invalid or of an incorrect type panics.
|
||||
// The element [Value] type is determined by [FieldDescriptor.Kind].
|
||||
// Providing a [Value] that is invalid or of an incorrect type panics.
|
||||
type List interface {
|
||||
// Len reports the number of entries in the List.
|
||||
// Get, Set, and Truncate panic with out of bound indexes.
|
||||
@@ -226,9 +226,9 @@ type List interface {
|
||||
}
|
||||
|
||||
// Map is an unordered, associative map.
|
||||
// The entry MapKey type is determined by FieldDescriptor.MapKey.Kind.
|
||||
// The entry Value type is determined by FieldDescriptor.MapValue.Kind.
|
||||
// Providing a MapKey or Value that is invalid or of an incorrect type panics.
|
||||
// The entry [MapKey] type is determined by [FieldDescriptor.MapKey].Kind.
|
||||
// The entry [Value] type is determined by [FieldDescriptor.MapValue].Kind.
|
||||
// Providing a [MapKey] or [Value] that is invalid or of an incorrect type panics.
|
||||
type Map interface {
|
||||
// Len reports the number of elements in the map.
|
||||
Len() int
|
||||
|
||||
168
go/vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go
generated
vendored
Normal file
168
go/vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go
generated
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
// Copyright 2022 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package protoreflect
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"math"
|
||||
"reflect"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
)
|
||||
|
||||
// Equal reports whether v1 and v2 are recursively equal.
|
||||
//
|
||||
// - Values of different types are always unequal.
|
||||
//
|
||||
// - Bytes values are equal if they contain identical bytes.
|
||||
// Empty bytes (regardless of nil-ness) are considered equal.
|
||||
//
|
||||
// - Floating point values are equal if they contain the same value.
|
||||
// Unlike the == operator, a NaN is equal to another NaN.
|
||||
//
|
||||
// - Enums are equal if they contain the same number.
|
||||
// Since [Value] does not contain an enum descriptor,
|
||||
// enum values do not consider the type of the enum.
|
||||
//
|
||||
// - Other scalar values are equal if they contain the same value.
|
||||
//
|
||||
// - [Message] values are equal if they belong to the same message descriptor,
|
||||
// have the same set of populated known and extension field values,
|
||||
// and the same set of unknown fields values.
|
||||
//
|
||||
// - [List] values are equal if they are the same length and
|
||||
// each corresponding element is equal.
|
||||
//
|
||||
// - [Map] values are equal if they have the same set of keys and
|
||||
// the corresponding value for each key is equal.
|
||||
func (v1 Value) Equal(v2 Value) bool {
|
||||
return equalValue(v1, v2)
|
||||
}
|
||||
|
||||
func equalValue(x, y Value) bool {
|
||||
eqType := x.typ == y.typ
|
||||
switch x.typ {
|
||||
case nilType:
|
||||
return eqType
|
||||
case boolType:
|
||||
return eqType && x.Bool() == y.Bool()
|
||||
case int32Type, int64Type:
|
||||
return eqType && x.Int() == y.Int()
|
||||
case uint32Type, uint64Type:
|
||||
return eqType && x.Uint() == y.Uint()
|
||||
case float32Type, float64Type:
|
||||
return eqType && equalFloat(x.Float(), y.Float())
|
||||
case stringType:
|
||||
return eqType && x.String() == y.String()
|
||||
case bytesType:
|
||||
return eqType && bytes.Equal(x.Bytes(), y.Bytes())
|
||||
case enumType:
|
||||
return eqType && x.Enum() == y.Enum()
|
||||
default:
|
||||
switch x := x.Interface().(type) {
|
||||
case Message:
|
||||
y, ok := y.Interface().(Message)
|
||||
return ok && equalMessage(x, y)
|
||||
case List:
|
||||
y, ok := y.Interface().(List)
|
||||
return ok && equalList(x, y)
|
||||
case Map:
|
||||
y, ok := y.Interface().(Map)
|
||||
return ok && equalMap(x, y)
|
||||
default:
|
||||
panic(fmt.Sprintf("unknown type: %T", x))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// equalFloat compares two floats, where NaNs are treated as equal.
|
||||
func equalFloat(x, y float64) bool {
|
||||
if math.IsNaN(x) || math.IsNaN(y) {
|
||||
return math.IsNaN(x) && math.IsNaN(y)
|
||||
}
|
||||
return x == y
|
||||
}
|
||||
|
||||
// equalMessage compares two messages.
|
||||
func equalMessage(mx, my Message) bool {
|
||||
if mx.Descriptor() != my.Descriptor() {
|
||||
return false
|
||||
}
|
||||
|
||||
nx := 0
|
||||
equal := true
|
||||
mx.Range(func(fd FieldDescriptor, vx Value) bool {
|
||||
nx++
|
||||
vy := my.Get(fd)
|
||||
equal = my.Has(fd) && equalValue(vx, vy)
|
||||
return equal
|
||||
})
|
||||
if !equal {
|
||||
return false
|
||||
}
|
||||
ny := 0
|
||||
my.Range(func(fd FieldDescriptor, vx Value) bool {
|
||||
ny++
|
||||
return true
|
||||
})
|
||||
if nx != ny {
|
||||
return false
|
||||
}
|
||||
|
||||
return equalUnknown(mx.GetUnknown(), my.GetUnknown())
|
||||
}
|
||||
|
||||
// equalList compares two lists.
|
||||
func equalList(x, y List) bool {
|
||||
if x.Len() != y.Len() {
|
||||
return false
|
||||
}
|
||||
for i := x.Len() - 1; i >= 0; i-- {
|
||||
if !equalValue(x.Get(i), y.Get(i)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// equalMap compares two maps.
|
||||
func equalMap(x, y Map) bool {
|
||||
if x.Len() != y.Len() {
|
||||
return false
|
||||
}
|
||||
equal := true
|
||||
x.Range(func(k MapKey, vx Value) bool {
|
||||
vy := y.Get(k)
|
||||
equal = y.Has(k) && equalValue(vx, vy)
|
||||
return equal
|
||||
})
|
||||
return equal
|
||||
}
|
||||
|
||||
// equalUnknown compares unknown fields by direct comparison on the raw bytes
|
||||
// of each individual field number.
|
||||
func equalUnknown(x, y RawFields) bool {
|
||||
if len(x) != len(y) {
|
||||
return false
|
||||
}
|
||||
if bytes.Equal([]byte(x), []byte(y)) {
|
||||
return true
|
||||
}
|
||||
|
||||
mx := make(map[FieldNumber]RawFields)
|
||||
my := make(map[FieldNumber]RawFields)
|
||||
for len(x) > 0 {
|
||||
fnum, _, n := protowire.ConsumeField(x)
|
||||
mx[fnum] = append(mx[fnum], x[:n]...)
|
||||
x = x[n:]
|
||||
}
|
||||
for len(y) > 0 {
|
||||
fnum, _, n := protowire.ConsumeField(y)
|
||||
my[fnum] = append(my[fnum], y[:n]...)
|
||||
y = y[n:]
|
||||
}
|
||||
return reflect.DeepEqual(mx, my)
|
||||
}
|
||||
50
go/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go
generated
vendored
50
go/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go
generated
vendored
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
// Value is a union where only one Go type may be set at a time.
|
||||
// The Value is used to represent all possible values a field may take.
|
||||
// The following shows which Go type is used to represent each proto Kind:
|
||||
// The following shows which Go type is used to represent each proto [Kind]:
|
||||
//
|
||||
// ╔════════════╤═════════════════════════════════════╗
|
||||
// ║ Go type │ Protobuf kind ║
|
||||
@@ -31,40 +31,41 @@ import (
|
||||
//
|
||||
// Multiple protobuf Kinds may be represented by a single Go type if the type
|
||||
// can losslessly represent the information for the proto kind. For example,
|
||||
// Int64Kind, Sint64Kind, and Sfixed64Kind are all represented by int64,
|
||||
// [Int64Kind], [Sint64Kind], and [Sfixed64Kind] are all represented by int64,
|
||||
// but use different integer encoding methods.
|
||||
//
|
||||
// The List or Map types are used if the field cardinality is repeated.
|
||||
// A field is a List if FieldDescriptor.IsList reports true.
|
||||
// A field is a Map if FieldDescriptor.IsMap reports true.
|
||||
// The [List] or [Map] types are used if the field cardinality is repeated.
|
||||
// A field is a [List] if [FieldDescriptor.IsList] reports true.
|
||||
// A field is a [Map] if [FieldDescriptor.IsMap] reports true.
|
||||
//
|
||||
// Converting to/from a Value and a concrete Go value panics on type mismatch.
|
||||
// For example, ValueOf("hello").Int() panics because this attempts to
|
||||
// For example, [ValueOf]("hello").Int() panics because this attempts to
|
||||
// retrieve an int64 from a string.
|
||||
//
|
||||
// List, Map, and Message Values are called "composite" values.
|
||||
// [List], [Map], and [Message] Values are called "composite" values.
|
||||
//
|
||||
// A composite Value may alias (reference) memory at some location,
|
||||
// such that changes to the Value updates the that location.
|
||||
// A composite value acquired with a Mutable method, such as Message.Mutable,
|
||||
// A composite value acquired with a Mutable method, such as [Message.Mutable],
|
||||
// always references the source object.
|
||||
//
|
||||
// For example:
|
||||
//
|
||||
// // Append a 0 to a "repeated int32" field.
|
||||
// // Since the Value returned by Mutable is guaranteed to alias
|
||||
// // the source message, modifying the Value modifies the message.
|
||||
// message.Mutable(fieldDesc).(List).Append(protoreflect.ValueOfInt32(0))
|
||||
// message.Mutable(fieldDesc).List().Append(protoreflect.ValueOfInt32(0))
|
||||
//
|
||||
// // Assign [0] to a "repeated int32" field by creating a new Value,
|
||||
// // modifying it, and assigning it.
|
||||
// list := message.NewField(fieldDesc).(List)
|
||||
// list := message.NewField(fieldDesc).List()
|
||||
// list.Append(protoreflect.ValueOfInt32(0))
|
||||
// message.Set(fieldDesc, list)
|
||||
// // ERROR: Since it is not defined whether Set aliases the source,
|
||||
// // appending to the List here may or may not modify the message.
|
||||
// list.Append(protoreflect.ValueOfInt32(0))
|
||||
//
|
||||
// Some operations, such as Message.Get, may return an "empty, read-only"
|
||||
// Some operations, such as [Message.Get], may return an "empty, read-only"
|
||||
// composite Value. Modifying an empty, read-only value panics.
|
||||
type Value value
|
||||
|
||||
@@ -305,7 +306,7 @@ func (v Value) Float() float64 {
|
||||
}
|
||||
}
|
||||
|
||||
// String returns v as a string. Since this method implements fmt.Stringer,
|
||||
// String returns v as a string. Since this method implements [fmt.Stringer],
|
||||
// this returns the formatted string value for any non-string type.
|
||||
func (v Value) String() string {
|
||||
switch v.typ {
|
||||
@@ -326,7 +327,7 @@ func (v Value) Bytes() []byte {
|
||||
}
|
||||
}
|
||||
|
||||
// Enum returns v as a EnumNumber and panics if the type is not a EnumNumber.
|
||||
// Enum returns v as a [EnumNumber] and panics if the type is not a [EnumNumber].
|
||||
func (v Value) Enum() EnumNumber {
|
||||
switch v.typ {
|
||||
case enumType:
|
||||
@@ -336,7 +337,7 @@ func (v Value) Enum() EnumNumber {
|
||||
}
|
||||
}
|
||||
|
||||
// Message returns v as a Message and panics if the type is not a Message.
|
||||
// Message returns v as a [Message] and panics if the type is not a [Message].
|
||||
func (v Value) Message() Message {
|
||||
switch vi := v.getIface().(type) {
|
||||
case Message:
|
||||
@@ -346,7 +347,7 @@ func (v Value) Message() Message {
|
||||
}
|
||||
}
|
||||
|
||||
// List returns v as a List and panics if the type is not a List.
|
||||
// List returns v as a [List] and panics if the type is not a [List].
|
||||
func (v Value) List() List {
|
||||
switch vi := v.getIface().(type) {
|
||||
case List:
|
||||
@@ -356,7 +357,7 @@ func (v Value) List() List {
|
||||
}
|
||||
}
|
||||
|
||||
// Map returns v as a Map and panics if the type is not a Map.
|
||||
// Map returns v as a [Map] and panics if the type is not a [Map].
|
||||
func (v Value) Map() Map {
|
||||
switch vi := v.getIface().(type) {
|
||||
case Map:
|
||||
@@ -366,7 +367,7 @@ func (v Value) Map() Map {
|
||||
}
|
||||
}
|
||||
|
||||
// MapKey returns v as a MapKey and panics for invalid MapKey types.
|
||||
// MapKey returns v as a [MapKey] and panics for invalid [MapKey] types.
|
||||
func (v Value) MapKey() MapKey {
|
||||
switch v.typ {
|
||||
case boolType, int32Type, int64Type, uint32Type, uint64Type, stringType:
|
||||
@@ -377,8 +378,8 @@ func (v Value) MapKey() MapKey {
|
||||
}
|
||||
|
||||
// MapKey is used to index maps, where the Go type of the MapKey must match
|
||||
// the specified key Kind (see MessageDescriptor.IsMapEntry).
|
||||
// The following shows what Go type is used to represent each proto Kind:
|
||||
// the specified key [Kind] (see [MessageDescriptor.IsMapEntry]).
|
||||
// The following shows what Go type is used to represent each proto [Kind]:
|
||||
//
|
||||
// ╔═════════╤═════════════════════════════════════╗
|
||||
// ║ Go type │ Protobuf kind ║
|
||||
@@ -391,12 +392,13 @@ func (v Value) MapKey() MapKey {
|
||||
// ║ string │ StringKind ║
|
||||
// ╚═════════╧═════════════════════════════════════╝
|
||||
//
|
||||
// A MapKey is constructed and accessed through a Value:
|
||||
// A MapKey is constructed and accessed through a [Value]:
|
||||
//
|
||||
// k := ValueOf("hash").MapKey() // convert string to MapKey
|
||||
// s := k.String() // convert MapKey to string
|
||||
//
|
||||
// The MapKey is a strict subset of valid types used in Value;
|
||||
// converting a Value to a MapKey with an invalid type panics.
|
||||
// The MapKey is a strict subset of valid types used in [Value];
|
||||
// converting a [Value] to a MapKey with an invalid type panics.
|
||||
type MapKey value
|
||||
|
||||
// IsValid reports whether k is populated with a value.
|
||||
@@ -424,13 +426,13 @@ func (k MapKey) Uint() uint64 {
|
||||
return Value(k).Uint()
|
||||
}
|
||||
|
||||
// String returns k as a string. Since this method implements fmt.Stringer,
|
||||
// String returns k as a string. Since this method implements [fmt.Stringer],
|
||||
// this returns the formatted string value for any non-string type.
|
||||
func (k MapKey) String() string {
|
||||
return Value(k).String()
|
||||
}
|
||||
|
||||
// Value returns k as a Value.
|
||||
// Value returns k as a [Value].
|
||||
func (k MapKey) Value() Value {
|
||||
return Value(k)
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !purego && !appengine
|
||||
// +build !purego,!appengine
|
||||
//go:build !purego && !appengine && !go1.21
|
||||
// +build !purego,!appengine,!go1.21
|
||||
|
||||
package protoreflect
|
||||
|
||||
87
go/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go
generated
vendored
Normal file
87
go/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !purego && !appengine && go1.21
|
||||
// +build !purego,!appengine,go1.21
|
||||
|
||||
package protoreflect
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"google.golang.org/protobuf/internal/pragma"
|
||||
)
|
||||
|
||||
type (
|
||||
ifaceHeader struct {
|
||||
_ [0]interface{} // if interfaces have greater alignment than unsafe.Pointer, this will enforce it.
|
||||
Type unsafe.Pointer
|
||||
Data unsafe.Pointer
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
nilType = typeOf(nil)
|
||||
boolType = typeOf(*new(bool))
|
||||
int32Type = typeOf(*new(int32))
|
||||
int64Type = typeOf(*new(int64))
|
||||
uint32Type = typeOf(*new(uint32))
|
||||
uint64Type = typeOf(*new(uint64))
|
||||
float32Type = typeOf(*new(float32))
|
||||
float64Type = typeOf(*new(float64))
|
||||
stringType = typeOf(*new(string))
|
||||
bytesType = typeOf(*new([]byte))
|
||||
enumType = typeOf(*new(EnumNumber))
|
||||
)
|
||||
|
||||
// typeOf returns a pointer to the Go type information.
|
||||
// The pointer is comparable and equal if and only if the types are identical.
|
||||
func typeOf(t interface{}) unsafe.Pointer {
|
||||
return (*ifaceHeader)(unsafe.Pointer(&t)).Type
|
||||
}
|
||||
|
||||
// value is a union where only one type can be represented at a time.
|
||||
// The struct is 24B large on 64-bit systems and requires the minimum storage
|
||||
// necessary to represent each possible type.
|
||||
//
|
||||
// The Go GC needs to be able to scan variables containing pointers.
|
||||
// As such, pointers and non-pointers cannot be intermixed.
|
||||
type value struct {
|
||||
pragma.DoNotCompare // 0B
|
||||
|
||||
// typ stores the type of the value as a pointer to the Go type.
|
||||
typ unsafe.Pointer // 8B
|
||||
|
||||
// ptr stores the data pointer for a String, Bytes, or interface value.
|
||||
ptr unsafe.Pointer // 8B
|
||||
|
||||
// num stores a Bool, Int32, Int64, Uint32, Uint64, Float32, Float64, or
|
||||
// Enum value as a raw uint64.
|
||||
//
|
||||
// It is also used to store the length of a String or Bytes value;
|
||||
// the capacity is ignored.
|
||||
num uint64 // 8B
|
||||
}
|
||||
|
||||
func valueOfString(v string) Value {
|
||||
return Value{typ: stringType, ptr: unsafe.Pointer(unsafe.StringData(v)), num: uint64(len(v))}
|
||||
}
|
||||
func valueOfBytes(v []byte) Value {
|
||||
return Value{typ: bytesType, ptr: unsafe.Pointer(unsafe.SliceData(v)), num: uint64(len(v))}
|
||||
}
|
||||
func valueOfIface(v interface{}) Value {
|
||||
p := (*ifaceHeader)(unsafe.Pointer(&v))
|
||||
return Value{typ: p.Type, ptr: p.Data}
|
||||
}
|
||||
|
||||
func (v Value) getString() string {
|
||||
return unsafe.String((*byte)(v.ptr), v.num)
|
||||
}
|
||||
func (v Value) getBytes() []byte {
|
||||
return unsafe.Slice((*byte)(v.ptr), v.num)
|
||||
}
|
||||
func (v Value) getIface() (x interface{}) {
|
||||
*(*ifaceHeader)(unsafe.Pointer(&x)) = ifaceHeader{Type: v.typ, Data: v.ptr}
|
||||
return x
|
||||
}
|
||||
28
go/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go
generated
vendored
28
go/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go
generated
vendored
@@ -5,12 +5,12 @@
|
||||
// Package protoregistry provides data structures to register and lookup
|
||||
// protobuf descriptor types.
|
||||
//
|
||||
// The Files registry contains file descriptors and provides the ability
|
||||
// The [Files] registry contains file descriptors and provides the ability
|
||||
// to iterate over the files or lookup a specific descriptor within the files.
|
||||
// Files only contains protobuf descriptors and has no understanding of Go
|
||||
// [Files] only contains protobuf descriptors and has no understanding of Go
|
||||
// type information that may be associated with each descriptor.
|
||||
//
|
||||
// The Types registry contains descriptor types for which there is a known
|
||||
// The [Types] registry contains descriptor types for which there is a known
|
||||
// Go type associated with that descriptor. It provides the ability to iterate
|
||||
// over the registered types or lookup a type by name.
|
||||
package protoregistry
|
||||
@@ -30,9 +30,11 @@ import (
|
||||
// conflictPolicy configures the policy for handling registration conflicts.
|
||||
//
|
||||
// It can be over-written at compile time with a linker-initialized variable:
|
||||
//
|
||||
// go build -ldflags "-X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn"
|
||||
//
|
||||
// It can be over-written at program execution with an environment variable:
|
||||
//
|
||||
// GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn ./main
|
||||
//
|
||||
// Neither of the above are covered by the compatibility promise and
|
||||
@@ -44,7 +46,7 @@ var conflictPolicy = "panic" // "panic" | "warn" | "ignore"
|
||||
// It is a variable so that the behavior is easily overridden in another file.
|
||||
var ignoreConflict = func(d protoreflect.Descriptor, err error) bool {
|
||||
const env = "GOLANG_PROTOBUF_REGISTRATION_CONFLICT"
|
||||
const faq = "https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict"
|
||||
const faq = "https://protobuf.dev/reference/go/faq#namespace-conflict"
|
||||
policy := conflictPolicy
|
||||
if v := os.Getenv(env); v != "" {
|
||||
policy = v
|
||||
@@ -216,7 +218,7 @@ func (r *Files) checkGenProtoConflict(path string) {
|
||||
|
||||
// FindDescriptorByName looks up a descriptor by the full name.
|
||||
//
|
||||
// This returns (nil, NotFound) if not found.
|
||||
// This returns (nil, [NotFound]) if not found.
|
||||
func (r *Files) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) {
|
||||
if r == nil {
|
||||
return nil, NotFound
|
||||
@@ -308,7 +310,7 @@ func (s *nameSuffix) Pop() (name protoreflect.Name) {
|
||||
|
||||
// FindFileByPath looks up a file by the path.
|
||||
//
|
||||
// This returns (nil, NotFound) if not found.
|
||||
// This returns (nil, [NotFound]) if not found.
|
||||
// This returns an error if multiple files have the same path.
|
||||
func (r *Files) FindFileByPath(path string) (protoreflect.FileDescriptor, error) {
|
||||
if r == nil {
|
||||
@@ -429,7 +431,7 @@ func rangeTopLevelDescriptors(fd protoreflect.FileDescriptor, f func(protoreflec
|
||||
// A compliant implementation must deterministically return the same type
|
||||
// if no error is encountered.
|
||||
//
|
||||
// The Types type implements this interface.
|
||||
// The [Types] type implements this interface.
|
||||
type MessageTypeResolver interface {
|
||||
// FindMessageByName looks up a message by its full name.
|
||||
// E.g., "google.protobuf.Any"
|
||||
@@ -449,7 +451,7 @@ type MessageTypeResolver interface {
|
||||
// A compliant implementation must deterministically return the same type
|
||||
// if no error is encountered.
|
||||
//
|
||||
// The Types type implements this interface.
|
||||
// The [Types] type implements this interface.
|
||||
type ExtensionTypeResolver interface {
|
||||
// FindExtensionByName looks up a extension field by the field's full name.
|
||||
// Note that this is the full name of the field as determined by
|
||||
@@ -588,7 +590,7 @@ func (r *Types) register(kind string, desc protoreflect.Descriptor, typ interfac
|
||||
// FindEnumByName looks up an enum by its full name.
|
||||
// E.g., "google.protobuf.Field.Kind".
|
||||
//
|
||||
// This returns (nil, NotFound) if not found.
|
||||
// This returns (nil, [NotFound]) if not found.
|
||||
func (r *Types) FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumType, error) {
|
||||
if r == nil {
|
||||
return nil, NotFound
|
||||
@@ -609,7 +611,7 @@ func (r *Types) FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumTyp
|
||||
// FindMessageByName looks up a message by its full name,
|
||||
// e.g. "google.protobuf.Any".
|
||||
//
|
||||
// This returns (nil, NotFound) if not found.
|
||||
// This returns (nil, [NotFound]) if not found.
|
||||
func (r *Types) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) {
|
||||
if r == nil {
|
||||
return nil, NotFound
|
||||
@@ -630,7 +632,7 @@ func (r *Types) FindMessageByName(message protoreflect.FullName) (protoreflect.M
|
||||
// FindMessageByURL looks up a message by a URL identifier.
|
||||
// See documentation on google.protobuf.Any.type_url for the URL format.
|
||||
//
|
||||
// This returns (nil, NotFound) if not found.
|
||||
// This returns (nil, [NotFound]) if not found.
|
||||
func (r *Types) FindMessageByURL(url string) (protoreflect.MessageType, error) {
|
||||
// This function is similar to FindMessageByName but
|
||||
// truncates anything before and including '/' in the URL.
|
||||
@@ -660,7 +662,7 @@ func (r *Types) FindMessageByURL(url string) (protoreflect.MessageType, error) {
|
||||
// where the extension is declared and is unrelated to the full name of the
|
||||
// message being extended.
|
||||
//
|
||||
// This returns (nil, NotFound) if not found.
|
||||
// This returns (nil, [NotFound]) if not found.
|
||||
func (r *Types) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) {
|
||||
if r == nil {
|
||||
return nil, NotFound
|
||||
@@ -701,7 +703,7 @@ func (r *Types) FindExtensionByName(field protoreflect.FullName) (protoreflect.E
|
||||
// FindExtensionByNumber looks up a extension field by the field number
|
||||
// within some parent message, identified by full name.
|
||||
//
|
||||
// This returns (nil, NotFound) if not found.
|
||||
// This returns (nil, [NotFound]) if not found.
|
||||
func (r *Types) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) {
|
||||
if r == nil {
|
||||
return nil, NotFound
|
||||
|
||||
8
go/vendor/google.golang.org/protobuf/runtime/protoimpl/version.go
generated
vendored
8
go/vendor/google.golang.org/protobuf/runtime/protoimpl/version.go
generated
vendored
@@ -26,16 +26,19 @@ const (
|
||||
// EnforceVersion is used by code generated by protoc-gen-go
|
||||
// to statically enforce minimum and maximum versions of this package.
|
||||
// A compilation failure implies either that:
|
||||
// * the runtime package is too old and needs to be updated OR
|
||||
// * the generated code is too old and needs to be regenerated.
|
||||
// - the runtime package is too old and needs to be updated OR
|
||||
// - the generated code is too old and needs to be regenerated.
|
||||
//
|
||||
// The runtime package can be upgraded by running:
|
||||
//
|
||||
// go get google.golang.org/protobuf
|
||||
//
|
||||
// The generated code can be regenerated by running:
|
||||
//
|
||||
// protoc --go_out=${PROTOC_GEN_GO_ARGS} ${PROTO_FILES}
|
||||
//
|
||||
// Example usage by generated code:
|
||||
//
|
||||
// const (
|
||||
// // Verify that this generated code is sufficiently up-to-date.
|
||||
// _ = protoimpl.EnforceVersion(genVersion - protoimpl.MinVersion)
|
||||
@@ -49,6 +52,7 @@ const (
|
||||
type EnforceVersion uint
|
||||
|
||||
// This enforces the following invariant:
|
||||
//
|
||||
// MinVersion ≤ GenVersion ≤ MaxVersion
|
||||
const (
|
||||
_ = EnforceVersion(GenVersion - MinVersion)
|
||||
|
||||
63
go/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go
generated
vendored
63
go/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go
generated
vendored
@@ -36,8 +36,7 @@
|
||||
// The Timestamp message represents a timestamp,
|
||||
// an instant in time since the Unix epoch (January 1st, 1970).
|
||||
//
|
||||
//
|
||||
// Conversion to a Go Time
|
||||
// # Conversion to a Go Time
|
||||
//
|
||||
// The AsTime method can be used to convert a Timestamp message to a
|
||||
// standard Go time.Time value in UTC:
|
||||
@@ -59,8 +58,7 @@
|
||||
// ... // handle error
|
||||
// }
|
||||
//
|
||||
//
|
||||
// Conversion from a Go Time
|
||||
// # Conversion from a Go Time
|
||||
//
|
||||
// The timestamppb.New function can be used to construct a Timestamp message
|
||||
// from a standard Go time.Time value:
|
||||
@@ -72,7 +70,6 @@
|
||||
//
|
||||
// ts := timestamppb.Now()
|
||||
// ... // make use of ts as a *timestamppb.Timestamp
|
||||
//
|
||||
package timestamppb
|
||||
|
||||
import (
|
||||
@@ -101,52 +98,50 @@ import (
|
||||
//
|
||||
// Example 1: Compute Timestamp from POSIX `time()`.
|
||||
//
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds(time(NULL));
|
||||
// timestamp.set_nanos(0);
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds(time(NULL));
|
||||
// timestamp.set_nanos(0);
|
||||
//
|
||||
// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
||||
//
|
||||
// struct timeval tv;
|
||||
// gettimeofday(&tv, NULL);
|
||||
// struct timeval tv;
|
||||
// gettimeofday(&tv, NULL);
|
||||
//
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds(tv.tv_sec);
|
||||
// timestamp.set_nanos(tv.tv_usec * 1000);
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds(tv.tv_sec);
|
||||
// timestamp.set_nanos(tv.tv_usec * 1000);
|
||||
//
|
||||
// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
||||
//
|
||||
// FILETIME ft;
|
||||
// GetSystemTimeAsFileTime(&ft);
|
||||
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
||||
// FILETIME ft;
|
||||
// GetSystemTimeAsFileTime(&ft);
|
||||
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
||||
//
|
||||
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
||||
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
||||
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
||||
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
||||
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
||||
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
||||
//
|
||||
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
||||
//
|
||||
// long millis = System.currentTimeMillis();
|
||||
//
|
||||
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
||||
// .setNanos((int) ((millis % 1000) * 1000000)).build();
|
||||
// long millis = System.currentTimeMillis();
|
||||
//
|
||||
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
||||
// .setNanos((int) ((millis % 1000) * 1000000)).build();
|
||||
//
|
||||
// Example 5: Compute Timestamp from Java `Instant.now()`.
|
||||
//
|
||||
// Instant now = Instant.now();
|
||||
//
|
||||
// Timestamp timestamp =
|
||||
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
||||
// .setNanos(now.getNano()).build();
|
||||
// Instant now = Instant.now();
|
||||
//
|
||||
// Timestamp timestamp =
|
||||
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
||||
// .setNanos(now.getNano()).build();
|
||||
//
|
||||
// Example 6: Compute Timestamp from current time in Python.
|
||||
//
|
||||
// timestamp = Timestamp()
|
||||
// timestamp.GetCurrentTime()
|
||||
// timestamp = Timestamp()
|
||||
// timestamp.GetCurrentTime()
|
||||
//
|
||||
// # JSON Mapping
|
||||
//
|
||||
@@ -172,10 +167,8 @@ import (
|
||||
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
||||
// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
||||
// the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
||||
// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
|
||||
// ) to obtain a formatter capable of generating timestamps in this format.
|
||||
//
|
||||
//
|
||||
type Timestamp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
|
||||
7
go/vendor/modules.txt
vendored
7
go/vendor/modules.txt
vendored
@@ -1,8 +1,5 @@
|
||||
# github.com/golang/protobuf v1.5.2
|
||||
## explicit; go 1.9
|
||||
github.com/golang/protobuf/ptypes/timestamp
|
||||
# google.golang.org/protobuf v1.28.0
|
||||
## explicit; go 1.11
|
||||
# google.golang.org/protobuf v1.32.0
|
||||
## explicit; go 1.17
|
||||
google.golang.org/protobuf/encoding/prototext
|
||||
google.golang.org/protobuf/encoding/protowire
|
||||
google.golang.org/protobuf/internal/descfmt
|
||||
|
||||
14
python/README.md
Normal file
14
python/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# robocar-protobuf
|
||||
|
||||
Protobuf message definitions for robocar
|
||||
|
||||
## Generate package
|
||||
|
||||
```bash
|
||||
poetry self install
|
||||
poetry shell
|
||||
cd ..
|
||||
protoc --python_out=./python --mypy_out=./python events/events.proto
|
||||
cd python
|
||||
poetry build
|
||||
```
|
||||
@@ -1,392 +0,0 @@
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: events/events.proto
|
||||
|
||||
import sys
|
||||
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
|
||||
from google.protobuf.internal import enum_type_wrapper
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import message as _message
|
||||
from google.protobuf import reflection as _reflection
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
||||
name='events/events.proto',
|
||||
package='robocar.events',
|
||||
syntax='proto3',
|
||||
serialized_options=_b('Z\006events'),
|
||||
serialized_pb=_b('\n\x13\x65vents/events.proto\x12\x0erobocar.events\"$\n\x08\x46rameRef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\"C\n\x0c\x46rameMessage\x12$\n\x02id\x18\x01 \x01(\x0b\x32\x18.robocar.events.FrameRef\x12\r\n\x05\x66rame\x18\x02 \x01(\x0c\"d\n\x0fSteeringMessage\x12\x10\n\x08steering\x18\x01 \x01(\x02\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"d\n\x0fThrottleMessage\x12\x10\n\x08throttle\x18\x01 \x01(\x02\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"f\n\x0eObjectsMessage\x12\'\n\x07objects\x18\x01 \x03(\x0b\x32\x16.robocar.events.Object\x12+\n\tframe_ref\x18\x02 \x01(\x0b\x32\x18.robocar.events.FrameRef\"\x80\x01\n\x06Object\x12(\n\x04type\x18\x01 \x01(\x0e\x32\x1a.robocar.events.TypeObject\x12\r\n\x05lLeft\x18\x02 \x01(\x05\x12\n\n\x02up\x18\x03 \x01(\x05\x12\r\n\x05right\x18\x04 \x01(\x05\x12\x0e\n\x06\x62ottom\x18\x05 \x01(\x05\x12\x12\n\nconfidence\x18\x06 \x01(\x02*2\n\nTypeObject\x12\x07\n\x03\x41NY\x10\x00\x12\x07\n\x03\x43\x41R\x10\x01\x12\x08\n\x04\x42UMP\x10\x02\x12\x08\n\x04PLOT\x10\x03\x42\x08Z\x06\x65ventsb\x06proto3')
|
||||
)
|
||||
|
||||
_TYPEOBJECT = _descriptor.EnumDescriptor(
|
||||
name='TypeObject',
|
||||
full_name='robocar.events.TypeObject',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
values=[
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='ANY', index=0, number=0,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='CAR', index=1, number=1,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='BUMP', index=2, number=2,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='PLOT', index=3, number=3,
|
||||
serialized_options=None,
|
||||
type=None),
|
||||
],
|
||||
containing_type=None,
|
||||
serialized_options=None,
|
||||
serialized_start=585,
|
||||
serialized_end=635,
|
||||
)
|
||||
_sym_db.RegisterEnumDescriptor(_TYPEOBJECT)
|
||||
|
||||
TypeObject = enum_type_wrapper.EnumTypeWrapper(_TYPEOBJECT)
|
||||
ANY = 0
|
||||
CAR = 1
|
||||
BUMP = 2
|
||||
PLOT = 3
|
||||
|
||||
|
||||
|
||||
_FRAMEREF = _descriptor.Descriptor(
|
||||
name='FrameRef',
|
||||
full_name='robocar.events.FrameRef',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='name', full_name='robocar.events.FrameRef.name', index=0,
|
||||
number=1, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='id', full_name='robocar.events.FrameRef.id', index=1,
|
||||
number=2, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b("").decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=39,
|
||||
serialized_end=75,
|
||||
)
|
||||
|
||||
|
||||
_FRAMEMESSAGE = _descriptor.Descriptor(
|
||||
name='FrameMessage',
|
||||
full_name='robocar.events.FrameMessage',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='id', full_name='robocar.events.FrameMessage.id', index=0,
|
||||
number=1, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='frame', full_name='robocar.events.FrameMessage.frame', index=1,
|
||||
number=2, type=12, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=_b(""),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=77,
|
||||
serialized_end=144,
|
||||
)
|
||||
|
||||
|
||||
_STEERINGMESSAGE = _descriptor.Descriptor(
|
||||
name='SteeringMessage',
|
||||
full_name='robocar.events.SteeringMessage',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='steering', full_name='robocar.events.SteeringMessage.steering', index=0,
|
||||
number=1, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='confidence', full_name='robocar.events.SteeringMessage.confidence', index=1,
|
||||
number=2, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='frame_ref', full_name='robocar.events.SteeringMessage.frame_ref', index=2,
|
||||
number=3, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=146,
|
||||
serialized_end=246,
|
||||
)
|
||||
|
||||
|
||||
_THROTTLEMESSAGE = _descriptor.Descriptor(
|
||||
name='ThrottleMessage',
|
||||
full_name='robocar.events.ThrottleMessage',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='throttle', full_name='robocar.events.ThrottleMessage.throttle', index=0,
|
||||
number=1, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='confidence', full_name='robocar.events.ThrottleMessage.confidence', index=1,
|
||||
number=2, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='frame_ref', full_name='robocar.events.ThrottleMessage.frame_ref', index=2,
|
||||
number=3, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=248,
|
||||
serialized_end=348,
|
||||
)
|
||||
|
||||
|
||||
_OBJECTSMESSAGE = _descriptor.Descriptor(
|
||||
name='ObjectsMessage',
|
||||
full_name='robocar.events.ObjectsMessage',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='objects', full_name='robocar.events.ObjectsMessage.objects', index=0,
|
||||
number=1, type=11, cpp_type=10, label=3,
|
||||
has_default_value=False, default_value=[],
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='frame_ref', full_name='robocar.events.ObjectsMessage.frame_ref', index=1,
|
||||
number=2, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=350,
|
||||
serialized_end=452,
|
||||
)
|
||||
|
||||
|
||||
_OBJECT = _descriptor.Descriptor(
|
||||
name='Object',
|
||||
full_name='robocar.events.Object',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='type', full_name='robocar.events.Object.type', index=0,
|
||||
number=1, type=14, cpp_type=8, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='lLeft', full_name='robocar.events.Object.lLeft', index=1,
|
||||
number=2, type=5, cpp_type=1, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='up', full_name='robocar.events.Object.up', index=2,
|
||||
number=3, type=5, cpp_type=1, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='right', full_name='robocar.events.Object.right', index=3,
|
||||
number=4, type=5, cpp_type=1, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='bottom', full_name='robocar.events.Object.bottom', index=4,
|
||||
number=5, type=5, cpp_type=1, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='confidence', full_name='robocar.events.Object.confidence', index=5,
|
||||
number=6, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=455,
|
||||
serialized_end=583,
|
||||
)
|
||||
|
||||
_FRAMEMESSAGE.fields_by_name['id'].message_type = _FRAMEREF
|
||||
_STEERINGMESSAGE.fields_by_name['frame_ref'].message_type = _FRAMEREF
|
||||
_THROTTLEMESSAGE.fields_by_name['frame_ref'].message_type = _FRAMEREF
|
||||
_OBJECTSMESSAGE.fields_by_name['objects'].message_type = _OBJECT
|
||||
_OBJECTSMESSAGE.fields_by_name['frame_ref'].message_type = _FRAMEREF
|
||||
_OBJECT.fields_by_name['type'].enum_type = _TYPEOBJECT
|
||||
DESCRIPTOR.message_types_by_name['FrameRef'] = _FRAMEREF
|
||||
DESCRIPTOR.message_types_by_name['FrameMessage'] = _FRAMEMESSAGE
|
||||
DESCRIPTOR.message_types_by_name['SteeringMessage'] = _STEERINGMESSAGE
|
||||
DESCRIPTOR.message_types_by_name['ThrottleMessage'] = _THROTTLEMESSAGE
|
||||
DESCRIPTOR.message_types_by_name['ObjectsMessage'] = _OBJECTSMESSAGE
|
||||
DESCRIPTOR.message_types_by_name['Object'] = _OBJECT
|
||||
DESCRIPTOR.enum_types_by_name['TypeObject'] = _TYPEOBJECT
|
||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
||||
|
||||
FrameRef = _reflection.GeneratedProtocolMessageType('FrameRef', (_message.Message,), dict(
|
||||
DESCRIPTOR = _FRAMEREF,
|
||||
__module__ = 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.FrameRef)
|
||||
))
|
||||
_sym_db.RegisterMessage(FrameRef)
|
||||
|
||||
FrameMessage = _reflection.GeneratedProtocolMessageType('FrameMessage', (_message.Message,), dict(
|
||||
DESCRIPTOR = _FRAMEMESSAGE,
|
||||
__module__ = 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.FrameMessage)
|
||||
))
|
||||
_sym_db.RegisterMessage(FrameMessage)
|
||||
|
||||
SteeringMessage = _reflection.GeneratedProtocolMessageType('SteeringMessage', (_message.Message,), dict(
|
||||
DESCRIPTOR = _STEERINGMESSAGE,
|
||||
__module__ = 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.SteeringMessage)
|
||||
))
|
||||
_sym_db.RegisterMessage(SteeringMessage)
|
||||
|
||||
ThrottleMessage = _reflection.GeneratedProtocolMessageType('ThrottleMessage', (_message.Message,), dict(
|
||||
DESCRIPTOR = _THROTTLEMESSAGE,
|
||||
__module__ = 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.ThrottleMessage)
|
||||
))
|
||||
_sym_db.RegisterMessage(ThrottleMessage)
|
||||
|
||||
ObjectsMessage = _reflection.GeneratedProtocolMessageType('ObjectsMessage', (_message.Message,), dict(
|
||||
DESCRIPTOR = _OBJECTSMESSAGE,
|
||||
__module__ = 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.ObjectsMessage)
|
||||
))
|
||||
_sym_db.RegisterMessage(ObjectsMessage)
|
||||
|
||||
Object = _reflection.GeneratedProtocolMessageType('Object', (_message.Message,), dict(
|
||||
DESCRIPTOR = _OBJECT,
|
||||
__module__ = 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.Object)
|
||||
))
|
||||
_sym_db.RegisterMessage(Object)
|
||||
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
@@ -1,11 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: events/events.proto
|
||||
|
||||
from google.protobuf.internal import enum_type_wrapper
|
||||
"""Generated protocol buffer code."""
|
||||
from google.protobuf.internal import builder as _builder
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import message as _message
|
||||
from google.protobuf import reflection as _reflection
|
||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
@@ -15,744 +14,46 @@ _sym_db = _symbol_database.Default()
|
||||
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
||||
name='events/events.proto',
|
||||
package='robocar.events',
|
||||
syntax='proto3',
|
||||
serialized_options=b'Z\010./events',
|
||||
create_key=_descriptor._internal_create_key,
|
||||
serialized_pb=b'\n\x13\x65vents/events.proto\x12\x0erobocar.events\x1a\x1fgoogle/protobuf/timestamp.proto\"T\n\x08\x46rameRef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12.\n\ncreated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"C\n\x0c\x46rameMessage\x12$\n\x02id\x18\x01 \x01(\x0b\x32\x18.robocar.events.FrameRef\x12\r\n\x05\x66rame\x18\x02 \x01(\x0c\"d\n\x0fSteeringMessage\x12\x10\n\x08steering\x18\x01 \x01(\x02\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"d\n\x0fThrottleMessage\x12\x10\n\x08throttle\x18\x01 \x01(\x02\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"A\n\x10\x44riveModeMessage\x12-\n\ndrive_mode\x18\x01 \x01(\x0e\x32\x19.robocar.events.DriveMode\"f\n\x0eObjectsMessage\x12\'\n\x07objects\x18\x01 \x03(\x0b\x32\x16.robocar.events.Object\x12+\n\tframe_ref\x18\x02 \x01(\x0b\x32\x18.robocar.events.FrameRef\"\x80\x01\n\x06Object\x12(\n\x04type\x18\x01 \x01(\x0e\x32\x1a.robocar.events.TypeObject\x12\x0c\n\x04left\x18\x02 \x01(\x05\x12\x0b\n\x03top\x18\x03 \x01(\x05\x12\r\n\x05right\x18\x04 \x01(\x05\x12\x0e\n\x06\x62ottom\x18\x05 \x01(\x05\x12\x12\n\nconfidence\x18\x06 \x01(\x02\"&\n\x13SwitchRecordMessage\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\"\x8c\x01\n\x0bRoadMessage\x12&\n\x07\x63ontour\x18\x01 \x03(\x0b\x32\x15.robocar.events.Point\x12(\n\x07\x65llipse\x18\x02 \x01(\x0b\x32\x17.robocar.events.Ellipse\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"\x1d\n\x05Point\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"r\n\x07\x45llipse\x12%\n\x06\x63\x65nter\x18\x01 \x01(\x0b\x32\x15.robocar.events.Point\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12\r\n\x05\x61ngle\x18\x04 \x01(\x02\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"\x82\x01\n\rRecordMessage\x12+\n\x05\x66rame\x18\x01 \x01(\x0b\x32\x1c.robocar.events.FrameMessage\x12\x31\n\x08steering\x18\x02 \x01(\x0b\x32\x1f.robocar.events.SteeringMessage\x12\x11\n\trecordSet\x18\x03 \x01(\t*-\n\tDriveMode\x12\x0b\n\x07INVALID\x10\x00\x12\x08\n\x04USER\x10\x01\x12\t\n\x05PILOT\x10\x02*2\n\nTypeObject\x12\x07\n\x03\x41NY\x10\x00\x12\x07\n\x03\x43\x41R\x10\x01\x12\x08\n\x04\x42UMP\x10\x02\x12\x08\n\x04PLOT\x10\x03\x42\nZ\x08./eventsb\x06proto3'
|
||||
,
|
||||
dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,])
|
||||
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13\x65vents/events.proto\x12\x0erobocar.events\x1a\x1fgoogle/protobuf/timestamp.proto\"T\n\x08\x46rameRef\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12.\n\ncreated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"C\n\x0c\x46rameMessage\x12$\n\x02id\x18\x01 \x01(\x0b\x32\x18.robocar.events.FrameRef\x12\r\n\x05\x66rame\x18\x02 \x01(\x0c\"\x8a\x01\n\x10\x44isparityMessage\x12+\n\tframe_ref\x18\x01 \x01(\x0b\x32\x18.robocar.events.FrameRef\x12\x11\n\tdisparity\x18\x02 \x01(\x0c\x12\x1e\n\x16\x66ocal_length_in_pixels\x18\x03 \x01(\x01\x12\x16\n\x0e\x62\x61seline_in_mm\x18\x04 \x01(\x01\"d\n\x0fSteeringMessage\x12\x10\n\x08steering\x18\x01 \x01(\x02\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"d\n\x0fThrottleMessage\x12\x10\n\x08throttle\x18\x01 \x01(\x02\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"\x82\x01\n\x10SpeedZoneMessage\x12-\n\nspeed_zone\x18\x01 \x01(\x0e\x32\x19.robocar.events.SpeedZone\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"A\n\x10\x44riveModeMessage\x12-\n\ndrive_mode\x18\x01 \x01(\x0e\x32\x19.robocar.events.DriveMode\"f\n\x0eObjectsMessage\x12\'\n\x07objects\x18\x01 \x03(\x0b\x32\x16.robocar.events.Object\x12+\n\tframe_ref\x18\x02 \x01(\x0b\x32\x18.robocar.events.FrameRef\"\x96\x01\n\x06Object\x12(\n\x04type\x18\x01 \x01(\x0e\x32\x1a.robocar.events.TypeObject\x12\x0c\n\x04left\x18\x02 \x01(\x02\x12\x0b\n\x03top\x18\x03 \x01(\x02\x12\r\n\x05right\x18\x04 \x01(\x02\x12\x0e\n\x06\x62ottom\x18\x05 \x01(\x02\x12\x12\n\nconfidence\x18\x06 \x01(\x02\x12\x14\n\x0c\x64istanceInMm\x18\x07 \x01(\x03\"&\n\x13SwitchRecordMessage\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\"\x8c\x01\n\x0bRoadMessage\x12&\n\x07\x63ontour\x18\x01 \x03(\x0b\x32\x15.robocar.events.Point\x12(\n\x07\x65llipse\x18\x02 \x01(\x0b\x32\x17.robocar.events.Ellipse\x12+\n\tframe_ref\x18\x03 \x01(\x0b\x32\x18.robocar.events.FrameRef\"\x1d\n\x05Point\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"r\n\x07\x45llipse\x12%\n\x06\x63\x65nter\x18\x01 \x01(\x0b\x32\x15.robocar.events.Point\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12\r\n\x05\x61ngle\x18\x04 \x01(\x02\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"\xf5\x01\n\rRecordMessage\x12+\n\x05\x66rame\x18\x01 \x01(\x0b\x32\x1c.robocar.events.FrameMessage\x12\x31\n\x08steering\x18\x02 \x01(\x0b\x32\x1f.robocar.events.SteeringMessage\x12;\n\x12\x61utopilot_steering\x18\x04 \x01(\x0b\x32\x1f.robocar.events.SteeringMessage\x12\x34\n\ndrive_mode\x18\x05 \x01(\x0b\x32 .robocar.events.DriveModeMessage\x12\x11\n\trecordSet\x18\x03 \x01(\t*8\n\tSpeedZone\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04SLOW\x10\x01\x12\n\n\x06NORMAL\x10\x02\x12\x08\n\x04\x46\x41ST\x10\x03*:\n\tDriveMode\x12\x0b\n\x07INVALID\x10\x00\x12\x08\n\x04USER\x10\x01\x12\t\n\x05PILOT\x10\x02\x12\x0b\n\x07\x43OPILOT\x10\x03*2\n\nTypeObject\x12\x07\n\x03\x41NY\x10\x00\x12\x07\n\x03\x43\x41R\x10\x01\x12\x08\n\x04\x42UMP\x10\x02\x12\x08\n\x04PLOT\x10\x03\x42\nZ\x08./eventsb\x06proto3')
|
||||
|
||||
_DRIVEMODE = _descriptor.EnumDescriptor(
|
||||
name='DriveMode',
|
||||
full_name='robocar.events.DriveMode',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
values=[
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='INVALID', index=0, number=0,
|
||||
serialized_options=None,
|
||||
type=None,
|
||||
create_key=_descriptor._internal_create_key),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='USER', index=1, number=1,
|
||||
serialized_options=None,
|
||||
type=None,
|
||||
create_key=_descriptor._internal_create_key),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='PILOT', index=2, number=2,
|
||||
serialized_options=None,
|
||||
type=None,
|
||||
create_key=_descriptor._internal_create_key),
|
||||
],
|
||||
containing_type=None,
|
||||
serialized_options=None,
|
||||
serialized_start=1196,
|
||||
serialized_end=1241,
|
||||
)
|
||||
_sym_db.RegisterEnumDescriptor(_DRIVEMODE)
|
||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'events.events_pb2', globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DriveMode = enum_type_wrapper.EnumTypeWrapper(_DRIVEMODE)
|
||||
_TYPEOBJECT = _descriptor.EnumDescriptor(
|
||||
name='TypeObject',
|
||||
full_name='robocar.events.TypeObject',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
values=[
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='ANY', index=0, number=0,
|
||||
serialized_options=None,
|
||||
type=None,
|
||||
create_key=_descriptor._internal_create_key),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='CAR', index=1, number=1,
|
||||
serialized_options=None,
|
||||
type=None,
|
||||
create_key=_descriptor._internal_create_key),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='BUMP', index=2, number=2,
|
||||
serialized_options=None,
|
||||
type=None,
|
||||
create_key=_descriptor._internal_create_key),
|
||||
_descriptor.EnumValueDescriptor(
|
||||
name='PLOT', index=3, number=3,
|
||||
serialized_options=None,
|
||||
type=None,
|
||||
create_key=_descriptor._internal_create_key),
|
||||
],
|
||||
containing_type=None,
|
||||
serialized_options=None,
|
||||
serialized_start=1243,
|
||||
serialized_end=1293,
|
||||
)
|
||||
_sym_db.RegisterEnumDescriptor(_TYPEOBJECT)
|
||||
|
||||
TypeObject = enum_type_wrapper.EnumTypeWrapper(_TYPEOBJECT)
|
||||
INVALID = 0
|
||||
USER = 1
|
||||
PILOT = 2
|
||||
ANY = 0
|
||||
CAR = 1
|
||||
BUMP = 2
|
||||
PLOT = 3
|
||||
|
||||
|
||||
|
||||
_FRAMEREF = _descriptor.Descriptor(
|
||||
name='FrameRef',
|
||||
full_name='robocar.events.FrameRef',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='name', full_name='robocar.events.FrameRef.name', index=0,
|
||||
number=1, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=b"".decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='id', full_name='robocar.events.FrameRef.id', index=1,
|
||||
number=2, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=b"".decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='created_at', full_name='robocar.events.FrameRef.created_at', index=2,
|
||||
number=3, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=72,
|
||||
serialized_end=156,
|
||||
)
|
||||
|
||||
|
||||
_FRAMEMESSAGE = _descriptor.Descriptor(
|
||||
name='FrameMessage',
|
||||
full_name='robocar.events.FrameMessage',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='id', full_name='robocar.events.FrameMessage.id', index=0,
|
||||
number=1, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='frame', full_name='robocar.events.FrameMessage.frame', index=1,
|
||||
number=2, type=12, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=b"",
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=158,
|
||||
serialized_end=225,
|
||||
)
|
||||
|
||||
|
||||
_STEERINGMESSAGE = _descriptor.Descriptor(
|
||||
name='SteeringMessage',
|
||||
full_name='robocar.events.SteeringMessage',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='steering', full_name='robocar.events.SteeringMessage.steering', index=0,
|
||||
number=1, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='confidence', full_name='robocar.events.SteeringMessage.confidence', index=1,
|
||||
number=2, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='frame_ref', full_name='robocar.events.SteeringMessage.frame_ref', index=2,
|
||||
number=3, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=227,
|
||||
serialized_end=327,
|
||||
)
|
||||
|
||||
|
||||
_THROTTLEMESSAGE = _descriptor.Descriptor(
|
||||
name='ThrottleMessage',
|
||||
full_name='robocar.events.ThrottleMessage',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='throttle', full_name='robocar.events.ThrottleMessage.throttle', index=0,
|
||||
number=1, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='confidence', full_name='robocar.events.ThrottleMessage.confidence', index=1,
|
||||
number=2, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='frame_ref', full_name='robocar.events.ThrottleMessage.frame_ref', index=2,
|
||||
number=3, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=329,
|
||||
serialized_end=429,
|
||||
)
|
||||
|
||||
|
||||
_DRIVEMODEMESSAGE = _descriptor.Descriptor(
|
||||
name='DriveModeMessage',
|
||||
full_name='robocar.events.DriveModeMessage',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='drive_mode', full_name='robocar.events.DriveModeMessage.drive_mode', index=0,
|
||||
number=1, type=14, cpp_type=8, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=431,
|
||||
serialized_end=496,
|
||||
)
|
||||
|
||||
|
||||
_OBJECTSMESSAGE = _descriptor.Descriptor(
|
||||
name='ObjectsMessage',
|
||||
full_name='robocar.events.ObjectsMessage',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='objects', full_name='robocar.events.ObjectsMessage.objects', index=0,
|
||||
number=1, type=11, cpp_type=10, label=3,
|
||||
has_default_value=False, default_value=[],
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='frame_ref', full_name='robocar.events.ObjectsMessage.frame_ref', index=1,
|
||||
number=2, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=498,
|
||||
serialized_end=600,
|
||||
)
|
||||
|
||||
|
||||
_OBJECT = _descriptor.Descriptor(
|
||||
name='Object',
|
||||
full_name='robocar.events.Object',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='type', full_name='robocar.events.Object.type', index=0,
|
||||
number=1, type=14, cpp_type=8, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='left', full_name='robocar.events.Object.left', index=1,
|
||||
number=2, type=5, cpp_type=1, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='top', full_name='robocar.events.Object.top', index=2,
|
||||
number=3, type=5, cpp_type=1, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='right', full_name='robocar.events.Object.right', index=3,
|
||||
number=4, type=5, cpp_type=1, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='bottom', full_name='robocar.events.Object.bottom', index=4,
|
||||
number=5, type=5, cpp_type=1, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='confidence', full_name='robocar.events.Object.confidence', index=5,
|
||||
number=6, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=603,
|
||||
serialized_end=731,
|
||||
)
|
||||
|
||||
|
||||
_SWITCHRECORDMESSAGE = _descriptor.Descriptor(
|
||||
name='SwitchRecordMessage',
|
||||
full_name='robocar.events.SwitchRecordMessage',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='enabled', full_name='robocar.events.SwitchRecordMessage.enabled', index=0,
|
||||
number=1, type=8, cpp_type=7, label=1,
|
||||
has_default_value=False, default_value=False,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=733,
|
||||
serialized_end=771,
|
||||
)
|
||||
|
||||
|
||||
_ROADMESSAGE = _descriptor.Descriptor(
|
||||
name='RoadMessage',
|
||||
full_name='robocar.events.RoadMessage',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='contour', full_name='robocar.events.RoadMessage.contour', index=0,
|
||||
number=1, type=11, cpp_type=10, label=3,
|
||||
has_default_value=False, default_value=[],
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='ellipse', full_name='robocar.events.RoadMessage.ellipse', index=1,
|
||||
number=2, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='frame_ref', full_name='robocar.events.RoadMessage.frame_ref', index=2,
|
||||
number=3, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=774,
|
||||
serialized_end=914,
|
||||
)
|
||||
|
||||
|
||||
_POINT = _descriptor.Descriptor(
|
||||
name='Point',
|
||||
full_name='robocar.events.Point',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='x', full_name='robocar.events.Point.x', index=0,
|
||||
number=1, type=5, cpp_type=1, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='y', full_name='robocar.events.Point.y', index=1,
|
||||
number=2, type=5, cpp_type=1, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=916,
|
||||
serialized_end=945,
|
||||
)
|
||||
|
||||
|
||||
_ELLIPSE = _descriptor.Descriptor(
|
||||
name='Ellipse',
|
||||
full_name='robocar.events.Ellipse',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='center', full_name='robocar.events.Ellipse.center', index=0,
|
||||
number=1, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='width', full_name='robocar.events.Ellipse.width', index=1,
|
||||
number=2, type=5, cpp_type=1, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='height', full_name='robocar.events.Ellipse.height', index=2,
|
||||
number=3, type=5, cpp_type=1, label=1,
|
||||
has_default_value=False, default_value=0,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='angle', full_name='robocar.events.Ellipse.angle', index=3,
|
||||
number=4, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='confidence', full_name='robocar.events.Ellipse.confidence', index=4,
|
||||
number=5, type=2, cpp_type=6, label=1,
|
||||
has_default_value=False, default_value=float(0),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=947,
|
||||
serialized_end=1061,
|
||||
)
|
||||
|
||||
|
||||
_RECORDMESSAGE = _descriptor.Descriptor(
|
||||
name='RecordMessage',
|
||||
full_name='robocar.events.RecordMessage',
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
fields=[
|
||||
_descriptor.FieldDescriptor(
|
||||
name='frame', full_name='robocar.events.RecordMessage.frame', index=0,
|
||||
number=1, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='steering', full_name='robocar.events.RecordMessage.steering', index=1,
|
||||
number=2, type=11, cpp_type=10, label=1,
|
||||
has_default_value=False, default_value=None,
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
_descriptor.FieldDescriptor(
|
||||
name='recordSet', full_name='robocar.events.RecordMessage.recordSet', index=2,
|
||||
number=3, type=9, cpp_type=9, label=1,
|
||||
has_default_value=False, default_value=b"".decode('utf-8'),
|
||||
message_type=None, enum_type=None, containing_type=None,
|
||||
is_extension=False, extension_scope=None,
|
||||
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
|
||||
],
|
||||
extensions=[
|
||||
],
|
||||
nested_types=[],
|
||||
enum_types=[
|
||||
],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax='proto3',
|
||||
extension_ranges=[],
|
||||
oneofs=[
|
||||
],
|
||||
serialized_start=1064,
|
||||
serialized_end=1194,
|
||||
)
|
||||
|
||||
_FRAMEREF.fields_by_name['created_at'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP
|
||||
_FRAMEMESSAGE.fields_by_name['id'].message_type = _FRAMEREF
|
||||
_STEERINGMESSAGE.fields_by_name['frame_ref'].message_type = _FRAMEREF
|
||||
_THROTTLEMESSAGE.fields_by_name['frame_ref'].message_type = _FRAMEREF
|
||||
_DRIVEMODEMESSAGE.fields_by_name['drive_mode'].enum_type = _DRIVEMODE
|
||||
_OBJECTSMESSAGE.fields_by_name['objects'].message_type = _OBJECT
|
||||
_OBJECTSMESSAGE.fields_by_name['frame_ref'].message_type = _FRAMEREF
|
||||
_OBJECT.fields_by_name['type'].enum_type = _TYPEOBJECT
|
||||
_ROADMESSAGE.fields_by_name['contour'].message_type = _POINT
|
||||
_ROADMESSAGE.fields_by_name['ellipse'].message_type = _ELLIPSE
|
||||
_ROADMESSAGE.fields_by_name['frame_ref'].message_type = _FRAMEREF
|
||||
_ELLIPSE.fields_by_name['center'].message_type = _POINT
|
||||
_RECORDMESSAGE.fields_by_name['frame'].message_type = _FRAMEMESSAGE
|
||||
_RECORDMESSAGE.fields_by_name['steering'].message_type = _STEERINGMESSAGE
|
||||
DESCRIPTOR.message_types_by_name['FrameRef'] = _FRAMEREF
|
||||
DESCRIPTOR.message_types_by_name['FrameMessage'] = _FRAMEMESSAGE
|
||||
DESCRIPTOR.message_types_by_name['SteeringMessage'] = _STEERINGMESSAGE
|
||||
DESCRIPTOR.message_types_by_name['ThrottleMessage'] = _THROTTLEMESSAGE
|
||||
DESCRIPTOR.message_types_by_name['DriveModeMessage'] = _DRIVEMODEMESSAGE
|
||||
DESCRIPTOR.message_types_by_name['ObjectsMessage'] = _OBJECTSMESSAGE
|
||||
DESCRIPTOR.message_types_by_name['Object'] = _OBJECT
|
||||
DESCRIPTOR.message_types_by_name['SwitchRecordMessage'] = _SWITCHRECORDMESSAGE
|
||||
DESCRIPTOR.message_types_by_name['RoadMessage'] = _ROADMESSAGE
|
||||
DESCRIPTOR.message_types_by_name['Point'] = _POINT
|
||||
DESCRIPTOR.message_types_by_name['Ellipse'] = _ELLIPSE
|
||||
DESCRIPTOR.message_types_by_name['RecordMessage'] = _RECORDMESSAGE
|
||||
DESCRIPTOR.enum_types_by_name['DriveMode'] = _DRIVEMODE
|
||||
DESCRIPTOR.enum_types_by_name['TypeObject'] = _TYPEOBJECT
|
||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
||||
|
||||
FrameRef = _reflection.GeneratedProtocolMessageType('FrameRef', (_message.Message,), {
|
||||
'DESCRIPTOR' : _FRAMEREF,
|
||||
'__module__' : 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.FrameRef)
|
||||
})
|
||||
_sym_db.RegisterMessage(FrameRef)
|
||||
|
||||
FrameMessage = _reflection.GeneratedProtocolMessageType('FrameMessage', (_message.Message,), {
|
||||
'DESCRIPTOR' : _FRAMEMESSAGE,
|
||||
'__module__' : 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.FrameMessage)
|
||||
})
|
||||
_sym_db.RegisterMessage(FrameMessage)
|
||||
|
||||
SteeringMessage = _reflection.GeneratedProtocolMessageType('SteeringMessage', (_message.Message,), {
|
||||
'DESCRIPTOR' : _STEERINGMESSAGE,
|
||||
'__module__' : 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.SteeringMessage)
|
||||
})
|
||||
_sym_db.RegisterMessage(SteeringMessage)
|
||||
|
||||
ThrottleMessage = _reflection.GeneratedProtocolMessageType('ThrottleMessage', (_message.Message,), {
|
||||
'DESCRIPTOR' : _THROTTLEMESSAGE,
|
||||
'__module__' : 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.ThrottleMessage)
|
||||
})
|
||||
_sym_db.RegisterMessage(ThrottleMessage)
|
||||
|
||||
DriveModeMessage = _reflection.GeneratedProtocolMessageType('DriveModeMessage', (_message.Message,), {
|
||||
'DESCRIPTOR' : _DRIVEMODEMESSAGE,
|
||||
'__module__' : 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.DriveModeMessage)
|
||||
})
|
||||
_sym_db.RegisterMessage(DriveModeMessage)
|
||||
|
||||
ObjectsMessage = _reflection.GeneratedProtocolMessageType('ObjectsMessage', (_message.Message,), {
|
||||
'DESCRIPTOR' : _OBJECTSMESSAGE,
|
||||
'__module__' : 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.ObjectsMessage)
|
||||
})
|
||||
_sym_db.RegisterMessage(ObjectsMessage)
|
||||
|
||||
Object = _reflection.GeneratedProtocolMessageType('Object', (_message.Message,), {
|
||||
'DESCRIPTOR' : _OBJECT,
|
||||
'__module__' : 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.Object)
|
||||
})
|
||||
_sym_db.RegisterMessage(Object)
|
||||
|
||||
SwitchRecordMessage = _reflection.GeneratedProtocolMessageType('SwitchRecordMessage', (_message.Message,), {
|
||||
'DESCRIPTOR' : _SWITCHRECORDMESSAGE,
|
||||
'__module__' : 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.SwitchRecordMessage)
|
||||
})
|
||||
_sym_db.RegisterMessage(SwitchRecordMessage)
|
||||
|
||||
RoadMessage = _reflection.GeneratedProtocolMessageType('RoadMessage', (_message.Message,), {
|
||||
'DESCRIPTOR' : _ROADMESSAGE,
|
||||
'__module__' : 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.RoadMessage)
|
||||
})
|
||||
_sym_db.RegisterMessage(RoadMessage)
|
||||
|
||||
Point = _reflection.GeneratedProtocolMessageType('Point', (_message.Message,), {
|
||||
'DESCRIPTOR' : _POINT,
|
||||
'__module__' : 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.Point)
|
||||
})
|
||||
_sym_db.RegisterMessage(Point)
|
||||
|
||||
Ellipse = _reflection.GeneratedProtocolMessageType('Ellipse', (_message.Message,), {
|
||||
'DESCRIPTOR' : _ELLIPSE,
|
||||
'__module__' : 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.Ellipse)
|
||||
})
|
||||
_sym_db.RegisterMessage(Ellipse)
|
||||
|
||||
RecordMessage = _reflection.GeneratedProtocolMessageType('RecordMessage', (_message.Message,), {
|
||||
'DESCRIPTOR' : _RECORDMESSAGE,
|
||||
'__module__' : 'events.events_pb2'
|
||||
# @@protoc_insertion_point(class_scope:robocar.events.RecordMessage)
|
||||
})
|
||||
_sym_db.RegisterMessage(RecordMessage)
|
||||
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b'Z\010./events'
|
||||
_SPEEDZONE._serialized_start=1607
|
||||
_SPEEDZONE._serialized_end=1663
|
||||
_DRIVEMODE._serialized_start=1665
|
||||
_DRIVEMODE._serialized_end=1723
|
||||
_TYPEOBJECT._serialized_start=1725
|
||||
_TYPEOBJECT._serialized_end=1775
|
||||
_FRAMEREF._serialized_start=72
|
||||
_FRAMEREF._serialized_end=156
|
||||
_FRAMEMESSAGE._serialized_start=158
|
||||
_FRAMEMESSAGE._serialized_end=225
|
||||
_DISPARITYMESSAGE._serialized_start=228
|
||||
_DISPARITYMESSAGE._serialized_end=366
|
||||
_STEERINGMESSAGE._serialized_start=368
|
||||
_STEERINGMESSAGE._serialized_end=468
|
||||
_THROTTLEMESSAGE._serialized_start=470
|
||||
_THROTTLEMESSAGE._serialized_end=570
|
||||
_SPEEDZONEMESSAGE._serialized_start=573
|
||||
_SPEEDZONEMESSAGE._serialized_end=703
|
||||
_DRIVEMODEMESSAGE._serialized_start=705
|
||||
_DRIVEMODEMESSAGE._serialized_end=770
|
||||
_OBJECTSMESSAGE._serialized_start=772
|
||||
_OBJECTSMESSAGE._serialized_end=874
|
||||
_OBJECT._serialized_start=877
|
||||
_OBJECT._serialized_end=1027
|
||||
_SWITCHRECORDMESSAGE._serialized_start=1029
|
||||
_SWITCHRECORDMESSAGE._serialized_end=1067
|
||||
_ROADMESSAGE._serialized_start=1070
|
||||
_ROADMESSAGE._serialized_end=1210
|
||||
_POINT._serialized_start=1212
|
||||
_POINT._serialized_end=1241
|
||||
_ELLIPSE._serialized_start=1243
|
||||
_ELLIPSE._serialized_end=1357
|
||||
_RECORDMESSAGE._serialized_start=1360
|
||||
_RECORDMESSAGE._serialized_end=1605
|
||||
# @@protoc_insertion_point(module_scope)
|
||||
|
||||
411
python/events/events_pb2.pyi
Normal file
411
python/events/events_pb2.pyi
Normal file
@@ -0,0 +1,411 @@
|
||||
"""
|
||||
@generated by mypy-protobuf. Do not edit manually!
|
||||
isort:skip_file
|
||||
"""
|
||||
import builtins
|
||||
import collections.abc
|
||||
import google.protobuf.descriptor
|
||||
import google.protobuf.internal.containers
|
||||
import google.protobuf.internal.enum_type_wrapper
|
||||
import google.protobuf.message
|
||||
import google.protobuf.timestamp_pb2
|
||||
import sys
|
||||
import typing
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
import typing as typing_extensions
|
||||
else:
|
||||
import typing_extensions
|
||||
|
||||
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
||||
|
||||
class _SpeedZone:
|
||||
ValueType = typing.NewType("ValueType", builtins.int)
|
||||
V: typing_extensions.TypeAlias = ValueType
|
||||
|
||||
class _SpeedZoneEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SpeedZone.ValueType], builtins.type):
|
||||
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
||||
UNKNOWN: _SpeedZone.ValueType # 0
|
||||
SLOW: _SpeedZone.ValueType # 1
|
||||
NORMAL: _SpeedZone.ValueType # 2
|
||||
FAST: _SpeedZone.ValueType # 3
|
||||
|
||||
class SpeedZone(_SpeedZone, metaclass=_SpeedZoneEnumTypeWrapper): ...
|
||||
|
||||
UNKNOWN: SpeedZone.ValueType # 0
|
||||
SLOW: SpeedZone.ValueType # 1
|
||||
NORMAL: SpeedZone.ValueType # 2
|
||||
FAST: SpeedZone.ValueType # 3
|
||||
global___SpeedZone = SpeedZone
|
||||
|
||||
class _DriveMode:
|
||||
ValueType = typing.NewType("ValueType", builtins.int)
|
||||
V: typing_extensions.TypeAlias = ValueType
|
||||
|
||||
class _DriveModeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DriveMode.ValueType], builtins.type):
|
||||
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
||||
INVALID: _DriveMode.ValueType # 0
|
||||
USER: _DriveMode.ValueType # 1
|
||||
PILOT: _DriveMode.ValueType # 2
|
||||
COPILOT: _DriveMode.ValueType # 3
|
||||
|
||||
class DriveMode(_DriveMode, metaclass=_DriveModeEnumTypeWrapper): ...
|
||||
|
||||
INVALID: DriveMode.ValueType # 0
|
||||
USER: DriveMode.ValueType # 1
|
||||
PILOT: DriveMode.ValueType # 2
|
||||
COPILOT: DriveMode.ValueType # 3
|
||||
global___DriveMode = DriveMode
|
||||
|
||||
class _TypeObject:
|
||||
ValueType = typing.NewType("ValueType", builtins.int)
|
||||
V: typing_extensions.TypeAlias = ValueType
|
||||
|
||||
class _TypeObjectEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_TypeObject.ValueType], builtins.type):
|
||||
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
||||
ANY: _TypeObject.ValueType # 0
|
||||
CAR: _TypeObject.ValueType # 1
|
||||
BUMP: _TypeObject.ValueType # 2
|
||||
PLOT: _TypeObject.ValueType # 3
|
||||
|
||||
class TypeObject(_TypeObject, metaclass=_TypeObjectEnumTypeWrapper): ...
|
||||
|
||||
ANY: TypeObject.ValueType # 0
|
||||
CAR: TypeObject.ValueType # 1
|
||||
BUMP: TypeObject.ValueType # 2
|
||||
PLOT: TypeObject.ValueType # 3
|
||||
global___TypeObject = TypeObject
|
||||
|
||||
@typing_extensions.final
|
||||
class FrameRef(google.protobuf.message.Message):
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
NAME_FIELD_NUMBER: builtins.int
|
||||
ID_FIELD_NUMBER: builtins.int
|
||||
CREATED_AT_FIELD_NUMBER: builtins.int
|
||||
name: builtins.str
|
||||
id: builtins.str
|
||||
@property
|
||||
def created_at(self) -> google.protobuf.timestamp_pb2.Timestamp: ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
name: builtins.str = ...,
|
||||
id: builtins.str = ...,
|
||||
created_at: google.protobuf.timestamp_pb2.Timestamp | None = ...,
|
||||
) -> None: ...
|
||||
def HasField(self, field_name: typing_extensions.Literal["created_at", b"created_at"]) -> builtins.bool: ...
|
||||
def ClearField(self, field_name: typing_extensions.Literal["created_at", b"created_at", "id", b"id", "name", b"name"]) -> None: ...
|
||||
|
||||
global___FrameRef = FrameRef
|
||||
|
||||
@typing_extensions.final
|
||||
class FrameMessage(google.protobuf.message.Message):
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
ID_FIELD_NUMBER: builtins.int
|
||||
FRAME_FIELD_NUMBER: builtins.int
|
||||
@property
|
||||
def id(self) -> global___FrameRef: ...
|
||||
frame: builtins.bytes
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
id: global___FrameRef | None = ...,
|
||||
frame: builtins.bytes = ...,
|
||||
) -> None: ...
|
||||
def HasField(self, field_name: typing_extensions.Literal["id", b"id"]) -> builtins.bool: ...
|
||||
def ClearField(self, field_name: typing_extensions.Literal["frame", b"frame", "id", b"id"]) -> None: ...
|
||||
|
||||
global___FrameMessage = FrameMessage
|
||||
|
||||
@typing_extensions.final
|
||||
class DisparityMessage(google.protobuf.message.Message):
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
FRAME_REF_FIELD_NUMBER: builtins.int
|
||||
DISPARITY_FIELD_NUMBER: builtins.int
|
||||
FOCAL_LENGTH_IN_PIXELS_FIELD_NUMBER: builtins.int
|
||||
BASELINE_IN_MM_FIELD_NUMBER: builtins.int
|
||||
@property
|
||||
def frame_ref(self) -> global___FrameRef: ...
|
||||
disparity: builtins.bytes
|
||||
focal_length_in_pixels: builtins.float
|
||||
baseline_in_mm: builtins.float
|
||||
"""the distance between two mono cameras"""
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
frame_ref: global___FrameRef | None = ...,
|
||||
disparity: builtins.bytes = ...,
|
||||
focal_length_in_pixels: builtins.float = ...,
|
||||
baseline_in_mm: builtins.float = ...,
|
||||
) -> None: ...
|
||||
def HasField(self, field_name: typing_extensions.Literal["frame_ref", b"frame_ref"]) -> builtins.bool: ...
|
||||
def ClearField(self, field_name: typing_extensions.Literal["baseline_in_mm", b"baseline_in_mm", "disparity", b"disparity", "focal_length_in_pixels", b"focal_length_in_pixels", "frame_ref", b"frame_ref"]) -> None: ...
|
||||
|
||||
global___DisparityMessage = DisparityMessage
|
||||
|
||||
@typing_extensions.final
|
||||
class SteeringMessage(google.protobuf.message.Message):
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
STEERING_FIELD_NUMBER: builtins.int
|
||||
CONFIDENCE_FIELD_NUMBER: builtins.int
|
||||
FRAME_REF_FIELD_NUMBER: builtins.int
|
||||
steering: builtins.float
|
||||
confidence: builtins.float
|
||||
@property
|
||||
def frame_ref(self) -> global___FrameRef: ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
steering: builtins.float = ...,
|
||||
confidence: builtins.float = ...,
|
||||
frame_ref: global___FrameRef | None = ...,
|
||||
) -> None: ...
|
||||
def HasField(self, field_name: typing_extensions.Literal["frame_ref", b"frame_ref"]) -> builtins.bool: ...
|
||||
def ClearField(self, field_name: typing_extensions.Literal["confidence", b"confidence", "frame_ref", b"frame_ref", "steering", b"steering"]) -> None: ...
|
||||
|
||||
global___SteeringMessage = SteeringMessage
|
||||
|
||||
@typing_extensions.final
|
||||
class ThrottleMessage(google.protobuf.message.Message):
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
THROTTLE_FIELD_NUMBER: builtins.int
|
||||
CONFIDENCE_FIELD_NUMBER: builtins.int
|
||||
FRAME_REF_FIELD_NUMBER: builtins.int
|
||||
throttle: builtins.float
|
||||
confidence: builtins.float
|
||||
@property
|
||||
def frame_ref(self) -> global___FrameRef: ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
throttle: builtins.float = ...,
|
||||
confidence: builtins.float = ...,
|
||||
frame_ref: global___FrameRef | None = ...,
|
||||
) -> None: ...
|
||||
def HasField(self, field_name: typing_extensions.Literal["frame_ref", b"frame_ref"]) -> builtins.bool: ...
|
||||
def ClearField(self, field_name: typing_extensions.Literal["confidence", b"confidence", "frame_ref", b"frame_ref", "throttle", b"throttle"]) -> None: ...
|
||||
|
||||
global___ThrottleMessage = ThrottleMessage
|
||||
|
||||
@typing_extensions.final
|
||||
class SpeedZoneMessage(google.protobuf.message.Message):
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
SPEED_ZONE_FIELD_NUMBER: builtins.int
|
||||
CONFIDENCE_FIELD_NUMBER: builtins.int
|
||||
FRAME_REF_FIELD_NUMBER: builtins.int
|
||||
speed_zone: global___SpeedZone.ValueType
|
||||
confidence: builtins.float
|
||||
@property
|
||||
def frame_ref(self) -> global___FrameRef: ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
speed_zone: global___SpeedZone.ValueType = ...,
|
||||
confidence: builtins.float = ...,
|
||||
frame_ref: global___FrameRef | None = ...,
|
||||
) -> None: ...
|
||||
def HasField(self, field_name: typing_extensions.Literal["frame_ref", b"frame_ref"]) -> builtins.bool: ...
|
||||
def ClearField(self, field_name: typing_extensions.Literal["confidence", b"confidence", "frame_ref", b"frame_ref", "speed_zone", b"speed_zone"]) -> None: ...
|
||||
|
||||
global___SpeedZoneMessage = SpeedZoneMessage
|
||||
|
||||
@typing_extensions.final
|
||||
class DriveModeMessage(google.protobuf.message.Message):
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
DRIVE_MODE_FIELD_NUMBER: builtins.int
|
||||
drive_mode: global___DriveMode.ValueType
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
drive_mode: global___DriveMode.ValueType = ...,
|
||||
) -> None: ...
|
||||
def ClearField(self, field_name: typing_extensions.Literal["drive_mode", b"drive_mode"]) -> None: ...
|
||||
|
||||
global___DriveModeMessage = DriveModeMessage
|
||||
|
||||
@typing_extensions.final
|
||||
class ObjectsMessage(google.protobuf.message.Message):
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
OBJECTS_FIELD_NUMBER: builtins.int
|
||||
FRAME_REF_FIELD_NUMBER: builtins.int
|
||||
@property
|
||||
def objects(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Object]: ...
|
||||
@property
|
||||
def frame_ref(self) -> global___FrameRef: ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
objects: collections.abc.Iterable[global___Object] | None = ...,
|
||||
frame_ref: global___FrameRef | None = ...,
|
||||
) -> None: ...
|
||||
def HasField(self, field_name: typing_extensions.Literal["frame_ref", b"frame_ref"]) -> builtins.bool: ...
|
||||
def ClearField(self, field_name: typing_extensions.Literal["frame_ref", b"frame_ref", "objects", b"objects"]) -> None: ...
|
||||
|
||||
global___ObjectsMessage = ObjectsMessage
|
||||
|
||||
@typing_extensions.final
|
||||
class Object(google.protobuf.message.Message):
|
||||
"""BoundingBox that contains an object, coordinates as percent"""
|
||||
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
TYPE_FIELD_NUMBER: builtins.int
|
||||
LEFT_FIELD_NUMBER: builtins.int
|
||||
TOP_FIELD_NUMBER: builtins.int
|
||||
RIGHT_FIELD_NUMBER: builtins.int
|
||||
BOTTOM_FIELD_NUMBER: builtins.int
|
||||
CONFIDENCE_FIELD_NUMBER: builtins.int
|
||||
type: global___TypeObject.ValueType
|
||||
left: builtins.float
|
||||
top: builtins.float
|
||||
right: builtins.float
|
||||
bottom: builtins.float
|
||||
confidence: builtins.float
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
type: global___TypeObject.ValueType = ...,
|
||||
left: builtins.float = ...,
|
||||
top: builtins.float = ...,
|
||||
right: builtins.float = ...,
|
||||
bottom: builtins.float = ...,
|
||||
confidence: builtins.float = ...,
|
||||
) -> None: ...
|
||||
def ClearField(self, field_name: typing_extensions.Literal["bottom", b"bottom", "confidence", b"confidence", "left", b"left", "right", b"right", "top", b"top", "type", b"type"]) -> None: ...
|
||||
|
||||
global___Object = Object
|
||||
|
||||
@typing_extensions.final
|
||||
class SwitchRecordMessage(google.protobuf.message.Message):
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
ENABLED_FIELD_NUMBER: builtins.int
|
||||
enabled: builtins.bool
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
enabled: builtins.bool = ...,
|
||||
) -> None: ...
|
||||
def ClearField(self, field_name: typing_extensions.Literal["enabled", b"enabled"]) -> None: ...
|
||||
|
||||
global___SwitchRecordMessage = SwitchRecordMessage
|
||||
|
||||
@typing_extensions.final
|
||||
class RoadMessage(google.protobuf.message.Message):
|
||||
"""Road description"""
|
||||
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
CONTOUR_FIELD_NUMBER: builtins.int
|
||||
ELLIPSE_FIELD_NUMBER: builtins.int
|
||||
FRAME_REF_FIELD_NUMBER: builtins.int
|
||||
@property
|
||||
def contour(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Point]:
|
||||
"""list of points that describes road contour"""
|
||||
@property
|
||||
def ellipse(self) -> global___Ellipse:
|
||||
"""rotated ellipse that fit road contour"""
|
||||
@property
|
||||
def frame_ref(self) -> global___FrameRef:
|
||||
"""Reference to the frame used for compute"""
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
contour: collections.abc.Iterable[global___Point] | None = ...,
|
||||
ellipse: global___Ellipse | None = ...,
|
||||
frame_ref: global___FrameRef | None = ...,
|
||||
) -> None: ...
|
||||
def HasField(self, field_name: typing_extensions.Literal["ellipse", b"ellipse", "frame_ref", b"frame_ref"]) -> builtins.bool: ...
|
||||
def ClearField(self, field_name: typing_extensions.Literal["contour", b"contour", "ellipse", b"ellipse", "frame_ref", b"frame_ref"]) -> None: ...
|
||||
|
||||
global___RoadMessage = RoadMessage
|
||||
|
||||
@typing_extensions.final
|
||||
class Point(google.protobuf.message.Message):
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
X_FIELD_NUMBER: builtins.int
|
||||
Y_FIELD_NUMBER: builtins.int
|
||||
x: builtins.int
|
||||
y: builtins.int
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
x: builtins.int = ...,
|
||||
y: builtins.int = ...,
|
||||
) -> None: ...
|
||||
def ClearField(self, field_name: typing_extensions.Literal["x", b"x", "y", b"y"]) -> None: ...
|
||||
|
||||
global___Point = Point
|
||||
|
||||
@typing_extensions.final
|
||||
class Ellipse(google.protobuf.message.Message):
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
CENTER_FIELD_NUMBER: builtins.int
|
||||
WIDTH_FIELD_NUMBER: builtins.int
|
||||
HEIGHT_FIELD_NUMBER: builtins.int
|
||||
ANGLE_FIELD_NUMBER: builtins.int
|
||||
CONFIDENCE_FIELD_NUMBER: builtins.int
|
||||
@property
|
||||
def center(self) -> global___Point: ...
|
||||
width: builtins.int
|
||||
height: builtins.int
|
||||
angle: builtins.float
|
||||
confidence: builtins.float
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
center: global___Point | None = ...,
|
||||
width: builtins.int = ...,
|
||||
height: builtins.int = ...,
|
||||
angle: builtins.float = ...,
|
||||
confidence: builtins.float = ...,
|
||||
) -> None: ...
|
||||
def HasField(self, field_name: typing_extensions.Literal["center", b"center"]) -> builtins.bool: ...
|
||||
def ClearField(self, field_name: typing_extensions.Literal["angle", b"angle", "center", b"center", "confidence", b"confidence", "height", b"height", "width", b"width"]) -> None: ...
|
||||
|
||||
global___Ellipse = Ellipse
|
||||
|
||||
@typing_extensions.final
|
||||
class RecordMessage(google.protobuf.message.Message):
|
||||
"""Record message used to tensorflow learning"""
|
||||
|
||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||
|
||||
FRAME_FIELD_NUMBER: builtins.int
|
||||
STEERING_FIELD_NUMBER: builtins.int
|
||||
AUTOPILOT_STEERING_FIELD_NUMBER: builtins.int
|
||||
DRIVE_MODE_FIELD_NUMBER: builtins.int
|
||||
RECORDSET_FIELD_NUMBER: builtins.int
|
||||
@property
|
||||
def frame(self) -> global___FrameMessage: ...
|
||||
@property
|
||||
def steering(self) -> global___SteeringMessage: ...
|
||||
@property
|
||||
def autopilot_steering(self) -> global___SteeringMessage: ...
|
||||
@property
|
||||
def drive_mode(self) -> global___DriveModeMessage: ...
|
||||
recordSet: builtins.str
|
||||
"""Record set name"""
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
frame: global___FrameMessage | None = ...,
|
||||
steering: global___SteeringMessage | None = ...,
|
||||
autopilot_steering: global___SteeringMessage | None = ...,
|
||||
drive_mode: global___DriveModeMessage | None = ...,
|
||||
recordSet: builtins.str = ...,
|
||||
) -> None: ...
|
||||
def HasField(self, field_name: typing_extensions.Literal["autopilot_steering", b"autopilot_steering", "drive_mode", b"drive_mode", "frame", b"frame", "steering", b"steering"]) -> builtins.bool: ...
|
||||
def ClearField(self, field_name: typing_extensions.Literal["autopilot_steering", b"autopilot_steering", "drive_mode", b"drive_mode", "frame", b"frame", "recordSet", b"recordSet", "steering", b"steering"]) -> None: ...
|
||||
|
||||
global___RecordMessage = RecordMessage
|
||||
993
python/poetry.lock
generated
Normal file
993
python/poetry.lock
generated
Normal file
@@ -0,0 +1,993 @@
|
||||
[[package]]
|
||||
name = "attrs"
|
||||
version = "22.1.0"
|
||||
description = "Classes Without Boilerplate"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.5"
|
||||
|
||||
[package.extras]
|
||||
dev = ["cloudpickle", "coverage[toml] (>=5.0.2)", "furo", "hypothesis", "mypy (>=0.900,!=0.940)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "sphinx", "sphinx-notfound-page", "zope.interface"]
|
||||
docs = ["furo", "sphinx", "sphinx-notfound-page", "zope.interface"]
|
||||
tests = ["cloudpickle", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy (>=0.900,!=0.940)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "zope.interface"]
|
||||
tests-no-zope = ["cloudpickle", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy (>=0.900,!=0.940)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins"]
|
||||
|
||||
[[package]]
|
||||
name = "cachecontrol"
|
||||
version = "0.12.11"
|
||||
description = "httplib2 caching for requests"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
lockfile = {version = ">=0.9", optional = true, markers = "extra == \"filecache\""}
|
||||
msgpack = ">=0.5.2"
|
||||
requests = "*"
|
||||
|
||||
[package.extras]
|
||||
filecache = ["lockfile (>=0.9)"]
|
||||
redis = ["redis (>=2.10.5)"]
|
||||
|
||||
[[package]]
|
||||
name = "cachy"
|
||||
version = "0.3.0"
|
||||
description = "Cachy provides a simple yet effective caching library."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
|
||||
|
||||
[package.extras]
|
||||
memcached = ["python-memcached (>=1.59,<2.0)"]
|
||||
msgpack = ["msgpack-python (>=0.5,<0.6)"]
|
||||
redis = ["redis (>=3.3.6,<4.0.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "certifi"
|
||||
version = "2022.9.24"
|
||||
description = "Python package for providing Mozilla's CA Bundle."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[[package]]
|
||||
name = "cffi"
|
||||
version = "1.15.1"
|
||||
description = "Foreign Function Interface for Python calling C code."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[package.dependencies]
|
||||
pycparser = "*"
|
||||
|
||||
[[package]]
|
||||
name = "charset-normalizer"
|
||||
version = "2.1.1"
|
||||
description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6.0"
|
||||
|
||||
[package.extras]
|
||||
unicode-backport = ["unicodedata2"]
|
||||
|
||||
[[package]]
|
||||
name = "cleo"
|
||||
version = "1.0.0a5"
|
||||
description = "Cleo allows you to create beautiful and testable command-line interfaces."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7,<4.0"
|
||||
|
||||
[package.dependencies]
|
||||
crashtest = ">=0.3.1,<0.4.0"
|
||||
pylev = ">=1.3.0,<2.0.0"
|
||||
|
||||
[[package]]
|
||||
name = "crashtest"
|
||||
version = "0.3.1"
|
||||
description = "Manage Python errors with ease"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6,<4.0"
|
||||
|
||||
[[package]]
|
||||
name = "cryptography"
|
||||
version = "38.0.1"
|
||||
description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
cffi = ">=1.12"
|
||||
|
||||
[package.extras]
|
||||
docs = ["sphinx (>=1.6.5,!=1.8.0,!=3.1.0,!=3.1.1)", "sphinx-rtd-theme"]
|
||||
docstest = ["pyenchant (>=1.6.11)", "sphinxcontrib-spelling (>=4.0.1)", "twine (>=1.12.0)"]
|
||||
pep8test = ["black", "flake8", "flake8-import-order", "pep8-naming"]
|
||||
sdist = ["setuptools-rust (>=0.11.4)"]
|
||||
ssh = ["bcrypt (>=3.1.5)"]
|
||||
test = ["hypothesis (>=1.11.4,!=3.79.2)", "iso8601", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-subtests", "pytest-xdist", "pytz"]
|
||||
|
||||
[[package]]
|
||||
name = "distlib"
|
||||
version = "0.3.6"
|
||||
description = "Distribution utilities"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "dulwich"
|
||||
version = "0.20.46"
|
||||
description = "Python Git Library"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
urllib3 = ">=1.25"
|
||||
|
||||
[package.extras]
|
||||
fastimport = ["fastimport"]
|
||||
https = ["urllib3 (>=1.24.1)"]
|
||||
paramiko = ["paramiko"]
|
||||
pgp = ["gpg"]
|
||||
|
||||
[[package]]
|
||||
name = "filelock"
|
||||
version = "3.8.0"
|
||||
description = "A platform independent file lock."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.extras]
|
||||
docs = ["furo (>=2022.6.21)", "sphinx (>=5.1.1)", "sphinx-autodoc-typehints (>=1.19.1)"]
|
||||
testing = ["covdefaults (>=2.2)", "coverage (>=6.4.2)", "pytest (>=7.1.2)", "pytest-cov (>=3)", "pytest-timeout (>=2.1)"]
|
||||
|
||||
[[package]]
|
||||
name = "html5lib"
|
||||
version = "1.1"
|
||||
description = "HTML parser based on the WHATWG HTML specification"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
||||
|
||||
[package.dependencies]
|
||||
six = ">=1.9"
|
||||
webencodings = "*"
|
||||
|
||||
[package.extras]
|
||||
all = ["chardet (>=2.2)", "genshi", "lxml"]
|
||||
chardet = ["chardet (>=2.2)"]
|
||||
genshi = ["genshi"]
|
||||
lxml = ["lxml"]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "3.4"
|
||||
description = "Internationalized Domain Names in Applications (IDNA)"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.5"
|
||||
|
||||
[[package]]
|
||||
name = "jaraco-classes"
|
||||
version = "3.2.3"
|
||||
description = "Utility functions for Python class constructs"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.dependencies]
|
||||
more-itertools = "*"
|
||||
|
||||
[package.extras]
|
||||
docs = ["jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)"]
|
||||
testing = ["flake8 (<5)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"]
|
||||
|
||||
[[package]]
|
||||
name = "jeepney"
|
||||
version = "0.8.0"
|
||||
description = "Low-level, pure Python DBus protocol wrapper."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.extras]
|
||||
test = ["async-timeout", "pytest", "pytest-asyncio (>=0.17)", "pytest-trio", "testpath", "trio"]
|
||||
trio = ["async_generator", "trio"]
|
||||
|
||||
[[package]]
|
||||
name = "jsonschema"
|
||||
version = "4.16.0"
|
||||
description = "An implementation of JSON Schema validation for Python"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.dependencies]
|
||||
attrs = ">=17.4.0"
|
||||
pyrsistent = ">=0.14.0,<0.17.0 || >0.17.0,<0.17.1 || >0.17.1,<0.17.2 || >0.17.2"
|
||||
|
||||
[package.extras]
|
||||
format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"]
|
||||
format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "uri-template", "webcolors (>=1.11)"]
|
||||
|
||||
[[package]]
|
||||
name = "keyring"
|
||||
version = "23.9.3"
|
||||
description = "Store and access your passwords safely."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.dependencies]
|
||||
"jaraco.classes" = "*"
|
||||
jeepney = {version = ">=0.4.2", markers = "sys_platform == \"linux\""}
|
||||
pywin32-ctypes = {version = "<0.1.0 || >0.1.0,<0.1.1 || >0.1.1", markers = "sys_platform == \"win32\""}
|
||||
SecretStorage = {version = ">=3.2", markers = "sys_platform == \"linux\""}
|
||||
|
||||
[package.extras]
|
||||
docs = ["jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx"]
|
||||
testing = ["flake8 (<5)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"]
|
||||
|
||||
[[package]]
|
||||
name = "lockfile"
|
||||
version = "0.12.2"
|
||||
description = "Platform-independent file locking module"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "more-itertools"
|
||||
version = "9.0.0"
|
||||
description = "More routines for operating on iterables, beyond itertools"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[[package]]
|
||||
name = "msgpack"
|
||||
version = "1.0.4"
|
||||
description = "MessagePack serializer"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "mypy-protobuf"
|
||||
version = "3.4.0"
|
||||
description = "Generate mypy stub files from protobuf specs"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.dependencies]
|
||||
protobuf = ">=4.21.8"
|
||||
types-protobuf = ">=3.20.4"
|
||||
|
||||
[[package]]
|
||||
name = "packaging"
|
||||
version = "21.3"
|
||||
description = "Core utilities for Python packages"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
pyparsing = ">=2.0.2,<3.0.5 || >3.0.5"
|
||||
|
||||
[[package]]
|
||||
name = "pexpect"
|
||||
version = "4.8.0"
|
||||
description = "Pexpect allows easy control of interactive console applications."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[package.dependencies]
|
||||
ptyprocess = ">=0.5"
|
||||
|
||||
[[package]]
|
||||
name = "pkginfo"
|
||||
version = "1.8.3"
|
||||
description = "Query metadatdata from sdists / bdists / installed packages."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*"
|
||||
|
||||
[package.extras]
|
||||
testing = ["coverage", "nose"]
|
||||
|
||||
[[package]]
|
||||
name = "platformdirs"
|
||||
version = "2.5.2"
|
||||
description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.extras]
|
||||
docs = ["furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx (>=4)", "sphinx-autodoc-typehints (>=1.12)"]
|
||||
test = ["appdirs (==1.4.4)", "pytest (>=6)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)"]
|
||||
|
||||
[[package]]
|
||||
name = "poetry"
|
||||
version = "1.2.2"
|
||||
description = "Python dependency management and packaging made easy."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7,<4.0"
|
||||
|
||||
[package.dependencies]
|
||||
cachecontrol = {version = ">=0.12.9,<0.13.0", extras = ["filecache"]}
|
||||
cachy = ">=0.3.0,<0.4.0"
|
||||
cleo = ">=1.0.0a5,<2.0.0"
|
||||
crashtest = ">=0.3.0,<0.4.0"
|
||||
dulwich = ">=0.20.46,<0.21.0"
|
||||
html5lib = ">=1.0,<2.0"
|
||||
jsonschema = ">=4.10.0,<5.0.0"
|
||||
keyring = ">=21.2.0"
|
||||
packaging = ">=20.4"
|
||||
pexpect = ">=4.7.0,<5.0.0"
|
||||
pkginfo = ">=1.5,<2.0"
|
||||
platformdirs = ">=2.5.2,<3.0.0"
|
||||
poetry-core = "1.3.2"
|
||||
poetry-plugin-export = ">=1.1.2,<2.0.0"
|
||||
requests = ">=2.18,<3.0"
|
||||
requests-toolbelt = ">=0.9.1,<0.10.0"
|
||||
shellingham = ">=1.5,<2.0"
|
||||
tomlkit = ">=0.11.1,<0.11.2 || >0.11.2,<0.11.3 || >0.11.3,<1.0.0"
|
||||
urllib3 = ">=1.26.0,<2.0.0"
|
||||
virtualenv = ">=20.4.3,<20.4.5 || >20.4.5,<20.4.6 || >20.4.6"
|
||||
xattr = {version = ">=0.9.7,<0.10.0", markers = "sys_platform == \"darwin\""}
|
||||
|
||||
[[package]]
|
||||
name = "poetry-core"
|
||||
version = "1.3.2"
|
||||
description = "Poetry PEP 517 Build Backend"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7,<4.0"
|
||||
|
||||
[[package]]
|
||||
name = "poetry-plugin-export"
|
||||
version = "1.1.2"
|
||||
description = "Poetry plugin to export the dependencies to various formats"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7,<4.0"
|
||||
|
||||
[package.dependencies]
|
||||
poetry = ">=1.2.0,<2.0.0"
|
||||
poetry-core = ">=1.1.0,<2.0.0"
|
||||
|
||||
[[package]]
|
||||
name = "protobuf"
|
||||
version = "4.21.8"
|
||||
description = ""
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[[package]]
|
||||
name = "ptyprocess"
|
||||
version = "0.7.0"
|
||||
description = "Run a subprocess in a pseudo terminal"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "pycparser"
|
||||
version = "2.21"
|
||||
description = "C parser in Python"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
|
||||
|
||||
[[package]]
|
||||
name = "pylev"
|
||||
version = "1.4.0"
|
||||
description = "A pure Python Levenshtein implementation that's not freaking GPL'd."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "pyparsing"
|
||||
version = "3.0.9"
|
||||
description = "pyparsing module - Classes and methods to define and execute parsing grammars"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6.8"
|
||||
|
||||
[package.extras]
|
||||
diagrams = ["jinja2", "railroad-diagrams"]
|
||||
|
||||
[[package]]
|
||||
name = "pyrsistent"
|
||||
version = "0.18.1"
|
||||
description = "Persistent/Functional/Immutable data structures"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[[package]]
|
||||
name = "pywin32-ctypes"
|
||||
version = "0.2.0"
|
||||
description = ""
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "requests"
|
||||
version = "2.28.1"
|
||||
description = "Python HTTP for Humans."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.7, <4"
|
||||
|
||||
[package.dependencies]
|
||||
certifi = ">=2017.4.17"
|
||||
charset-normalizer = ">=2,<3"
|
||||
idna = ">=2.5,<4"
|
||||
urllib3 = ">=1.21.1,<1.27"
|
||||
|
||||
[package.extras]
|
||||
socks = ["PySocks (>=1.5.6,!=1.5.7)"]
|
||||
use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
|
||||
|
||||
[[package]]
|
||||
name = "requests-toolbelt"
|
||||
version = "0.9.1"
|
||||
description = "A utility belt for advanced users of python-requests"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[package.dependencies]
|
||||
requests = ">=2.0.1,<3.0.0"
|
||||
|
||||
[[package]]
|
||||
name = "secretstorage"
|
||||
version = "3.3.3"
|
||||
description = "Python bindings to FreeDesktop.org Secret Service API"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
cryptography = ">=2.0"
|
||||
jeepney = ">=0.6"
|
||||
|
||||
[[package]]
|
||||
name = "shellingham"
|
||||
version = "1.5.0"
|
||||
description = "Tool to Detect Surrounding Shell"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.4"
|
||||
|
||||
[[package]]
|
||||
name = "six"
|
||||
version = "1.16.0"
|
||||
description = "Python 2 and 3 compatibility utilities"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
|
||||
|
||||
[[package]]
|
||||
name = "tomlkit"
|
||||
version = "0.11.5"
|
||||
description = "Style preserving TOML library"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6,<4.0"
|
||||
|
||||
[[package]]
|
||||
name = "types-protobuf"
|
||||
version = "3.20.4.2"
|
||||
description = "Typing stubs for protobuf"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "urllib3"
|
||||
version = "1.26.12"
|
||||
description = "HTTP library with thread-safe connection pooling, file post, and more."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4"
|
||||
|
||||
[package.extras]
|
||||
brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"]
|
||||
secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"]
|
||||
socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "virtualenv"
|
||||
version = "20.16.6"
|
||||
description = "Virtual Python Environment builder"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
distlib = ">=0.3.6,<1"
|
||||
filelock = ">=3.4.1,<4"
|
||||
platformdirs = ">=2.4,<3"
|
||||
|
||||
[package.extras]
|
||||
docs = ["proselint (>=0.13)", "sphinx (>=5.3)", "sphinx-argparse (>=0.3.2)", "sphinx-rtd-theme (>=1)", "towncrier (>=22.8)"]
|
||||
testing = ["coverage (>=6.2)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=21.3)", "pytest (>=7.0.1)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.2)", "pytest-mock (>=3.6.1)", "pytest-randomly (>=3.10.3)", "pytest-timeout (>=2.1)"]
|
||||
|
||||
[[package]]
|
||||
name = "webencodings"
|
||||
version = "0.5.1"
|
||||
description = "Character encoding aliases for legacy web content"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "xattr"
|
||||
version = "0.9.9"
|
||||
description = "Python wrapper for extended filesystem attributes"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[package.dependencies]
|
||||
cffi = ">=1.0"
|
||||
|
||||
[metadata]
|
||||
lock-version = "1.1"
|
||||
python-versions = "^3.10"
|
||||
content-hash = "75da1086b2cdc053fb9f19f12ed0156976d7049cbaedd6427f3b0efefe49cfdb"
|
||||
|
||||
[metadata.files]
|
||||
attrs = [
|
||||
{file = "attrs-22.1.0-py2.py3-none-any.whl", hash = "sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c"},
|
||||
{file = "attrs-22.1.0.tar.gz", hash = "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6"},
|
||||
]
|
||||
cachecontrol = [
|
||||
{file = "CacheControl-0.12.11-py2.py3-none-any.whl", hash = "sha256:2c75d6a8938cb1933c75c50184549ad42728a27e9f6b92fd677c3151aa72555b"},
|
||||
{file = "CacheControl-0.12.11.tar.gz", hash = "sha256:a5b9fcc986b184db101aa280b42ecdcdfc524892596f606858e0b7a8b4d9e144"},
|
||||
]
|
||||
cachy = [
|
||||
{file = "cachy-0.3.0-py2.py3-none-any.whl", hash = "sha256:338ca09c8860e76b275aff52374330efedc4d5a5e45dc1c5b539c1ead0786fe7"},
|
||||
{file = "cachy-0.3.0.tar.gz", hash = "sha256:186581f4ceb42a0bbe040c407da73c14092379b1e4c0e327fdb72ae4a9b269b1"},
|
||||
]
|
||||
certifi = [
|
||||
{file = "certifi-2022.9.24-py3-none-any.whl", hash = "sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382"},
|
||||
{file = "certifi-2022.9.24.tar.gz", hash = "sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14"},
|
||||
]
|
||||
cffi = [
|
||||
{file = "cffi-1.15.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2"},
|
||||
{file = "cffi-1.15.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2"},
|
||||
{file = "cffi-1.15.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914"},
|
||||
{file = "cffi-1.15.1-cp27-cp27m-win32.whl", hash = "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3"},
|
||||
{file = "cffi-1.15.1-cp27-cp27m-win_amd64.whl", hash = "sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e"},
|
||||
{file = "cffi-1.15.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162"},
|
||||
{file = "cffi-1.15.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-win32.whl", hash = "sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2"},
|
||||
{file = "cffi-1.15.1-cp310-cp310-win_amd64.whl", hash = "sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-win32.whl", hash = "sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d"},
|
||||
{file = "cffi-1.15.1-cp311-cp311-win_amd64.whl", hash = "sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-win32.whl", hash = "sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf"},
|
||||
{file = "cffi-1.15.1-cp36-cp36m-win_amd64.whl", hash = "sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-win32.whl", hash = "sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9"},
|
||||
{file = "cffi-1.15.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-win32.whl", hash = "sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314"},
|
||||
{file = "cffi-1.15.1-cp38-cp38-win_amd64.whl", hash = "sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-win32.whl", hash = "sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee"},
|
||||
{file = "cffi-1.15.1-cp39-cp39-win_amd64.whl", hash = "sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c"},
|
||||
{file = "cffi-1.15.1.tar.gz", hash = "sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9"},
|
||||
]
|
||||
charset-normalizer = [
|
||||
{file = "charset-normalizer-2.1.1.tar.gz", hash = "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"},
|
||||
{file = "charset_normalizer-2.1.1-py3-none-any.whl", hash = "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"},
|
||||
]
|
||||
cleo = [
|
||||
{file = "cleo-1.0.0a5-py3-none-any.whl", hash = "sha256:ff53056589300976e960f75afb792dfbfc9c78dcbb5a448e207a17b643826360"},
|
||||
{file = "cleo-1.0.0a5.tar.gz", hash = "sha256:097c9d0e0332fd53cc89fc11eb0a6ba0309e6a3933c08f7b38558555486925d3"},
|
||||
]
|
||||
crashtest = [
|
||||
{file = "crashtest-0.3.1-py3-none-any.whl", hash = "sha256:300f4b0825f57688b47b6d70c6a31de33512eb2fa1ac614f780939aa0cf91680"},
|
||||
{file = "crashtest-0.3.1.tar.gz", hash = "sha256:42ca7b6ce88b6c7433e2ce47ea884e91ec93104a4b754998be498a8e6c3d37dd"},
|
||||
]
|
||||
cryptography = [
|
||||
{file = "cryptography-38.0.1-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:10d1f29d6292fc95acb597bacefd5b9e812099d75a6469004fd38ba5471a977f"},
|
||||
{file = "cryptography-38.0.1-cp36-abi3-macosx_10_10_x86_64.whl", hash = "sha256:3fc26e22840b77326a764ceb5f02ca2d342305fba08f002a8c1f139540cdfaad"},
|
||||
{file = "cryptography-38.0.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:3b72c360427889b40f36dc214630e688c2fe03e16c162ef0aa41da7ab1455153"},
|
||||
{file = "cryptography-38.0.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:194044c6b89a2f9f169df475cc167f6157eb9151cc69af8a2a163481d45cc407"},
|
||||
{file = "cryptography-38.0.1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ca9f6784ea96b55ff41708b92c3f6aeaebde4c560308e5fbbd3173fbc466e94e"},
|
||||
{file = "cryptography-38.0.1-cp36-abi3-manylinux_2_24_x86_64.whl", hash = "sha256:16fa61e7481f4b77ef53991075de29fc5bacb582a1244046d2e8b4bb72ef66d0"},
|
||||
{file = "cryptography-38.0.1-cp36-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:d4ef6cc305394ed669d4d9eebf10d3a101059bdcf2669c366ec1d14e4fb227bd"},
|
||||
{file = "cryptography-38.0.1-cp36-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:3261725c0ef84e7592597606f6583385fed2a5ec3909f43bc475ade9729a41d6"},
|
||||
{file = "cryptography-38.0.1-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:0297ffc478bdd237f5ca3a7dc96fc0d315670bfa099c04dc3a4a2172008a405a"},
|
||||
{file = "cryptography-38.0.1-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:89ed49784ba88c221756ff4d4755dbc03b3c8d2c5103f6d6b4f83a0fb1e85294"},
|
||||
{file = "cryptography-38.0.1-cp36-abi3-win32.whl", hash = "sha256:ac7e48f7e7261207d750fa7e55eac2d45f720027d5703cd9007e9b37bbb59ac0"},
|
||||
{file = "cryptography-38.0.1-cp36-abi3-win_amd64.whl", hash = "sha256:ad7353f6ddf285aeadfaf79e5a6829110106ff8189391704c1d8801aa0bae45a"},
|
||||
{file = "cryptography-38.0.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:896dd3a66959d3a5ddcfc140a53391f69ff1e8f25d93f0e2e7830c6de90ceb9d"},
|
||||
{file = "cryptography-38.0.1-pp37-pypy37_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:d3971e2749a723e9084dd507584e2a2761f78ad2c638aa31e80bc7a15c9db4f9"},
|
||||
{file = "cryptography-38.0.1-pp37-pypy37_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:79473cf8a5cbc471979bd9378c9f425384980fcf2ab6534b18ed7d0d9843987d"},
|
||||
{file = "cryptography-38.0.1-pp38-pypy38_pp73-macosx_10_10_x86_64.whl", hash = "sha256:d9e69ae01f99abe6ad646947bba8941e896cb3aa805be2597a0400e0764b5818"},
|
||||
{file = "cryptography-38.0.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5067ee7f2bce36b11d0e334abcd1ccf8c541fc0bbdaf57cdd511fdee53e879b6"},
|
||||
{file = "cryptography-38.0.1-pp38-pypy38_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:3e3a2599e640927089f932295a9a247fc40a5bdf69b0484532f530471a382750"},
|
||||
{file = "cryptography-38.0.1-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c2e5856248a416767322c8668ef1845ad46ee62629266f84a8f007a317141013"},
|
||||
{file = "cryptography-38.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:64760ba5331e3f1794d0bcaabc0d0c39e8c60bf67d09c93dc0e54189dfd7cfe5"},
|
||||
{file = "cryptography-38.0.1-pp39-pypy39_pp73-macosx_10_10_x86_64.whl", hash = "sha256:b6c9b706316d7b5a137c35e14f4103e2115b088c412140fdbd5f87c73284df61"},
|
||||
{file = "cryptography-38.0.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b0163a849b6f315bf52815e238bc2b2346604413fa7c1601eea84bcddb5fb9ac"},
|
||||
{file = "cryptography-38.0.1-pp39-pypy39_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:d1a5bd52d684e49a36582193e0b89ff267704cd4025abefb9e26803adeb3e5fb"},
|
||||
{file = "cryptography-38.0.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:765fa194a0f3372d83005ab83ab35d7c5526c4e22951e46059b8ac678b44fa5a"},
|
||||
{file = "cryptography-38.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:52e7bee800ec869b4031093875279f1ff2ed12c1e2f74923e8f49c916afd1d3b"},
|
||||
{file = "cryptography-38.0.1.tar.gz", hash = "sha256:1db3d807a14931fa317f96435695d9ec386be7b84b618cc61cfa5d08b0ae33d7"},
|
||||
]
|
||||
distlib = [
|
||||
{file = "distlib-0.3.6-py2.py3-none-any.whl", hash = "sha256:f35c4b692542ca110de7ef0bea44d73981caeb34ca0b9b6b2e6d7790dda8f80e"},
|
||||
{file = "distlib-0.3.6.tar.gz", hash = "sha256:14bad2d9b04d3a36127ac97f30b12a19268f211063d8f8ee4f47108896e11b46"},
|
||||
]
|
||||
dulwich = [
|
||||
{file = "dulwich-0.20.46-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:6676196e9cf377cde62aa2f5d741e93207437343e0c62368bd0d784c322a3c49"},
|
||||
{file = "dulwich-0.20.46-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a1ca555a3eafe7388d6cb81bb08f34608a1592500f0bd4c26734c91d208a546"},
|
||||
{file = "dulwich-0.20.46-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:769442c9657b10fc35ac625beeaf440540c9288c96fcfaba3e58adf745c5cafd"},
|
||||
{file = "dulwich-0.20.46-cp310-cp310-win32.whl", hash = "sha256:de22a54f68c6c4e97f9b924abd46da4618536d7934b9849066be9fc5cd31205d"},
|
||||
{file = "dulwich-0.20.46-cp310-cp310-win_amd64.whl", hash = "sha256:42fa5a68908556eb6c40f231a67caf6a4660588aad707a9d6b334fa1d8f04bf7"},
|
||||
{file = "dulwich-0.20.46-cp311-cp311-macosx_10_15_x86_64.whl", hash = "sha256:3e16376031466848e44aabf3489fafb054482143744b21167dbd168731041c74"},
|
||||
{file = "dulwich-0.20.46-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:153c7512587384a290c60fef330f1ab397a59559e19e8b02a0169ff21b4c69fb"},
|
||||
{file = "dulwich-0.20.46-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a5b68bd815cd2769c75e5a78708eb0440612df19b370a977aa9e01a056baa9ed"},
|
||||
{file = "dulwich-0.20.46-cp311-cp311-win32.whl", hash = "sha256:b1339bca70764eb8e780d80c72e7c1cb4651201dc9e43ec5d616bf51eb3bb3a6"},
|
||||
{file = "dulwich-0.20.46-cp311-cp311-win_amd64.whl", hash = "sha256:1162fdafb2abdfe66649617061f3853cb26384fade1f6884f6fe6e9c570a7552"},
|
||||
{file = "dulwich-0.20.46-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:6826512f778eaa47e2e8c0a46cdc555958f9f5286771490b8642b4b508ea5d25"},
|
||||
{file = "dulwich-0.20.46-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:100d39bc18196a07c521fd5f60f78f397493303daa0b8690216864bbc621cd5d"},
|
||||
{file = "dulwich-0.20.46-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c4cd2cd7baa81246bdc8c5272d4e9224e2255da7a0618a220aab5e07b9888e9b"},
|
||||
{file = "dulwich-0.20.46-cp36-cp36m-win32.whl", hash = "sha256:6eed5a3194d64112605fc0f638f4fa91771495e8674fa3e6d6b33bf150d297d5"},
|
||||
{file = "dulwich-0.20.46-cp36-cp36m-win_amd64.whl", hash = "sha256:9ca4d73987f5b0e2e843497876f9bb39a47384a2e50597a85542285f5c890293"},
|
||||
{file = "dulwich-0.20.46-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:b9f49de83911eed7adbe83136229837ef9d102e42dbe6aacb1a18be45c997ace"},
|
||||
{file = "dulwich-0.20.46-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d38be7d3a78d608ecab3348f7920d6b9002e7972dd245206dc8075cfdb91621d"},
|
||||
{file = "dulwich-0.20.46-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f4b7a7feb966a4669c254b18385fe0b3c639f3b1f5ddef0d9e083364cc762847"},
|
||||
{file = "dulwich-0.20.46-cp37-cp37m-win32.whl", hash = "sha256:f9552ac246bceab1c5cdd1ec3cfe9446fe76b9853eaf59d3244df03eb27fd3fe"},
|
||||
{file = "dulwich-0.20.46-cp37-cp37m-win_amd64.whl", hash = "sha256:90a075aeb0fdbad7e18b9db3af161e3d635e2b7697b7a4b467e6844a13b0b210"},
|
||||
{file = "dulwich-0.20.46-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:8d6fee82cedb2362942d9ef94061901f7e07d7d8674e4c7b6fceeef7822ae275"},
|
||||
{file = "dulwich-0.20.46-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:669c6b3d82996518a7fec4604771bd285e23f0860f41f565fef5987265d431d9"},
|
||||
{file = "dulwich-0.20.46-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd3eac228117487a959ac8f49ea2787eac34acc69999fe7adae70b23e3c3571c"},
|
||||
{file = "dulwich-0.20.46-cp38-cp38-win32.whl", hash = "sha256:92024f572d32680e021219f77015c8b443c38022e502b7f51ad7cf51a6285a36"},
|
||||
{file = "dulwich-0.20.46-cp38-cp38-win_amd64.whl", hash = "sha256:d928de1eba0326a2a8a52ed94c9bf7c315ff4db606a1aa3ae688d39574f93267"},
|
||||
{file = "dulwich-0.20.46-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:a5d1b7a3a7d84a5dedbb90092e00097357106b9642ac08a96c2ae89ccd8afd9a"},
|
||||
{file = "dulwich-0.20.46-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b739d759c10e2af7c964dcc97fd4e5dc49e8567d080eed8906fc422c79b7fdcf"},
|
||||
{file = "dulwich-0.20.46-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fc7a4f633f5468453d5dd84a753cd99d4433f0397437229a0a8b10347935591"},
|
||||
{file = "dulwich-0.20.46-cp39-cp39-win32.whl", hash = "sha256:525115c4d1fbf60a5fe98f340b4ca597ba47b2c75d9c5ec750dd0e9115ef8ec6"},
|
||||
{file = "dulwich-0.20.46-cp39-cp39-win_amd64.whl", hash = "sha256:73e2585a9fcf1f8cdad8597a0c384c0b365b2e8346463130c96d9ea1478587ae"},
|
||||
{file = "dulwich-0.20.46.tar.gz", hash = "sha256:4f0e88ffff5db1523d93d92f1525fe5fa161318ffbaad502c1b9b3be7a067172"},
|
||||
]
|
||||
filelock = [
|
||||
{file = "filelock-3.8.0-py3-none-any.whl", hash = "sha256:617eb4e5eedc82fc5f47b6d61e4d11cb837c56cb4544e39081099fa17ad109d4"},
|
||||
{file = "filelock-3.8.0.tar.gz", hash = "sha256:55447caa666f2198c5b6b13a26d2084d26fa5b115c00d065664b2124680c4edc"},
|
||||
]
|
||||
html5lib = [
|
||||
{file = "html5lib-1.1-py2.py3-none-any.whl", hash = "sha256:0d78f8fde1c230e99fe37986a60526d7049ed4bf8a9fadbad5f00e22e58e041d"},
|
||||
{file = "html5lib-1.1.tar.gz", hash = "sha256:b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f"},
|
||||
]
|
||||
idna = [
|
||||
{file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"},
|
||||
{file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"},
|
||||
]
|
||||
jaraco-classes = [
|
||||
{file = "jaraco.classes-3.2.3-py3-none-any.whl", hash = "sha256:2353de3288bc6b82120752201c6b1c1a14b058267fa424ed5ce5984e3b922158"},
|
||||
{file = "jaraco.classes-3.2.3.tar.gz", hash = "sha256:89559fa5c1d3c34eff6f631ad80bb21f378dbcbb35dd161fd2c6b93f5be2f98a"},
|
||||
]
|
||||
jeepney = [
|
||||
{file = "jeepney-0.8.0-py3-none-any.whl", hash = "sha256:c0a454ad016ca575060802ee4d590dd912e35c122fa04e70306de3d076cce755"},
|
||||
{file = "jeepney-0.8.0.tar.gz", hash = "sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806"},
|
||||
]
|
||||
jsonschema = [
|
||||
{file = "jsonschema-4.16.0-py3-none-any.whl", hash = "sha256:9e74b8f9738d6a946d70705dc692b74b5429cd0960d58e79ffecfc43b2221eb9"},
|
||||
{file = "jsonschema-4.16.0.tar.gz", hash = "sha256:165059f076eff6971bae5b742fc029a7b4ef3f9bcf04c14e4776a7605de14b23"},
|
||||
]
|
||||
keyring = [
|
||||
{file = "keyring-23.9.3-py3-none-any.whl", hash = "sha256:69732a15cb1433bdfbc3b980a8a36a04878a6cfd7cb99f497b573f31618001c0"},
|
||||
{file = "keyring-23.9.3.tar.gz", hash = "sha256:69b01dd83c42f590250fe7a1f503fc229b14de83857314b1933a3ddbf595c4a5"},
|
||||
]
|
||||
lockfile = [
|
||||
{file = "lockfile-0.12.2-py2.py3-none-any.whl", hash = "sha256:6c3cb24f344923d30b2785d5ad75182c8ea7ac1b6171b08657258ec7429d50fa"},
|
||||
{file = "lockfile-0.12.2.tar.gz", hash = "sha256:6aed02de03cba24efabcd600b30540140634fc06cfa603822d508d5361e9f799"},
|
||||
]
|
||||
more-itertools = [
|
||||
{file = "more-itertools-9.0.0.tar.gz", hash = "sha256:5a6257e40878ef0520b1803990e3e22303a41b5714006c32a3fd8304b26ea1ab"},
|
||||
{file = "more_itertools-9.0.0-py3-none-any.whl", hash = "sha256:250e83d7e81d0c87ca6bd942e6aeab8cc9daa6096d12c5308f3f92fa5e5c1f41"},
|
||||
]
|
||||
msgpack = [
|
||||
{file = "msgpack-1.0.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:4ab251d229d10498e9a2f3b1e68ef64cb393394ec477e3370c457f9430ce9250"},
|
||||
{file = "msgpack-1.0.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:112b0f93202d7c0fef0b7810d465fde23c746a2d482e1e2de2aafd2ce1492c88"},
|
||||
{file = "msgpack-1.0.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:002b5c72b6cd9b4bafd790f364b8480e859b4712e91f43014fe01e4f957b8467"},
|
||||
{file = "msgpack-1.0.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:35bc0faa494b0f1d851fd29129b2575b2e26d41d177caacd4206d81502d4c6a6"},
|
||||
{file = "msgpack-1.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4733359808c56d5d7756628736061c432ded018e7a1dff2d35a02439043321aa"},
|
||||
{file = "msgpack-1.0.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb514ad14edf07a1dbe63761fd30f89ae79b42625731e1ccf5e1f1092950eaa6"},
|
||||
{file = "msgpack-1.0.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:c23080fdeec4716aede32b4e0ef7e213c7b1093eede9ee010949f2a418ced6ba"},
|
||||
{file = "msgpack-1.0.4-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:49565b0e3d7896d9ea71d9095df15b7f75a035c49be733051c34762ca95bbf7e"},
|
||||
{file = "msgpack-1.0.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:aca0f1644d6b5a73eb3e74d4d64d5d8c6c3d577e753a04c9e9c87d07692c58db"},
|
||||
{file = "msgpack-1.0.4-cp310-cp310-win32.whl", hash = "sha256:0dfe3947db5fb9ce52aaea6ca28112a170db9eae75adf9339a1aec434dc954ef"},
|
||||
{file = "msgpack-1.0.4-cp310-cp310-win_amd64.whl", hash = "sha256:4dea20515f660aa6b7e964433b1808d098dcfcabbebeaaad240d11f909298075"},
|
||||
{file = "msgpack-1.0.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:e83f80a7fec1a62cf4e6c9a660e39c7f878f603737a0cdac8c13131d11d97f52"},
|
||||
{file = "msgpack-1.0.4-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c11a48cf5e59026ad7cb0dc29e29a01b5a66a3e333dc11c04f7e991fc5510a9"},
|
||||
{file = "msgpack-1.0.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1276e8f34e139aeff1c77a3cefb295598b504ac5314d32c8c3d54d24fadb94c9"},
|
||||
{file = "msgpack-1.0.4-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6c9566f2c39ccced0a38d37c26cc3570983b97833c365a6044edef3574a00c08"},
|
||||
{file = "msgpack-1.0.4-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:fcb8a47f43acc113e24e910399376f7277cf8508b27e5b88499f053de6b115a8"},
|
||||
{file = "msgpack-1.0.4-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:76ee788122de3a68a02ed6f3a16bbcd97bc7c2e39bd4d94be2f1821e7c4a64e6"},
|
||||
{file = "msgpack-1.0.4-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:0a68d3ac0104e2d3510de90a1091720157c319ceeb90d74f7b5295a6bee51bae"},
|
||||
{file = "msgpack-1.0.4-cp36-cp36m-win32.whl", hash = "sha256:85f279d88d8e833ec015650fd15ae5eddce0791e1e8a59165318f371158efec6"},
|
||||
{file = "msgpack-1.0.4-cp36-cp36m-win_amd64.whl", hash = "sha256:c1683841cd4fa45ac427c18854c3ec3cd9b681694caf5bff04edb9387602d661"},
|
||||
{file = "msgpack-1.0.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a75dfb03f8b06f4ab093dafe3ddcc2d633259e6c3f74bb1b01996f5d8aa5868c"},
|
||||
{file = "msgpack-1.0.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9667bdfdf523c40d2511f0e98a6c9d3603be6b371ae9a238b7ef2dc4e7a427b0"},
|
||||
{file = "msgpack-1.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:11184bc7e56fd74c00ead4f9cc9a3091d62ecb96e97653add7a879a14b003227"},
|
||||
{file = "msgpack-1.0.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ac5bd7901487c4a1dd51a8c58f2632b15d838d07ceedaa5e4c080f7190925bff"},
|
||||
{file = "msgpack-1.0.4-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:1e91d641d2bfe91ba4c52039adc5bccf27c335356055825c7f88742c8bb900dd"},
|
||||
{file = "msgpack-1.0.4-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:2a2df1b55a78eb5f5b7d2a4bb221cd8363913830145fad05374a80bf0877cb1e"},
|
||||
{file = "msgpack-1.0.4-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:545e3cf0cf74f3e48b470f68ed19551ae6f9722814ea969305794645da091236"},
|
||||
{file = "msgpack-1.0.4-cp37-cp37m-win32.whl", hash = "sha256:2cc5ca2712ac0003bcb625c96368fd08a0f86bbc1a5578802512d87bc592fe44"},
|
||||
{file = "msgpack-1.0.4-cp37-cp37m-win_amd64.whl", hash = "sha256:eba96145051ccec0ec86611fe9cf693ce55f2a3ce89c06ed307de0e085730ec1"},
|
||||
{file = "msgpack-1.0.4-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:7760f85956c415578c17edb39eed99f9181a48375b0d4a94076d84148cf67b2d"},
|
||||
{file = "msgpack-1.0.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:449e57cc1ff18d3b444eb554e44613cffcccb32805d16726a5494038c3b93dab"},
|
||||
{file = "msgpack-1.0.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:d603de2b8d2ea3f3bcb2efe286849aa7a81531abc52d8454da12f46235092bcb"},
|
||||
{file = "msgpack-1.0.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:48f5d88c99f64c456413d74a975bd605a9b0526293218a3b77220a2c15458ba9"},
|
||||
{file = "msgpack-1.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6916c78f33602ecf0509cc40379271ba0f9ab572b066bd4bdafd7434dee4bc6e"},
|
||||
{file = "msgpack-1.0.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:81fc7ba725464651190b196f3cd848e8553d4d510114a954681fd0b9c479d7e1"},
|
||||
{file = "msgpack-1.0.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:d5b5b962221fa2c5d3a7f8133f9abffc114fe218eb4365e40f17732ade576c8e"},
|
||||
{file = "msgpack-1.0.4-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:77ccd2af37f3db0ea59fb280fa2165bf1b096510ba9fe0cc2bf8fa92a22fdb43"},
|
||||
{file = "msgpack-1.0.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b17be2478b622939e39b816e0aa8242611cc8d3583d1cd8ec31b249f04623243"},
|
||||
{file = "msgpack-1.0.4-cp38-cp38-win32.whl", hash = "sha256:2bb8cdf50dd623392fa75525cce44a65a12a00c98e1e37bf0fb08ddce2ff60d2"},
|
||||
{file = "msgpack-1.0.4-cp38-cp38-win_amd64.whl", hash = "sha256:26b8feaca40a90cbe031b03d82b2898bf560027160d3eae1423f4a67654ec5d6"},
|
||||
{file = "msgpack-1.0.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:462497af5fd4e0edbb1559c352ad84f6c577ffbbb708566a0abaaa84acd9f3ae"},
|
||||
{file = "msgpack-1.0.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2999623886c5c02deefe156e8f869c3b0aaeba14bfc50aa2486a0415178fce55"},
|
||||
{file = "msgpack-1.0.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f0029245c51fd9473dc1aede1160b0a29f4a912e6b1dd353fa6d317085b219da"},
|
||||
{file = "msgpack-1.0.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed6f7b854a823ea44cf94919ba3f727e230da29feb4a99711433f25800cf747f"},
|
||||
{file = "msgpack-1.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0df96d6eaf45ceca04b3f3b4b111b86b33785683d682c655063ef8057d61fd92"},
|
||||
{file = "msgpack-1.0.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6a4192b1ab40f8dca3f2877b70e63799d95c62c068c84dc028b40a6cb03ccd0f"},
|
||||
{file = "msgpack-1.0.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0e3590f9fb9f7fbc36df366267870e77269c03172d086fa76bb4eba8b2b46624"},
|
||||
{file = "msgpack-1.0.4-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:1576bd97527a93c44fa856770197dec00d223b0b9f36ef03f65bac60197cedf8"},
|
||||
{file = "msgpack-1.0.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:63e29d6e8c9ca22b21846234913c3466b7e4ee6e422f205a2988083de3b08cae"},
|
||||
{file = "msgpack-1.0.4-cp39-cp39-win32.whl", hash = "sha256:fb62ea4b62bfcb0b380d5680f9a4b3f9a2d166d9394e9bbd9666c0ee09a3645c"},
|
||||
{file = "msgpack-1.0.4-cp39-cp39-win_amd64.whl", hash = "sha256:4d5834a2a48965a349da1c5a79760d94a1a0172fbb5ab6b5b33cbf8447e109ce"},
|
||||
{file = "msgpack-1.0.4.tar.gz", hash = "sha256:f5d869c18f030202eb412f08b28d2afeea553d6613aee89e200d7aca7ef01f5f"},
|
||||
]
|
||||
mypy-protobuf = [
|
||||
{file = "mypy-protobuf-3.4.0.tar.gz", hash = "sha256:7d75a079651b105076776a35a5405e3fa773b8a167118f1b712e443e9a6c18a2"},
|
||||
{file = "mypy_protobuf-3.4.0-py3-none-any.whl", hash = "sha256:da33dfde7547ff57e5ba5564126cbfa114f14413b2fa50759b1fa5de1e4ab511"},
|
||||
]
|
||||
packaging = [
|
||||
{file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"},
|
||||
{file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"},
|
||||
]
|
||||
pexpect = [
|
||||
{file = "pexpect-4.8.0-py2.py3-none-any.whl", hash = "sha256:0b48a55dcb3c05f3329815901ea4fc1537514d6ba867a152b581d69ae3710937"},
|
||||
{file = "pexpect-4.8.0.tar.gz", hash = "sha256:fc65a43959d153d0114afe13997d439c22823a27cefceb5ff35c2178c6784c0c"},
|
||||
]
|
||||
pkginfo = [
|
||||
{file = "pkginfo-1.8.3-py2.py3-none-any.whl", hash = "sha256:848865108ec99d4901b2f7e84058b6e7660aae8ae10164e015a6dcf5b242a594"},
|
||||
{file = "pkginfo-1.8.3.tar.gz", hash = "sha256:a84da4318dd86f870a9447a8c98340aa06216bfc6f2b7bdc4b8766984ae1867c"},
|
||||
]
|
||||
platformdirs = [
|
||||
{file = "platformdirs-2.5.2-py3-none-any.whl", hash = "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788"},
|
||||
{file = "platformdirs-2.5.2.tar.gz", hash = "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19"},
|
||||
]
|
||||
poetry = [
|
||||
{file = "poetry-1.2.2-py3-none-any.whl", hash = "sha256:93ea3c4a622485c2a7b7249f1e34e4ac84f8229ded76153b67506313201b154f"},
|
||||
{file = "poetry-1.2.2.tar.gz", hash = "sha256:6d9ed0b1b826a0a79190f2078d7d78483fa24bf2494f3b170e354eaa5e7b5ea1"},
|
||||
]
|
||||
poetry-core = [
|
||||
{file = "poetry-core-1.3.2.tar.gz", hash = "sha256:0ab006a40cb38d6a38b97264f6835da2f08a96912f2728ce668e9ac6a34f686f"},
|
||||
{file = "poetry_core-1.3.2-py3-none-any.whl", hash = "sha256:ea0f5a90b339cde132b4e43cff78a1b440cd928db864bb67cfc97fdfcefe7218"},
|
||||
]
|
||||
poetry-plugin-export = [
|
||||
{file = "poetry-plugin-export-1.1.2.tar.gz", hash = "sha256:5e92525dd63f38ce74a51ed68ea91d753523f21ce5f9ef8d3b793e2a4b2222ef"},
|
||||
{file = "poetry_plugin_export-1.1.2-py3-none-any.whl", hash = "sha256:946e3313b3d00c18fb9a50522e9d5e6a7e111beaba8d6ae33297662fc2070ac1"},
|
||||
]
|
||||
protobuf = [
|
||||
{file = "protobuf-4.21.8-cp310-abi3-win32.whl", hash = "sha256:c252c55ee15175aa1b21b7b9896e6add5162d066d5202e75c39f96136f08cce3"},
|
||||
{file = "protobuf-4.21.8-cp310-abi3-win_amd64.whl", hash = "sha256:809ca0b225d3df42655a12f311dd0f4148a943c51f1ad63c38343e457492b689"},
|
||||
{file = "protobuf-4.21.8-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:bbececaf3cfea9ea65ebb7974e6242d310d2a7772a6f015477e0d79993af4511"},
|
||||
{file = "protobuf-4.21.8-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:b02eabb9ebb1a089ed20626a90ad7a69cee6bcd62c227692466054b19c38dd1f"},
|
||||
{file = "protobuf-4.21.8-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:4761201b93e024bb70ee3a6a6425d61f3152ca851f403ba946fb0cde88872661"},
|
||||
{file = "protobuf-4.21.8-cp37-cp37m-win32.whl", hash = "sha256:f2d55ff22ec300c4d954d3b0d1eeb185681ec8ad4fbecff8a5aee6a1cdd345ba"},
|
||||
{file = "protobuf-4.21.8-cp37-cp37m-win_amd64.whl", hash = "sha256:c5f94911dd8feb3cd3786fc90f7565c9aba7ce45d0f254afd625b9628f578c3f"},
|
||||
{file = "protobuf-4.21.8-cp38-cp38-win32.whl", hash = "sha256:b37b76efe84d539f16cba55ee0036a11ad91300333abd213849cbbbb284b878e"},
|
||||
{file = "protobuf-4.21.8-cp38-cp38-win_amd64.whl", hash = "sha256:2c92a7bfcf4ae76a8ac72e545e99a7407e96ffe52934d690eb29a8809ee44d7b"},
|
||||
{file = "protobuf-4.21.8-cp39-cp39-win32.whl", hash = "sha256:89d641be4b5061823fa0e463c50a2607a97833e9f8cfb36c2f91ef5ccfcc3861"},
|
||||
{file = "protobuf-4.21.8-cp39-cp39-win_amd64.whl", hash = "sha256:bc471cf70a0f53892fdd62f8cd4215f0af8b3f132eeee002c34302dff9edd9b6"},
|
||||
{file = "protobuf-4.21.8-py2.py3-none-any.whl", hash = "sha256:a55545ce9eec4030cf100fcb93e861c622d927ef94070c1a3c01922902464278"},
|
||||
{file = "protobuf-4.21.8-py3-none-any.whl", hash = "sha256:0f236ce5016becd989bf39bd20761593e6d8298eccd2d878eda33012645dc369"},
|
||||
{file = "protobuf-4.21.8.tar.gz", hash = "sha256:427426593b55ff106c84e4a88cac855175330cb6eb7e889e85aaa7b5652b686d"},
|
||||
]
|
||||
ptyprocess = [
|
||||
{file = "ptyprocess-0.7.0-py2.py3-none-any.whl", hash = "sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35"},
|
||||
{file = "ptyprocess-0.7.0.tar.gz", hash = "sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220"},
|
||||
]
|
||||
pycparser = [
|
||||
{file = "pycparser-2.21-py2.py3-none-any.whl", hash = "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9"},
|
||||
{file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"},
|
||||
]
|
||||
pylev = [
|
||||
{file = "pylev-1.4.0-py2.py3-none-any.whl", hash = "sha256:7b2e2aa7b00e05bb3f7650eb506fc89f474f70493271a35c242d9a92188ad3dd"},
|
||||
{file = "pylev-1.4.0.tar.gz", hash = "sha256:9e77e941042ad3a4cc305dcdf2b2dec1aec2fbe3dd9015d2698ad02b173006d1"},
|
||||
]
|
||||
pyparsing = [
|
||||
{file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"},
|
||||
{file = "pyparsing-3.0.9.tar.gz", hash = "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"},
|
||||
]
|
||||
pyrsistent = [
|
||||
{file = "pyrsistent-0.18.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:df46c854f490f81210870e509818b729db4488e1f30f2a1ce1698b2295a878d1"},
|
||||
{file = "pyrsistent-0.18.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d45866ececf4a5fff8742c25722da6d4c9e180daa7b405dc0a2a2790d668c26"},
|
||||
{file = "pyrsistent-0.18.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4ed6784ceac462a7d6fcb7e9b663e93b9a6fb373b7f43594f9ff68875788e01e"},
|
||||
{file = "pyrsistent-0.18.1-cp310-cp310-win32.whl", hash = "sha256:e4f3149fd5eb9b285d6bfb54d2e5173f6a116fe19172686797c056672689daf6"},
|
||||
{file = "pyrsistent-0.18.1-cp310-cp310-win_amd64.whl", hash = "sha256:636ce2dc235046ccd3d8c56a7ad54e99d5c1cd0ef07d9ae847306c91d11b5fec"},
|
||||
{file = "pyrsistent-0.18.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e92a52c166426efbe0d1ec1332ee9119b6d32fc1f0bbfd55d5c1088070e7fc1b"},
|
||||
{file = "pyrsistent-0.18.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d7a096646eab884bf8bed965bad63ea327e0d0c38989fc83c5ea7b8a87037bfc"},
|
||||
{file = "pyrsistent-0.18.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cdfd2c361b8a8e5d9499b9082b501c452ade8bbf42aef97ea04854f4a3f43b22"},
|
||||
{file = "pyrsistent-0.18.1-cp37-cp37m-win32.whl", hash = "sha256:7ec335fc998faa4febe75cc5268a9eac0478b3f681602c1f27befaf2a1abe1d8"},
|
||||
{file = "pyrsistent-0.18.1-cp37-cp37m-win_amd64.whl", hash = "sha256:6455fc599df93d1f60e1c5c4fe471499f08d190d57eca040c0ea182301321286"},
|
||||
{file = "pyrsistent-0.18.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:fd8da6d0124efa2f67d86fa70c851022f87c98e205f0594e1fae044e7119a5a6"},
|
||||
{file = "pyrsistent-0.18.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7bfe2388663fd18bd8ce7db2c91c7400bf3e1a9e8bd7d63bf7e77d39051b85ec"},
|
||||
{file = "pyrsistent-0.18.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0e3e1fcc45199df76053026a51cc59ab2ea3fc7c094c6627e93b7b44cdae2c8c"},
|
||||
{file = "pyrsistent-0.18.1-cp38-cp38-win32.whl", hash = "sha256:b568f35ad53a7b07ed9b1b2bae09eb15cdd671a5ba5d2c66caee40dbf91c68ca"},
|
||||
{file = "pyrsistent-0.18.1-cp38-cp38-win_amd64.whl", hash = "sha256:d1b96547410f76078eaf66d282ddca2e4baae8964364abb4f4dcdde855cd123a"},
|
||||
{file = "pyrsistent-0.18.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:f87cc2863ef33c709e237d4b5f4502a62a00fab450c9e020892e8e2ede5847f5"},
|
||||
{file = "pyrsistent-0.18.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bc66318fb7ee012071b2792024564973ecc80e9522842eb4e17743604b5e045"},
|
||||
{file = "pyrsistent-0.18.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:914474c9f1d93080338ace89cb2acee74f4f666fb0424896fcfb8d86058bf17c"},
|
||||
{file = "pyrsistent-0.18.1-cp39-cp39-win32.whl", hash = "sha256:1b34eedd6812bf4d33814fca1b66005805d3640ce53140ab8bbb1e2651b0d9bc"},
|
||||
{file = "pyrsistent-0.18.1-cp39-cp39-win_amd64.whl", hash = "sha256:e24a828f57e0c337c8d8bb9f6b12f09dfdf0273da25fda9e314f0b684b415a07"},
|
||||
{file = "pyrsistent-0.18.1.tar.gz", hash = "sha256:d4d61f8b993a7255ba714df3aca52700f8125289f84f704cf80916517c46eb96"},
|
||||
]
|
||||
pywin32-ctypes = [
|
||||
{file = "pywin32-ctypes-0.2.0.tar.gz", hash = "sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942"},
|
||||
{file = "pywin32_ctypes-0.2.0-py2.py3-none-any.whl", hash = "sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98"},
|
||||
]
|
||||
requests = [
|
||||
{file = "requests-2.28.1-py3-none-any.whl", hash = "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"},
|
||||
{file = "requests-2.28.1.tar.gz", hash = "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"},
|
||||
]
|
||||
requests-toolbelt = [
|
||||
{file = "requests-toolbelt-0.9.1.tar.gz", hash = "sha256:968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0"},
|
||||
{file = "requests_toolbelt-0.9.1-py2.py3-none-any.whl", hash = "sha256:380606e1d10dc85c3bd47bf5a6095f815ec007be7a8b69c878507068df059e6f"},
|
||||
]
|
||||
secretstorage = [
|
||||
{file = "SecretStorage-3.3.3-py3-none-any.whl", hash = "sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99"},
|
||||
{file = "SecretStorage-3.3.3.tar.gz", hash = "sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77"},
|
||||
]
|
||||
shellingham = [
|
||||
{file = "shellingham-1.5.0-py2.py3-none-any.whl", hash = "sha256:a8f02ba61b69baaa13facdba62908ca8690a94b8119b69f5ec5873ea85f7391b"},
|
||||
{file = "shellingham-1.5.0.tar.gz", hash = "sha256:72fb7f5c63103ca2cb91b23dee0c71fe8ad6fbfd46418ef17dbe40db51592dad"},
|
||||
]
|
||||
six = [
|
||||
{file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
|
||||
{file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
|
||||
]
|
||||
tomlkit = [
|
||||
{file = "tomlkit-0.11.5-py3-none-any.whl", hash = "sha256:f2ef9da9cef846ee027947dc99a45d6b68a63b0ebc21944649505bf2e8bc5fe7"},
|
||||
{file = "tomlkit-0.11.5.tar.gz", hash = "sha256:571854ebbb5eac89abcb4a2e47d7ea27b89bf29e09c35395da6f03dd4ae23d1c"},
|
||||
]
|
||||
types-protobuf = [
|
||||
{file = "types-protobuf-3.20.4.2.tar.gz", hash = "sha256:fd65ab8502f9a08e089f2cad26d52fab04cd57322cf896c570ab3391ca760bae"},
|
||||
{file = "types_protobuf-3.20.4.2-py3-none-any.whl", hash = "sha256:329bec368fd11a8cb95192b33aa61e59e0b30f659ec14be75301c651026c4cc1"},
|
||||
]
|
||||
urllib3 = [
|
||||
{file = "urllib3-1.26.12-py2.py3-none-any.whl", hash = "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997"},
|
||||
{file = "urllib3-1.26.12.tar.gz", hash = "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"},
|
||||
]
|
||||
virtualenv = [
|
||||
{file = "virtualenv-20.16.6-py3-none-any.whl", hash = "sha256:186ca84254abcbde98180fd17092f9628c5fe742273c02724972a1d8a2035108"},
|
||||
{file = "virtualenv-20.16.6.tar.gz", hash = "sha256:530b850b523c6449406dfba859d6345e48ef19b8439606c5d74d7d3c9e14d76e"},
|
||||
]
|
||||
webencodings = [
|
||||
{file = "webencodings-0.5.1-py2.py3-none-any.whl", hash = "sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78"},
|
||||
{file = "webencodings-0.5.1.tar.gz", hash = "sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923"},
|
||||
]
|
||||
xattr = [
|
||||
{file = "xattr-0.9.9-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:58a9fb4fd19b467e88f4b75b5243706caa57e312d3aee757b53b57c7fd0f4ba9"},
|
||||
{file = "xattr-0.9.9-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:e71efca59705c7abde5b7f76323ebe00ed2977f10cba4204b9421dada036b5ca"},
|
||||
{file = "xattr-0.9.9-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:1aad96b6603961c3d1ca1aaa8369b1a8d684a7b37357b2428087c286bf0e561c"},
|
||||
{file = "xattr-0.9.9-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:46cb74f98d31d9d70f975ec3e6554360a9bdcbb4b9fb50a69fabe54f9f928c97"},
|
||||
{file = "xattr-0.9.9-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:80c2db56058a687d7439be041f916cbeb2943fbe2623e53d5da721a4552d8991"},
|
||||
{file = "xattr-0.9.9-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:c360d1cc42e885b64d84f64de3c501dd7bce576248327ef583b4625ee63aa023"},
|
||||
{file = "xattr-0.9.9-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:debd87afe6bdf88c3689bde52eecf2b166388b13ef7388259d23223374db417d"},
|
||||
{file = "xattr-0.9.9-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:4280c9f33a8678828f1bbc3d3dc8b823b5e4a113ee5ecb0fb98bff60cc2b9ad1"},
|
||||
{file = "xattr-0.9.9-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:e0916ec1656d2071cd3139d1f52426825985d8ed076f981ef7f0bc13dfa8e96c"},
|
||||
{file = "xattr-0.9.9-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a517916fbf2f58a3222bb2048fe1eeff4e23e07a4ce6228a27de004c80bf53ab"},
|
||||
{file = "xattr-0.9.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e886c882b3b28c7a684c3e3daf46347da5428a46b88bc6d62c4867d574b90c54"},
|
||||
{file = "xattr-0.9.9-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:373e3d1fd9258438fc38d1438142d3659f36743f374a20457346ef26741ed441"},
|
||||
{file = "xattr-0.9.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1a7beeb54ca140273b2f6320bb98b701ec30628af2ebe4eb30f7051419eb4ef3"},
|
||||
{file = "xattr-0.9.9-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ef3ca29cdaae9c47c625d84bb6c9046f7275cccde0ea805caa23ca58d3671f3f"},
|
||||
{file = "xattr-0.9.9-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5c381d890931cd18b137ce3fb5c5f08b672c3c61e2e47b1a7442ee46e827abfe"},
|
||||
{file = "xattr-0.9.9-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:59c5783ccf57cf2700ce57d51a92134900ed26f6ab20d209f383fb898903fea6"},
|
||||
{file = "xattr-0.9.9-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:966b885b69d95362e2a12d39f84889cf857090e57263b5ac33409498aa00c160"},
|
||||
{file = "xattr-0.9.9-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:efaaf0cb1ea8e9febb7baad301ae8cc9ad7a96fdfc5c6399d165e7a19e3e61ce"},
|
||||
{file = "xattr-0.9.9-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f19fa75ed1e9db86354efab29869cb2be6976d456bd7c89e67b118d5384a1d98"},
|
||||
{file = "xattr-0.9.9-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ca28ad06828244b315214ee35388f57e81e90aac2ceac3f32e42ae394e31b9c"},
|
||||
{file = "xattr-0.9.9-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:532c7f1656dd2fe937116b9e210229f716d7fc7ac142f9cdace7da92266d32e8"},
|
||||
{file = "xattr-0.9.9-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:11c28033c17e98c67e0def9d6ebd415ad3c006a7bc3fee6bad79c5e52d0dff49"},
|
||||
{file = "xattr-0.9.9-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:473cabb30e544ea08c8c01c1ef18053147cdc8552d443ac97815e46fbb13c7d4"},
|
||||
{file = "xattr-0.9.9-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:c4a308522b444d090fbd66a385c9519b6b977818226921b0d2fc403667c93564"},
|
||||
{file = "xattr-0.9.9-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:82493434488aca72d88b5129dac8f212e7b8bdca7ceffe7bb977c850f2452e4e"},
|
||||
{file = "xattr-0.9.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e41d289706c7e8940f4d08e865da6a8ae988123e40a44f9a97ddc09e67795d7d"},
|
||||
{file = "xattr-0.9.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef08698e360cf43688dca3db3421b156b29948a714d5d089348073f463c11646"},
|
||||
{file = "xattr-0.9.9-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4eb10ac16ca8d534c0395425d52121e0c1981f808e1b3f577f6a5ec33d3853e4"},
|
||||
{file = "xattr-0.9.9-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5605fec07b0e964bd980cc70ec335b9eb1b7ac7c6f314c7c2d8f54b09104fe4c"},
|
||||
{file = "xattr-0.9.9-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:974e7d577ddb15e4552fb0ec10a4cfe09bdf6267365aa2b8394bb04637785aad"},
|
||||
{file = "xattr-0.9.9-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:ad6777de922c638bfa87a0d7faebc5722ddef04a1210b2a8909289b58b769af0"},
|
||||
{file = "xattr-0.9.9-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:3887e70873ebf0efbde32f9929ec1c7e45ec0013561743e2cc0406a91e51113b"},
|
||||
{file = "xattr-0.9.9-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:83caa8e93a45a0f25f91b92d9b45f490c87bff74f02555df6312efeba0dacc31"},
|
||||
{file = "xattr-0.9.9-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e33ec0a1d913d946d1ab7509f37ee37306c45af735347f13b963df34ffe6e029"},
|
||||
{file = "xattr-0.9.9-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:263c58dca83372260c5c195e0b59959e38e1f107f0b7350de82e3db38479036c"},
|
||||
{file = "xattr-0.9.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:125dfb9905428162349d3b8b825d9a18280893f0cb0db2a2467d5ef253fa6ce2"},
|
||||
{file = "xattr-0.9.9-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e243524e0dde16d7a2e1b52512ad2c6964df2143dd1c79b820dcb4c6c0822c20"},
|
||||
{file = "xattr-0.9.9-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:01ec07d24a14406bdc6a123041c63a88e1c4a3f820e4a7d30f7609d57311b499"},
|
||||
{file = "xattr-0.9.9-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:85c1df5f1d209345ea96de137419e886a27bb55076b3ae01faacf35aafcf3a61"},
|
||||
{file = "xattr-0.9.9-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ca74d3eff92d6dc16e271fbad9cbab547fb9a0c983189c4031c3ff3d150dd871"},
|
||||
{file = "xattr-0.9.9-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:7d17505e49ac70c0e71939c5aac96417a863583fb30a2d6304d5ac881230548f"},
|
||||
{file = "xattr-0.9.9-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:1ae47a6398d3c04623fa386a4aa2f66e5cd3cdb1a7e69d1bfaeb8c73983bf271"},
|
||||
{file = "xattr-0.9.9-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:809e2537d0aff9fca97dacf3245cbbaf711bbced5d1b0235a8d1906b04e26114"},
|
||||
{file = "xattr-0.9.9-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:de3af84364f06d67b3662ccf7c1a73e1d389d8d274394e952651e7bf1bbd2718"},
|
||||
{file = "xattr-0.9.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3b62cdad232d2d2dedd39b543701db8e3883444ec0d57ce3fab8f75e5f8b0301"},
|
||||
{file = "xattr-0.9.9-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6b11d2eda397d47f7075743409683c233519ca52aa1dac109b413a4d8c15b740"},
|
||||
{file = "xattr-0.9.9-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:661c0a939aefdf071887121f534bb10588d69c7b2dfca5c486af2fc81a0786e8"},
|
||||
{file = "xattr-0.9.9-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:5db7c2db320a8d5264d437d71f1eb7270a7e4a6545296e7766161d17752590b7"},
|
||||
{file = "xattr-0.9.9-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:83203e60cbaca9536d297e5039b285a600ff84e6e9e8536fe2d521825eeeb437"},
|
||||
{file = "xattr-0.9.9-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:42bfb4e4da06477e739770ac6942edbdc71e9fc3b497b67db5fba712fa8109c2"},
|
||||
{file = "xattr-0.9.9-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:67047d04d1c56ad4f0f5886085e91b0077238ab3faaec6492c3c21920c6566eb"},
|
||||
{file = "xattr-0.9.9-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:885782bc82ded1a3f684d54a1af259ae9fcc347fa54b5a05b8aad82b8a42044c"},
|
||||
{file = "xattr-0.9.9-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5bc84ccec618b5aa089e7cee8b07fcc92d4069aac4053da604c8143a0d6b1381"},
|
||||
{file = "xattr-0.9.9-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baeff3e5dda8ea7e9424cfaee51829f46afe3836c30d02f343f9049c685681ca"},
|
||||
{file = "xattr-0.9.9.tar.gz", hash = "sha256:09cb7e1efb3aa1b4991d6be4eb25b73dc518b4fe894f0915f5b0dcede972f346"},
|
||||
]
|
||||
35
python/pyproject.toml
Normal file
35
python/pyproject.toml
Normal file
@@ -0,0 +1,35 @@
|
||||
[tool.poetry]
|
||||
name = "robocar-protobuf"
|
||||
version = "0.0.0"
|
||||
description = "Protobuf message definitions for robocar"
|
||||
authors = ["Cyrille Nofficial <cynoffic@cyrilix.fr>"]
|
||||
license = "Apache2"
|
||||
readme = "README.md"
|
||||
packages = [{include = "events"}]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.10"
|
||||
protobuf = "^4.21.8"
|
||||
poetry = "^1.2.2"
|
||||
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
mypy-protobuf = "^3.4.0"
|
||||
|
||||
|
||||
[[tool.poetry.source]]
|
||||
name = "robocar"
|
||||
url = "https://git.cyrilix.bzh/api/packages/robocars/pypi"
|
||||
default = false
|
||||
secondary = false
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
|
||||
build-backend = "poetry_dynamic_versioning.backend"
|
||||
|
||||
[tool.poetry-dynamic-versioning]
|
||||
enable = true
|
||||
style = 'semver'
|
||||
vcs = 'git'
|
||||
dirty = true
|
||||
bump = true
|
||||
Reference in New Issue
Block a user