mirror of
https://github.com/openfaas/faas.git
synced 2025-06-22 14:53:25 +00:00
Update go.mod, Alpine to 3.20.0 and to Go 1.22
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
This commit is contained in:
160
gateway/vendor/google.golang.org/protobuf/encoding/protodelim/protodelim.go
generated
vendored
Normal file
160
gateway/vendor/google.golang.org/protobuf/encoding/protodelim/protodelim.go
generated
vendored
Normal file
@ -0,0 +1,160 @@
|
||||
// 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 protodelim marshals and unmarshals varint size-delimited messages.
|
||||
package protodelim
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/internal/errors"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// MarshalOptions is a configurable varint size-delimited marshaler.
|
||||
type MarshalOptions struct{ proto.MarshalOptions }
|
||||
|
||||
// MarshalTo writes a varint size-delimited wire-format message to w.
|
||||
// If w returns an error, MarshalTo returns it unchanged.
|
||||
func (o MarshalOptions) MarshalTo(w io.Writer, m proto.Message) (int, error) {
|
||||
msgBytes, err := o.MarshalOptions.Marshal(m)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
sizeBytes := protowire.AppendVarint(nil, uint64(len(msgBytes)))
|
||||
sizeWritten, err := w.Write(sizeBytes)
|
||||
if err != nil {
|
||||
return sizeWritten, err
|
||||
}
|
||||
msgWritten, err := w.Write(msgBytes)
|
||||
if err != nil {
|
||||
return sizeWritten + msgWritten, err
|
||||
}
|
||||
return sizeWritten + msgWritten, nil
|
||||
}
|
||||
|
||||
// MarshalTo writes a varint size-delimited wire-format message to w
|
||||
// with the default options.
|
||||
//
|
||||
// See the documentation for [MarshalOptions.MarshalTo].
|
||||
func MarshalTo(w io.Writer, m proto.Message) (int, error) {
|
||||
return MarshalOptions{}.MarshalTo(w, m)
|
||||
}
|
||||
|
||||
// UnmarshalOptions is a configurable varint size-delimited unmarshaler.
|
||||
type UnmarshalOptions struct {
|
||||
proto.UnmarshalOptions
|
||||
|
||||
// MaxSize is the maximum size in wire-format bytes of a single message.
|
||||
// Unmarshaling a message larger than MaxSize will return an error.
|
||||
// A zero MaxSize will default to 4 MiB.
|
||||
// Setting MaxSize to -1 disables the limit.
|
||||
MaxSize int64
|
||||
}
|
||||
|
||||
const defaultMaxSize = 4 << 20 // 4 MiB, corresponds to the default gRPC max request/response size
|
||||
|
||||
// SizeTooLargeError is an error that is returned when the unmarshaler encounters a message size
|
||||
// that is larger than its configured [UnmarshalOptions.MaxSize].
|
||||
type SizeTooLargeError struct {
|
||||
// Size is the varint size of the message encountered
|
||||
// that was larger than the provided MaxSize.
|
||||
Size uint64
|
||||
|
||||
// MaxSize is the MaxSize limit configured in UnmarshalOptions, which Size exceeded.
|
||||
MaxSize uint64
|
||||
}
|
||||
|
||||
func (e *SizeTooLargeError) Error() string {
|
||||
return fmt.Sprintf("message size %d exceeded unmarshaler's maximum configured size %d", e.Size, e.MaxSize)
|
||||
}
|
||||
|
||||
// Reader is the interface expected by [UnmarshalFrom].
|
||||
// It is implemented by *[bufio.Reader].
|
||||
type Reader interface {
|
||||
io.Reader
|
||||
io.ByteReader
|
||||
}
|
||||
|
||||
// UnmarshalFrom parses and consumes a varint size-delimited wire-format message
|
||||
// from r.
|
||||
// The provided message must be mutable (e.g., a non-nil pointer to a message).
|
||||
//
|
||||
// The error is [io.EOF] error only if no bytes are read.
|
||||
// If an EOF happens after reading some but not all the bytes,
|
||||
// UnmarshalFrom returns a non-io.EOF error.
|
||||
// In particular if r returns a non-io.EOF error, UnmarshalFrom returns it unchanged,
|
||||
// and if only a size is read with no subsequent message, [io.ErrUnexpectedEOF] is returned.
|
||||
func (o UnmarshalOptions) UnmarshalFrom(r Reader, m proto.Message) error {
|
||||
var sizeArr [binary.MaxVarintLen64]byte
|
||||
sizeBuf := sizeArr[:0]
|
||||
for i := range sizeArr {
|
||||
b, err := r.ReadByte()
|
||||
if err != nil {
|
||||
// Immediate EOF is unexpected.
|
||||
if err == io.EOF && i != 0 {
|
||||
break
|
||||
}
|
||||
return err
|
||||
}
|
||||
sizeBuf = append(sizeBuf, b)
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
size, n := protowire.ConsumeVarint(sizeBuf)
|
||||
if n < 0 {
|
||||
return protowire.ParseError(n)
|
||||
}
|
||||
|
||||
maxSize := o.MaxSize
|
||||
if maxSize == 0 {
|
||||
maxSize = defaultMaxSize
|
||||
}
|
||||
if maxSize != -1 && size > uint64(maxSize) {
|
||||
return errors.Wrap(&SizeTooLargeError{Size: size, MaxSize: uint64(maxSize)}, "")
|
||||
}
|
||||
|
||||
var b []byte
|
||||
var err error
|
||||
if br, ok := r.(*bufio.Reader); ok {
|
||||
// Use the []byte from the bufio.Reader instead of having to allocate one.
|
||||
// This reduces CPU usage and allocated bytes.
|
||||
b, err = br.Peek(int(size))
|
||||
if err == nil {
|
||||
defer br.Discard(int(size))
|
||||
} else {
|
||||
b = nil
|
||||
}
|
||||
}
|
||||
if b == nil {
|
||||
b = make([]byte, size)
|
||||
_, err = io.ReadFull(r, b)
|
||||
}
|
||||
|
||||
if err == io.EOF {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := o.Unmarshal(b, m); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// UnmarshalFrom parses and consumes a varint size-delimited wire-format message
|
||||
// from r with the default options.
|
||||
// The provided message must be mutable (e.g., a non-nil pointer to a message).
|
||||
//
|
||||
// See the documentation for [UnmarshalOptions.UnmarshalFrom].
|
||||
func UnmarshalFrom(r Reader, m proto.Message) error {
|
||||
return UnmarshalOptions{}.UnmarshalFrom(r, m)
|
||||
}
|
8
gateway/vendor/google.golang.org/protobuf/encoding/prototext/decode.go
generated
vendored
8
gateway/vendor/google.golang.org/protobuf/encoding/prototext/decode.go
generated
vendored
@ -21,7 +21,7 @@ import (
|
||||
"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 {
|
||||
@ -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++
|
||||
|
24
gateway/vendor/google.golang.org/protobuf/encoding/prototext/encode.go
generated
vendored
24
gateway/vendor/google.golang.org/protobuf/encoding/prototext/encode.go
generated
vendored
@ -27,15 +27,17 @@ const defaultIndent = " "
|
||||
|
||||
// Format formats the message as a multiline string.
|
||||
// This function is only intended for human consumption and ignores errors.
|
||||
// Do not depend on the output being stable. It may change over time across
|
||||
// different versions of the program.
|
||||
// Do not depend on the output being stable. Its output will change across
|
||||
// different builds of your program, even when using the same version of the
|
||||
// protobuf module.
|
||||
func Format(m proto.Message) string {
|
||||
return MarshalOptions{Multiline: true}.Format(m)
|
||||
}
|
||||
|
||||
// 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.
|
||||
// Marshal writes the given [proto.Message] in textproto format using default
|
||||
// options. Do not depend on the output being stable. Its output will change
|
||||
// across different builds of your program, even when using the same version of
|
||||
// the protobuf module.
|
||||
func Marshal(m proto.Message) ([]byte, error) {
|
||||
return MarshalOptions{}.Marshal(m)
|
||||
}
|
||||
@ -84,8 +86,9 @@ type MarshalOptions struct {
|
||||
|
||||
// Format formats the message as a string.
|
||||
// This method is only intended for human consumption and ignores errors.
|
||||
// Do not depend on the output being stable. It may change over time across
|
||||
// different versions of the program.
|
||||
// Do not depend on the output being stable. Its output will change across
|
||||
// different builds of your program, even when using the same version of the
|
||||
// protobuf module.
|
||||
func (o MarshalOptions) Format(m proto.Message) string {
|
||||
if m == nil || !m.ProtoReflect().IsValid() {
|
||||
return "<nil>" // invalid syntax, but okay since this is for debugging
|
||||
@ -97,9 +100,10 @@ func (o MarshalOptions) Format(m proto.Message) string {
|
||||
return string(b)
|
||||
}
|
||||
|
||||
// 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.
|
||||
// Marshal writes the given [proto.Message] in textproto format using options in
|
||||
// MarshalOptions object. Do not depend on the output being stable. Its output
|
||||
// will change across different builds of your program, even when using the
|
||||
// same version of the protobuf module.
|
||||
func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) {
|
||||
return o.marshal(nil, m)
|
||||
}
|
||||
|
28
gateway/vendor/google.golang.org/protobuf/encoding/protowire/wire.go
generated
vendored
28
gateway/vendor/google.golang.org/protobuf/encoding/protowire/wire.go
generated
vendored
@ -6,7 +6,7 @@
|
||||
// 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 (
|
||||
@ -87,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).
|
||||
@ -104,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.
|
||||
@ -164,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 {
|
||||
@ -263,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 {
|
||||
@ -384,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
|
||||
@ -412,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
|
||||
@ -432,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 {
|
||||
@ -456,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
|
||||
@ -471,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 {
|
||||
@ -495,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.
|
||||
@ -506,7 +506,7 @@ 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)
|
||||
}
|
||||
|
184
gateway/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go
generated
vendored
184
gateway/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go
generated
vendored
@ -83,7 +83,13 @@ func formatListOpt(vs list, isRoot, allowMulti bool) string {
|
||||
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
|
||||
@ -92,34 +98,26 @@ func formatListOpt(vs list, isRoot, allowMulti bool) string {
|
||||
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.(protoreflect.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((*protoreflect.FileDescriptor)(nil)).Elem(): {"Path", "Package", "Imports", "Messages", "Enums", "Extensions", "Services"},
|
||||
reflect.TypeOf((*protoreflect.MessageDescriptor)(nil)).Elem(): {"IsMapEntry", "Fields", "Oneofs", "ReservedNames", "ReservedRanges", "RequiredNumbers", "ExtensionRanges", "Messages", "Enums", "Extensions"},
|
||||
reflect.TypeOf((*protoreflect.FieldDescriptor)(nil)).Elem(): {"Number", "Cardinality", "Kind", "HasJSONName", "JSONName", "HasPresence", "IsExtension", "IsPacked", "IsWeak", "IsList", "IsMap", "MapKey", "MapValue", "HasDefault", "Default", "ContainingOneof", "ContainingMessage", "Message", "Enum"},
|
||||
reflect.TypeOf((*protoreflect.OneofDescriptor)(nil)).Elem(): {"Fields"}, // not directly used; must keep in sync with formatDescOpt
|
||||
reflect.TypeOf((*protoreflect.EnumDescriptor)(nil)).Elem(): {"Values", "ReservedNames", "ReservedRanges"},
|
||||
reflect.TypeOf((*protoreflect.EnumValueDescriptor)(nil)).Elem(): {"Number"},
|
||||
reflect.TypeOf((*protoreflect.ServiceDescriptor)(nil)).Elem(): {"Methods"},
|
||||
reflect.TypeOf((*protoreflect.MethodDescriptor)(nil)).Elem(): {"Input", "Output", "IsStreamingClient", "IsStreamingServer"},
|
||||
type methodAndName struct {
|
||||
method reflect.Value
|
||||
name string
|
||||
}
|
||||
|
||||
func FormatDesc(s fmt.State, r rune, t protoreflect.Descriptor) {
|
||||
io.WriteString(s, formatDescOpt(t, true, r == 'v' && (s.Flag('+') || s.Flag('#'))))
|
||||
io.WriteString(s, formatDescOpt(t, true, r == 'v' && (s.Flag('+') || s.Flag('#')), nil))
|
||||
}
|
||||
func formatDescOpt(t protoreflect.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)
|
||||
|
||||
@ -129,26 +127,60 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool) string {
|
||||
}
|
||||
|
||||
_, isFile := t.(protoreflect.FileDescriptor)
|
||||
rs := records{allowMulti: allowMulti}
|
||||
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 protoreflect.FieldDescriptor:
|
||||
for _, s := range descriptorAccessors[rt] {
|
||||
switch s {
|
||||
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()})
|
||||
@ -157,20 +189,20 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool) string {
|
||||
if v := t.MapValue(); v != nil {
|
||||
switch v.Kind() {
|
||||
case protoreflect.EnumKind:
|
||||
rs.recs = append(rs.recs, [2]string{"MapValue", string(v.Enum().FullName())})
|
||||
rs.AppendRecs("MapValue", [2]string{"MapValue", string(v.Enum().FullName())})
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
rs.recs = append(rs.recs, [2]string{"MapValue", string(v.Message().FullName())})
|
||||
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() {
|
||||
@ -187,13 +219,62 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool) string {
|
||||
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"},
|
||||
{rv.MethodByName("IsClosed"), "IsClosed"},
|
||||
}...)
|
||||
|
||||
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,19 +283,34 @@ func formatDescOpt(t protoreflect.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().(protoreflect.Value); ok {
|
||||
rv = rv.MethodByName("Interface").Call(nil)[0]
|
||||
@ -261,7 +357,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})
|
||||
}
|
||||
}
|
||||
|
||||
|
12
gateway/vendor/google.golang.org/protobuf/internal/editiondefaults/defaults.go
generated
vendored
Normal file
12
gateway/vendor/google.golang.org/protobuf/internal/editiondefaults/defaults.go
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
// Copyright 2024 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 editiondefaults contains the binary representation of the editions
|
||||
// defaults.
|
||||
package editiondefaults
|
||||
|
||||
import _ "embed"
|
||||
|
||||
//go:embed editions_defaults.binpb
|
||||
var Defaults []byte
|
BIN
gateway/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb
generated
vendored
Normal file
BIN
gateway/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb
generated
vendored
Normal file
Binary file not shown.
4
gateway/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go
generated
vendored
4
gateway/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go
generated
vendored
@ -32,6 +32,7 @@ var byteType = reflect.TypeOf(byte(0))
|
||||
func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescriptors) protoreflect.FieldDescriptor {
|
||||
f := new(filedesc.Field)
|
||||
f.L0.ParentFile = filedesc.SurrogateProto2
|
||||
f.L1.EditionFeatures = f.L0.ParentFile.L1.EditionFeatures
|
||||
for len(tag) > 0 {
|
||||
i := strings.IndexByte(tag, ',')
|
||||
if i < 0 {
|
||||
@ -107,8 +108,7 @@ func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescri
|
||||
f.L1.StringName.InitJSON(jsonName)
|
||||
}
|
||||
case s == "packed":
|
||||
f.L1.HasPacked = true
|
||||
f.L1.IsPacked = true
|
||||
f.L1.EditionFeatures.IsPacked = true
|
||||
case strings.HasPrefix(s, "weak="):
|
||||
f.L1.IsWeak = true
|
||||
f.L1.Message = filedesc.PlaceholderMessage(protoreflect.FullName(s[len("weak="):]))
|
||||
|
15
gateway/vendor/google.golang.org/protobuf/internal/errors/errors.go
generated
vendored
15
gateway/vendor/google.golang.org/protobuf/internal/errors/errors.go
generated
vendored
@ -87,3 +87,18 @@ func InvalidUTF8(name string) error {
|
||||
func RequiredNotSet(name string) error {
|
||||
return New("required field %v not set", name)
|
||||
}
|
||||
|
||||
type SizeMismatchError struct {
|
||||
Calculated, Measured int
|
||||
}
|
||||
|
||||
func (e *SizeMismatchError) Error() string {
|
||||
return fmt.Sprintf("size mismatch (see https://github.com/golang/protobuf/issues/1609): calculated=%d, measured=%d", e.Calculated, e.Measured)
|
||||
}
|
||||
|
||||
func MismatchedSizeCalculation(calculated, measured int) error {
|
||||
return &SizeMismatchError{
|
||||
Calculated: calculated,
|
||||
Measured: measured,
|
||||
}
|
||||
}
|
||||
|
162
gateway/vendor/google.golang.org/protobuf/internal/filedesc/desc.go
generated
vendored
162
gateway/vendor/google.golang.org/protobuf/internal/filedesc/desc.go
generated
vendored
@ -7,6 +7,7 @@ package filedesc
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
@ -21,11 +22,26 @@ import (
|
||||
"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.
|
||||
@ -44,6 +60,7 @@ type (
|
||||
}
|
||||
FileL1 struct {
|
||||
Syntax protoreflect.Syntax
|
||||
Edition Edition // Only used if Syntax == Editions
|
||||
Path string
|
||||
Package protoreflect.FullName
|
||||
|
||||
@ -51,21 +68,53 @@ type (
|
||||
Messages Messages
|
||||
Extensions Extensions
|
||||
Services Services
|
||||
|
||||
EditionFeatures EditionFeatures
|
||||
}
|
||||
FileL2 struct {
|
||||
Options func() protoreflect.ProtoMessage
|
||||
Imports FileImports
|
||||
Locations SourceLocations
|
||||
}
|
||||
|
||||
EditionFeatures struct {
|
||||
// IsFieldPresence is true if field_presence is EXPLICIT
|
||||
// https://protobuf.dev/editions/features/#field_presence
|
||||
IsFieldPresence bool
|
||||
// IsFieldPresence is true if field_presence is LEGACY_REQUIRED
|
||||
// https://protobuf.dev/editions/features/#field_presence
|
||||
IsLegacyRequired 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
|
||||
// GenerateLegacyUnmarshalJSON determines if the plugin generates the
|
||||
// UnmarshalJSON([]byte) error method for enums.
|
||||
GenerateLegacyUnmarshalJSON bool
|
||||
}
|
||||
)
|
||||
|
||||
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 }
|
||||
|
||||
// Not exported and just used to reconstruct the original FileDescriptor proto
|
||||
func (fd *File) Edition() int32 { return int32(fd.L1.Edition) }
|
||||
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()
|
||||
@ -117,6 +166,8 @@ type (
|
||||
}
|
||||
EnumL1 struct {
|
||||
eagerValues bool // controls whether EnumL2.Values is already populated
|
||||
|
||||
EditionFeatures EditionFeatures
|
||||
}
|
||||
EnumL2 struct {
|
||||
Options func() protoreflect.ProtoMessage
|
||||
@ -155,6 +206,9 @@ func (ed *Enum) lazyInit() *EnumL2 {
|
||||
ed.L0.ParentFile.lazyInit() // implicitly initializes L2
|
||||
return ed.L2
|
||||
}
|
||||
func (ed *Enum) IsClosed() bool {
|
||||
return !ed.L1.EditionFeatures.IsOpenEnum
|
||||
}
|
||||
|
||||
func (ed *EnumValue) Options() protoreflect.ProtoMessage {
|
||||
if f := ed.L1.Options; f != nil {
|
||||
@ -178,6 +232,8 @@ type (
|
||||
Extensions Extensions
|
||||
IsMapEntry bool // promoted from google.protobuf.MessageOptions
|
||||
IsMessageSet bool // promoted from google.protobuf.MessageOptions
|
||||
|
||||
EditionFeatures EditionFeatures
|
||||
}
|
||||
MessageL2 struct {
|
||||
Options func() protoreflect.ProtoMessage
|
||||
@ -202,14 +258,12 @@ type (
|
||||
StringName stringName
|
||||
IsProto3Optional bool // promoted from google.protobuf.FieldDescriptorProto
|
||||
IsWeak bool // promoted from google.protobuf.FieldOptions
|
||||
HasPacked bool // promoted from google.protobuf.FieldOptions
|
||||
IsPacked bool // promoted from google.protobuf.FieldOptions
|
||||
HasEnforceUTF8 bool // promoted from google.protobuf.FieldOptions
|
||||
EnforceUTF8 bool // promoted from google.protobuf.FieldOptions
|
||||
Default defaultValue
|
||||
ContainingOneof protoreflect.OneofDescriptor // must be consistent with Message.Oneofs.Fields
|
||||
Enum protoreflect.EnumDescriptor
|
||||
Message protoreflect.MessageDescriptor
|
||||
|
||||
EditionFeatures EditionFeatures
|
||||
}
|
||||
|
||||
Oneof struct {
|
||||
@ -219,6 +273,8 @@ type (
|
||||
OneofL1 struct {
|
||||
Options func() protoreflect.ProtoMessage
|
||||
Fields OneofFields // must be consistent with Message.Fields.ContainingOneof
|
||||
|
||||
EditionFeatures EditionFeatures
|
||||
}
|
||||
)
|
||||
|
||||
@ -268,25 +324,30 @@ func (fd *Field) Options() protoreflect.ProtoMessage {
|
||||
}
|
||||
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) 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 != protoreflect.Repeated && (fd.L0.ParentFile.L1.Syntax == protoreflect.Proto2 || fd.L1.Message != nil || fd.L1.ContainingOneof != nil)
|
||||
if fd.L1.Cardinality == protoreflect.Repeated {
|
||||
return false
|
||||
}
|
||||
return fd.IsExtension() || fd.L1.EditionFeatures.IsFieldPresence || fd.L1.Message != nil || fd.L1.ContainingOneof != nil
|
||||
}
|
||||
func (fd *Field) HasOptionalKeyword() bool {
|
||||
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 != protoreflect.Proto2 && fd.L1.Cardinality == protoreflect.Repeated {
|
||||
switch fd.L1.Kind {
|
||||
case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
default:
|
||||
return true
|
||||
}
|
||||
if fd.L1.Cardinality != protoreflect.Repeated {
|
||||
return false
|
||||
}
|
||||
return fd.L1.IsPacked
|
||||
switch fd.L1.Kind {
|
||||
case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
return false
|
||||
}
|
||||
return fd.L1.EditionFeatures.IsPacked
|
||||
}
|
||||
func (fd *Field) IsExtension() bool { return false }
|
||||
func (fd *Field) IsWeak() bool { return fd.L1.IsWeak }
|
||||
@ -333,10 +394,7 @@ func (fd *Field) ProtoType(protoreflect.FieldDescriptor) {}
|
||||
// WARNING: This method is exempt from the compatibility promise and may be
|
||||
// removed in the future without warning.
|
||||
func (fd *Field) EnforceUTF8() bool {
|
||||
if fd.L1.HasEnforceUTF8 {
|
||||
return fd.L1.EnforceUTF8
|
||||
}
|
||||
return fd.L0.ParentFile.L1.Syntax == protoreflect.Proto3
|
||||
return fd.L1.EditionFeatures.IsUTF8Validated
|
||||
}
|
||||
|
||||
func (od *Oneof) IsSynthetic() bool {
|
||||
@ -359,16 +417,16 @@ type (
|
||||
L2 *ExtensionL2 // protected by fileDesc.once
|
||||
}
|
||||
ExtensionL1 struct {
|
||||
Number protoreflect.FieldNumber
|
||||
Extendee protoreflect.MessageDescriptor
|
||||
Cardinality protoreflect.Cardinality
|
||||
Kind protoreflect.Kind
|
||||
Number protoreflect.FieldNumber
|
||||
Extendee protoreflect.MessageDescriptor
|
||||
Cardinality protoreflect.Cardinality
|
||||
Kind protoreflect.Kind
|
||||
EditionFeatures EditionFeatures
|
||||
}
|
||||
ExtensionL2 struct {
|
||||
Options func() protoreflect.ProtoMessage
|
||||
StringName stringName
|
||||
IsProto3Optional bool // promoted from google.protobuf.FieldDescriptorProto
|
||||
IsPacked bool // promoted from google.protobuf.FieldOptions
|
||||
Default defaultValue
|
||||
Enum protoreflect.EnumDescriptor
|
||||
Message protoreflect.MessageDescriptor
|
||||
@ -391,7 +449,16 @@ func (xd *Extension) HasPresence() bool { return xd.L1.Cardi
|
||||
func (xd *Extension) HasOptionalKeyword() bool {
|
||||
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) IsPacked() bool {
|
||||
if xd.L1.Cardinality != protoreflect.Repeated {
|
||||
return false
|
||||
}
|
||||
switch xd.L1.Kind {
|
||||
case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
return false
|
||||
}
|
||||
return xd.L1.EditionFeatures.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 }
|
||||
@ -472,8 +539,9 @@ 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: protoreflect.Proto2}, L2: &FileL2{}}
|
||||
SurrogateProto3 = &File{L1: FileL1{Syntax: protoreflect.Proto3}, L2: &FileL2{}}
|
||||
SurrogateProto2 = &File{L1: FileL1{Syntax: protoreflect.Proto2}, L2: &FileL2{}}
|
||||
SurrogateProto3 = &File{L1: FileL1{Syntax: protoreflect.Proto3}, L2: &FileL2{}}
|
||||
SurrogateEdition2023 = &File{L1: FileL1{Syntax: protoreflect.Editions, Edition: Edition2023}, L2: &FileL2{}}
|
||||
)
|
||||
|
||||
type (
|
||||
@ -515,6 +583,34 @@ func (s *stringName) InitJSON(name string) {
|
||||
s.nameJSON = name
|
||||
}
|
||||
|
||||
// Returns true if this field is structured like the synthetic field of a proto2
|
||||
// group. This allows us to expand our treatment of delimited fields without
|
||||
// breaking proto2 files that have been upgraded to editions.
|
||||
func isGroupLike(fd protoreflect.FieldDescriptor) bool {
|
||||
// Groups are always group types.
|
||||
if fd.Kind() != protoreflect.GroupKind {
|
||||
return false
|
||||
}
|
||||
|
||||
// Group fields are always the lowercase type name.
|
||||
if strings.ToLower(string(fd.Message().Name())) != string(fd.Name()) {
|
||||
return false
|
||||
}
|
||||
|
||||
// Groups could only be defined in the same file they're used.
|
||||
if fd.Message().ParentFile() != fd.ParentFile() {
|
||||
return false
|
||||
}
|
||||
|
||||
// Group messages are always defined in the same scope as the field. File
|
||||
// level extensions will compare NULL == NULL here, which is why the file
|
||||
// comparison above is necessary to ensure both come from the same file.
|
||||
if fd.IsExtension() {
|
||||
return fd.Parent() == fd.Message().Parent()
|
||||
}
|
||||
return fd.ContainingMessage() == fd.Message().Parent()
|
||||
}
|
||||
|
||||
func (s *stringName) lazyInit(fd protoreflect.FieldDescriptor) *stringName {
|
||||
s.once.Do(func() {
|
||||
if fd.IsExtension() {
|
||||
@ -535,7 +631,7 @@ func (s *stringName) lazyInit(fd protoreflect.FieldDescriptor) *stringName {
|
||||
|
||||
// Format the text name.
|
||||
s.nameText = string(fd.Name())
|
||||
if fd.Kind() == protoreflect.GroupKind {
|
||||
if isGroupLike(fd) {
|
||||
s.nameText = string(fd.Message().Name())
|
||||
}
|
||||
}
|
||||
|
87
gateway/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go
generated
vendored
87
gateway/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go
generated
vendored
@ -5,6 +5,7 @@
|
||||
package filedesc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
@ -98,6 +99,7 @@ func (fd *File) unmarshalSeed(b []byte) {
|
||||
var prevField protoreflect.FieldNumber
|
||||
var numEnums, numMessages, numExtensions, numServices int
|
||||
var posEnums, posMessages, posExtensions, posServices int
|
||||
var options []byte
|
||||
b0 := b
|
||||
for len(b) > 0 {
|
||||
num, typ, n := protowire.ConsumeTag(b)
|
||||
@ -111,8 +113,12 @@ func (fd *File) unmarshalSeed(b []byte) {
|
||||
switch string(v) {
|
||||
case "proto2":
|
||||
fd.L1.Syntax = protoreflect.Proto2
|
||||
fd.L1.Edition = EditionProto2
|
||||
case "proto3":
|
||||
fd.L1.Syntax = protoreflect.Proto3
|
||||
fd.L1.Edition = EditionProto3
|
||||
case "editions":
|
||||
fd.L1.Syntax = protoreflect.Editions
|
||||
default:
|
||||
panic("invalid syntax")
|
||||
}
|
||||
@ -120,6 +126,8 @@ func (fd *File) unmarshalSeed(b []byte) {
|
||||
fd.L1.Path = sb.MakeString(v)
|
||||
case genid.FileDescriptorProto_Package_field_number:
|
||||
fd.L1.Package = protoreflect.FullName(sb.MakeString(v))
|
||||
case genid.FileDescriptorProto_Options_field_number:
|
||||
options = v
|
||||
case genid.FileDescriptorProto_EnumType_field_number:
|
||||
if prevField != genid.FileDescriptorProto_EnumType_field_number {
|
||||
if numEnums > 0 {
|
||||
@ -154,6 +162,13 @@ func (fd *File) unmarshalSeed(b []byte) {
|
||||
numServices++
|
||||
}
|
||||
prevField = num
|
||||
case protowire.VarintType:
|
||||
v, m := protowire.ConsumeVarint(b)
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.FileDescriptorProto_Edition_field_number:
|
||||
fd.L1.Edition = Edition(v)
|
||||
}
|
||||
default:
|
||||
m := protowire.ConsumeFieldValue(num, typ, b)
|
||||
b = b[m:]
|
||||
@ -164,6 +179,14 @@ func (fd *File) unmarshalSeed(b []byte) {
|
||||
// If syntax is missing, it is assumed to be proto2.
|
||||
if fd.L1.Syntax == 0 {
|
||||
fd.L1.Syntax = protoreflect.Proto2
|
||||
fd.L1.Edition = EditionProto2
|
||||
}
|
||||
|
||||
fd.L1.EditionFeatures = getFeaturesFor(fd.L1.Edition)
|
||||
|
||||
// Parse editions features from options if any
|
||||
if options != nil {
|
||||
fd.unmarshalSeedOptions(options)
|
||||
}
|
||||
|
||||
// Must allocate all declarations before parsing each descriptor type
|
||||
@ -219,10 +242,33 @@ func (fd *File) unmarshalSeed(b []byte) {
|
||||
}
|
||||
}
|
||||
|
||||
func (fd *File) unmarshalSeedOptions(b []byte) {
|
||||
for b := b; len(b) > 0; {
|
||||
num, typ, n := protowire.ConsumeTag(b)
|
||||
b = b[n:]
|
||||
switch typ {
|
||||
case protowire.BytesType:
|
||||
v, m := protowire.ConsumeBytes(b)
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.FileOptions_Features_field_number:
|
||||
if fd.Syntax() != protoreflect.Editions {
|
||||
panic(fmt.Sprintf("invalid descriptor: using edition features in a proto with syntax %s", fd.Syntax()))
|
||||
}
|
||||
fd.L1.EditionFeatures = unmarshalFeatureSet(v, fd.L1.EditionFeatures)
|
||||
}
|
||||
default:
|
||||
m := protowire.ConsumeFieldValue(num, typ, b)
|
||||
b = b[m:]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
ed.L1.EditionFeatures = featuresFromParentDesc(ed.Parent())
|
||||
|
||||
var numValues int
|
||||
for b := b; len(b) > 0; {
|
||||
@ -275,6 +321,7 @@ func (md *Message) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protor
|
||||
md.L0.ParentFile = pf
|
||||
md.L0.Parent = pd
|
||||
md.L0.Index = i
|
||||
md.L1.EditionFeatures = featuresFromParentDesc(md.Parent())
|
||||
|
||||
var prevField protoreflect.FieldNumber
|
||||
var numEnums, numMessages, numExtensions int
|
||||
@ -380,6 +427,13 @@ func (md *Message) unmarshalSeedOptions(b []byte) {
|
||||
case genid.MessageOptions_MessageSetWireFormat_field_number:
|
||||
md.L1.IsMessageSet = protowire.DecodeBool(v)
|
||||
}
|
||||
case protowire.BytesType:
|
||||
v, m := protowire.ConsumeBytes(b)
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.MessageOptions_Features_field_number:
|
||||
md.L1.EditionFeatures = unmarshalFeatureSet(v, md.L1.EditionFeatures)
|
||||
}
|
||||
default:
|
||||
m := protowire.ConsumeFieldValue(num, typ, b)
|
||||
b = b[m:]
|
||||
@ -391,6 +445,7 @@ func (xd *Extension) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd prot
|
||||
xd.L0.ParentFile = pf
|
||||
xd.L0.Parent = pd
|
||||
xd.L0.Index = i
|
||||
xd.L1.EditionFeatures = featuresFromParentDesc(pd)
|
||||
|
||||
for len(b) > 0 {
|
||||
num, typ, n := protowire.ConsumeTag(b)
|
||||
@ -415,6 +470,38 @@ func (xd *Extension) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd prot
|
||||
xd.L0.FullName = appendFullName(sb, pd.FullName(), v)
|
||||
case genid.FieldDescriptorProto_Extendee_field_number:
|
||||
xd.L1.Extendee = PlaceholderMessage(makeFullName(sb, v))
|
||||
case genid.FieldDescriptorProto_Options_field_number:
|
||||
xd.unmarshalOptions(v)
|
||||
}
|
||||
default:
|
||||
m := protowire.ConsumeFieldValue(num, typ, b)
|
||||
b = b[m:]
|
||||
}
|
||||
}
|
||||
|
||||
if xd.L1.Kind == protoreflect.MessageKind && xd.L1.EditionFeatures.IsDelimitedEncoded {
|
||||
xd.L1.Kind = protoreflect.GroupKind
|
||||
}
|
||||
}
|
||||
|
||||
func (xd *Extension) unmarshalOptions(b []byte) {
|
||||
for len(b) > 0 {
|
||||
num, typ, n := protowire.ConsumeTag(b)
|
||||
b = b[n:]
|
||||
switch typ {
|
||||
case protowire.VarintType:
|
||||
v, m := protowire.ConsumeVarint(b)
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.FieldOptions_Packed_field_number:
|
||||
xd.L1.EditionFeatures.IsPacked = protowire.DecodeBool(v)
|
||||
}
|
||||
case protowire.BytesType:
|
||||
v, m := protowire.ConsumeBytes(b)
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.FieldOptions_Features_field_number:
|
||||
xd.L1.EditionFeatures = unmarshalFeatureSet(v, xd.L1.EditionFeatures)
|
||||
}
|
||||
default:
|
||||
m := protowire.ConsumeFieldValue(num, typ, b)
|
||||
|
40
gateway/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go
generated
vendored
40
gateway/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go
generated
vendored
@ -414,6 +414,7 @@ func (fd *Field) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd protoref
|
||||
fd.L0.ParentFile = pf
|
||||
fd.L0.Parent = pd
|
||||
fd.L0.Index = i
|
||||
fd.L1.EditionFeatures = featuresFromParentDesc(fd.Parent())
|
||||
|
||||
var rawTypeName []byte
|
||||
var rawOptions []byte
|
||||
@ -465,6 +466,12 @@ func (fd *Field) unmarshalFull(b []byte, sb *strs.Builder, pf *File, pd protoref
|
||||
b = b[m:]
|
||||
}
|
||||
}
|
||||
if fd.L1.Kind == protoreflect.MessageKind && fd.L1.EditionFeatures.IsDelimitedEncoded {
|
||||
fd.L1.Kind = protoreflect.GroupKind
|
||||
}
|
||||
if fd.L1.EditionFeatures.IsLegacyRequired {
|
||||
fd.L1.Cardinality = protoreflect.Required
|
||||
}
|
||||
if rawTypeName != nil {
|
||||
name := makeFullName(sb, rawTypeName)
|
||||
switch fd.L1.Kind {
|
||||
@ -489,13 +496,18 @@ func (fd *Field) unmarshalOptions(b []byte) {
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.FieldOptions_Packed_field_number:
|
||||
fd.L1.HasPacked = true
|
||||
fd.L1.IsPacked = protowire.DecodeBool(v)
|
||||
fd.L1.EditionFeatures.IsPacked = protowire.DecodeBool(v)
|
||||
case genid.FieldOptions_Weak_field_number:
|
||||
fd.L1.IsWeak = protowire.DecodeBool(v)
|
||||
case FieldOptions_EnforceUTF8:
|
||||
fd.L1.HasEnforceUTF8 = true
|
||||
fd.L1.EnforceUTF8 = protowire.DecodeBool(v)
|
||||
fd.L1.EditionFeatures.IsUTF8Validated = protowire.DecodeBool(v)
|
||||
}
|
||||
case protowire.BytesType:
|
||||
v, m := protowire.ConsumeBytes(b)
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.FieldOptions_Features_field_number:
|
||||
fd.L1.EditionFeatures = unmarshalFeatureSet(v, fd.L1.EditionFeatures)
|
||||
}
|
||||
default:
|
||||
m := protowire.ConsumeFieldValue(num, typ, b)
|
||||
@ -557,7 +569,6 @@ func (xd *Extension) unmarshalFull(b []byte, sb *strs.Builder) {
|
||||
case genid.FieldDescriptorProto_TypeName_field_number:
|
||||
rawTypeName = v
|
||||
case genid.FieldDescriptorProto_Options_field_number:
|
||||
xd.unmarshalOptions(v)
|
||||
rawOptions = appendOptions(rawOptions, v)
|
||||
}
|
||||
default:
|
||||
@ -577,25 +588,6 @@ func (xd *Extension) unmarshalFull(b []byte, sb *strs.Builder) {
|
||||
xd.L2.Options = xd.L0.ParentFile.builder.optionsUnmarshaler(&descopts.Field, rawOptions)
|
||||
}
|
||||
|
||||
func (xd *Extension) unmarshalOptions(b []byte) {
|
||||
for len(b) > 0 {
|
||||
num, typ, n := protowire.ConsumeTag(b)
|
||||
b = b[n:]
|
||||
switch typ {
|
||||
case protowire.VarintType:
|
||||
v, m := protowire.ConsumeVarint(b)
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.FieldOptions_Packed_field_number:
|
||||
xd.L2.IsPacked = protowire.DecodeBool(v)
|
||||
}
|
||||
default:
|
||||
m := protowire.ConsumeFieldValue(num, typ, b)
|
||||
b = b[m:]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (sd *Service) unmarshalFull(b []byte, sb *strs.Builder) {
|
||||
var rawMethods [][]byte
|
||||
var rawOptions []byte
|
||||
|
11
gateway/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go
generated
vendored
11
gateway/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go
generated
vendored
@ -8,6 +8,7 @@ package filedesc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"google.golang.org/protobuf/internal/descfmt"
|
||||
@ -198,6 +199,16 @@ func (p *Fields) lazyInit() *Fields {
|
||||
if _, ok := p.byText[d.TextName()]; !ok {
|
||||
p.byText[d.TextName()] = d
|
||||
}
|
||||
if isGroupLike(d) {
|
||||
lowerJSONName := strings.ToLower(d.JSONName())
|
||||
if _, ok := p.byJSON[lowerJSONName]; !ok {
|
||||
p.byJSON[lowerJSONName] = d
|
||||
}
|
||||
lowerTextName := strings.ToLower(d.TextName())
|
||||
if _, ok := p.byText[lowerTextName]; !ok {
|
||||
p.byText[lowerTextName] = d
|
||||
}
|
||||
}
|
||||
if _, ok := p.byNum[d.Number()]; !ok {
|
||||
p.byNum[d.Number()] = d
|
||||
}
|
||||
|
156
gateway/vendor/google.golang.org/protobuf/internal/filedesc/editions.go
generated
vendored
Normal file
156
gateway/vendor/google.golang.org/protobuf/internal/filedesc/editions.go
generated
vendored
Normal file
@ -0,0 +1,156 @@
|
||||
// Copyright 2024 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 filedesc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/internal/editiondefaults"
|
||||
"google.golang.org/protobuf/internal/genid"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
var defaultsCache = make(map[Edition]EditionFeatures)
|
||||
var defaultsKeys = []Edition{}
|
||||
|
||||
func init() {
|
||||
unmarshalEditionDefaults(editiondefaults.Defaults)
|
||||
SurrogateProto2.L1.EditionFeatures = getFeaturesFor(EditionProto2)
|
||||
SurrogateProto3.L1.EditionFeatures = getFeaturesFor(EditionProto3)
|
||||
SurrogateEdition2023.L1.EditionFeatures = getFeaturesFor(Edition2023)
|
||||
}
|
||||
|
||||
func unmarshalGoFeature(b []byte, parent EditionFeatures) EditionFeatures {
|
||||
for len(b) > 0 {
|
||||
num, _, n := protowire.ConsumeTag(b)
|
||||
b = b[n:]
|
||||
switch num {
|
||||
case genid.GoFeatures_LegacyUnmarshalJsonEnum_field_number:
|
||||
v, m := protowire.ConsumeVarint(b)
|
||||
b = b[m:]
|
||||
parent.GenerateLegacyUnmarshalJSON = protowire.DecodeBool(v)
|
||||
default:
|
||||
panic(fmt.Sprintf("unkown field number %d while unmarshalling GoFeatures", num))
|
||||
}
|
||||
}
|
||||
return parent
|
||||
}
|
||||
|
||||
func unmarshalFeatureSet(b []byte, parent EditionFeatures) EditionFeatures {
|
||||
for len(b) > 0 {
|
||||
num, typ, n := protowire.ConsumeTag(b)
|
||||
b = b[n:]
|
||||
switch typ {
|
||||
case protowire.VarintType:
|
||||
v, m := protowire.ConsumeVarint(b)
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.FeatureSet_FieldPresence_field_number:
|
||||
parent.IsFieldPresence = v == genid.FeatureSet_EXPLICIT_enum_value || v == genid.FeatureSet_LEGACY_REQUIRED_enum_value
|
||||
parent.IsLegacyRequired = v == genid.FeatureSet_LEGACY_REQUIRED_enum_value
|
||||
case genid.FeatureSet_EnumType_field_number:
|
||||
parent.IsOpenEnum = v == genid.FeatureSet_OPEN_enum_value
|
||||
case genid.FeatureSet_RepeatedFieldEncoding_field_number:
|
||||
parent.IsPacked = v == genid.FeatureSet_PACKED_enum_value
|
||||
case genid.FeatureSet_Utf8Validation_field_number:
|
||||
parent.IsUTF8Validated = v == genid.FeatureSet_VERIFY_enum_value
|
||||
case genid.FeatureSet_MessageEncoding_field_number:
|
||||
parent.IsDelimitedEncoded = v == genid.FeatureSet_DELIMITED_enum_value
|
||||
case genid.FeatureSet_JsonFormat_field_number:
|
||||
parent.IsJSONCompliant = v == genid.FeatureSet_ALLOW_enum_value
|
||||
default:
|
||||
panic(fmt.Sprintf("unkown field number %d while unmarshalling FeatureSet", num))
|
||||
}
|
||||
case protowire.BytesType:
|
||||
v, m := protowire.ConsumeBytes(b)
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.GoFeatures_LegacyUnmarshalJsonEnum_field_number:
|
||||
parent = unmarshalGoFeature(v, parent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return parent
|
||||
}
|
||||
|
||||
func featuresFromParentDesc(parentDesc protoreflect.Descriptor) EditionFeatures {
|
||||
var parentFS EditionFeatures
|
||||
switch p := parentDesc.(type) {
|
||||
case *File:
|
||||
parentFS = p.L1.EditionFeatures
|
||||
case *Message:
|
||||
parentFS = p.L1.EditionFeatures
|
||||
default:
|
||||
panic(fmt.Sprintf("unknown parent type %T", parentDesc))
|
||||
}
|
||||
return parentFS
|
||||
}
|
||||
|
||||
func unmarshalEditionDefault(b []byte) {
|
||||
var ed Edition
|
||||
var fs EditionFeatures
|
||||
for len(b) > 0 {
|
||||
num, typ, n := protowire.ConsumeTag(b)
|
||||
b = b[n:]
|
||||
switch typ {
|
||||
case protowire.VarintType:
|
||||
v, m := protowire.ConsumeVarint(b)
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_number:
|
||||
ed = Edition(v)
|
||||
}
|
||||
case protowire.BytesType:
|
||||
v, m := protowire.ConsumeBytes(b)
|
||||
b = b[m:]
|
||||
switch num {
|
||||
case genid.FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_number:
|
||||
fs = unmarshalFeatureSet(v, fs)
|
||||
case genid.FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_number:
|
||||
fs = unmarshalFeatureSet(v, fs)
|
||||
}
|
||||
}
|
||||
}
|
||||
defaultsCache[ed] = fs
|
||||
defaultsKeys = append(defaultsKeys, ed)
|
||||
}
|
||||
|
||||
func unmarshalEditionDefaults(b []byte) {
|
||||
for len(b) > 0 {
|
||||
num, _, n := protowire.ConsumeTag(b)
|
||||
b = b[n:]
|
||||
switch num {
|
||||
case genid.FeatureSetDefaults_Defaults_field_number:
|
||||
def, m := protowire.ConsumeBytes(b)
|
||||
b = b[m:]
|
||||
unmarshalEditionDefault(def)
|
||||
case genid.FeatureSetDefaults_MinimumEdition_field_number,
|
||||
genid.FeatureSetDefaults_MaximumEdition_field_number:
|
||||
// We don't care about the minimum and maximum editions. If the
|
||||
// edition we are looking for later on is not in the cache we know
|
||||
// it is outside of the range between minimum and maximum edition.
|
||||
_, m := protowire.ConsumeVarint(b)
|
||||
b = b[m:]
|
||||
default:
|
||||
panic(fmt.Sprintf("unkown field number %d while unmarshalling EditionDefault", num))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func getFeaturesFor(ed Edition) EditionFeatures {
|
||||
match := EditionUnknown
|
||||
for _, key := range defaultsKeys {
|
||||
if key > ed {
|
||||
break
|
||||
}
|
||||
match = key
|
||||
}
|
||||
if match == EditionUnknown {
|
||||
panic(fmt.Sprintf("unsupported edition: %v", ed))
|
||||
}
|
||||
return defaultsCache[match]
|
||||
}
|
1
gateway/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go
generated
vendored
1
gateway/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go
generated
vendored
@ -63,6 +63,7 @@ func (e PlaceholderEnum) Options() protoreflect.ProtoMessage { return des
|
||||
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) IsClosed() bool { return false }
|
||||
func (e PlaceholderEnum) ProtoType(protoreflect.EnumDescriptor) { return }
|
||||
func (e PlaceholderEnum) ProtoInternal(pragma.DoNotImplement) { return }
|
||||
|
||||
|
398
gateway/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go
generated
vendored
398
gateway/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go
generated
vendored
@ -12,6 +12,28 @@ 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"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.Edition.
|
||||
const (
|
||||
Edition_EDITION_UNKNOWN_enum_value = 0
|
||||
Edition_EDITION_LEGACY_enum_value = 900
|
||||
Edition_EDITION_PROTO2_enum_value = 998
|
||||
Edition_EDITION_PROTO3_enum_value = 999
|
||||
Edition_EDITION_2023_enum_value = 1000
|
||||
Edition_EDITION_2024_enum_value = 1001
|
||||
Edition_EDITION_1_TEST_ONLY_enum_value = 1
|
||||
Edition_EDITION_2_TEST_ONLY_enum_value = 2
|
||||
Edition_EDITION_99997_TEST_ONLY_enum_value = 99997
|
||||
Edition_EDITION_99998_TEST_ONLY_enum_value = 99998
|
||||
Edition_EDITION_99999_TEST_ONLY_enum_value = 99999
|
||||
Edition_EDITION_MAX_enum_value = 2147483647
|
||||
)
|
||||
|
||||
// Names for google.protobuf.FileDescriptorSet.
|
||||
const (
|
||||
FileDescriptorSet_message_name protoreflect.Name = "FileDescriptorSet"
|
||||
@ -81,7 +103,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 = 13
|
||||
FileDescriptorProto_Edition_field_number protoreflect.FieldNumber = 14
|
||||
)
|
||||
|
||||
// Names for google.protobuf.DescriptorProto.
|
||||
@ -184,10 +206,12 @@ const (
|
||||
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"
|
||||
)
|
||||
|
||||
@ -195,6 +219,7 @@ const (
|
||||
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
|
||||
)
|
||||
|
||||
@ -204,6 +229,12 @@ const (
|
||||
ExtensionRangeOptions_VerificationState_enum_name = "VerificationState"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.ExtensionRangeOptions.VerificationState.
|
||||
const (
|
||||
ExtensionRangeOptions_DECLARATION_enum_value = 0
|
||||
ExtensionRangeOptions_UNVERIFIED_enum_value = 1
|
||||
)
|
||||
|
||||
// Names for google.protobuf.ExtensionRangeOptions.Declaration.
|
||||
const (
|
||||
ExtensionRangeOptions_Declaration_message_name protoreflect.Name = "Declaration"
|
||||
@ -212,29 +243,26 @@ const (
|
||||
|
||||
// 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_IsRepeated_field_name protoreflect.Name = "is_repeated"
|
||||
ExtensionRangeOptions_Declaration_Reserved_field_name protoreflect.Name = "reserved"
|
||||
ExtensionRangeOptions_Declaration_Repeated_field_name protoreflect.Name = "repeated"
|
||||
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_IsRepeated_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.is_repeated"
|
||||
ExtensionRangeOptions_Declaration_Reserved_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.reserved"
|
||||
ExtensionRangeOptions_Declaration_Repeated_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.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_IsRepeated_field_number protoreflect.FieldNumber = 4
|
||||
ExtensionRangeOptions_Declaration_Reserved_field_number protoreflect.FieldNumber = 5
|
||||
ExtensionRangeOptions_Declaration_Repeated_field_number protoreflect.FieldNumber = 6
|
||||
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.
|
||||
@ -291,12 +319,41 @@ const (
|
||||
FieldDescriptorProto_Type_enum_name = "Type"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.FieldDescriptorProto.Type.
|
||||
const (
|
||||
FieldDescriptorProto_TYPE_DOUBLE_enum_value = 1
|
||||
FieldDescriptorProto_TYPE_FLOAT_enum_value = 2
|
||||
FieldDescriptorProto_TYPE_INT64_enum_value = 3
|
||||
FieldDescriptorProto_TYPE_UINT64_enum_value = 4
|
||||
FieldDescriptorProto_TYPE_INT32_enum_value = 5
|
||||
FieldDescriptorProto_TYPE_FIXED64_enum_value = 6
|
||||
FieldDescriptorProto_TYPE_FIXED32_enum_value = 7
|
||||
FieldDescriptorProto_TYPE_BOOL_enum_value = 8
|
||||
FieldDescriptorProto_TYPE_STRING_enum_value = 9
|
||||
FieldDescriptorProto_TYPE_GROUP_enum_value = 10
|
||||
FieldDescriptorProto_TYPE_MESSAGE_enum_value = 11
|
||||
FieldDescriptorProto_TYPE_BYTES_enum_value = 12
|
||||
FieldDescriptorProto_TYPE_UINT32_enum_value = 13
|
||||
FieldDescriptorProto_TYPE_ENUM_enum_value = 14
|
||||
FieldDescriptorProto_TYPE_SFIXED32_enum_value = 15
|
||||
FieldDescriptorProto_TYPE_SFIXED64_enum_value = 16
|
||||
FieldDescriptorProto_TYPE_SINT32_enum_value = 17
|
||||
FieldDescriptorProto_TYPE_SINT64_enum_value = 18
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FieldDescriptorProto.Label.
|
||||
const (
|
||||
FieldDescriptorProto_Label_enum_fullname = "google.protobuf.FieldDescriptorProto.Label"
|
||||
FieldDescriptorProto_Label_enum_name = "Label"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.FieldDescriptorProto.Label.
|
||||
const (
|
||||
FieldDescriptorProto_LABEL_OPTIONAL_enum_value = 1
|
||||
FieldDescriptorProto_LABEL_REPEATED_enum_value = 3
|
||||
FieldDescriptorProto_LABEL_REQUIRED_enum_value = 2
|
||||
)
|
||||
|
||||
// Names for google.protobuf.OneofDescriptorProto.
|
||||
const (
|
||||
OneofDescriptorProto_message_name protoreflect.Name = "OneofDescriptorProto"
|
||||
@ -468,7 +525,6 @@ const (
|
||||
FileOptions_CcGenericServices_field_name protoreflect.Name = "cc_generic_services"
|
||||
FileOptions_JavaGenericServices_field_name protoreflect.Name = "java_generic_services"
|
||||
FileOptions_PyGenericServices_field_name protoreflect.Name = "py_generic_services"
|
||||
FileOptions_PhpGenericServices_field_name protoreflect.Name = "php_generic_services"
|
||||
FileOptions_Deprecated_field_name protoreflect.Name = "deprecated"
|
||||
FileOptions_CcEnableArenas_field_name protoreflect.Name = "cc_enable_arenas"
|
||||
FileOptions_ObjcClassPrefix_field_name protoreflect.Name = "objc_class_prefix"
|
||||
@ -478,6 +534,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"
|
||||
@ -490,7 +547,6 @@ const (
|
||||
FileOptions_CcGenericServices_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.cc_generic_services"
|
||||
FileOptions_JavaGenericServices_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.java_generic_services"
|
||||
FileOptions_PyGenericServices_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.py_generic_services"
|
||||
FileOptions_PhpGenericServices_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.php_generic_services"
|
||||
FileOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.deprecated"
|
||||
FileOptions_CcEnableArenas_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.cc_enable_arenas"
|
||||
FileOptions_ObjcClassPrefix_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.objc_class_prefix"
|
||||
@ -500,6 +556,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"
|
||||
)
|
||||
|
||||
@ -515,7 +572,6 @@ const (
|
||||
FileOptions_CcGenericServices_field_number protoreflect.FieldNumber = 16
|
||||
FileOptions_JavaGenericServices_field_number protoreflect.FieldNumber = 17
|
||||
FileOptions_PyGenericServices_field_number protoreflect.FieldNumber = 18
|
||||
FileOptions_PhpGenericServices_field_number protoreflect.FieldNumber = 42
|
||||
FileOptions_Deprecated_field_number protoreflect.FieldNumber = 23
|
||||
FileOptions_CcEnableArenas_field_number protoreflect.FieldNumber = 31
|
||||
FileOptions_ObjcClassPrefix_field_number protoreflect.FieldNumber = 36
|
||||
@ -525,6 +581,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
|
||||
)
|
||||
|
||||
@ -534,6 +591,13 @@ const (
|
||||
FileOptions_OptimizeMode_enum_name = "OptimizeMode"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.FileOptions.OptimizeMode.
|
||||
const (
|
||||
FileOptions_SPEED_enum_value = 1
|
||||
FileOptions_CODE_SIZE_enum_value = 2
|
||||
FileOptions_LITE_RUNTIME_enum_value = 3
|
||||
)
|
||||
|
||||
// Names for google.protobuf.MessageOptions.
|
||||
const (
|
||||
MessageOptions_message_name protoreflect.Name = "MessageOptions"
|
||||
@ -547,6 +611,7 @@ const (
|
||||
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"
|
||||
@ -554,6 +619,7 @@ const (
|
||||
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"
|
||||
)
|
||||
|
||||
@ -564,6 +630,7 @@ const (
|
||||
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
|
||||
)
|
||||
|
||||
@ -584,8 +651,10 @@ const (
|
||||
FieldOptions_Weak_field_name protoreflect.Name = "weak"
|
||||
FieldOptions_DebugRedact_field_name protoreflect.Name = "debug_redact"
|
||||
FieldOptions_Retention_field_name protoreflect.Name = "retention"
|
||||
FieldOptions_Target_field_name protoreflect.Name = "target"
|
||||
FieldOptions_Targets_field_name protoreflect.Name = "targets"
|
||||
FieldOptions_EditionDefaults_field_name protoreflect.Name = "edition_defaults"
|
||||
FieldOptions_Features_field_name protoreflect.Name = "features"
|
||||
FieldOptions_FeatureSupport_field_name protoreflect.Name = "feature_support"
|
||||
FieldOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
|
||||
FieldOptions_Ctype_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.ctype"
|
||||
@ -597,8 +666,10 @@ const (
|
||||
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_Target_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.target"
|
||||
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_FeatureSupport_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.feature_support"
|
||||
FieldOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.uninterpreted_option"
|
||||
)
|
||||
|
||||
@ -613,8 +684,10 @@ const (
|
||||
FieldOptions_Weak_field_number protoreflect.FieldNumber = 10
|
||||
FieldOptions_DebugRedact_field_number protoreflect.FieldNumber = 16
|
||||
FieldOptions_Retention_field_number protoreflect.FieldNumber = 17
|
||||
FieldOptions_Target_field_number protoreflect.FieldNumber = 18
|
||||
FieldOptions_Targets_field_number protoreflect.FieldNumber = 19
|
||||
FieldOptions_EditionDefaults_field_number protoreflect.FieldNumber = 20
|
||||
FieldOptions_Features_field_number protoreflect.FieldNumber = 21
|
||||
FieldOptions_FeatureSupport_field_number protoreflect.FieldNumber = 22
|
||||
FieldOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
)
|
||||
|
||||
@ -624,24 +697,107 @@ const (
|
||||
FieldOptions_CType_enum_name = "CType"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.FieldOptions.CType.
|
||||
const (
|
||||
FieldOptions_STRING_enum_value = 0
|
||||
FieldOptions_CORD_enum_value = 1
|
||||
FieldOptions_STRING_PIECE_enum_value = 2
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FieldOptions.JSType.
|
||||
const (
|
||||
FieldOptions_JSType_enum_fullname = "google.protobuf.FieldOptions.JSType"
|
||||
FieldOptions_JSType_enum_name = "JSType"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.FieldOptions.JSType.
|
||||
const (
|
||||
FieldOptions_JS_NORMAL_enum_value = 0
|
||||
FieldOptions_JS_STRING_enum_value = 1
|
||||
FieldOptions_JS_NUMBER_enum_value = 2
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FieldOptions.OptionRetention.
|
||||
const (
|
||||
FieldOptions_OptionRetention_enum_fullname = "google.protobuf.FieldOptions.OptionRetention"
|
||||
FieldOptions_OptionRetention_enum_name = "OptionRetention"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.FieldOptions.OptionRetention.
|
||||
const (
|
||||
FieldOptions_RETENTION_UNKNOWN_enum_value = 0
|
||||
FieldOptions_RETENTION_RUNTIME_enum_value = 1
|
||||
FieldOptions_RETENTION_SOURCE_enum_value = 2
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FieldOptions.OptionTargetType.
|
||||
const (
|
||||
FieldOptions_OptionTargetType_enum_fullname = "google.protobuf.FieldOptions.OptionTargetType"
|
||||
FieldOptions_OptionTargetType_enum_name = "OptionTargetType"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.FieldOptions.OptionTargetType.
|
||||
const (
|
||||
FieldOptions_TARGET_TYPE_UNKNOWN_enum_value = 0
|
||||
FieldOptions_TARGET_TYPE_FILE_enum_value = 1
|
||||
FieldOptions_TARGET_TYPE_EXTENSION_RANGE_enum_value = 2
|
||||
FieldOptions_TARGET_TYPE_MESSAGE_enum_value = 3
|
||||
FieldOptions_TARGET_TYPE_FIELD_enum_value = 4
|
||||
FieldOptions_TARGET_TYPE_ONEOF_enum_value = 5
|
||||
FieldOptions_TARGET_TYPE_ENUM_enum_value = 6
|
||||
FieldOptions_TARGET_TYPE_ENUM_ENTRY_enum_value = 7
|
||||
FieldOptions_TARGET_TYPE_SERVICE_enum_value = 8
|
||||
FieldOptions_TARGET_TYPE_METHOD_enum_value = 9
|
||||
)
|
||||
|
||||
// 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.FieldOptions.FeatureSupport.
|
||||
const (
|
||||
FieldOptions_FeatureSupport_message_name protoreflect.Name = "FeatureSupport"
|
||||
FieldOptions_FeatureSupport_message_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport"
|
||||
)
|
||||
|
||||
// Field names for google.protobuf.FieldOptions.FeatureSupport.
|
||||
const (
|
||||
FieldOptions_FeatureSupport_EditionIntroduced_field_name protoreflect.Name = "edition_introduced"
|
||||
FieldOptions_FeatureSupport_EditionDeprecated_field_name protoreflect.Name = "edition_deprecated"
|
||||
FieldOptions_FeatureSupport_DeprecationWarning_field_name protoreflect.Name = "deprecation_warning"
|
||||
FieldOptions_FeatureSupport_EditionRemoved_field_name protoreflect.Name = "edition_removed"
|
||||
|
||||
FieldOptions_FeatureSupport_EditionIntroduced_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_introduced"
|
||||
FieldOptions_FeatureSupport_EditionDeprecated_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_deprecated"
|
||||
FieldOptions_FeatureSupport_DeprecationWarning_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.deprecation_warning"
|
||||
FieldOptions_FeatureSupport_EditionRemoved_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.FeatureSupport.edition_removed"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.FieldOptions.FeatureSupport.
|
||||
const (
|
||||
FieldOptions_FeatureSupport_EditionIntroduced_field_number protoreflect.FieldNumber = 1
|
||||
FieldOptions_FeatureSupport_EditionDeprecated_field_number protoreflect.FieldNumber = 2
|
||||
FieldOptions_FeatureSupport_DeprecationWarning_field_number protoreflect.FieldNumber = 3
|
||||
FieldOptions_FeatureSupport_EditionRemoved_field_number protoreflect.FieldNumber = 4
|
||||
)
|
||||
|
||||
// Names for google.protobuf.OneofOptions.
|
||||
const (
|
||||
OneofOptions_message_name protoreflect.Name = "OneofOptions"
|
||||
@ -650,13 +806,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
|
||||
)
|
||||
|
||||
@ -671,11 +830,13 @@ const (
|
||||
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_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"
|
||||
)
|
||||
|
||||
@ -684,6 +845,7 @@ const (
|
||||
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
|
||||
)
|
||||
|
||||
@ -696,15 +858,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
|
||||
)
|
||||
|
||||
@ -716,15 +884,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
|
||||
)
|
||||
@ -739,10 +910,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"
|
||||
)
|
||||
|
||||
@ -750,6 +923,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
|
||||
)
|
||||
|
||||
@ -759,6 +933,13 @@ const (
|
||||
MethodOptions_IdempotencyLevel_enum_name = "IdempotencyLevel"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.MethodOptions.IdempotencyLevel.
|
||||
const (
|
||||
MethodOptions_IDEMPOTENCY_UNKNOWN_enum_value = 0
|
||||
MethodOptions_NO_SIDE_EFFECTS_enum_value = 1
|
||||
MethodOptions_IDEMPOTENT_enum_value = 2
|
||||
)
|
||||
|
||||
// Names for google.protobuf.UninterpretedOption.
|
||||
const (
|
||||
UninterpretedOption_message_name protoreflect.Name = "UninterpretedOption"
|
||||
@ -816,6 +997,166 @@ 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"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.FeatureSet.FieldPresence.
|
||||
const (
|
||||
FeatureSet_FIELD_PRESENCE_UNKNOWN_enum_value = 0
|
||||
FeatureSet_EXPLICIT_enum_value = 1
|
||||
FeatureSet_IMPLICIT_enum_value = 2
|
||||
FeatureSet_LEGACY_REQUIRED_enum_value = 3
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FeatureSet.EnumType.
|
||||
const (
|
||||
FeatureSet_EnumType_enum_fullname = "google.protobuf.FeatureSet.EnumType"
|
||||
FeatureSet_EnumType_enum_name = "EnumType"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.FeatureSet.EnumType.
|
||||
const (
|
||||
FeatureSet_ENUM_TYPE_UNKNOWN_enum_value = 0
|
||||
FeatureSet_OPEN_enum_value = 1
|
||||
FeatureSet_CLOSED_enum_value = 2
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FeatureSet.RepeatedFieldEncoding.
|
||||
const (
|
||||
FeatureSet_RepeatedFieldEncoding_enum_fullname = "google.protobuf.FeatureSet.RepeatedFieldEncoding"
|
||||
FeatureSet_RepeatedFieldEncoding_enum_name = "RepeatedFieldEncoding"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.FeatureSet.RepeatedFieldEncoding.
|
||||
const (
|
||||
FeatureSet_REPEATED_FIELD_ENCODING_UNKNOWN_enum_value = 0
|
||||
FeatureSet_PACKED_enum_value = 1
|
||||
FeatureSet_EXPANDED_enum_value = 2
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FeatureSet.Utf8Validation.
|
||||
const (
|
||||
FeatureSet_Utf8Validation_enum_fullname = "google.protobuf.FeatureSet.Utf8Validation"
|
||||
FeatureSet_Utf8Validation_enum_name = "Utf8Validation"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.FeatureSet.Utf8Validation.
|
||||
const (
|
||||
FeatureSet_UTF8_VALIDATION_UNKNOWN_enum_value = 0
|
||||
FeatureSet_VERIFY_enum_value = 2
|
||||
FeatureSet_NONE_enum_value = 3
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FeatureSet.MessageEncoding.
|
||||
const (
|
||||
FeatureSet_MessageEncoding_enum_fullname = "google.protobuf.FeatureSet.MessageEncoding"
|
||||
FeatureSet_MessageEncoding_enum_name = "MessageEncoding"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.FeatureSet.MessageEncoding.
|
||||
const (
|
||||
FeatureSet_MESSAGE_ENCODING_UNKNOWN_enum_value = 0
|
||||
FeatureSet_LENGTH_PREFIXED_enum_value = 1
|
||||
FeatureSet_DELIMITED_enum_value = 2
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FeatureSet.JsonFormat.
|
||||
const (
|
||||
FeatureSet_JsonFormat_enum_fullname = "google.protobuf.FeatureSet.JsonFormat"
|
||||
FeatureSet_JsonFormat_enum_name = "JsonFormat"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.FeatureSet.JsonFormat.
|
||||
const (
|
||||
FeatureSet_JSON_FORMAT_UNKNOWN_enum_value = 0
|
||||
FeatureSet_ALLOW_enum_value = 1
|
||||
FeatureSet_LEGACY_BEST_EFFORT_enum_value = 2
|
||||
)
|
||||
|
||||
// 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_OverridableFeatures_field_name protoreflect.Name = "overridable_features"
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_name protoreflect.Name = "fixed_features"
|
||||
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition"
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridable_features"
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixed_features"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.
|
||||
const (
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_number protoreflect.FieldNumber = 3
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_OverridableFeatures_field_number protoreflect.FieldNumber = 4
|
||||
FeatureSetDefaults_FeatureSetEditionDefault_FixedFeatures_field_number protoreflect.FieldNumber = 5
|
||||
)
|
||||
|
||||
// Names for google.protobuf.SourceCodeInfo.
|
||||
const (
|
||||
SourceCodeInfo_message_name protoreflect.Name = "SourceCodeInfo"
|
||||
@ -917,3 +1258,10 @@ const (
|
||||
GeneratedCodeInfo_Annotation_Semantic_enum_fullname = "google.protobuf.GeneratedCodeInfo.Annotation.Semantic"
|
||||
GeneratedCodeInfo_Annotation_Semantic_enum_name = "Semantic"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.GeneratedCodeInfo.Annotation.Semantic.
|
||||
const (
|
||||
GeneratedCodeInfo_Annotation_NONE_enum_value = 0
|
||||
GeneratedCodeInfo_Annotation_SET_enum_value = 1
|
||||
GeneratedCodeInfo_Annotation_ALIAS_enum_value = 2
|
||||
)
|
||||
|
31
gateway/vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go
generated
vendored
Normal file
31
gateway/vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
// Copyright 2019 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.
|
||||
|
||||
// Code generated by generate-protos. DO NOT EDIT.
|
||||
|
||||
package genid
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
const File_google_protobuf_go_features_proto = "google/protobuf/go_features.proto"
|
||||
|
||||
// Names for google.protobuf.GoFeatures.
|
||||
const (
|
||||
GoFeatures_message_name protoreflect.Name = "GoFeatures"
|
||||
GoFeatures_message_fullname protoreflect.FullName = "google.protobuf.GoFeatures"
|
||||
)
|
||||
|
||||
// Field names for google.protobuf.GoFeatures.
|
||||
const (
|
||||
GoFeatures_LegacyUnmarshalJsonEnum_field_name protoreflect.Name = "legacy_unmarshal_json_enum"
|
||||
|
||||
GoFeatures_LegacyUnmarshalJsonEnum_field_fullname protoreflect.FullName = "google.protobuf.GoFeatures.legacy_unmarshal_json_enum"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.GoFeatures.
|
||||
const (
|
||||
GoFeatures_LegacyUnmarshalJsonEnum_field_number protoreflect.FieldNumber = 1
|
||||
)
|
5
gateway/vendor/google.golang.org/protobuf/internal/genid/struct_gen.go
generated
vendored
5
gateway/vendor/google.golang.org/protobuf/internal/genid/struct_gen.go
generated
vendored
@ -18,6 +18,11 @@ const (
|
||||
NullValue_enum_name = "NullValue"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.NullValue.
|
||||
const (
|
||||
NullValue_NULL_VALUE_enum_value = 0
|
||||
)
|
||||
|
||||
// Names for google.protobuf.Struct.
|
||||
const (
|
||||
Struct_message_name protoreflect.Name = "Struct"
|
||||
|
38
gateway/vendor/google.golang.org/protobuf/internal/genid/type_gen.go
generated
vendored
38
gateway/vendor/google.golang.org/protobuf/internal/genid/type_gen.go
generated
vendored
@ -18,6 +18,13 @@ const (
|
||||
Syntax_enum_name = "Syntax"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.Syntax.
|
||||
const (
|
||||
Syntax_SYNTAX_PROTO2_enum_value = 0
|
||||
Syntax_SYNTAX_PROTO3_enum_value = 1
|
||||
Syntax_SYNTAX_EDITIONS_enum_value = 2
|
||||
)
|
||||
|
||||
// Names for google.protobuf.Type.
|
||||
const (
|
||||
Type_message_name protoreflect.Name = "Type"
|
||||
@ -105,12 +112,43 @@ const (
|
||||
Field_Kind_enum_name = "Kind"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.Field.Kind.
|
||||
const (
|
||||
Field_TYPE_UNKNOWN_enum_value = 0
|
||||
Field_TYPE_DOUBLE_enum_value = 1
|
||||
Field_TYPE_FLOAT_enum_value = 2
|
||||
Field_TYPE_INT64_enum_value = 3
|
||||
Field_TYPE_UINT64_enum_value = 4
|
||||
Field_TYPE_INT32_enum_value = 5
|
||||
Field_TYPE_FIXED64_enum_value = 6
|
||||
Field_TYPE_FIXED32_enum_value = 7
|
||||
Field_TYPE_BOOL_enum_value = 8
|
||||
Field_TYPE_STRING_enum_value = 9
|
||||
Field_TYPE_GROUP_enum_value = 10
|
||||
Field_TYPE_MESSAGE_enum_value = 11
|
||||
Field_TYPE_BYTES_enum_value = 12
|
||||
Field_TYPE_UINT32_enum_value = 13
|
||||
Field_TYPE_ENUM_enum_value = 14
|
||||
Field_TYPE_SFIXED32_enum_value = 15
|
||||
Field_TYPE_SFIXED64_enum_value = 16
|
||||
Field_TYPE_SINT32_enum_value = 17
|
||||
Field_TYPE_SINT64_enum_value = 18
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.Field.Cardinality.
|
||||
const (
|
||||
Field_Cardinality_enum_fullname = "google.protobuf.Field.Cardinality"
|
||||
Field_Cardinality_enum_name = "Cardinality"
|
||||
)
|
||||
|
||||
// Enum values for google.protobuf.Field.Cardinality.
|
||||
const (
|
||||
Field_CARDINALITY_UNKNOWN_enum_value = 0
|
||||
Field_CARDINALITY_OPTIONAL_enum_value = 1
|
||||
Field_CARDINALITY_REQUIRED_enum_value = 2
|
||||
Field_CARDINALITY_REPEATED_enum_value = 3
|
||||
)
|
||||
|
||||
// Names for google.protobuf.Enum.
|
||||
const (
|
||||
Enum_message_name protoreflect.Name = "Enum"
|
||||
|
22
gateway/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go
generated
vendored
22
gateway/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go
generated
vendored
@ -21,26 +21,18 @@ type extensionFieldInfo struct {
|
||||
validation validationInfo
|
||||
}
|
||||
|
||||
var legacyExtensionFieldInfoCache sync.Map // map[protoreflect.ExtensionType]*extensionFieldInfo
|
||||
|
||||
func getExtensionFieldInfo(xt protoreflect.ExtensionType) *extensionFieldInfo {
|
||||
if xi, ok := xt.(*ExtensionInfo); ok {
|
||||
xi.lazyInit()
|
||||
return xi.info
|
||||
}
|
||||
return legacyLoadExtensionFieldInfo(xt)
|
||||
}
|
||||
|
||||
// legacyLoadExtensionFieldInfo dynamically loads a *ExtensionInfo for xt.
|
||||
func legacyLoadExtensionFieldInfo(xt protoreflect.ExtensionType) *extensionFieldInfo {
|
||||
if xi, ok := legacyExtensionFieldInfoCache.Load(xt); ok {
|
||||
return xi.(*extensionFieldInfo)
|
||||
}
|
||||
e := makeExtensionFieldInfo(xt.TypeDescriptor())
|
||||
if e, ok := legacyMessageTypeCache.LoadOrStore(xt, e); ok {
|
||||
return e.(*extensionFieldInfo)
|
||||
}
|
||||
return e
|
||||
// Ideally we'd cache the resulting *extensionFieldInfo so we don't have to
|
||||
// recompute this metadata repeatedly. But without support for something like
|
||||
// weak references, such a cache would pin temporary values (like dynamic
|
||||
// extension types, constructed for the duration of a user request) to the
|
||||
// heap forever, causing memory usage of the cache to grow unbounded.
|
||||
// See discussion in https://github.com/golang/protobuf/issues/1521.
|
||||
return makeExtensionFieldInfo(xt.TypeDescriptor())
|
||||
}
|
||||
|
||||
func makeExtensionFieldInfo(xd protoreflect.ExtensionDescriptor) *extensionFieldInfo {
|
||||
|
64
gateway/vendor/google.golang.org/protobuf/internal/impl/codec_field.go
generated
vendored
64
gateway/vendor/google.golang.org/protobuf/internal/impl/codec_field.go
generated
vendored
@ -233,9 +233,15 @@ func sizeMessageInfo(p pointer, f *coderFieldInfo, opts marshalOptions) int {
|
||||
}
|
||||
|
||||
func appendMessageInfo(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
|
||||
calculatedSize := f.mi.sizePointer(p.Elem(), opts)
|
||||
b = protowire.AppendVarint(b, f.wiretag)
|
||||
b = protowire.AppendVarint(b, uint64(f.mi.sizePointer(p.Elem(), opts)))
|
||||
return f.mi.marshalAppendPointer(b, p.Elem(), opts)
|
||||
b = protowire.AppendVarint(b, uint64(calculatedSize))
|
||||
before := len(b)
|
||||
b, err := f.mi.marshalAppendPointer(b, p.Elem(), opts)
|
||||
if measuredSize := len(b) - before; calculatedSize != measuredSize && err == nil {
|
||||
return nil, errors.MismatchedSizeCalculation(calculatedSize, measuredSize)
|
||||
}
|
||||
return b, err
|
||||
}
|
||||
|
||||
func consumeMessageInfo(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
@ -262,14 +268,21 @@ func isInitMessageInfo(p pointer, f *coderFieldInfo) error {
|
||||
return f.mi.checkInitializedPointer(p.Elem())
|
||||
}
|
||||
|
||||
func sizeMessage(m proto.Message, tagsize int, _ marshalOptions) int {
|
||||
return protowire.SizeBytes(proto.Size(m)) + tagsize
|
||||
func sizeMessage(m proto.Message, tagsize int, opts marshalOptions) int {
|
||||
return protowire.SizeBytes(opts.Options().Size(m)) + tagsize
|
||||
}
|
||||
|
||||
func appendMessage(b []byte, m proto.Message, wiretag uint64, opts marshalOptions) ([]byte, error) {
|
||||
mopts := opts.Options()
|
||||
calculatedSize := mopts.Size(m)
|
||||
b = protowire.AppendVarint(b, wiretag)
|
||||
b = protowire.AppendVarint(b, uint64(proto.Size(m)))
|
||||
return opts.Options().MarshalAppend(b, m)
|
||||
b = protowire.AppendVarint(b, uint64(calculatedSize))
|
||||
before := len(b)
|
||||
b, err := mopts.MarshalAppend(b, m)
|
||||
if measuredSize := len(b) - before; calculatedSize != measuredSize && err == nil {
|
||||
return nil, errors.MismatchedSizeCalculation(calculatedSize, measuredSize)
|
||||
}
|
||||
return b, err
|
||||
}
|
||||
|
||||
func consumeMessage(b []byte, m proto.Message, wtyp protowire.Type, opts unmarshalOptions) (out unmarshalOutput, err error) {
|
||||
@ -405,8 +418,8 @@ func consumeGroupType(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInf
|
||||
return f.mi.unmarshalPointer(b, p.Elem(), f.num, opts)
|
||||
}
|
||||
|
||||
func sizeGroup(m proto.Message, tagsize int, _ marshalOptions) int {
|
||||
return 2*tagsize + proto.Size(m)
|
||||
func sizeGroup(m proto.Message, tagsize int, opts marshalOptions) int {
|
||||
return 2*tagsize + opts.Options().Size(m)
|
||||
}
|
||||
|
||||
func appendGroup(b []byte, m proto.Message, wiretag uint64, opts marshalOptions) ([]byte, error) {
|
||||
@ -482,10 +495,14 @@ func appendMessageSliceInfo(b []byte, p pointer, f *coderFieldInfo, opts marshal
|
||||
b = protowire.AppendVarint(b, f.wiretag)
|
||||
siz := f.mi.sizePointer(v, opts)
|
||||
b = protowire.AppendVarint(b, uint64(siz))
|
||||
before := len(b)
|
||||
b, err = f.mi.marshalAppendPointer(b, v, opts)
|
||||
if err != nil {
|
||||
return b, err
|
||||
}
|
||||
if measuredSize := len(b) - before; siz != measuredSize {
|
||||
return nil, errors.MismatchedSizeCalculation(siz, measuredSize)
|
||||
}
|
||||
}
|
||||
return b, nil
|
||||
}
|
||||
@ -520,28 +537,34 @@ func isInitMessageSliceInfo(p pointer, f *coderFieldInfo) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func sizeMessageSlice(p pointer, goType reflect.Type, tagsize int, _ marshalOptions) int {
|
||||
func sizeMessageSlice(p pointer, goType reflect.Type, tagsize int, opts marshalOptions) int {
|
||||
mopts := opts.Options()
|
||||
s := p.PointerSlice()
|
||||
n := 0
|
||||
for _, v := range s {
|
||||
m := asMessage(v.AsValueOf(goType.Elem()))
|
||||
n += protowire.SizeBytes(proto.Size(m)) + tagsize
|
||||
n += protowire.SizeBytes(mopts.Size(m)) + tagsize
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func appendMessageSlice(b []byte, p pointer, wiretag uint64, goType reflect.Type, opts marshalOptions) ([]byte, error) {
|
||||
mopts := opts.Options()
|
||||
s := p.PointerSlice()
|
||||
var err error
|
||||
for _, v := range s {
|
||||
m := asMessage(v.AsValueOf(goType.Elem()))
|
||||
b = protowire.AppendVarint(b, wiretag)
|
||||
siz := proto.Size(m)
|
||||
siz := mopts.Size(m)
|
||||
b = protowire.AppendVarint(b, uint64(siz))
|
||||
b, err = opts.Options().MarshalAppend(b, m)
|
||||
before := len(b)
|
||||
b, err = mopts.MarshalAppend(b, m)
|
||||
if err != nil {
|
||||
return b, err
|
||||
}
|
||||
if measuredSize := len(b) - before; siz != measuredSize {
|
||||
return nil, errors.MismatchedSizeCalculation(siz, measuredSize)
|
||||
}
|
||||
}
|
||||
return b, nil
|
||||
}
|
||||
@ -582,11 +605,12 @@ func isInitMessageSlice(p pointer, goType reflect.Type) error {
|
||||
// Slices of messages
|
||||
|
||||
func sizeMessageSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) int {
|
||||
mopts := opts.Options()
|
||||
list := listv.List()
|
||||
n := 0
|
||||
for i, llen := 0, list.Len(); i < llen; i++ {
|
||||
m := list.Get(i).Message().Interface()
|
||||
n += protowire.SizeBytes(proto.Size(m)) + tagsize
|
||||
n += protowire.SizeBytes(mopts.Size(m)) + tagsize
|
||||
}
|
||||
return n
|
||||
}
|
||||
@ -597,13 +621,17 @@ func appendMessageSliceValue(b []byte, listv protoreflect.Value, wiretag uint64,
|
||||
for i, llen := 0, list.Len(); i < llen; i++ {
|
||||
m := list.Get(i).Message().Interface()
|
||||
b = protowire.AppendVarint(b, wiretag)
|
||||
siz := proto.Size(m)
|
||||
siz := mopts.Size(m)
|
||||
b = protowire.AppendVarint(b, uint64(siz))
|
||||
before := len(b)
|
||||
var err error
|
||||
b, err = mopts.MarshalAppend(b, m)
|
||||
if err != nil {
|
||||
return b, err
|
||||
}
|
||||
if measuredSize := len(b) - before; siz != measuredSize {
|
||||
return nil, errors.MismatchedSizeCalculation(siz, measuredSize)
|
||||
}
|
||||
}
|
||||
return b, nil
|
||||
}
|
||||
@ -651,11 +679,12 @@ var coderMessageSliceValue = valueCoderFuncs{
|
||||
}
|
||||
|
||||
func sizeGroupSliceValue(listv protoreflect.Value, tagsize int, opts marshalOptions) int {
|
||||
mopts := opts.Options()
|
||||
list := listv.List()
|
||||
n := 0
|
||||
for i, llen := 0, list.Len(); i < llen; i++ {
|
||||
m := list.Get(i).Message().Interface()
|
||||
n += 2*tagsize + proto.Size(m)
|
||||
n += 2*tagsize + mopts.Size(m)
|
||||
}
|
||||
return n
|
||||
}
|
||||
@ -738,12 +767,13 @@ func makeGroupSliceFieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type)
|
||||
}
|
||||
}
|
||||
|
||||
func sizeGroupSlice(p pointer, messageType reflect.Type, tagsize int, _ marshalOptions) int {
|
||||
func sizeGroupSlice(p pointer, messageType reflect.Type, tagsize int, opts marshalOptions) int {
|
||||
mopts := opts.Options()
|
||||
s := p.PointerSlice()
|
||||
n := 0
|
||||
for _, v := range s {
|
||||
m := asMessage(v.AsValueOf(messageType.Elem()))
|
||||
n += 2*tagsize + proto.Size(m)
|
||||
n += 2*tagsize + mopts.Size(m)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
113
gateway/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go
generated
vendored
113
gateway/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 {
|
||||
|
15
gateway/vendor/google.golang.org/protobuf/internal/impl/codec_map.go
generated
vendored
15
gateway/vendor/google.golang.org/protobuf/internal/impl/codec_map.go
generated
vendored
@ -9,6 +9,7 @@ import (
|
||||
"sort"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/internal/errors"
|
||||
"google.golang.org/protobuf/internal/genid"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
@ -240,11 +241,16 @@ func appendMapItem(b []byte, keyrv, valrv reflect.Value, mapi *mapInfo, f *coder
|
||||
size += mapi.keyFuncs.size(key.Value(), mapKeyTagSize, opts)
|
||||
size += mapi.valFuncs.size(val, mapValTagSize, opts)
|
||||
b = protowire.AppendVarint(b, uint64(size))
|
||||
before := len(b)
|
||||
b, err := mapi.keyFuncs.marshal(b, key.Value(), mapi.keyWiretag, opts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return mapi.valFuncs.marshal(b, val, mapi.valWiretag, opts)
|
||||
b, err = mapi.valFuncs.marshal(b, val, mapi.valWiretag, opts)
|
||||
if measuredSize := len(b) - before; size != measuredSize && err == nil {
|
||||
return nil, errors.MismatchedSizeCalculation(size, measuredSize)
|
||||
}
|
||||
return b, err
|
||||
} else {
|
||||
key := mapi.conv.keyConv.PBValueOf(keyrv).MapKey()
|
||||
val := pointerOfValue(valrv)
|
||||
@ -259,7 +265,12 @@ func appendMapItem(b []byte, keyrv, valrv reflect.Value, mapi *mapInfo, f *coder
|
||||
}
|
||||
b = protowire.AppendVarint(b, mapi.valWiretag)
|
||||
b = protowire.AppendVarint(b, uint64(valSize))
|
||||
return f.mi.marshalAppendPointer(b, val, opts)
|
||||
before := len(b)
|
||||
b, err = f.mi.marshalAppendPointer(b, val, opts)
|
||||
if measuredSize := len(b) - before; valSize != measuredSize && err == nil {
|
||||
return nil, errors.MismatchedSizeCalculation(valSize, measuredSize)
|
||||
}
|
||||
return b, err
|
||||
}
|
||||
}
|
||||
|
||||
|
2
gateway/vendor/google.golang.org/protobuf/internal/impl/codec_tables.go
generated
vendored
2
gateway/vendor/google.golang.org/protobuf/internal/impl/codec_tables.go
generated
vendored
@ -197,7 +197,7 @@ func fieldCoder(fd protoreflect.FieldDescriptor, ft reflect.Type) (*MessageInfo,
|
||||
return getMessageInfo(ft), makeMessageFieldCoder(fd, ft)
|
||||
case fd.Kind() == protoreflect.GroupKind:
|
||||
return getMessageInfo(ft), makeGroupFieldCoder(fd, ft)
|
||||
case fd.Syntax() == protoreflect.Proto3 && fd.ContainingOneof() == nil:
|
||||
case !fd.HasPresence() && 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() {
|
||||
|
1
gateway/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go
generated
vendored
1
gateway/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go
generated
vendored
@ -167,6 +167,7 @@ func aberrantLoadEnumDesc(t reflect.Type) protoreflect.EnumDescriptor {
|
||||
ed := &filedesc.Enum{L2: new(filedesc.EnumL2)}
|
||||
ed.L0.FullName = AberrantDeriveFullName(t) // e.g., github_com.user.repo.MyEnum
|
||||
ed.L0.ParentFile = filedesc.SurrogateProto3
|
||||
ed.L1.EditionFeatures = ed.L0.ParentFile.L1.EditionFeatures
|
||||
ed.L2.Values.List = append(ed.L2.Values.List, filedesc.EnumValue{})
|
||||
|
||||
// TODO: Use the presence of a UnmarshalJSON method to determine proto2?
|
||||
|
2
gateway/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go
generated
vendored
2
gateway/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go
generated
vendored
@ -118,7 +118,7 @@ func (xi *ExtensionInfo) initFromLegacy() {
|
||||
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
|
||||
xd.L1.EditionFeatures = fd.L1.EditionFeatures
|
||||
xd.L2.Default = fd.L1.Default
|
||||
xd.L1.Extendee = Export{}.MessageDescriptorOf(xi.ExtendedType)
|
||||
xd.L2.Enum = ed
|
||||
|
4
gateway/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go
generated
vendored
4
gateway/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go
generated
vendored
@ -7,7 +7,7 @@ package impl
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"sync"
|
||||
|
||||
"google.golang.org/protobuf/internal/filedesc"
|
||||
@ -51,7 +51,7 @@ func legacyLoadFileDesc(b []byte) protoreflect.FileDescriptor {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
b2, err := ioutil.ReadAll(zr)
|
||||
b2, err := io.ReadAll(zr)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
29
gateway/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go
generated
vendored
29
gateway/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go
generated
vendored
@ -204,15 +204,21 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName
|
||||
}
|
||||
}
|
||||
|
||||
md.L1.EditionFeatures = md.L0.ParentFile.L1.EditionFeatures
|
||||
// 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))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -245,6 +251,7 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName
|
||||
od := &md.L2.Oneofs.List[n]
|
||||
od.L0.FullName = md.FullName().Append(protoreflect.Name(tag))
|
||||
od.L0.ParentFile = md.L0.ParentFile
|
||||
od.L1.EditionFeatures = md.L1.EditionFeatures
|
||||
od.L0.Parent = md
|
||||
od.L0.Index = n
|
||||
|
||||
@ -255,6 +262,7 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName
|
||||
aberrantAppendField(md, f.Type, tag, "", "")
|
||||
fd := &md.L2.Fields.List[len(md.L2.Fields.List)-1]
|
||||
fd.L1.ContainingOneof = od
|
||||
fd.L1.EditionFeatures = od.L1.EditionFeatures
|
||||
od.L1.Fields.List = append(od.L1.Fields.List, fd)
|
||||
}
|
||||
}
|
||||
@ -302,14 +310,14 @@ func aberrantAppendField(md *filedesc.Message, goType reflect.Type, tag, tagKey,
|
||||
fd.L0.Parent = md
|
||||
fd.L0.Index = n
|
||||
|
||||
if fd.L1.IsWeak || fd.L1.HasPacked {
|
||||
if fd.L1.IsWeak || fd.L1.EditionFeatures.IsPacked {
|
||||
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))
|
||||
}
|
||||
if fd.L1.HasPacked {
|
||||
opts.Set(opts.Descriptor().Fields().ByName("packed"), protoreflect.ValueOfBool(fd.L1.IsPacked))
|
||||
if fd.L1.EditionFeatures.IsPacked {
|
||||
opts.Set(opts.Descriptor().Fields().ByName("packed"), protoreflect.ValueOfBool(fd.L1.EditionFeatures.IsPacked))
|
||||
}
|
||||
return opts.Interface()
|
||||
}
|
||||
@ -339,6 +347,7 @@ func aberrantAppendField(md *filedesc.Message, goType reflect.Type, tag, tagKey,
|
||||
md2.L0.ParentFile = md.L0.ParentFile
|
||||
md2.L0.Parent = md
|
||||
md2.L0.Index = n
|
||||
md2.L1.EditionFeatures = md.L1.EditionFeatures
|
||||
|
||||
md2.L1.IsMapEntry = true
|
||||
md2.L2.Options = func() protoreflect.ProtoMessage {
|
||||
|
17
gateway/vendor/google.golang.org/protobuf/internal/impl/message.go
generated
vendored
17
gateway/vendor/google.golang.org/protobuf/internal/impl/message.go
generated
vendored
@ -192,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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
31
gateway/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go
generated
vendored
31
gateway/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go
generated
vendored
@ -247,11 +247,10 @@ func (m *extensionMap) Range(f func(protoreflect.FieldDescriptor, protoreflect.V
|
||||
}
|
||||
}
|
||||
}
|
||||
func (m *extensionMap) Has(xt protoreflect.ExtensionType) (ok bool) {
|
||||
func (m *extensionMap) Has(xd protoreflect.ExtensionTypeDescriptor) (ok bool) {
|
||||
if m == nil {
|
||||
return false
|
||||
}
|
||||
xd := xt.TypeDescriptor()
|
||||
x, ok := (*m)[int32(xd.Number())]
|
||||
if !ok {
|
||||
return false
|
||||
@ -261,25 +260,22 @@ func (m *extensionMap) Has(xt protoreflect.ExtensionType) (ok bool) {
|
||||
return x.Value().List().Len() > 0
|
||||
case xd.IsMap():
|
||||
return x.Value().Map().Len() > 0
|
||||
case xd.Message() != nil:
|
||||
return x.Value().Message().IsValid()
|
||||
}
|
||||
return true
|
||||
}
|
||||
func (m *extensionMap) Clear(xt protoreflect.ExtensionType) {
|
||||
delete(*m, int32(xt.TypeDescriptor().Number()))
|
||||
func (m *extensionMap) Clear(xd protoreflect.ExtensionTypeDescriptor) {
|
||||
delete(*m, int32(xd.Number()))
|
||||
}
|
||||
func (m *extensionMap) Get(xt protoreflect.ExtensionType) protoreflect.Value {
|
||||
xd := xt.TypeDescriptor()
|
||||
func (m *extensionMap) Get(xd protoreflect.ExtensionTypeDescriptor) protoreflect.Value {
|
||||
if m != nil {
|
||||
if x, ok := (*m)[int32(xd.Number())]; ok {
|
||||
return x.Value()
|
||||
}
|
||||
}
|
||||
return xt.Zero()
|
||||
return xd.Type().Zero()
|
||||
}
|
||||
func (m *extensionMap) Set(xt protoreflect.ExtensionType, v protoreflect.Value) {
|
||||
xd := xt.TypeDescriptor()
|
||||
func (m *extensionMap) Set(xd protoreflect.ExtensionTypeDescriptor, v protoreflect.Value) {
|
||||
xt := xd.Type()
|
||||
isValid := true
|
||||
switch {
|
||||
case !xt.IsValidValue(v):
|
||||
@ -292,7 +288,7 @@ func (m *extensionMap) Set(xt protoreflect.ExtensionType, v protoreflect.Value)
|
||||
isValid = v.Message().IsValid()
|
||||
}
|
||||
if !isValid {
|
||||
panic(fmt.Sprintf("%v: assigning invalid value", xt.TypeDescriptor().FullName()))
|
||||
panic(fmt.Sprintf("%v: assigning invalid value", xd.FullName()))
|
||||
}
|
||||
|
||||
if *m == nil {
|
||||
@ -302,16 +298,15 @@ func (m *extensionMap) Set(xt protoreflect.ExtensionType, v protoreflect.Value)
|
||||
x.Set(xt, v)
|
||||
(*m)[int32(xd.Number())] = x
|
||||
}
|
||||
func (m *extensionMap) Mutable(xt protoreflect.ExtensionType) protoreflect.Value {
|
||||
xd := xt.TypeDescriptor()
|
||||
func (m *extensionMap) Mutable(xd protoreflect.ExtensionTypeDescriptor) protoreflect.Value {
|
||||
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 {
|
||||
return x.Value()
|
||||
}
|
||||
v := xt.New()
|
||||
m.Set(xt, v)
|
||||
v := xd.Type().New()
|
||||
m.Set(xd, v)
|
||||
return v
|
||||
}
|
||||
|
||||
@ -428,7 +423,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 protoreflect.FieldDescriptor) (*fieldInfo, protoreflect.ExtensionType) {
|
||||
func (mi *MessageInfo) checkField(fd protoreflect.FieldDescriptor) (*fieldInfo, protoreflect.ExtensionTypeDescriptor) {
|
||||
var fi *fieldInfo
|
||||
if n := fd.Number(); 0 < n && int(n) < len(mi.denseFields) {
|
||||
fi = mi.denseFields[n]
|
||||
@ -457,7 +452,7 @@ func (mi *MessageInfo) checkField(fd protoreflect.FieldDescriptor) (*fieldInfo,
|
||||
if !ok {
|
||||
panic(fmt.Sprintf("extension %v does not implement protoreflect.ExtensionTypeDescriptor", fd.FullName()))
|
||||
}
|
||||
return nil, xtd.Type()
|
||||
return nil, xtd
|
||||
}
|
||||
panic(fmt.Sprintf("field %v is invalid", fd.FullName()))
|
||||
}
|
||||
|
2
gateway/vendor/google.golang.org/protobuf/internal/impl/message_reflect_field.go
generated
vendored
2
gateway/vendor/google.golang.org/protobuf/internal/impl/message_reflect_field.go
generated
vendored
@ -538,6 +538,6 @@ func isZero(v reflect.Value) bool {
|
||||
}
|
||||
return true
|
||||
default:
|
||||
panic(&reflect.ValueError{"reflect.Value.IsZero", v.Kind()})
|
||||
panic(&reflect.ValueError{Method: "reflect.Value.IsZero", Kind: v.Kind()})
|
||||
}
|
||||
}
|
||||
|
142
gateway/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go
generated
vendored
142
gateway/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go
generated
vendored
@ -27,8 +27,9 @@ func (m *messageState) protoUnwrap() interface{} {
|
||||
return m.pointer().AsIfaceOf(m.messageInfo().GoReflectType.Elem())
|
||||
}
|
||||
func (m *messageState) ProtoMethods() *protoiface.Methods {
|
||||
m.messageInfo().init()
|
||||
return &m.messageInfo().methods
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
return &mi.methods
|
||||
}
|
||||
|
||||
// ProtoMessageInfo is a pseudo-internal API for allowing the v1 code
|
||||
@ -41,8 +42,9 @@ func (m *messageState) ProtoMessageInfo() *MessageInfo {
|
||||
}
|
||||
|
||||
func (m *messageState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
m.messageInfo().init()
|
||||
for _, ri := range m.messageInfo().rangeInfos {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
for _, ri := range mi.rangeInfos {
|
||||
switch ri := ri.(type) {
|
||||
case *fieldInfo:
|
||||
if ri.has(m.pointer()) {
|
||||
@ -52,77 +54,86 @@ func (m *messageState) Range(f func(protoreflect.FieldDescriptor, protoreflect.V
|
||||
}
|
||||
case *oneofInfo:
|
||||
if n := ri.which(m.pointer()); n > 0 {
|
||||
fi := m.messageInfo().fields[n]
|
||||
fi := mi.fields[n]
|
||||
if !f(fi.fieldDesc, fi.get(m.pointer())) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m.messageInfo().extensionMap(m.pointer()).Range(f)
|
||||
mi.extensionMap(m.pointer()).Range(f)
|
||||
}
|
||||
func (m *messageState) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
m.messageInfo().init()
|
||||
if fi, xt := m.messageInfo().checkField(fd); fi != nil {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
if fi, xd := mi.checkField(fd); fi != nil {
|
||||
return fi.has(m.pointer())
|
||||
} else {
|
||||
return m.messageInfo().extensionMap(m.pointer()).Has(xt)
|
||||
return mi.extensionMap(m.pointer()).Has(xd)
|
||||
}
|
||||
}
|
||||
func (m *messageState) Clear(fd protoreflect.FieldDescriptor) {
|
||||
m.messageInfo().init()
|
||||
if fi, xt := m.messageInfo().checkField(fd); fi != nil {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
if fi, xd := mi.checkField(fd); fi != nil {
|
||||
fi.clear(m.pointer())
|
||||
} else {
|
||||
m.messageInfo().extensionMap(m.pointer()).Clear(xt)
|
||||
mi.extensionMap(m.pointer()).Clear(xd)
|
||||
}
|
||||
}
|
||||
func (m *messageState) Get(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
m.messageInfo().init()
|
||||
if fi, xt := m.messageInfo().checkField(fd); fi != nil {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
if fi, xd := mi.checkField(fd); fi != nil {
|
||||
return fi.get(m.pointer())
|
||||
} else {
|
||||
return m.messageInfo().extensionMap(m.pointer()).Get(xt)
|
||||
return mi.extensionMap(m.pointer()).Get(xd)
|
||||
}
|
||||
}
|
||||
func (m *messageState) Set(fd protoreflect.FieldDescriptor, v protoreflect.Value) {
|
||||
m.messageInfo().init()
|
||||
if fi, xt := m.messageInfo().checkField(fd); fi != nil {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
if fi, xd := mi.checkField(fd); fi != nil {
|
||||
fi.set(m.pointer(), v)
|
||||
} else {
|
||||
m.messageInfo().extensionMap(m.pointer()).Set(xt, v)
|
||||
mi.extensionMap(m.pointer()).Set(xd, v)
|
||||
}
|
||||
}
|
||||
func (m *messageState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
m.messageInfo().init()
|
||||
if fi, xt := m.messageInfo().checkField(fd); fi != nil {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
if fi, xd := mi.checkField(fd); fi != nil {
|
||||
return fi.mutable(m.pointer())
|
||||
} else {
|
||||
return m.messageInfo().extensionMap(m.pointer()).Mutable(xt)
|
||||
return mi.extensionMap(m.pointer()).Mutable(xd)
|
||||
}
|
||||
}
|
||||
func (m *messageState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
m.messageInfo().init()
|
||||
if fi, xt := m.messageInfo().checkField(fd); fi != nil {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
if fi, xd := mi.checkField(fd); fi != nil {
|
||||
return fi.newField()
|
||||
} else {
|
||||
return xt.New()
|
||||
return xd.Type().New()
|
||||
}
|
||||
}
|
||||
func (m *messageState) WhichOneof(od protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||
m.messageInfo().init()
|
||||
if oi := m.messageInfo().oneofs[od.Name()]; oi != nil && oi.oneofDesc == od {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
if oi := mi.oneofs[od.Name()]; oi != nil && oi.oneofDesc == od {
|
||||
return od.Fields().ByNumber(oi.which(m.pointer()))
|
||||
}
|
||||
panic("invalid oneof descriptor " + string(od.FullName()) + " for message " + string(m.Descriptor().FullName()))
|
||||
}
|
||||
func (m *messageState) GetUnknown() protoreflect.RawFields {
|
||||
m.messageInfo().init()
|
||||
return m.messageInfo().getUnknown(m.pointer())
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
return mi.getUnknown(m.pointer())
|
||||
}
|
||||
func (m *messageState) SetUnknown(b protoreflect.RawFields) {
|
||||
m.messageInfo().init()
|
||||
m.messageInfo().setUnknown(m.pointer(), b)
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
mi.setUnknown(m.pointer(), b)
|
||||
}
|
||||
func (m *messageState) IsValid() bool {
|
||||
return !m.pointer().IsNil()
|
||||
@ -147,8 +158,9 @@ func (m *messageReflectWrapper) protoUnwrap() interface{} {
|
||||
return m.pointer().AsIfaceOf(m.messageInfo().GoReflectType.Elem())
|
||||
}
|
||||
func (m *messageReflectWrapper) ProtoMethods() *protoiface.Methods {
|
||||
m.messageInfo().init()
|
||||
return &m.messageInfo().methods
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
return &mi.methods
|
||||
}
|
||||
|
||||
// ProtoMessageInfo is a pseudo-internal API for allowing the v1 code
|
||||
@ -161,8 +173,9 @@ func (m *messageReflectWrapper) ProtoMessageInfo() *MessageInfo {
|
||||
}
|
||||
|
||||
func (m *messageReflectWrapper) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
m.messageInfo().init()
|
||||
for _, ri := range m.messageInfo().rangeInfos {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
for _, ri := range mi.rangeInfos {
|
||||
switch ri := ri.(type) {
|
||||
case *fieldInfo:
|
||||
if ri.has(m.pointer()) {
|
||||
@ -172,77 +185,86 @@ func (m *messageReflectWrapper) Range(f func(protoreflect.FieldDescriptor, proto
|
||||
}
|
||||
case *oneofInfo:
|
||||
if n := ri.which(m.pointer()); n > 0 {
|
||||
fi := m.messageInfo().fields[n]
|
||||
fi := mi.fields[n]
|
||||
if !f(fi.fieldDesc, fi.get(m.pointer())) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m.messageInfo().extensionMap(m.pointer()).Range(f)
|
||||
mi.extensionMap(m.pointer()).Range(f)
|
||||
}
|
||||
func (m *messageReflectWrapper) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
m.messageInfo().init()
|
||||
if fi, xt := m.messageInfo().checkField(fd); fi != nil {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
if fi, xd := mi.checkField(fd); fi != nil {
|
||||
return fi.has(m.pointer())
|
||||
} else {
|
||||
return m.messageInfo().extensionMap(m.pointer()).Has(xt)
|
||||
return mi.extensionMap(m.pointer()).Has(xd)
|
||||
}
|
||||
}
|
||||
func (m *messageReflectWrapper) Clear(fd protoreflect.FieldDescriptor) {
|
||||
m.messageInfo().init()
|
||||
if fi, xt := m.messageInfo().checkField(fd); fi != nil {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
if fi, xd := mi.checkField(fd); fi != nil {
|
||||
fi.clear(m.pointer())
|
||||
} else {
|
||||
m.messageInfo().extensionMap(m.pointer()).Clear(xt)
|
||||
mi.extensionMap(m.pointer()).Clear(xd)
|
||||
}
|
||||
}
|
||||
func (m *messageReflectWrapper) Get(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
m.messageInfo().init()
|
||||
if fi, xt := m.messageInfo().checkField(fd); fi != nil {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
if fi, xd := mi.checkField(fd); fi != nil {
|
||||
return fi.get(m.pointer())
|
||||
} else {
|
||||
return m.messageInfo().extensionMap(m.pointer()).Get(xt)
|
||||
return mi.extensionMap(m.pointer()).Get(xd)
|
||||
}
|
||||
}
|
||||
func (m *messageReflectWrapper) Set(fd protoreflect.FieldDescriptor, v protoreflect.Value) {
|
||||
m.messageInfo().init()
|
||||
if fi, xt := m.messageInfo().checkField(fd); fi != nil {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
if fi, xd := mi.checkField(fd); fi != nil {
|
||||
fi.set(m.pointer(), v)
|
||||
} else {
|
||||
m.messageInfo().extensionMap(m.pointer()).Set(xt, v)
|
||||
mi.extensionMap(m.pointer()).Set(xd, v)
|
||||
}
|
||||
}
|
||||
func (m *messageReflectWrapper) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
m.messageInfo().init()
|
||||
if fi, xt := m.messageInfo().checkField(fd); fi != nil {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
if fi, xd := mi.checkField(fd); fi != nil {
|
||||
return fi.mutable(m.pointer())
|
||||
} else {
|
||||
return m.messageInfo().extensionMap(m.pointer()).Mutable(xt)
|
||||
return mi.extensionMap(m.pointer()).Mutable(xd)
|
||||
}
|
||||
}
|
||||
func (m *messageReflectWrapper) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
m.messageInfo().init()
|
||||
if fi, xt := m.messageInfo().checkField(fd); fi != nil {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
if fi, xd := mi.checkField(fd); fi != nil {
|
||||
return fi.newField()
|
||||
} else {
|
||||
return xt.New()
|
||||
return xd.Type().New()
|
||||
}
|
||||
}
|
||||
func (m *messageReflectWrapper) WhichOneof(od protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||
m.messageInfo().init()
|
||||
if oi := m.messageInfo().oneofs[od.Name()]; oi != nil && oi.oneofDesc == od {
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
if oi := mi.oneofs[od.Name()]; oi != nil && oi.oneofDesc == od {
|
||||
return od.Fields().ByNumber(oi.which(m.pointer()))
|
||||
}
|
||||
panic("invalid oneof descriptor " + string(od.FullName()) + " for message " + string(m.Descriptor().FullName()))
|
||||
}
|
||||
func (m *messageReflectWrapper) GetUnknown() protoreflect.RawFields {
|
||||
m.messageInfo().init()
|
||||
return m.messageInfo().getUnknown(m.pointer())
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
return mi.getUnknown(m.pointer())
|
||||
}
|
||||
func (m *messageReflectWrapper) SetUnknown(b protoreflect.RawFields) {
|
||||
m.messageInfo().init()
|
||||
m.messageInfo().setUnknown(m.pointer(), b)
|
||||
mi := m.messageInfo()
|
||||
mi.init()
|
||||
mi.setUnknown(m.pointer(), b)
|
||||
}
|
||||
func (m *messageReflectWrapper) IsValid() bool {
|
||||
return !m.pointer().IsNil()
|
||||
|
36
gateway/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go
generated
vendored
36
gateway/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
gateway/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go
generated
vendored
40
gateway/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{}))
|
||||
|
||||
|
2
gateway/vendor/google.golang.org/protobuf/internal/strs/strings.go
generated
vendored
2
gateway/vendor/google.golang.org/protobuf/internal/strs/strings.go
generated
vendored
@ -17,7 +17,7 @@ import (
|
||||
|
||||
// EnforceUTF8 reports whether to enforce strict UTF-8 validation.
|
||||
func EnforceUTF8(fd protoreflect.FieldDescriptor) bool {
|
||||
if flags.ProtoLegacy {
|
||||
if flags.ProtoLegacy || fd.Syntax() == protoreflect.Editions {
|
||||
if fd, ok := fd.(interface{ EnforceUTF8() bool }); ok {
|
||||
return fd.EnforceUTF8()
|
||||
}
|
||||
|
@ -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 strs
|
||||
|
74
gateway/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go121.go
generated
vendored
Normal file
74
gateway/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:])
|
||||
}
|
4
gateway/vendor/google.golang.org/protobuf/internal/version/version.go
generated
vendored
4
gateway/vendor/google.golang.org/protobuf/internal/version/version.go
generated
vendored
@ -51,8 +51,8 @@ import (
|
||||
// 10. Send out the CL for review and submit it.
|
||||
const (
|
||||
Major = 1
|
||||
Minor = 31
|
||||
Patch = 0
|
||||
Minor = 34
|
||||
Patch = 1
|
||||
PreRelease = ""
|
||||
)
|
||||
|
||||
|
4
gateway/vendor/google.golang.org/protobuf/proto/decode.go
generated
vendored
4
gateway/vendor/google.golang.org/protobuf/proto/decode.go
generated
vendored
@ -51,6 +51,8 @@ type UnmarshalOptions struct {
|
||||
|
||||
// Unmarshal parses the wire-format message in b and places the result in m.
|
||||
// The provided message must be mutable (e.g., a non-nil pointer to a message).
|
||||
//
|
||||
// See the [UnmarshalOptions] type if you need more control.
|
||||
func Unmarshal(b []byte, m Message) error {
|
||||
_, err := UnmarshalOptions{RecursionLimit: protowire.DefaultRecursionLimit}.unmarshal(b, m.ProtoReflect())
|
||||
return err
|
||||
@ -69,7 +71,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
|
||||
|
58
gateway/vendor/google.golang.org/protobuf/proto/doc.go
generated
vendored
58
gateway/vendor/google.golang.org/protobuf/proto/doc.go
generated
vendored
@ -18,27 +18,27 @@
|
||||
// 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
|
||||
//
|
||||
// • 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
|
||||
//
|
||||
@ -46,9 +46,9 @@
|
||||
// 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.
|
||||
@ -57,29 +57,29 @@
|
||||
//
|
||||
// # 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
|
||||
//
|
||||
// • 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.
|
||||
|
46
gateway/vendor/google.golang.org/protobuf/proto/encode.go
generated
vendored
46
gateway/vendor/google.golang.org/protobuf/proto/encode.go
generated
vendored
@ -5,12 +5,17 @@
|
||||
package proto
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/internal/encoding/messageset"
|
||||
"google.golang.org/protobuf/internal/order"
|
||||
"google.golang.org/protobuf/internal/pragma"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/runtime/protoiface"
|
||||
|
||||
protoerrors "google.golang.org/protobuf/internal/errors"
|
||||
)
|
||||
|
||||
// MarshalOptions configures the marshaler.
|
||||
@ -70,7 +75,32 @@ type MarshalOptions struct {
|
||||
UseCachedSize bool
|
||||
}
|
||||
|
||||
// flags turns the specified MarshalOptions (user-facing) into
|
||||
// protoiface.MarshalInputFlags (used internally by the marshaler).
|
||||
//
|
||||
// See impl.marshalOptions.Options for the inverse operation.
|
||||
func (o MarshalOptions) flags() protoiface.MarshalInputFlags {
|
||||
var flags protoiface.MarshalInputFlags
|
||||
|
||||
// Note: o.AllowPartial is always forced to true by MarshalOptions.marshal,
|
||||
// which is why it is not a part of MarshalInputFlags.
|
||||
|
||||
if o.Deterministic {
|
||||
flags |= protoiface.MarshalDeterministic
|
||||
}
|
||||
|
||||
if o.UseCachedSize {
|
||||
flags |= protoiface.MarshalUseCachedSize
|
||||
}
|
||||
|
||||
return flags
|
||||
}
|
||||
|
||||
// Marshal returns the wire-format encoding of m.
|
||||
//
|
||||
// This is the most common entry point for encoding a Protobuf message.
|
||||
//
|
||||
// See the [MarshalOptions] type if you need more control.
|
||||
func Marshal(m Message) ([]byte, error) {
|
||||
// Treat nil message interface as an empty message; nothing to output.
|
||||
if m == nil {
|
||||
@ -116,6 +146,9 @@ func emptyBytesForMessage(m Message) []byte {
|
||||
|
||||
// MarshalAppend appends the wire-format encoding of m to b,
|
||||
// returning the result.
|
||||
//
|
||||
// This is a less common entry point than [Marshal], which is only needed if you
|
||||
// need to supply your own buffers for performance reasons.
|
||||
func (o MarshalOptions) MarshalAppend(b []byte, m Message) ([]byte, error) {
|
||||
// Treat nil message interface as an empty message; nothing to append.
|
||||
if m == nil {
|
||||
@ -129,7 +162,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)
|
||||
}
|
||||
@ -145,12 +178,7 @@ func (o MarshalOptions) marshal(b []byte, m protoreflect.Message) (out protoifac
|
||||
in := protoiface.MarshalInput{
|
||||
Message: m,
|
||||
Buf: b,
|
||||
}
|
||||
if o.Deterministic {
|
||||
in.Flags |= protoiface.MarshalDeterministic
|
||||
}
|
||||
if o.UseCachedSize {
|
||||
in.Flags |= protoiface.MarshalUseCachedSize
|
||||
Flags: o.flags(),
|
||||
}
|
||||
if methods.Size != nil {
|
||||
sout := methods.Size(protoiface.SizeInput{
|
||||
@ -168,6 +196,10 @@ func (o MarshalOptions) marshal(b []byte, m protoreflect.Message) (out protoifac
|
||||
out.Buf, err = o.marshalMessageSlow(b, m)
|
||||
}
|
||||
if err != nil {
|
||||
var mismatch *protoerrors.SizeMismatchError
|
||||
if errors.As(err, &mismatch) {
|
||||
return out, fmt.Errorf("marshaling %s: %v", string(m.Descriptor().FullName()), err)
|
||||
}
|
||||
return out, err
|
||||
}
|
||||
if allowPartial {
|
||||
|
13
gateway/vendor/google.golang.org/protobuf/proto/extension.go
generated
vendored
13
gateway/vendor/google.golang.org/protobuf/proto/extension.go
generated
vendored
@ -11,22 +11,25 @@ import (
|
||||
// HasExtension reports whether an extension field is populated.
|
||||
// It returns false if m is invalid or if xt does not extend m.
|
||||
func HasExtension(m Message, xt protoreflect.ExtensionType) bool {
|
||||
// Treat nil message interface as an empty message; no populated fields.
|
||||
if m == nil {
|
||||
// Treat nil message interface or descriptor as an empty message; no populated
|
||||
// fields.
|
||||
if m == nil || xt == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
// As a special-case, we reports invalid or mismatching descriptors
|
||||
// as always not being populated (since they aren't).
|
||||
if xt == nil || m.ProtoReflect().Descriptor() != xt.TypeDescriptor().ContainingMessage() {
|
||||
mr := m.ProtoReflect()
|
||||
xd := xt.TypeDescriptor()
|
||||
if mr.Descriptor() != xd.ContainingMessage() {
|
||||
return false
|
||||
}
|
||||
|
||||
return m.ProtoReflect().Has(xt.TypeDescriptor())
|
||||
return mr.Has(xd)
|
||||
}
|
||||
|
||||
// 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
gateway/vendor/google.golang.org/protobuf/proto/merge.go
generated
vendored
2
gateway/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?
|
||||
|
7
gateway/vendor/google.golang.org/protobuf/proto/messageset.go
generated
vendored
7
gateway/vendor/google.golang.org/protobuf/proto/messageset.go
generated
vendored
@ -47,11 +47,16 @@ func (o MarshalOptions) marshalMessageSet(b []byte, m protoreflect.Message) ([]b
|
||||
func (o MarshalOptions) marshalMessageSetField(b []byte, fd protoreflect.FieldDescriptor, value protoreflect.Value) ([]byte, error) {
|
||||
b = messageset.AppendFieldStart(b, fd.Number())
|
||||
b = protowire.AppendTag(b, messageset.FieldMessage, protowire.BytesType)
|
||||
b = protowire.AppendVarint(b, uint64(o.Size(value.Message().Interface())))
|
||||
calculatedSize := o.Size(value.Message().Interface())
|
||||
b = protowire.AppendVarint(b, uint64(calculatedSize))
|
||||
before := len(b)
|
||||
b, err := o.marshalMessage(b, value.Message())
|
||||
if err != nil {
|
||||
return b, err
|
||||
}
|
||||
if measuredSize := len(b) - before; calculatedSize != measuredSize {
|
||||
return nil, errors.MismatchedSizeCalculation(calculatedSize, measuredSize)
|
||||
}
|
||||
b = messageset.AppendFieldEnd(b)
|
||||
return b, nil
|
||||
}
|
||||
|
18
gateway/vendor/google.golang.org/protobuf/proto/proto.go
generated
vendored
18
gateway/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() {
|
||||
|
2
gateway/vendor/google.golang.org/protobuf/proto/size.go
generated
vendored
2
gateway/vendor/google.golang.org/protobuf/proto/size.go
generated
vendored
@ -34,6 +34,7 @@ func (o MarshalOptions) size(m protoreflect.Message) (size int) {
|
||||
if methods != nil && methods.Size != nil {
|
||||
out := methods.Size(protoiface.SizeInput{
|
||||
Message: m,
|
||||
Flags: o.flags(),
|
||||
})
|
||||
return out.Size
|
||||
}
|
||||
@ -42,6 +43,7 @@ func (o MarshalOptions) size(m protoreflect.Message) (size int) {
|
||||
// This case is mainly used for legacy types with a Marshal method.
|
||||
out, _ := methods.Marshal(protoiface.MarshalInput{
|
||||
Message: m,
|
||||
Flags: o.flags(),
|
||||
})
|
||||
return len(out.Buf)
|
||||
}
|
||||
|
276
gateway/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go
generated
vendored
276
gateway/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go
generated
vendored
@ -1,276 +0,0 @@
|
||||
// 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.
|
||||
|
||||
// Package protodesc provides functionality for converting
|
||||
// FileDescriptorProto messages to/from protoreflect.FileDescriptor values.
|
||||
//
|
||||
// The google.protobuf.FileDescriptorProto is a protobuf message that describes
|
||||
// the type information for a .proto file in a form that is easily serializable.
|
||||
// The protoreflect.FileDescriptor is a more structured representation of
|
||||
// the FileDescriptorProto message where references and remote dependencies
|
||||
// can be directly followed.
|
||||
package protodesc
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/internal/errors"
|
||||
"google.golang.org/protobuf/internal/filedesc"
|
||||
"google.golang.org/protobuf/internal/pragma"
|
||||
"google.golang.org/protobuf/internal/strs"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
|
||||
"google.golang.org/protobuf/types/descriptorpb"
|
||||
)
|
||||
|
||||
// Resolver is the resolver used by NewFile to resolve dependencies.
|
||||
// The enums and messages provided must belong to some parent file,
|
||||
// which is also registered.
|
||||
//
|
||||
// It is implemented by protoregistry.Files.
|
||||
type Resolver interface {
|
||||
FindFileByPath(string) (protoreflect.FileDescriptor, error)
|
||||
FindDescriptorByName(protoreflect.FullName) (protoreflect.Descriptor, error)
|
||||
}
|
||||
|
||||
// FileOptions configures the construction of file descriptors.
|
||||
type FileOptions struct {
|
||||
pragma.NoUnkeyedLiterals
|
||||
|
||||
// AllowUnresolvable configures New to permissively allow unresolvable
|
||||
// file, enum, or message dependencies. Unresolved dependencies are replaced
|
||||
// by placeholder equivalents.
|
||||
//
|
||||
// The following dependencies may be left unresolved:
|
||||
// • Resolving an imported file.
|
||||
// • Resolving the type for a message field or extension field.
|
||||
// If the kind of the field is unknown, then a placeholder is used for both
|
||||
// the Enum and Message accessors on the protoreflect.FieldDescriptor.
|
||||
// • Resolving an enum value set as the default for an optional enum field.
|
||||
// If unresolvable, the protoreflect.FieldDescriptor.Default is set to the
|
||||
// first value in the associated enum (or zero if the also enum dependency
|
||||
// is also unresolvable). The protoreflect.FieldDescriptor.DefaultEnumValue
|
||||
// is populated with a placeholder.
|
||||
// • Resolving the extended message type for an extension field.
|
||||
// • Resolving the input or output message type for a service method.
|
||||
//
|
||||
// If the unresolved dependency uses a relative name,
|
||||
// then the placeholder will contain an invalid FullName with a "*." prefix,
|
||||
// indicating that the starting prefix of the full name is unknown.
|
||||
AllowUnresolvable bool
|
||||
}
|
||||
|
||||
// NewFile creates a new protoreflect.FileDescriptor from the provided
|
||||
// file descriptor message. See FileOptions.New for more information.
|
||||
func NewFile(fd *descriptorpb.FileDescriptorProto, r Resolver) (protoreflect.FileDescriptor, error) {
|
||||
return FileOptions{}.New(fd, r)
|
||||
}
|
||||
|
||||
// NewFiles creates a new protoregistry.Files from the provided
|
||||
// FileDescriptorSet message. See FileOptions.NewFiles for more information.
|
||||
func NewFiles(fd *descriptorpb.FileDescriptorSet) (*protoregistry.Files, error) {
|
||||
return FileOptions{}.NewFiles(fd)
|
||||
}
|
||||
|
||||
// New creates a new protoreflect.FileDescriptor from the provided
|
||||
// file descriptor message. The file must represent a valid proto file according
|
||||
// to protobuf semantics. The returned descriptor is a deep copy of the input.
|
||||
//
|
||||
// Any imported files, enum types, or message types referenced in the file are
|
||||
// resolved using the provided registry. When looking up an import file path,
|
||||
// the path must be unique. The newly created file descriptor is not registered
|
||||
// back into the provided file registry.
|
||||
func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (protoreflect.FileDescriptor, error) {
|
||||
if r == nil {
|
||||
r = (*protoregistry.Files)(nil) // empty resolver
|
||||
}
|
||||
|
||||
// Handle the file descriptor content.
|
||||
f := &filedesc.File{L2: &filedesc.FileL2{}}
|
||||
switch fd.GetSyntax() {
|
||||
case "proto2", "":
|
||||
f.L1.Syntax = protoreflect.Proto2
|
||||
case "proto3":
|
||||
f.L1.Syntax = protoreflect.Proto3
|
||||
default:
|
||||
return nil, errors.New("invalid syntax: %q", fd.GetSyntax())
|
||||
}
|
||||
f.L1.Path = fd.GetName()
|
||||
if f.L1.Path == "" {
|
||||
return nil, errors.New("file path must be populated")
|
||||
}
|
||||
f.L1.Package = protoreflect.FullName(fd.GetPackage())
|
||||
if !f.L1.Package.IsValid() && f.L1.Package != "" {
|
||||
return nil, errors.New("invalid package: %q", f.L1.Package)
|
||||
}
|
||||
if opts := fd.GetOptions(); opts != nil {
|
||||
opts = proto.Clone(opts).(*descriptorpb.FileOptions)
|
||||
f.L2.Options = func() protoreflect.ProtoMessage { return opts }
|
||||
}
|
||||
|
||||
f.L2.Imports = make(filedesc.FileImports, len(fd.GetDependency()))
|
||||
for _, i := range fd.GetPublicDependency() {
|
||||
if !(0 <= i && int(i) < len(f.L2.Imports)) || f.L2.Imports[i].IsPublic {
|
||||
return nil, errors.New("invalid or duplicate public import index: %d", i)
|
||||
}
|
||||
f.L2.Imports[i].IsPublic = true
|
||||
}
|
||||
for _, i := range fd.GetWeakDependency() {
|
||||
if !(0 <= i && int(i) < len(f.L2.Imports)) || f.L2.Imports[i].IsWeak {
|
||||
return nil, errors.New("invalid or duplicate weak import index: %d", i)
|
||||
}
|
||||
f.L2.Imports[i].IsWeak = true
|
||||
}
|
||||
imps := importSet{f.Path(): true}
|
||||
for i, path := range fd.GetDependency() {
|
||||
imp := &f.L2.Imports[i]
|
||||
f, err := r.FindFileByPath(path)
|
||||
if err == protoregistry.NotFound && (o.AllowUnresolvable || imp.IsWeak) {
|
||||
f = filedesc.PlaceholderFile(path)
|
||||
} else if err != nil {
|
||||
return nil, errors.New("could not resolve import %q: %v", path, err)
|
||||
}
|
||||
imp.FileDescriptor = f
|
||||
|
||||
if imps[imp.Path()] {
|
||||
return nil, errors.New("already imported %q", path)
|
||||
}
|
||||
imps[imp.Path()] = true
|
||||
}
|
||||
for i := range fd.GetDependency() {
|
||||
imp := &f.L2.Imports[i]
|
||||
imps.importPublic(imp.Imports())
|
||||
}
|
||||
|
||||
// Handle source locations.
|
||||
f.L2.Locations.File = f
|
||||
for _, loc := range fd.GetSourceCodeInfo().GetLocation() {
|
||||
var l protoreflect.SourceLocation
|
||||
// TODO: Validate that the path points to an actual declaration?
|
||||
l.Path = protoreflect.SourcePath(loc.GetPath())
|
||||
s := loc.GetSpan()
|
||||
switch len(s) {
|
||||
case 3:
|
||||
l.StartLine, l.StartColumn, l.EndLine, l.EndColumn = int(s[0]), int(s[1]), int(s[0]), int(s[2])
|
||||
case 4:
|
||||
l.StartLine, l.StartColumn, l.EndLine, l.EndColumn = int(s[0]), int(s[1]), int(s[2]), int(s[3])
|
||||
default:
|
||||
return nil, errors.New("invalid span: %v", s)
|
||||
}
|
||||
// TODO: Validate that the span information is sensible?
|
||||
// See https://github.com/protocolbuffers/protobuf/issues/6378.
|
||||
if false && (l.EndLine < l.StartLine || l.StartLine < 0 || l.StartColumn < 0 || l.EndColumn < 0 ||
|
||||
(l.StartLine == l.EndLine && l.EndColumn <= l.StartColumn)) {
|
||||
return nil, errors.New("invalid span: %v", s)
|
||||
}
|
||||
l.LeadingDetachedComments = loc.GetLeadingDetachedComments()
|
||||
l.LeadingComments = loc.GetLeadingComments()
|
||||
l.TrailingComments = loc.GetTrailingComments()
|
||||
f.L2.Locations.List = append(f.L2.Locations.List, l)
|
||||
}
|
||||
|
||||
// Step 1: Allocate and derive the names for all declarations.
|
||||
// This copies all fields from the descriptor proto except:
|
||||
// google.protobuf.FieldDescriptorProto.type_name
|
||||
// google.protobuf.FieldDescriptorProto.default_value
|
||||
// google.protobuf.FieldDescriptorProto.oneof_index
|
||||
// google.protobuf.FieldDescriptorProto.extendee
|
||||
// google.protobuf.MethodDescriptorProto.input
|
||||
// google.protobuf.MethodDescriptorProto.output
|
||||
var err error
|
||||
sb := new(strs.Builder)
|
||||
r1 := make(descsByName)
|
||||
if f.L1.Enums.List, err = r1.initEnumDeclarations(fd.GetEnumType(), f, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if f.L1.Messages.List, err = r1.initMessagesDeclarations(fd.GetMessageType(), f, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if f.L1.Extensions.List, err = r1.initExtensionDeclarations(fd.GetExtension(), f, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if f.L1.Services.List, err = r1.initServiceDeclarations(fd.GetService(), f, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Step 2: Resolve every dependency reference not handled by step 1.
|
||||
r2 := &resolver{local: r1, remote: r, imports: imps, allowUnresolvable: o.AllowUnresolvable}
|
||||
if err := r2.resolveMessageDependencies(f.L1.Messages.List, fd.GetMessageType()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := r2.resolveExtensionDependencies(f.L1.Extensions.List, fd.GetExtension()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := r2.resolveServiceDependencies(f.L1.Services.List, fd.GetService()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Step 3: Validate every enum, message, and extension declaration.
|
||||
if err := validateEnumDeclarations(f.L1.Enums.List, fd.GetEnumType()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := validateMessageDeclarations(f.L1.Messages.List, fd.GetMessageType()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := validateExtensionDeclarations(f.L1.Extensions.List, fd.GetExtension()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return f, nil
|
||||
}
|
||||
|
||||
type importSet map[string]bool
|
||||
|
||||
func (is importSet) importPublic(imps protoreflect.FileImports) {
|
||||
for i := 0; i < imps.Len(); i++ {
|
||||
if imp := imps.Get(i); imp.IsPublic {
|
||||
is[imp.Path()] = true
|
||||
is.importPublic(imp.Imports())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// NewFiles creates a new protoregistry.Files from the provided
|
||||
// FileDescriptorSet message. The descriptor set must include only
|
||||
// valid files according to protobuf semantics. The returned descriptors
|
||||
// are a deep copy of the input.
|
||||
func (o FileOptions) NewFiles(fds *descriptorpb.FileDescriptorSet) (*protoregistry.Files, error) {
|
||||
files := make(map[string]*descriptorpb.FileDescriptorProto)
|
||||
for _, fd := range fds.File {
|
||||
if _, ok := files[fd.GetName()]; ok {
|
||||
return nil, errors.New("file appears multiple times: %q", fd.GetName())
|
||||
}
|
||||
files[fd.GetName()] = fd
|
||||
}
|
||||
r := &protoregistry.Files{}
|
||||
for _, fd := range files {
|
||||
if err := o.addFileDeps(r, fd, files); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return r, nil
|
||||
}
|
||||
func (o FileOptions) addFileDeps(r *protoregistry.Files, fd *descriptorpb.FileDescriptorProto, files map[string]*descriptorpb.FileDescriptorProto) error {
|
||||
// Set the entry to nil while descending into a file's dependencies to detect cycles.
|
||||
files[fd.GetName()] = nil
|
||||
for _, dep := range fd.Dependency {
|
||||
depfd, ok := files[dep]
|
||||
if depfd == nil {
|
||||
if ok {
|
||||
return errors.New("import cycle in file: %q", dep)
|
||||
}
|
||||
continue
|
||||
}
|
||||
if err := o.addFileDeps(r, depfd, files); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// Delete the entry once dependencies are processed.
|
||||
delete(files, fd.GetName())
|
||||
f, err := o.New(fd, r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return r.RegisterFile(f)
|
||||
}
|
248
gateway/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go
generated
vendored
248
gateway/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go
generated
vendored
@ -1,248 +0,0 @@
|
||||
// Copyright 2019 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 protodesc
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/internal/errors"
|
||||
"google.golang.org/protobuf/internal/filedesc"
|
||||
"google.golang.org/protobuf/internal/strs"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"google.golang.org/protobuf/types/descriptorpb"
|
||||
)
|
||||
|
||||
type descsByName map[protoreflect.FullName]protoreflect.Descriptor
|
||||
|
||||
func (r descsByName) initEnumDeclarations(eds []*descriptorpb.EnumDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (es []filedesc.Enum, err error) {
|
||||
es = make([]filedesc.Enum, len(eds)) // allocate up-front to ensure stable pointers
|
||||
for i, ed := range eds {
|
||||
e := &es[i]
|
||||
e.L2 = new(filedesc.EnumL2)
|
||||
if e.L0, err = r.makeBase(e, parent, ed.GetName(), i, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if opts := ed.GetOptions(); opts != nil {
|
||||
opts = proto.Clone(opts).(*descriptorpb.EnumOptions)
|
||||
e.L2.Options = func() protoreflect.ProtoMessage { return opts }
|
||||
}
|
||||
for _, s := range ed.GetReservedName() {
|
||||
e.L2.ReservedNames.List = append(e.L2.ReservedNames.List, protoreflect.Name(s))
|
||||
}
|
||||
for _, rr := range ed.GetReservedRange() {
|
||||
e.L2.ReservedRanges.List = append(e.L2.ReservedRanges.List, [2]protoreflect.EnumNumber{
|
||||
protoreflect.EnumNumber(rr.GetStart()),
|
||||
protoreflect.EnumNumber(rr.GetEnd()),
|
||||
})
|
||||
}
|
||||
if e.L2.Values.List, err = r.initEnumValuesFromDescriptorProto(ed.GetValue(), e, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return es, nil
|
||||
}
|
||||
|
||||
func (r descsByName) initEnumValuesFromDescriptorProto(vds []*descriptorpb.EnumValueDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (vs []filedesc.EnumValue, err error) {
|
||||
vs = make([]filedesc.EnumValue, len(vds)) // allocate up-front to ensure stable pointers
|
||||
for i, vd := range vds {
|
||||
v := &vs[i]
|
||||
if v.L0, err = r.makeBase(v, parent, vd.GetName(), i, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if opts := vd.GetOptions(); opts != nil {
|
||||
opts = proto.Clone(opts).(*descriptorpb.EnumValueOptions)
|
||||
v.L1.Options = func() protoreflect.ProtoMessage { return opts }
|
||||
}
|
||||
v.L1.Number = protoreflect.EnumNumber(vd.GetNumber())
|
||||
}
|
||||
return vs, nil
|
||||
}
|
||||
|
||||
func (r descsByName) initMessagesDeclarations(mds []*descriptorpb.DescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (ms []filedesc.Message, err error) {
|
||||
ms = make([]filedesc.Message, len(mds)) // allocate up-front to ensure stable pointers
|
||||
for i, md := range mds {
|
||||
m := &ms[i]
|
||||
m.L2 = new(filedesc.MessageL2)
|
||||
if m.L0, err = r.makeBase(m, parent, md.GetName(), i, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if opts := md.GetOptions(); opts != nil {
|
||||
opts = proto.Clone(opts).(*descriptorpb.MessageOptions)
|
||||
m.L2.Options = func() protoreflect.ProtoMessage { return opts }
|
||||
m.L1.IsMapEntry = opts.GetMapEntry()
|
||||
m.L1.IsMessageSet = opts.GetMessageSetWireFormat()
|
||||
}
|
||||
for _, s := range md.GetReservedName() {
|
||||
m.L2.ReservedNames.List = append(m.L2.ReservedNames.List, protoreflect.Name(s))
|
||||
}
|
||||
for _, rr := range md.GetReservedRange() {
|
||||
m.L2.ReservedRanges.List = append(m.L2.ReservedRanges.List, [2]protoreflect.FieldNumber{
|
||||
protoreflect.FieldNumber(rr.GetStart()),
|
||||
protoreflect.FieldNumber(rr.GetEnd()),
|
||||
})
|
||||
}
|
||||
for _, xr := range md.GetExtensionRange() {
|
||||
m.L2.ExtensionRanges.List = append(m.L2.ExtensionRanges.List, [2]protoreflect.FieldNumber{
|
||||
protoreflect.FieldNumber(xr.GetStart()),
|
||||
protoreflect.FieldNumber(xr.GetEnd()),
|
||||
})
|
||||
var optsFunc func() protoreflect.ProtoMessage
|
||||
if opts := xr.GetOptions(); opts != nil {
|
||||
opts = proto.Clone(opts).(*descriptorpb.ExtensionRangeOptions)
|
||||
optsFunc = func() protoreflect.ProtoMessage { return opts }
|
||||
}
|
||||
m.L2.ExtensionRangeOptions = append(m.L2.ExtensionRangeOptions, optsFunc)
|
||||
}
|
||||
if m.L2.Fields.List, err = r.initFieldsFromDescriptorProto(md.GetField(), m, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if m.L2.Oneofs.List, err = r.initOneofsFromDescriptorProto(md.GetOneofDecl(), m, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if m.L1.Enums.List, err = r.initEnumDeclarations(md.GetEnumType(), m, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if m.L1.Messages.List, err = r.initMessagesDeclarations(md.GetNestedType(), m, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if m.L1.Extensions.List, err = r.initExtensionDeclarations(md.GetExtension(), m, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return ms, nil
|
||||
}
|
||||
|
||||
func (r descsByName) initFieldsFromDescriptorProto(fds []*descriptorpb.FieldDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (fs []filedesc.Field, err error) {
|
||||
fs = make([]filedesc.Field, len(fds)) // allocate up-front to ensure stable pointers
|
||||
for i, fd := range fds {
|
||||
f := &fs[i]
|
||||
if f.L0, err = r.makeBase(f, parent, fd.GetName(), i, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
f.L1.IsProto3Optional = fd.GetProto3Optional()
|
||||
if opts := fd.GetOptions(); opts != nil {
|
||||
opts = proto.Clone(opts).(*descriptorpb.FieldOptions)
|
||||
f.L1.Options = func() protoreflect.ProtoMessage { return opts }
|
||||
f.L1.IsWeak = opts.GetWeak()
|
||||
f.L1.HasPacked = opts.Packed != nil
|
||||
f.L1.IsPacked = opts.GetPacked()
|
||||
}
|
||||
f.L1.Number = protoreflect.FieldNumber(fd.GetNumber())
|
||||
f.L1.Cardinality = protoreflect.Cardinality(fd.GetLabel())
|
||||
if fd.Type != nil {
|
||||
f.L1.Kind = protoreflect.Kind(fd.GetType())
|
||||
}
|
||||
if fd.JsonName != nil {
|
||||
f.L1.StringName.InitJSON(fd.GetJsonName())
|
||||
}
|
||||
}
|
||||
return fs, nil
|
||||
}
|
||||
|
||||
func (r descsByName) initOneofsFromDescriptorProto(ods []*descriptorpb.OneofDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (os []filedesc.Oneof, err error) {
|
||||
os = make([]filedesc.Oneof, len(ods)) // allocate up-front to ensure stable pointers
|
||||
for i, od := range ods {
|
||||
o := &os[i]
|
||||
if o.L0, err = r.makeBase(o, parent, od.GetName(), i, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if opts := od.GetOptions(); opts != nil {
|
||||
opts = proto.Clone(opts).(*descriptorpb.OneofOptions)
|
||||
o.L1.Options = func() protoreflect.ProtoMessage { return opts }
|
||||
}
|
||||
}
|
||||
return os, nil
|
||||
}
|
||||
|
||||
func (r descsByName) initExtensionDeclarations(xds []*descriptorpb.FieldDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (xs []filedesc.Extension, err error) {
|
||||
xs = make([]filedesc.Extension, len(xds)) // allocate up-front to ensure stable pointers
|
||||
for i, xd := range xds {
|
||||
x := &xs[i]
|
||||
x.L2 = new(filedesc.ExtensionL2)
|
||||
if x.L0, err = r.makeBase(x, parent, xd.GetName(), i, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if opts := xd.GetOptions(); opts != nil {
|
||||
opts = proto.Clone(opts).(*descriptorpb.FieldOptions)
|
||||
x.L2.Options = func() protoreflect.ProtoMessage { return opts }
|
||||
x.L2.IsPacked = opts.GetPacked()
|
||||
}
|
||||
x.L1.Number = protoreflect.FieldNumber(xd.GetNumber())
|
||||
x.L1.Cardinality = protoreflect.Cardinality(xd.GetLabel())
|
||||
if xd.Type != nil {
|
||||
x.L1.Kind = protoreflect.Kind(xd.GetType())
|
||||
}
|
||||
if xd.JsonName != nil {
|
||||
x.L2.StringName.InitJSON(xd.GetJsonName())
|
||||
}
|
||||
}
|
||||
return xs, nil
|
||||
}
|
||||
|
||||
func (r descsByName) initServiceDeclarations(sds []*descriptorpb.ServiceDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (ss []filedesc.Service, err error) {
|
||||
ss = make([]filedesc.Service, len(sds)) // allocate up-front to ensure stable pointers
|
||||
for i, sd := range sds {
|
||||
s := &ss[i]
|
||||
s.L2 = new(filedesc.ServiceL2)
|
||||
if s.L0, err = r.makeBase(s, parent, sd.GetName(), i, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if opts := sd.GetOptions(); opts != nil {
|
||||
opts = proto.Clone(opts).(*descriptorpb.ServiceOptions)
|
||||
s.L2.Options = func() protoreflect.ProtoMessage { return opts }
|
||||
}
|
||||
if s.L2.Methods.List, err = r.initMethodsFromDescriptorProto(sd.GetMethod(), s, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return ss, nil
|
||||
}
|
||||
|
||||
func (r descsByName) initMethodsFromDescriptorProto(mds []*descriptorpb.MethodDescriptorProto, parent protoreflect.Descriptor, sb *strs.Builder) (ms []filedesc.Method, err error) {
|
||||
ms = make([]filedesc.Method, len(mds)) // allocate up-front to ensure stable pointers
|
||||
for i, md := range mds {
|
||||
m := &ms[i]
|
||||
if m.L0, err = r.makeBase(m, parent, md.GetName(), i, sb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if opts := md.GetOptions(); opts != nil {
|
||||
opts = proto.Clone(opts).(*descriptorpb.MethodOptions)
|
||||
m.L1.Options = func() protoreflect.ProtoMessage { return opts }
|
||||
}
|
||||
m.L1.IsStreamingClient = md.GetClientStreaming()
|
||||
m.L1.IsStreamingServer = md.GetServerStreaming()
|
||||
}
|
||||
return ms, nil
|
||||
}
|
||||
|
||||
func (r descsByName) makeBase(child, parent protoreflect.Descriptor, name string, idx int, sb *strs.Builder) (filedesc.BaseL0, error) {
|
||||
if !protoreflect.Name(name).IsValid() {
|
||||
return filedesc.BaseL0{}, errors.New("descriptor %q has an invalid nested name: %q", parent.FullName(), name)
|
||||
}
|
||||
|
||||
// Derive the full name of the child.
|
||||
// Note that enum values are a sibling to the enum parent in the namespace.
|
||||
var fullName protoreflect.FullName
|
||||
if _, ok := parent.(protoreflect.EnumDescriptor); ok {
|
||||
fullName = sb.AppendFullName(parent.FullName().Parent(), protoreflect.Name(name))
|
||||
} else {
|
||||
fullName = sb.AppendFullName(parent.FullName(), protoreflect.Name(name))
|
||||
}
|
||||
if _, ok := r[fullName]; ok {
|
||||
return filedesc.BaseL0{}, errors.New("descriptor %q already declared", fullName)
|
||||
}
|
||||
r[fullName] = child
|
||||
|
||||
// TODO: Verify that the full name does not already exist in the resolver?
|
||||
// This is not as critical since most usages of NewFile will register
|
||||
// the created file back into the registry, which will perform this check.
|
||||
|
||||
return filedesc.BaseL0{
|
||||
FullName: fullName,
|
||||
ParentFile: parent.ParentFile().(*filedesc.File),
|
||||
Parent: parent,
|
||||
Index: idx,
|
||||
}, nil
|
||||
}
|
286
gateway/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go
generated
vendored
286
gateway/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go
generated
vendored
@ -1,286 +0,0 @@
|
||||
// Copyright 2019 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 protodesc
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/internal/encoding/defval"
|
||||
"google.golang.org/protobuf/internal/errors"
|
||||
"google.golang.org/protobuf/internal/filedesc"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
|
||||
"google.golang.org/protobuf/types/descriptorpb"
|
||||
)
|
||||
|
||||
// resolver is a wrapper around a local registry of declarations within the file
|
||||
// and the remote resolver. The remote resolver is restricted to only return
|
||||
// descriptors that have been imported.
|
||||
type resolver struct {
|
||||
local descsByName
|
||||
remote Resolver
|
||||
imports importSet
|
||||
|
||||
allowUnresolvable bool
|
||||
}
|
||||
|
||||
func (r *resolver) resolveMessageDependencies(ms []filedesc.Message, mds []*descriptorpb.DescriptorProto) (err error) {
|
||||
for i, md := range mds {
|
||||
m := &ms[i]
|
||||
for j, fd := range md.GetField() {
|
||||
f := &m.L2.Fields.List[j]
|
||||
if f.L1.Cardinality == protoreflect.Required {
|
||||
m.L2.RequiredNumbers.List = append(m.L2.RequiredNumbers.List, f.L1.Number)
|
||||
}
|
||||
if fd.OneofIndex != nil {
|
||||
k := int(fd.GetOneofIndex())
|
||||
if !(0 <= k && k < len(md.GetOneofDecl())) {
|
||||
return errors.New("message field %q has an invalid oneof index: %d", f.FullName(), k)
|
||||
}
|
||||
o := &m.L2.Oneofs.List[k]
|
||||
f.L1.ContainingOneof = o
|
||||
o.L1.Fields.List = append(o.L1.Fields.List, f)
|
||||
}
|
||||
|
||||
if f.L1.Kind, f.L1.Enum, f.L1.Message, err = r.findTarget(f.Kind(), f.Parent().FullName(), partialName(fd.GetTypeName()), f.IsWeak()); err != nil {
|
||||
return errors.New("message field %q cannot resolve type: %v", f.FullName(), err)
|
||||
}
|
||||
if fd.DefaultValue != nil {
|
||||
v, ev, err := unmarshalDefault(fd.GetDefaultValue(), f, r.allowUnresolvable)
|
||||
if err != nil {
|
||||
return errors.New("message field %q has invalid default: %v", f.FullName(), err)
|
||||
}
|
||||
f.L1.Default = filedesc.DefaultValue(v, ev)
|
||||
}
|
||||
}
|
||||
|
||||
if err := r.resolveMessageDependencies(m.L1.Messages.List, md.GetNestedType()); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := r.resolveExtensionDependencies(m.L1.Extensions.List, md.GetExtension()); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *resolver) resolveExtensionDependencies(xs []filedesc.Extension, xds []*descriptorpb.FieldDescriptorProto) (err error) {
|
||||
for i, xd := range xds {
|
||||
x := &xs[i]
|
||||
if x.L1.Extendee, err = r.findMessageDescriptor(x.Parent().FullName(), partialName(xd.GetExtendee()), false); err != nil {
|
||||
return errors.New("extension field %q cannot resolve extendee: %v", x.FullName(), err)
|
||||
}
|
||||
if x.L1.Kind, x.L2.Enum, x.L2.Message, err = r.findTarget(x.Kind(), x.Parent().FullName(), partialName(xd.GetTypeName()), false); err != nil {
|
||||
return errors.New("extension field %q cannot resolve type: %v", x.FullName(), err)
|
||||
}
|
||||
if xd.DefaultValue != nil {
|
||||
v, ev, err := unmarshalDefault(xd.GetDefaultValue(), x, r.allowUnresolvable)
|
||||
if err != nil {
|
||||
return errors.New("extension field %q has invalid default: %v", x.FullName(), err)
|
||||
}
|
||||
x.L2.Default = filedesc.DefaultValue(v, ev)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *resolver) resolveServiceDependencies(ss []filedesc.Service, sds []*descriptorpb.ServiceDescriptorProto) (err error) {
|
||||
for i, sd := range sds {
|
||||
s := &ss[i]
|
||||
for j, md := range sd.GetMethod() {
|
||||
m := &s.L2.Methods.List[j]
|
||||
m.L1.Input, err = r.findMessageDescriptor(m.Parent().FullName(), partialName(md.GetInputType()), false)
|
||||
if err != nil {
|
||||
return errors.New("service method %q cannot resolve input: %v", m.FullName(), err)
|
||||
}
|
||||
m.L1.Output, err = r.findMessageDescriptor(s.FullName(), partialName(md.GetOutputType()), false)
|
||||
if err != nil {
|
||||
return errors.New("service method %q cannot resolve output: %v", m.FullName(), err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// findTarget finds an enum or message descriptor if k is an enum, message,
|
||||
// group, or unknown. If unknown, and the name could be resolved, the kind
|
||||
// returned kind is set based on the type of the resolved descriptor.
|
||||
func (r *resolver) findTarget(k protoreflect.Kind, scope protoreflect.FullName, ref partialName, isWeak bool) (protoreflect.Kind, protoreflect.EnumDescriptor, protoreflect.MessageDescriptor, error) {
|
||||
switch k {
|
||||
case protoreflect.EnumKind:
|
||||
ed, err := r.findEnumDescriptor(scope, ref, isWeak)
|
||||
if err != nil {
|
||||
return 0, nil, nil, err
|
||||
}
|
||||
return k, ed, nil, nil
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
md, err := r.findMessageDescriptor(scope, ref, isWeak)
|
||||
if err != nil {
|
||||
return 0, nil, nil, err
|
||||
}
|
||||
return k, nil, md, nil
|
||||
case 0:
|
||||
// Handle unspecified kinds (possible with parsers that operate
|
||||
// on a per-file basis without knowledge of dependencies).
|
||||
d, err := r.findDescriptor(scope, ref)
|
||||
if err == protoregistry.NotFound && (r.allowUnresolvable || isWeak) {
|
||||
return k, filedesc.PlaceholderEnum(ref.FullName()), filedesc.PlaceholderMessage(ref.FullName()), nil
|
||||
} else if err == protoregistry.NotFound {
|
||||
return 0, nil, nil, errors.New("%q not found", ref.FullName())
|
||||
} else if err != nil {
|
||||
return 0, nil, nil, err
|
||||
}
|
||||
switch d := d.(type) {
|
||||
case protoreflect.EnumDescriptor:
|
||||
return protoreflect.EnumKind, d, nil, nil
|
||||
case protoreflect.MessageDescriptor:
|
||||
return protoreflect.MessageKind, nil, d, nil
|
||||
default:
|
||||
return 0, nil, nil, errors.New("unknown kind")
|
||||
}
|
||||
default:
|
||||
if ref != "" {
|
||||
return 0, nil, nil, errors.New("target name cannot be specified for %v", k)
|
||||
}
|
||||
if !k.IsValid() {
|
||||
return 0, nil, nil, errors.New("invalid kind: %d", k)
|
||||
}
|
||||
return k, nil, nil, nil
|
||||
}
|
||||
}
|
||||
|
||||
// findDescriptor finds the descriptor by name,
|
||||
// which may be a relative name within some scope.
|
||||
//
|
||||
// Suppose the scope was "fizz.buzz" and the reference was "Foo.Bar",
|
||||
// then the following full names are searched:
|
||||
// - fizz.buzz.Foo.Bar
|
||||
// - fizz.Foo.Bar
|
||||
// - Foo.Bar
|
||||
func (r *resolver) findDescriptor(scope protoreflect.FullName, ref partialName) (protoreflect.Descriptor, error) {
|
||||
if !ref.IsValid() {
|
||||
return nil, errors.New("invalid name reference: %q", ref)
|
||||
}
|
||||
if ref.IsFull() {
|
||||
scope, ref = "", ref[1:]
|
||||
}
|
||||
var foundButNotImported protoreflect.Descriptor
|
||||
for {
|
||||
// Derive the full name to search.
|
||||
s := protoreflect.FullName(ref)
|
||||
if scope != "" {
|
||||
s = scope + "." + s
|
||||
}
|
||||
|
||||
// Check the current file for the descriptor.
|
||||
if d, ok := r.local[s]; ok {
|
||||
return d, nil
|
||||
}
|
||||
|
||||
// Check the remote registry for the descriptor.
|
||||
d, err := r.remote.FindDescriptorByName(s)
|
||||
if err == nil {
|
||||
// Only allow descriptors covered by one of the imports.
|
||||
if r.imports[d.ParentFile().Path()] {
|
||||
return d, nil
|
||||
}
|
||||
foundButNotImported = d
|
||||
} else if err != protoregistry.NotFound {
|
||||
return nil, errors.Wrap(err, "%q", s)
|
||||
}
|
||||
|
||||
// Continue on at a higher level of scoping.
|
||||
if scope == "" {
|
||||
if d := foundButNotImported; d != nil {
|
||||
return nil, errors.New("resolved %q, but %q is not imported", d.FullName(), d.ParentFile().Path())
|
||||
}
|
||||
return nil, protoregistry.NotFound
|
||||
}
|
||||
scope = scope.Parent()
|
||||
}
|
||||
}
|
||||
|
||||
func (r *resolver) findEnumDescriptor(scope protoreflect.FullName, ref partialName, isWeak bool) (protoreflect.EnumDescriptor, error) {
|
||||
d, err := r.findDescriptor(scope, ref)
|
||||
if err == protoregistry.NotFound && (r.allowUnresolvable || isWeak) {
|
||||
return filedesc.PlaceholderEnum(ref.FullName()), nil
|
||||
} else if err == protoregistry.NotFound {
|
||||
return nil, errors.New("%q not found", ref.FullName())
|
||||
} else if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ed, ok := d.(protoreflect.EnumDescriptor)
|
||||
if !ok {
|
||||
return nil, errors.New("resolved %q, but it is not an enum", d.FullName())
|
||||
}
|
||||
return ed, nil
|
||||
}
|
||||
|
||||
func (r *resolver) findMessageDescriptor(scope protoreflect.FullName, ref partialName, isWeak bool) (protoreflect.MessageDescriptor, error) {
|
||||
d, err := r.findDescriptor(scope, ref)
|
||||
if err == protoregistry.NotFound && (r.allowUnresolvable || isWeak) {
|
||||
return filedesc.PlaceholderMessage(ref.FullName()), nil
|
||||
} else if err == protoregistry.NotFound {
|
||||
return nil, errors.New("%q not found", ref.FullName())
|
||||
} else if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
md, ok := d.(protoreflect.MessageDescriptor)
|
||||
if !ok {
|
||||
return nil, errors.New("resolved %q, but it is not an message", d.FullName())
|
||||
}
|
||||
return md, nil
|
||||
}
|
||||
|
||||
// partialName is the partial name. A leading dot means that the name is full,
|
||||
// otherwise the name is relative to some current scope.
|
||||
// See google.protobuf.FieldDescriptorProto.type_name.
|
||||
type partialName string
|
||||
|
||||
func (s partialName) IsFull() bool {
|
||||
return len(s) > 0 && s[0] == '.'
|
||||
}
|
||||
|
||||
func (s partialName) IsValid() bool {
|
||||
if s.IsFull() {
|
||||
return protoreflect.FullName(s[1:]).IsValid()
|
||||
}
|
||||
return protoreflect.FullName(s).IsValid()
|
||||
}
|
||||
|
||||
const unknownPrefix = "*."
|
||||
|
||||
// FullName converts the partial name to a full name on a best-effort basis.
|
||||
// If relative, it creates an invalid full name, using a "*." prefix
|
||||
// to indicate that the start of the full name is unknown.
|
||||
func (s partialName) FullName() protoreflect.FullName {
|
||||
if s.IsFull() {
|
||||
return protoreflect.FullName(s[1:])
|
||||
}
|
||||
return protoreflect.FullName(unknownPrefix + s)
|
||||
}
|
||||
|
||||
func unmarshalDefault(s string, fd protoreflect.FieldDescriptor, allowUnresolvable bool) (protoreflect.Value, protoreflect.EnumValueDescriptor, error) {
|
||||
var evs protoreflect.EnumValueDescriptors
|
||||
if fd.Enum() != nil {
|
||||
evs = fd.Enum().Values()
|
||||
}
|
||||
v, ev, err := defval.Unmarshal(s, fd.Kind(), evs, defval.Descriptor)
|
||||
if err != nil && allowUnresolvable && evs != nil && protoreflect.Name(s).IsValid() {
|
||||
v = protoreflect.ValueOfEnum(0)
|
||||
if evs.Len() > 0 {
|
||||
v = protoreflect.ValueOfEnum(evs.Get(0).Number())
|
||||
}
|
||||
ev = filedesc.PlaceholderEnumValue(fd.Enum().FullName().Parent().Append(protoreflect.Name(s)))
|
||||
} else if err != nil {
|
||||
return v, ev, err
|
||||
}
|
||||
if fd.Syntax() == protoreflect.Proto3 {
|
||||
return v, ev, errors.New("cannot be specified under proto3 semantics")
|
||||
}
|
||||
if fd.Kind() == protoreflect.MessageKind || fd.Kind() == protoreflect.GroupKind || fd.Cardinality() == protoreflect.Repeated {
|
||||
return v, ev, errors.New("cannot be specified on composite types")
|
||||
}
|
||||
return v, ev, nil
|
||||
}
|
374
gateway/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go
generated
vendored
374
gateway/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go
generated
vendored
@ -1,374 +0,0 @@
|
||||
// Copyright 2019 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 protodesc
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/internal/errors"
|
||||
"google.golang.org/protobuf/internal/filedesc"
|
||||
"google.golang.org/protobuf/internal/flags"
|
||||
"google.golang.org/protobuf/internal/genid"
|
||||
"google.golang.org/protobuf/internal/strs"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"google.golang.org/protobuf/types/descriptorpb"
|
||||
)
|
||||
|
||||
func validateEnumDeclarations(es []filedesc.Enum, eds []*descriptorpb.EnumDescriptorProto) error {
|
||||
for i, ed := range eds {
|
||||
e := &es[i]
|
||||
if err := e.L2.ReservedNames.CheckValid(); err != nil {
|
||||
return errors.New("enum %q reserved names has %v", e.FullName(), err)
|
||||
}
|
||||
if err := e.L2.ReservedRanges.CheckValid(); err != nil {
|
||||
return errors.New("enum %q reserved ranges has %v", e.FullName(), err)
|
||||
}
|
||||
if len(ed.GetValue()) == 0 {
|
||||
return errors.New("enum %q must contain at least one value declaration", e.FullName())
|
||||
}
|
||||
allowAlias := ed.GetOptions().GetAllowAlias()
|
||||
foundAlias := false
|
||||
for i := 0; i < e.Values().Len(); i++ {
|
||||
v1 := e.Values().Get(i)
|
||||
if v2 := e.Values().ByNumber(v1.Number()); v1 != v2 {
|
||||
foundAlias = true
|
||||
if !allowAlias {
|
||||
return errors.New("enum %q has conflicting non-aliased values on number %d: %q with %q", e.FullName(), v1.Number(), v1.Name(), v2.Name())
|
||||
}
|
||||
}
|
||||
}
|
||||
if allowAlias && !foundAlias {
|
||||
return errors.New("enum %q allows aliases, but none were found", e.FullName())
|
||||
}
|
||||
if e.Syntax() == protoreflect.Proto3 {
|
||||
if v := e.Values().Get(0); v.Number() != 0 {
|
||||
return errors.New("enum %q using proto3 semantics must have zero number for the first value", v.FullName())
|
||||
}
|
||||
// Verify that value names in proto3 do not conflict if the
|
||||
// case-insensitive prefix is removed.
|
||||
// See protoc v3.8.0: src/google/protobuf/descriptor.cc:4991-5055
|
||||
names := map[string]protoreflect.EnumValueDescriptor{}
|
||||
prefix := strings.Replace(strings.ToLower(string(e.Name())), "_", "", -1)
|
||||
for i := 0; i < e.Values().Len(); i++ {
|
||||
v1 := e.Values().Get(i)
|
||||
s := strs.EnumValueName(strs.TrimEnumPrefix(string(v1.Name()), prefix))
|
||||
if v2, ok := names[s]; ok && v1.Number() != v2.Number() {
|
||||
return errors.New("enum %q using proto3 semantics has conflict: %q with %q", e.FullName(), v1.Name(), v2.Name())
|
||||
}
|
||||
names[s] = v1
|
||||
}
|
||||
}
|
||||
|
||||
for j, vd := range ed.GetValue() {
|
||||
v := &e.L2.Values.List[j]
|
||||
if vd.Number == nil {
|
||||
return errors.New("enum value %q must have a specified number", v.FullName())
|
||||
}
|
||||
if e.L2.ReservedNames.Has(v.Name()) {
|
||||
return errors.New("enum value %q must not use reserved name", v.FullName())
|
||||
}
|
||||
if e.L2.ReservedRanges.Has(v.Number()) {
|
||||
return errors.New("enum value %q must not use reserved number %d", v.FullName(), v.Number())
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateMessageDeclarations(ms []filedesc.Message, mds []*descriptorpb.DescriptorProto) error {
|
||||
for i, md := range mds {
|
||||
m := &ms[i]
|
||||
|
||||
// Handle the message descriptor itself.
|
||||
isMessageSet := md.GetOptions().GetMessageSetWireFormat()
|
||||
if err := m.L2.ReservedNames.CheckValid(); err != nil {
|
||||
return errors.New("message %q reserved names has %v", m.FullName(), err)
|
||||
}
|
||||
if err := m.L2.ReservedRanges.CheckValid(isMessageSet); err != nil {
|
||||
return errors.New("message %q reserved ranges has %v", m.FullName(), err)
|
||||
}
|
||||
if err := m.L2.ExtensionRanges.CheckValid(isMessageSet); err != nil {
|
||||
return errors.New("message %q extension ranges has %v", m.FullName(), err)
|
||||
}
|
||||
if err := (*filedesc.FieldRanges).CheckOverlap(&m.L2.ReservedRanges, &m.L2.ExtensionRanges); err != nil {
|
||||
return errors.New("message %q reserved and extension ranges has %v", m.FullName(), err)
|
||||
}
|
||||
for i := 0; i < m.Fields().Len(); i++ {
|
||||
f1 := m.Fields().Get(i)
|
||||
if f2 := m.Fields().ByNumber(f1.Number()); f1 != f2 {
|
||||
return errors.New("message %q has conflicting fields: %q with %q", m.FullName(), f1.Name(), f2.Name())
|
||||
}
|
||||
}
|
||||
if isMessageSet && !flags.ProtoLegacy {
|
||||
return errors.New("message %q is a MessageSet, which is a legacy proto1 feature that is no longer supported", m.FullName())
|
||||
}
|
||||
if isMessageSet && (m.Syntax() != protoreflect.Proto2 || m.Fields().Len() > 0 || m.ExtensionRanges().Len() == 0) {
|
||||
return errors.New("message %q is an invalid proto1 MessageSet", m.FullName())
|
||||
}
|
||||
if m.Syntax() == protoreflect.Proto3 {
|
||||
if m.ExtensionRanges().Len() > 0 {
|
||||
return errors.New("message %q using proto3 semantics cannot have extension ranges", m.FullName())
|
||||
}
|
||||
// Verify that field names in proto3 do not conflict if lowercased
|
||||
// with all underscores removed.
|
||||
// See protoc v3.8.0: src/google/protobuf/descriptor.cc:5830-5847
|
||||
names := map[string]protoreflect.FieldDescriptor{}
|
||||
for i := 0; i < m.Fields().Len(); i++ {
|
||||
f1 := m.Fields().Get(i)
|
||||
s := strings.Replace(strings.ToLower(string(f1.Name())), "_", "", -1)
|
||||
if f2, ok := names[s]; ok {
|
||||
return errors.New("message %q using proto3 semantics has conflict: %q with %q", m.FullName(), f1.Name(), f2.Name())
|
||||
}
|
||||
names[s] = f1
|
||||
}
|
||||
}
|
||||
|
||||
for j, fd := range md.GetField() {
|
||||
f := &m.L2.Fields.List[j]
|
||||
if m.L2.ReservedNames.Has(f.Name()) {
|
||||
return errors.New("message field %q must not use reserved name", f.FullName())
|
||||
}
|
||||
if !f.Number().IsValid() {
|
||||
return errors.New("message field %q has an invalid number: %d", f.FullName(), f.Number())
|
||||
}
|
||||
if !f.Cardinality().IsValid() {
|
||||
return errors.New("message field %q has an invalid cardinality: %d", f.FullName(), f.Cardinality())
|
||||
}
|
||||
if m.L2.ReservedRanges.Has(f.Number()) {
|
||||
return errors.New("message field %q must not use reserved number %d", f.FullName(), f.Number())
|
||||
}
|
||||
if m.L2.ExtensionRanges.Has(f.Number()) {
|
||||
return errors.New("message field %q with number %d in extension range", f.FullName(), f.Number())
|
||||
}
|
||||
if fd.Extendee != nil {
|
||||
return errors.New("message field %q may not have extendee: %q", f.FullName(), fd.GetExtendee())
|
||||
}
|
||||
if f.L1.IsProto3Optional {
|
||||
if f.Syntax() != protoreflect.Proto3 {
|
||||
return errors.New("message field %q under proto3 optional semantics must be specified in the proto3 syntax", f.FullName())
|
||||
}
|
||||
if f.Cardinality() != protoreflect.Optional {
|
||||
return errors.New("message field %q under proto3 optional semantics must have optional cardinality", f.FullName())
|
||||
}
|
||||
if f.ContainingOneof() != nil && f.ContainingOneof().Fields().Len() != 1 {
|
||||
return errors.New("message field %q under proto3 optional semantics must be within a single element oneof", f.FullName())
|
||||
}
|
||||
}
|
||||
if f.IsWeak() && !flags.ProtoLegacy {
|
||||
return errors.New("message field %q is a weak field, which is a legacy proto1 feature that is no longer supported", f.FullName())
|
||||
}
|
||||
if f.IsWeak() && (f.Syntax() != protoreflect.Proto2 || !isOptionalMessage(f) || f.ContainingOneof() != nil) {
|
||||
return errors.New("message field %q may only be weak for an optional message", f.FullName())
|
||||
}
|
||||
if f.IsPacked() && !isPackable(f) {
|
||||
return errors.New("message field %q is not packable", f.FullName())
|
||||
}
|
||||
if err := checkValidGroup(f); err != nil {
|
||||
return errors.New("message field %q is an invalid group: %v", f.FullName(), err)
|
||||
}
|
||||
if err := checkValidMap(f); err != nil {
|
||||
return errors.New("message field %q is an invalid map: %v", f.FullName(), err)
|
||||
}
|
||||
if f.Syntax() == protoreflect.Proto3 {
|
||||
if f.Cardinality() == protoreflect.Required {
|
||||
return errors.New("message field %q using proto3 semantics cannot be required", f.FullName())
|
||||
}
|
||||
if f.Enum() != nil && !f.Enum().IsPlaceholder() && f.Enum().Syntax() != protoreflect.Proto3 {
|
||||
return errors.New("message field %q using proto3 semantics may only depend on a proto3 enum", f.FullName())
|
||||
}
|
||||
}
|
||||
}
|
||||
seenSynthetic := false // synthetic oneofs for proto3 optional must come after real oneofs
|
||||
for j := range md.GetOneofDecl() {
|
||||
o := &m.L2.Oneofs.List[j]
|
||||
if o.Fields().Len() == 0 {
|
||||
return errors.New("message oneof %q must contain at least one field declaration", o.FullName())
|
||||
}
|
||||
if n := o.Fields().Len(); n-1 != (o.Fields().Get(n-1).Index() - o.Fields().Get(0).Index()) {
|
||||
return errors.New("message oneof %q must have consecutively declared fields", o.FullName())
|
||||
}
|
||||
|
||||
if o.IsSynthetic() {
|
||||
seenSynthetic = true
|
||||
continue
|
||||
}
|
||||
if !o.IsSynthetic() && seenSynthetic {
|
||||
return errors.New("message oneof %q must be declared before synthetic oneofs", o.FullName())
|
||||
}
|
||||
|
||||
for i := 0; i < o.Fields().Len(); i++ {
|
||||
f := o.Fields().Get(i)
|
||||
if f.Cardinality() != protoreflect.Optional {
|
||||
return errors.New("message field %q belongs in a oneof and must be optional", f.FullName())
|
||||
}
|
||||
if f.IsWeak() {
|
||||
return errors.New("message field %q belongs in a oneof and must not be a weak reference", f.FullName())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if err := validateEnumDeclarations(m.L1.Enums.List, md.GetEnumType()); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validateMessageDeclarations(m.L1.Messages.List, md.GetNestedType()); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validateExtensionDeclarations(m.L1.Extensions.List, md.GetExtension()); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateExtensionDeclarations(xs []filedesc.Extension, xds []*descriptorpb.FieldDescriptorProto) error {
|
||||
for i, xd := range xds {
|
||||
x := &xs[i]
|
||||
// NOTE: Avoid using the IsValid method since extensions to MessageSet
|
||||
// may have a field number higher than normal. This check only verifies
|
||||
// that the number is not negative or reserved. We check again later
|
||||
// if we know that the extendee is definitely not a MessageSet.
|
||||
if n := x.Number(); n < 0 || (protowire.FirstReservedNumber <= n && n <= protowire.LastReservedNumber) {
|
||||
return errors.New("extension field %q has an invalid number: %d", x.FullName(), x.Number())
|
||||
}
|
||||
if !x.Cardinality().IsValid() || x.Cardinality() == protoreflect.Required {
|
||||
return errors.New("extension field %q has an invalid cardinality: %d", x.FullName(), x.Cardinality())
|
||||
}
|
||||
if xd.JsonName != nil {
|
||||
// A bug in older versions of protoc would always populate the
|
||||
// "json_name" option for extensions when it is meaningless.
|
||||
// When it did so, it would always use the camel-cased field name.
|
||||
if xd.GetJsonName() != strs.JSONCamelCase(string(x.Name())) {
|
||||
return errors.New("extension field %q may not have an explicitly set JSON name: %q", x.FullName(), xd.GetJsonName())
|
||||
}
|
||||
}
|
||||
if xd.OneofIndex != nil {
|
||||
return errors.New("extension field %q may not be part of a oneof", x.FullName())
|
||||
}
|
||||
if md := x.ContainingMessage(); !md.IsPlaceholder() {
|
||||
if !md.ExtensionRanges().Has(x.Number()) {
|
||||
return errors.New("extension field %q extends %q with non-extension field number: %d", x.FullName(), md.FullName(), x.Number())
|
||||
}
|
||||
isMessageSet := md.Options().(*descriptorpb.MessageOptions).GetMessageSetWireFormat()
|
||||
if isMessageSet && !isOptionalMessage(x) {
|
||||
return errors.New("extension field %q extends MessageSet and must be an optional message", x.FullName())
|
||||
}
|
||||
if !isMessageSet && !x.Number().IsValid() {
|
||||
return errors.New("extension field %q has an invalid number: %d", x.FullName(), x.Number())
|
||||
}
|
||||
}
|
||||
if xd.GetOptions().GetWeak() {
|
||||
return errors.New("extension field %q cannot be a weak reference", x.FullName())
|
||||
}
|
||||
if x.IsPacked() && !isPackable(x) {
|
||||
return errors.New("extension field %q is not packable", x.FullName())
|
||||
}
|
||||
if err := checkValidGroup(x); err != nil {
|
||||
return errors.New("extension field %q is an invalid group: %v", x.FullName(), err)
|
||||
}
|
||||
if md := x.Message(); md != nil && md.IsMapEntry() {
|
||||
return errors.New("extension field %q cannot be a map entry", x.FullName())
|
||||
}
|
||||
if x.Syntax() == protoreflect.Proto3 {
|
||||
switch x.ContainingMessage().FullName() {
|
||||
case (*descriptorpb.FileOptions)(nil).ProtoReflect().Descriptor().FullName():
|
||||
case (*descriptorpb.EnumOptions)(nil).ProtoReflect().Descriptor().FullName():
|
||||
case (*descriptorpb.EnumValueOptions)(nil).ProtoReflect().Descriptor().FullName():
|
||||
case (*descriptorpb.MessageOptions)(nil).ProtoReflect().Descriptor().FullName():
|
||||
case (*descriptorpb.FieldOptions)(nil).ProtoReflect().Descriptor().FullName():
|
||||
case (*descriptorpb.OneofOptions)(nil).ProtoReflect().Descriptor().FullName():
|
||||
case (*descriptorpb.ExtensionRangeOptions)(nil).ProtoReflect().Descriptor().FullName():
|
||||
case (*descriptorpb.ServiceOptions)(nil).ProtoReflect().Descriptor().FullName():
|
||||
case (*descriptorpb.MethodOptions)(nil).ProtoReflect().Descriptor().FullName():
|
||||
default:
|
||||
return errors.New("extension field %q cannot be declared in proto3 unless extended descriptor options", x.FullName())
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// isOptionalMessage reports whether this is an optional message.
|
||||
// If the kind is unknown, it is assumed to be a message.
|
||||
func isOptionalMessage(fd protoreflect.FieldDescriptor) bool {
|
||||
return (fd.Kind() == 0 || fd.Kind() == protoreflect.MessageKind) && fd.Cardinality() == protoreflect.Optional
|
||||
}
|
||||
|
||||
// isPackable checks whether the pack option can be specified.
|
||||
func isPackable(fd protoreflect.FieldDescriptor) bool {
|
||||
switch fd.Kind() {
|
||||
case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
return false
|
||||
}
|
||||
return fd.IsList()
|
||||
}
|
||||
|
||||
// checkValidGroup reports whether fd is a valid group according to the same
|
||||
// rules that protoc imposes.
|
||||
func checkValidGroup(fd protoreflect.FieldDescriptor) error {
|
||||
md := fd.Message()
|
||||
switch {
|
||||
case fd.Kind() != protoreflect.GroupKind:
|
||||
return nil
|
||||
case fd.Syntax() != protoreflect.Proto2:
|
||||
return errors.New("invalid under proto2 semantics")
|
||||
case md == nil || md.IsPlaceholder():
|
||||
return errors.New("message must be resolvable")
|
||||
case fd.FullName().Parent() != md.FullName().Parent():
|
||||
return errors.New("message and field must be declared in the same scope")
|
||||
case !unicode.IsUpper(rune(md.Name()[0])):
|
||||
return errors.New("message name must start with an uppercase")
|
||||
case fd.Name() != protoreflect.Name(strings.ToLower(string(md.Name()))):
|
||||
return errors.New("field name must be lowercased form of the message name")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// checkValidMap checks whether the field is a valid map according to the same
|
||||
// rules that protoc imposes.
|
||||
// See protoc v3.8.0: src/google/protobuf/descriptor.cc:6045-6115
|
||||
func checkValidMap(fd protoreflect.FieldDescriptor) error {
|
||||
md := fd.Message()
|
||||
switch {
|
||||
case md == nil || !md.IsMapEntry():
|
||||
return nil
|
||||
case fd.FullName().Parent() != md.FullName().Parent():
|
||||
return errors.New("message and field must be declared in the same scope")
|
||||
case md.Name() != protoreflect.Name(strs.MapEntryName(string(fd.Name()))):
|
||||
return errors.New("incorrect implicit map entry name")
|
||||
case fd.Cardinality() != protoreflect.Repeated:
|
||||
return errors.New("field must be repeated")
|
||||
case md.Fields().Len() != 2:
|
||||
return errors.New("message must have exactly two fields")
|
||||
case md.ExtensionRanges().Len() > 0:
|
||||
return errors.New("message must not have any extension ranges")
|
||||
case md.Enums().Len()+md.Messages().Len()+md.Extensions().Len() > 0:
|
||||
return errors.New("message must not have any nested declarations")
|
||||
}
|
||||
kf := md.Fields().Get(0)
|
||||
vf := md.Fields().Get(1)
|
||||
switch {
|
||||
case kf.Name() != genid.MapEntry_Key_field_name || kf.Number() != genid.MapEntry_Key_field_number || kf.Cardinality() != protoreflect.Optional || kf.ContainingOneof() != nil || kf.HasDefault():
|
||||
return errors.New("invalid key field")
|
||||
case vf.Name() != genid.MapEntry_Value_field_name || vf.Number() != genid.MapEntry_Value_field_number || vf.Cardinality() != protoreflect.Optional || vf.ContainingOneof() != nil || vf.HasDefault():
|
||||
return errors.New("invalid value field")
|
||||
}
|
||||
switch kf.Kind() {
|
||||
case protoreflect.BoolKind: // bool
|
||||
case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: // int32
|
||||
case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: // int64
|
||||
case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: // uint32
|
||||
case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: // uint64
|
||||
case protoreflect.StringKind: // string
|
||||
default:
|
||||
return errors.New("invalid key kind: %v", kf.Kind())
|
||||
}
|
||||
if e := vf.Enum(); e != nil && e.Values().Len() > 0 && e.Values().Get(0).Number() != 0 {
|
||||
return errors.New("map enum value must have zero number for the first value")
|
||||
}
|
||||
return nil
|
||||
}
|
252
gateway/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go
generated
vendored
252
gateway/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go
generated
vendored
@ -1,252 +0,0 @@
|
||||
// Copyright 2019 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 protodesc
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"google.golang.org/protobuf/internal/encoding/defval"
|
||||
"google.golang.org/protobuf/internal/strs"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"google.golang.org/protobuf/types/descriptorpb"
|
||||
)
|
||||
|
||||
// ToFileDescriptorProto copies a protoreflect.FileDescriptor into a
|
||||
// google.protobuf.FileDescriptorProto message.
|
||||
func ToFileDescriptorProto(file protoreflect.FileDescriptor) *descriptorpb.FileDescriptorProto {
|
||||
p := &descriptorpb.FileDescriptorProto{
|
||||
Name: proto.String(file.Path()),
|
||||
Options: proto.Clone(file.Options()).(*descriptorpb.FileOptions),
|
||||
}
|
||||
if file.Package() != "" {
|
||||
p.Package = proto.String(string(file.Package()))
|
||||
}
|
||||
for i, imports := 0, file.Imports(); i < imports.Len(); i++ {
|
||||
imp := imports.Get(i)
|
||||
p.Dependency = append(p.Dependency, imp.Path())
|
||||
if imp.IsPublic {
|
||||
p.PublicDependency = append(p.PublicDependency, int32(i))
|
||||
}
|
||||
if imp.IsWeak {
|
||||
p.WeakDependency = append(p.WeakDependency, int32(i))
|
||||
}
|
||||
}
|
||||
for i, locs := 0, file.SourceLocations(); i < locs.Len(); i++ {
|
||||
loc := locs.Get(i)
|
||||
l := &descriptorpb.SourceCodeInfo_Location{}
|
||||
l.Path = append(l.Path, loc.Path...)
|
||||
if loc.StartLine == loc.EndLine {
|
||||
l.Span = []int32{int32(loc.StartLine), int32(loc.StartColumn), int32(loc.EndColumn)}
|
||||
} else {
|
||||
l.Span = []int32{int32(loc.StartLine), int32(loc.StartColumn), int32(loc.EndLine), int32(loc.EndColumn)}
|
||||
}
|
||||
l.LeadingDetachedComments = append([]string(nil), loc.LeadingDetachedComments...)
|
||||
if loc.LeadingComments != "" {
|
||||
l.LeadingComments = proto.String(loc.LeadingComments)
|
||||
}
|
||||
if loc.TrailingComments != "" {
|
||||
l.TrailingComments = proto.String(loc.TrailingComments)
|
||||
}
|
||||
if p.SourceCodeInfo == nil {
|
||||
p.SourceCodeInfo = &descriptorpb.SourceCodeInfo{}
|
||||
}
|
||||
p.SourceCodeInfo.Location = append(p.SourceCodeInfo.Location, l)
|
||||
|
||||
}
|
||||
for i, messages := 0, file.Messages(); i < messages.Len(); i++ {
|
||||
p.MessageType = append(p.MessageType, ToDescriptorProto(messages.Get(i)))
|
||||
}
|
||||
for i, enums := 0, file.Enums(); i < enums.Len(); i++ {
|
||||
p.EnumType = append(p.EnumType, ToEnumDescriptorProto(enums.Get(i)))
|
||||
}
|
||||
for i, services := 0, file.Services(); i < services.Len(); i++ {
|
||||
p.Service = append(p.Service, ToServiceDescriptorProto(services.Get(i)))
|
||||
}
|
||||
for i, exts := 0, file.Extensions(); i < exts.Len(); i++ {
|
||||
p.Extension = append(p.Extension, ToFieldDescriptorProto(exts.Get(i)))
|
||||
}
|
||||
if syntax := file.Syntax(); syntax != protoreflect.Proto2 {
|
||||
p.Syntax = proto.String(file.Syntax().String())
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
// ToDescriptorProto copies a protoreflect.MessageDescriptor into a
|
||||
// google.protobuf.DescriptorProto message.
|
||||
func ToDescriptorProto(message protoreflect.MessageDescriptor) *descriptorpb.DescriptorProto {
|
||||
p := &descriptorpb.DescriptorProto{
|
||||
Name: proto.String(string(message.Name())),
|
||||
Options: proto.Clone(message.Options()).(*descriptorpb.MessageOptions),
|
||||
}
|
||||
for i, fields := 0, message.Fields(); i < fields.Len(); i++ {
|
||||
p.Field = append(p.Field, ToFieldDescriptorProto(fields.Get(i)))
|
||||
}
|
||||
for i, exts := 0, message.Extensions(); i < exts.Len(); i++ {
|
||||
p.Extension = append(p.Extension, ToFieldDescriptorProto(exts.Get(i)))
|
||||
}
|
||||
for i, messages := 0, message.Messages(); i < messages.Len(); i++ {
|
||||
p.NestedType = append(p.NestedType, ToDescriptorProto(messages.Get(i)))
|
||||
}
|
||||
for i, enums := 0, message.Enums(); i < enums.Len(); i++ {
|
||||
p.EnumType = append(p.EnumType, ToEnumDescriptorProto(enums.Get(i)))
|
||||
}
|
||||
for i, xranges := 0, message.ExtensionRanges(); i < xranges.Len(); i++ {
|
||||
xrange := xranges.Get(i)
|
||||
p.ExtensionRange = append(p.ExtensionRange, &descriptorpb.DescriptorProto_ExtensionRange{
|
||||
Start: proto.Int32(int32(xrange[0])),
|
||||
End: proto.Int32(int32(xrange[1])),
|
||||
Options: proto.Clone(message.ExtensionRangeOptions(i)).(*descriptorpb.ExtensionRangeOptions),
|
||||
})
|
||||
}
|
||||
for i, oneofs := 0, message.Oneofs(); i < oneofs.Len(); i++ {
|
||||
p.OneofDecl = append(p.OneofDecl, ToOneofDescriptorProto(oneofs.Get(i)))
|
||||
}
|
||||
for i, ranges := 0, message.ReservedRanges(); i < ranges.Len(); i++ {
|
||||
rrange := ranges.Get(i)
|
||||
p.ReservedRange = append(p.ReservedRange, &descriptorpb.DescriptorProto_ReservedRange{
|
||||
Start: proto.Int32(int32(rrange[0])),
|
||||
End: proto.Int32(int32(rrange[1])),
|
||||
})
|
||||
}
|
||||
for i, names := 0, message.ReservedNames(); i < names.Len(); i++ {
|
||||
p.ReservedName = append(p.ReservedName, string(names.Get(i)))
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
// ToFieldDescriptorProto copies a protoreflect.FieldDescriptor into a
|
||||
// google.protobuf.FieldDescriptorProto message.
|
||||
func ToFieldDescriptorProto(field protoreflect.FieldDescriptor) *descriptorpb.FieldDescriptorProto {
|
||||
p := &descriptorpb.FieldDescriptorProto{
|
||||
Name: proto.String(string(field.Name())),
|
||||
Number: proto.Int32(int32(field.Number())),
|
||||
Label: descriptorpb.FieldDescriptorProto_Label(field.Cardinality()).Enum(),
|
||||
Options: proto.Clone(field.Options()).(*descriptorpb.FieldOptions),
|
||||
}
|
||||
if field.IsExtension() {
|
||||
p.Extendee = fullNameOf(field.ContainingMessage())
|
||||
}
|
||||
if field.Kind().IsValid() {
|
||||
p.Type = descriptorpb.FieldDescriptorProto_Type(field.Kind()).Enum()
|
||||
}
|
||||
if field.Enum() != nil {
|
||||
p.TypeName = fullNameOf(field.Enum())
|
||||
}
|
||||
if field.Message() != nil {
|
||||
p.TypeName = fullNameOf(field.Message())
|
||||
}
|
||||
if field.HasJSONName() {
|
||||
// A bug in older versions of protoc would always populate the
|
||||
// "json_name" option for extensions when it is meaningless.
|
||||
// When it did so, it would always use the camel-cased field name.
|
||||
if field.IsExtension() {
|
||||
p.JsonName = proto.String(strs.JSONCamelCase(string(field.Name())))
|
||||
} else {
|
||||
p.JsonName = proto.String(field.JSONName())
|
||||
}
|
||||
}
|
||||
if field.Syntax() == protoreflect.Proto3 && field.HasOptionalKeyword() {
|
||||
p.Proto3Optional = proto.Bool(true)
|
||||
}
|
||||
if field.HasDefault() {
|
||||
def, err := defval.Marshal(field.Default(), field.DefaultEnumValue(), field.Kind(), defval.Descriptor)
|
||||
if err != nil && field.DefaultEnumValue() != nil {
|
||||
def = string(field.DefaultEnumValue().Name()) // occurs for unresolved enum values
|
||||
} else if err != nil {
|
||||
panic(fmt.Sprintf("%v: %v", field.FullName(), err))
|
||||
}
|
||||
p.DefaultValue = proto.String(def)
|
||||
}
|
||||
if oneof := field.ContainingOneof(); oneof != nil {
|
||||
p.OneofIndex = proto.Int32(int32(oneof.Index()))
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
// ToOneofDescriptorProto copies a protoreflect.OneofDescriptor into a
|
||||
// google.protobuf.OneofDescriptorProto message.
|
||||
func ToOneofDescriptorProto(oneof protoreflect.OneofDescriptor) *descriptorpb.OneofDescriptorProto {
|
||||
return &descriptorpb.OneofDescriptorProto{
|
||||
Name: proto.String(string(oneof.Name())),
|
||||
Options: proto.Clone(oneof.Options()).(*descriptorpb.OneofOptions),
|
||||
}
|
||||
}
|
||||
|
||||
// ToEnumDescriptorProto copies a protoreflect.EnumDescriptor into a
|
||||
// google.protobuf.EnumDescriptorProto message.
|
||||
func ToEnumDescriptorProto(enum protoreflect.EnumDescriptor) *descriptorpb.EnumDescriptorProto {
|
||||
p := &descriptorpb.EnumDescriptorProto{
|
||||
Name: proto.String(string(enum.Name())),
|
||||
Options: proto.Clone(enum.Options()).(*descriptorpb.EnumOptions),
|
||||
}
|
||||
for i, values := 0, enum.Values(); i < values.Len(); i++ {
|
||||
p.Value = append(p.Value, ToEnumValueDescriptorProto(values.Get(i)))
|
||||
}
|
||||
for i, ranges := 0, enum.ReservedRanges(); i < ranges.Len(); i++ {
|
||||
rrange := ranges.Get(i)
|
||||
p.ReservedRange = append(p.ReservedRange, &descriptorpb.EnumDescriptorProto_EnumReservedRange{
|
||||
Start: proto.Int32(int32(rrange[0])),
|
||||
End: proto.Int32(int32(rrange[1])),
|
||||
})
|
||||
}
|
||||
for i, names := 0, enum.ReservedNames(); i < names.Len(); i++ {
|
||||
p.ReservedName = append(p.ReservedName, string(names.Get(i)))
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
// ToEnumValueDescriptorProto copies a protoreflect.EnumValueDescriptor into a
|
||||
// google.protobuf.EnumValueDescriptorProto message.
|
||||
func ToEnumValueDescriptorProto(value protoreflect.EnumValueDescriptor) *descriptorpb.EnumValueDescriptorProto {
|
||||
return &descriptorpb.EnumValueDescriptorProto{
|
||||
Name: proto.String(string(value.Name())),
|
||||
Number: proto.Int32(int32(value.Number())),
|
||||
Options: proto.Clone(value.Options()).(*descriptorpb.EnumValueOptions),
|
||||
}
|
||||
}
|
||||
|
||||
// ToServiceDescriptorProto copies a protoreflect.ServiceDescriptor into a
|
||||
// google.protobuf.ServiceDescriptorProto message.
|
||||
func ToServiceDescriptorProto(service protoreflect.ServiceDescriptor) *descriptorpb.ServiceDescriptorProto {
|
||||
p := &descriptorpb.ServiceDescriptorProto{
|
||||
Name: proto.String(string(service.Name())),
|
||||
Options: proto.Clone(service.Options()).(*descriptorpb.ServiceOptions),
|
||||
}
|
||||
for i, methods := 0, service.Methods(); i < methods.Len(); i++ {
|
||||
p.Method = append(p.Method, ToMethodDescriptorProto(methods.Get(i)))
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
// ToMethodDescriptorProto copies a protoreflect.MethodDescriptor into a
|
||||
// google.protobuf.MethodDescriptorProto message.
|
||||
func ToMethodDescriptorProto(method protoreflect.MethodDescriptor) *descriptorpb.MethodDescriptorProto {
|
||||
p := &descriptorpb.MethodDescriptorProto{
|
||||
Name: proto.String(string(method.Name())),
|
||||
InputType: fullNameOf(method.Input()),
|
||||
OutputType: fullNameOf(method.Output()),
|
||||
Options: proto.Clone(method.Options()).(*descriptorpb.MethodOptions),
|
||||
}
|
||||
if method.IsStreamingClient() {
|
||||
p.ClientStreaming = proto.Bool(true)
|
||||
}
|
||||
if method.IsStreamingServer() {
|
||||
p.ServerStreaming = proto.Bool(true)
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
func fullNameOf(d protoreflect.Descriptor) *string {
|
||||
if d == nil {
|
||||
return nil
|
||||
}
|
||||
if strings.HasPrefix(string(d.FullName()), unknownPrefix) {
|
||||
return proto.String(string(d.FullName()[len(unknownPrefix):]))
|
||||
}
|
||||
return proto.String("." + string(d.FullName()))
|
||||
}
|
87
gateway/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go
generated
vendored
87
gateway/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go
generated
vendored
@ -10,46 +10,46 @@
|
||||
//
|
||||
// # 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
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// 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
|
||||
@ -71,12 +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 [EnumDescriptor] describes an abstract protobuf enum type.
|
||||
//
|
||||
// • An Enum is a concrete enum instance. Generated enums implement Enum.
|
||||
// • An [Enum] is a concrete enum instance. Generated enums implement Enum.
|
||||
//
|
||||
// ┌──────────────── New() ─────────────────┐
|
||||
// │ │
|
||||
@ -90,24 +90,26 @@
|
||||
// │ │
|
||||
// └─────────────────── Type() ─────────┘
|
||||
//
|
||||
// • 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 [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.
|
||||
// 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 protoregistry.GlobalTypes.FindMessageByName
|
||||
// or constructing a dynamic MessageType using dynamicpb.NewMessageType.
|
||||
// • 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 ProtoReflect method is similar to
|
||||
// calling reflect.ValueOf, and the Message.Interface method is similar to
|
||||
// calling reflect.Value.Interface.
|
||||
// • 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
|
||||
@ -119,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 (
|
||||
@ -142,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.
|
||||
@ -151,14 +153,15 @@ 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.
|
||||
func (s Syntax) IsValid() bool {
|
||||
switch s {
|
||||
case Proto2, Proto3:
|
||||
case Proto2, Proto3, Editions:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
@ -172,6 +175,8 @@ func (s Syntax) String() string {
|
||||
return "proto2"
|
||||
case Proto3:
|
||||
return "proto3"
|
||||
case Editions:
|
||||
return "editions"
|
||||
default:
|
||||
return fmt.Sprintf("<unknown:%d>", s)
|
||||
}
|
||||
@ -436,7 +441,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"
|
||||
@ -480,7 +485,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:])
|
||||
|
83
gateway/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go
generated
vendored
83
gateway/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go
generated
vendored
@ -35,7 +35,7 @@ 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 13:
|
||||
case 14:
|
||||
b = p.appendSingularField(b, "edition", nil)
|
||||
}
|
||||
return b
|
||||
@ -160,8 +160,6 @@ func (p *SourcePath) appendFileOptions(b []byte) []byte {
|
||||
b = p.appendSingularField(b, "java_generic_services", nil)
|
||||
case 18:
|
||||
b = p.appendSingularField(b, "py_generic_services", nil)
|
||||
case 42:
|
||||
b = p.appendSingularField(b, "php_generic_services", nil)
|
||||
case 23:
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 31:
|
||||
@ -180,6 +178,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)
|
||||
}
|
||||
@ -240,6 +240,8 @@ func (p *SourcePath) appendMessageOptions(b []byte) []byte {
|
||||
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)
|
||||
}
|
||||
@ -285,6 +287,8 @@ func (p *SourcePath) appendEnumOptions(b []byte) []byte {
|
||||
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)
|
||||
}
|
||||
@ -330,6 +334,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:
|
||||
@ -361,16 +367,41 @@ func (p *SourcePath) appendFieldOptions(b []byte) []byte {
|
||||
b = p.appendSingularField(b, "debug_redact", nil)
|
||||
case 17:
|
||||
b = p.appendSingularField(b, "retention", nil)
|
||||
case 18:
|
||||
b = p.appendSingularField(b, "target", 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 22:
|
||||
b = p.appendSingularField(b, "feature_support", (*SourcePath).appendFieldOptions_FeatureSupport)
|
||||
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
|
||||
@ -422,6 +453,8 @@ func (p *SourcePath) appendExtensionRangeOptions(b []byte) []byte {
|
||||
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)
|
||||
}
|
||||
@ -433,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)
|
||||
}
|
||||
@ -446,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)
|
||||
}
|
||||
@ -461,12 +500,44 @@ 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) appendFieldOptions_FeatureSupport(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "edition_introduced", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "edition_deprecated", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "deprecation_warning", nil)
|
||||
case 4:
|
||||
b = p.appendSingularField(b, "edition_removed", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendUninterpretedOption_NamePart(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
@ -491,8 +562,6 @@ func (p *SourcePath) appendExtensionRangeOptions_Declaration(b []byte) []byte {
|
||||
b = p.appendSingularField(b, "full_name", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "type", nil)
|
||||
case 4:
|
||||
b = p.appendSingularField(b, "is_repeated", nil)
|
||||
case 5:
|
||||
b = p.appendSingularField(b, "reserved", nil)
|
||||
case 6:
|
||||
|
50
gateway/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go
generated
vendored
50
gateway/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,12 +470,12 @@ 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.
|
||||
//
|
||||
@ -532,7 +532,7 @@ type ExtensionType interface {
|
||||
// corresponds with the google.protobuf.EnumDescriptorProto message.
|
||||
//
|
||||
// Nested declarations:
|
||||
// EnumValueDescriptor.
|
||||
// [EnumValueDescriptor].
|
||||
type EnumDescriptor interface {
|
||||
Descriptor
|
||||
|
||||
@ -544,11 +544,17 @@ type EnumDescriptor interface {
|
||||
// ReservedRanges is a list of reserved ranges of enum numbers.
|
||||
ReservedRanges() EnumRanges
|
||||
|
||||
// IsClosed reports whether this enum uses closed semantics.
|
||||
// See https://protobuf.dev/programming-guides/enum/#definitions.
|
||||
// Note: the Go protobuf implementation is not spec compliant and treats
|
||||
// all enums as open enums.
|
||||
IsClosed() bool
|
||||
|
||||
isEnumDescriptor
|
||||
}
|
||||
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
|
||||
@ -610,7 +616,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
|
||||
|
||||
|
24
gateway/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go
generated
vendored
24
gateway/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.
|
||||
@ -152,7 +152,7 @@ type Message interface {
|
||||
// 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
|
||||
|
8
gateway/vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go
generated
vendored
8
gateway/vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go
generated
vendored
@ -24,19 +24,19 @@ import (
|
||||
// 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,
|
||||
// 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,
|
||||
// - [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.
|
||||
//
|
||||
// - Lists are equal if they are the same length and
|
||||
// - [List] values 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
|
||||
// - [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)
|
||||
|
44
gateway/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go
generated
vendored
44
gateway/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,22 +31,22 @@ 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:
|
||||
@ -65,7 +65,7 @@ import (
|
||||
// // 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
|
||||
|
||||
@ -306,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 {
|
||||
@ -327,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:
|
||||
@ -337,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:
|
||||
@ -347,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:
|
||||
@ -357,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:
|
||||
@ -367,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:
|
||||
@ -378,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 ║
|
||||
@ -392,13 +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.
|
||||
@ -426,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
gateway/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go
generated
vendored
Normal file
87
gateway/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
|
||||
}
|
24
gateway/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go
generated
vendored
24
gateway/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
|
||||
@ -218,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
|
||||
@ -310,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 {
|
||||
@ -431,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"
|
||||
@ -451,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
|
||||
@ -590,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
|
||||
@ -611,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
|
||||
@ -632,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.
|
||||
@ -662,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
|
||||
@ -703,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
|
||||
|
4605
gateway/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go
generated
vendored
4605
gateway/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user