Update vendor
This commit is contained in:
1
vendor/google.golang.org/protobuf/reflect/protoreflect/methods.go
generated
vendored
1
vendor/google.golang.org/protobuf/reflect/protoreflect/methods.go
generated
vendored
@@ -53,6 +53,7 @@ type (
|
||||
FindExtensionByName(field FullName) (ExtensionType, error)
|
||||
FindExtensionByNumber(message FullName, field FieldNumber) (ExtensionType, error)
|
||||
}
|
||||
Depth int
|
||||
}
|
||||
unmarshalOutput = struct {
|
||||
pragma.NoUnkeyedLiterals
|
||||
|
||||
80
vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go
generated
vendored
80
vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go
generated
vendored
@@ -8,8 +8,7 @@
|
||||
// defined in proto source files and value interfaces which provide the
|
||||
// ability to examine and manipulate the contents of messages.
|
||||
//
|
||||
//
|
||||
// Protocol Buffer Descriptors
|
||||
// # Protocol Buffer Descriptors
|
||||
//
|
||||
// Protobuf descriptors (e.g., EnumDescriptor or MessageDescriptor)
|
||||
// are immutable objects that represent protobuf type information.
|
||||
@@ -26,8 +25,7 @@
|
||||
// The "google.golang.org/protobuf/reflect/protodesc" package converts between
|
||||
// google.protobuf.DescriptorProto messages and protobuf descriptors.
|
||||
//
|
||||
//
|
||||
// Go Type Descriptors
|
||||
// # Go Type Descriptors
|
||||
//
|
||||
// A type descriptor (e.g., EnumType or MessageType) is a constructor for
|
||||
// a concrete Go type that represents the associated protobuf descriptor.
|
||||
@@ -41,8 +39,7 @@
|
||||
// The "google.golang.org/protobuf/types/dynamicpb" package can be used to
|
||||
// create Go type descriptors from protobuf descriptors.
|
||||
//
|
||||
//
|
||||
// Value Interfaces
|
||||
// # Value Interfaces
|
||||
//
|
||||
// The Enum and Message interfaces provide a reflective view over an
|
||||
// enum or message instance. For enums, it provides the ability to retrieve
|
||||
@@ -55,13 +52,11 @@
|
||||
// The "github.com/golang/protobuf/proto".MessageReflect function can be used
|
||||
// to obtain a reflective view on older messages.
|
||||
//
|
||||
//
|
||||
// Relationships
|
||||
// # Relationships
|
||||
//
|
||||
// The following diagrams demonstrate the relationships between
|
||||
// various types declared in this package.
|
||||
//
|
||||
//
|
||||
// ┌───────────────────────────────────┐
|
||||
// V │
|
||||
// ┌────────────── New(n) ─────────────┐ │
|
||||
@@ -83,7 +78,6 @@
|
||||
//
|
||||
// • An Enum is a concrete enum instance. Generated enums implement Enum.
|
||||
//
|
||||
//
|
||||
// ┌──────────────── New() ─────────────────┐
|
||||
// │ │
|
||||
// │ ┌─── Descriptor() ─────┐ │ ┌── Interface() ───┐
|
||||
@@ -98,12 +92,22 @@
|
||||
//
|
||||
// • 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 Message is a concrete message instance. Generated messages implement
|
||||
// ProtoMessage, which can convert to/from a Message.
|
||||
//
|
||||
// • 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.
|
||||
//
|
||||
// ┌── TypeDescriptor() ──┐ ┌───── Descriptor() ─────┐
|
||||
// │ V │ V
|
||||
@@ -128,7 +132,6 @@ package protoreflect
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
@@ -408,19 +411,14 @@ type EnumRanges interface {
|
||||
doNotImplement
|
||||
}
|
||||
|
||||
var (
|
||||
regexName = regexp.MustCompile(`^[_a-zA-Z][_a-zA-Z0-9]*$`)
|
||||
regexFullName = regexp.MustCompile(`^[_a-zA-Z][_a-zA-Z0-9]*(\.[_a-zA-Z][_a-zA-Z0-9]*)*$`)
|
||||
)
|
||||
|
||||
// Name is the short name for a proto declaration. This is not the name
|
||||
// as used in Go source code, which might not be identical to the proto name.
|
||||
type Name string // e.g., "Kind"
|
||||
|
||||
// IsValid reports whether n is a syntactically valid name.
|
||||
// IsValid reports whether s is a syntactically valid name.
|
||||
// An empty name is invalid.
|
||||
func (n Name) IsValid() bool {
|
||||
return regexName.MatchString(string(n))
|
||||
func (s Name) IsValid() bool {
|
||||
return consumeIdent(string(s)) == len(s)
|
||||
}
|
||||
|
||||
// Names represent a list of names.
|
||||
@@ -443,10 +441,42 @@ type Names interface {
|
||||
// This should not have any leading or trailing dots.
|
||||
type FullName string // e.g., "google.protobuf.Field.Kind"
|
||||
|
||||
// IsValid reports whether n is a syntactically valid full name.
|
||||
// IsValid reports whether s is a syntactically valid full name.
|
||||
// An empty full name is invalid.
|
||||
func (n FullName) IsValid() bool {
|
||||
return regexFullName.MatchString(string(n))
|
||||
func (s FullName) IsValid() bool {
|
||||
i := consumeIdent(string(s))
|
||||
if i < 0 {
|
||||
return false
|
||||
}
|
||||
for len(s) > i {
|
||||
if s[i] != '.' {
|
||||
return false
|
||||
}
|
||||
i++
|
||||
n := consumeIdent(string(s[i:]))
|
||||
if n < 0 {
|
||||
return false
|
||||
}
|
||||
i += n
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func consumeIdent(s string) (i int) {
|
||||
if len(s) == 0 || !isLetter(s[i]) {
|
||||
return -1
|
||||
}
|
||||
i++
|
||||
for len(s) > i && isLetterDigit(s[i]) {
|
||||
i++
|
||||
}
|
||||
return i
|
||||
}
|
||||
func isLetter(c byte) bool {
|
||||
return c == '_' || ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')
|
||||
}
|
||||
func isLetterDigit(c byte) bool {
|
||||
return isLetter(c) || ('0' <= c && c <= '9')
|
||||
}
|
||||
|
||||
// Name returns the short name, which is the last identifier segment.
|
||||
|
||||
85
vendor/google.golang.org/protobuf/reflect/protoreflect/source.go
generated
vendored
85
vendor/google.golang.org/protobuf/reflect/protoreflect/source.go
generated
vendored
@@ -4,6 +4,10 @@
|
||||
|
||||
package protoreflect
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// SourceLocations is a list of source locations.
|
||||
type SourceLocations interface {
|
||||
// Len reports the number of source locations in the proto file.
|
||||
@@ -11,9 +15,20 @@ type SourceLocations interface {
|
||||
// Get returns the ith SourceLocation. It panics if out of bounds.
|
||||
Get(int) SourceLocation
|
||||
|
||||
doNotImplement
|
||||
// ByPath returns the SourceLocation for the given path,
|
||||
// returning the first location if multiple exist for the same path.
|
||||
// If multiple locations exist for the same path,
|
||||
// then SourceLocation.Next index can be used to identify the
|
||||
// index of the next SourceLocation.
|
||||
// If no location exists for this path, it returns the zero value.
|
||||
ByPath(path SourcePath) SourceLocation
|
||||
|
||||
// TODO: Add ByPath and ByDescriptor helper methods.
|
||||
// ByDescriptor returns the SourceLocation for the given descriptor,
|
||||
// returning the first location if multiple exist for the same path.
|
||||
// If no location exists for this descriptor, it returns the zero value.
|
||||
ByDescriptor(desc Descriptor) SourceLocation
|
||||
|
||||
doNotImplement
|
||||
}
|
||||
|
||||
// SourceLocation describes a source location and
|
||||
@@ -39,6 +54,10 @@ type SourceLocation struct {
|
||||
LeadingComments string
|
||||
// TrailingComments is the trailing attached comment for the declaration.
|
||||
TrailingComments string
|
||||
|
||||
// Next is an index into SourceLocations for the next source location that
|
||||
// has the same Path. It is zero if there is no next location.
|
||||
Next int
|
||||
}
|
||||
|
||||
// SourcePath identifies part of a file descriptor for a source location.
|
||||
@@ -48,5 +67,63 @@ type SourceLocation struct {
|
||||
// See google.protobuf.SourceCodeInfo.Location.path.
|
||||
type SourcePath []int32
|
||||
|
||||
// TODO: Add SourcePath.String method to pretty-print the path. For example:
|
||||
// ".message_type[6].nested_type[15].field[3]"
|
||||
// Equal reports whether p1 equals p2.
|
||||
func (p1 SourcePath) Equal(p2 SourcePath) bool {
|
||||
if len(p1) != len(p2) {
|
||||
return false
|
||||
}
|
||||
for i := range p1 {
|
||||
if p1[i] != p2[i] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// String formats the path in a humanly readable manner.
|
||||
// The output is guaranteed to be deterministic,
|
||||
// making it suitable for use as a key into a Go map.
|
||||
// It is not guaranteed to be stable as the exact output could change
|
||||
// in a future version of this module.
|
||||
//
|
||||
// Example output:
|
||||
//
|
||||
// .message_type[6].nested_type[15].field[3]
|
||||
func (p SourcePath) String() string {
|
||||
b := p.appendFileDescriptorProto(nil)
|
||||
for _, i := range p {
|
||||
b = append(b, '.')
|
||||
b = strconv.AppendInt(b, int64(i), 10)
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
type appendFunc func(*SourcePath, []byte) []byte
|
||||
|
||||
func (p *SourcePath) appendSingularField(b []byte, name string, f appendFunc) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
b = append(b, '.')
|
||||
b = append(b, name...)
|
||||
*p = (*p)[1:]
|
||||
if f != nil {
|
||||
b = f(p, b)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendRepeatedField(b []byte, name string, f appendFunc) []byte {
|
||||
b = p.appendSingularField(b, name, nil)
|
||||
if len(*p) == 0 || (*p)[0] < 0 {
|
||||
return b
|
||||
}
|
||||
b = append(b, '[')
|
||||
b = strconv.AppendUint(b, uint64((*p)[0]), 10)
|
||||
b = append(b, ']')
|
||||
*p = (*p)[1:]
|
||||
if f != nil {
|
||||
b = f(p, b)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
461
vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go
generated
vendored
Normal file
461
vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go
generated
vendored
Normal file
@@ -0,0 +1,461 @@
|
||||
// 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 protoreflect
|
||||
|
||||
func (p *SourcePath) appendFileDescriptorProto(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "name", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "package", nil)
|
||||
case 3:
|
||||
b = p.appendRepeatedField(b, "dependency", nil)
|
||||
case 10:
|
||||
b = p.appendRepeatedField(b, "public_dependency", nil)
|
||||
case 11:
|
||||
b = p.appendRepeatedField(b, "weak_dependency", nil)
|
||||
case 4:
|
||||
b = p.appendRepeatedField(b, "message_type", (*SourcePath).appendDescriptorProto)
|
||||
case 5:
|
||||
b = p.appendRepeatedField(b, "enum_type", (*SourcePath).appendEnumDescriptorProto)
|
||||
case 6:
|
||||
b = p.appendRepeatedField(b, "service", (*SourcePath).appendServiceDescriptorProto)
|
||||
case 7:
|
||||
b = p.appendRepeatedField(b, "extension", (*SourcePath).appendFieldDescriptorProto)
|
||||
case 8:
|
||||
b = p.appendSingularField(b, "options", (*SourcePath).appendFileOptions)
|
||||
case 9:
|
||||
b = p.appendSingularField(b, "source_code_info", (*SourcePath).appendSourceCodeInfo)
|
||||
case 12:
|
||||
b = p.appendSingularField(b, "syntax", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendDescriptorProto(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "name", nil)
|
||||
case 2:
|
||||
b = p.appendRepeatedField(b, "field", (*SourcePath).appendFieldDescriptorProto)
|
||||
case 6:
|
||||
b = p.appendRepeatedField(b, "extension", (*SourcePath).appendFieldDescriptorProto)
|
||||
case 3:
|
||||
b = p.appendRepeatedField(b, "nested_type", (*SourcePath).appendDescriptorProto)
|
||||
case 4:
|
||||
b = p.appendRepeatedField(b, "enum_type", (*SourcePath).appendEnumDescriptorProto)
|
||||
case 5:
|
||||
b = p.appendRepeatedField(b, "extension_range", (*SourcePath).appendDescriptorProto_ExtensionRange)
|
||||
case 8:
|
||||
b = p.appendRepeatedField(b, "oneof_decl", (*SourcePath).appendOneofDescriptorProto)
|
||||
case 7:
|
||||
b = p.appendSingularField(b, "options", (*SourcePath).appendMessageOptions)
|
||||
case 9:
|
||||
b = p.appendRepeatedField(b, "reserved_range", (*SourcePath).appendDescriptorProto_ReservedRange)
|
||||
case 10:
|
||||
b = p.appendRepeatedField(b, "reserved_name", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendEnumDescriptorProto(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "name", nil)
|
||||
case 2:
|
||||
b = p.appendRepeatedField(b, "value", (*SourcePath).appendEnumValueDescriptorProto)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "options", (*SourcePath).appendEnumOptions)
|
||||
case 4:
|
||||
b = p.appendRepeatedField(b, "reserved_range", (*SourcePath).appendEnumDescriptorProto_EnumReservedRange)
|
||||
case 5:
|
||||
b = p.appendRepeatedField(b, "reserved_name", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendServiceDescriptorProto(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "name", nil)
|
||||
case 2:
|
||||
b = p.appendRepeatedField(b, "method", (*SourcePath).appendMethodDescriptorProto)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "options", (*SourcePath).appendServiceOptions)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendFieldDescriptorProto(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "name", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "number", nil)
|
||||
case 4:
|
||||
b = p.appendSingularField(b, "label", nil)
|
||||
case 5:
|
||||
b = p.appendSingularField(b, "type", nil)
|
||||
case 6:
|
||||
b = p.appendSingularField(b, "type_name", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "extendee", nil)
|
||||
case 7:
|
||||
b = p.appendSingularField(b, "default_value", nil)
|
||||
case 9:
|
||||
b = p.appendSingularField(b, "oneof_index", nil)
|
||||
case 10:
|
||||
b = p.appendSingularField(b, "json_name", nil)
|
||||
case 8:
|
||||
b = p.appendSingularField(b, "options", (*SourcePath).appendFieldOptions)
|
||||
case 17:
|
||||
b = p.appendSingularField(b, "proto3_optional", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendFileOptions(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "java_package", nil)
|
||||
case 8:
|
||||
b = p.appendSingularField(b, "java_outer_classname", nil)
|
||||
case 10:
|
||||
b = p.appendSingularField(b, "java_multiple_files", nil)
|
||||
case 20:
|
||||
b = p.appendSingularField(b, "java_generate_equals_and_hash", nil)
|
||||
case 27:
|
||||
b = p.appendSingularField(b, "java_string_check_utf8", nil)
|
||||
case 9:
|
||||
b = p.appendSingularField(b, "optimize_for", nil)
|
||||
case 11:
|
||||
b = p.appendSingularField(b, "go_package", nil)
|
||||
case 16:
|
||||
b = p.appendSingularField(b, "cc_generic_services", nil)
|
||||
case 17:
|
||||
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:
|
||||
b = p.appendSingularField(b, "cc_enable_arenas", nil)
|
||||
case 36:
|
||||
b = p.appendSingularField(b, "objc_class_prefix", nil)
|
||||
case 37:
|
||||
b = p.appendSingularField(b, "csharp_namespace", nil)
|
||||
case 39:
|
||||
b = p.appendSingularField(b, "swift_prefix", nil)
|
||||
case 40:
|
||||
b = p.appendSingularField(b, "php_class_prefix", nil)
|
||||
case 41:
|
||||
b = p.appendSingularField(b, "php_namespace", nil)
|
||||
case 44:
|
||||
b = p.appendSingularField(b, "php_metadata_namespace", nil)
|
||||
case 45:
|
||||
b = p.appendSingularField(b, "ruby_package", nil)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendSourceCodeInfo(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendRepeatedField(b, "location", (*SourcePath).appendSourceCodeInfo_Location)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendDescriptorProto_ExtensionRange(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "start", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "end", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "options", (*SourcePath).appendExtensionRangeOptions)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendOneofDescriptorProto(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "name", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "options", (*SourcePath).appendOneofOptions)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendMessageOptions(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "message_set_wire_format", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "no_standard_descriptor_accessor", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 7:
|
||||
b = p.appendSingularField(b, "map_entry", nil)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendDescriptorProto_ReservedRange(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "start", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "end", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendEnumValueDescriptorProto(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "name", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "number", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "options", (*SourcePath).appendEnumValueOptions)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendEnumOptions(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "allow_alias", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendEnumDescriptorProto_EnumReservedRange(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "start", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "end", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendMethodDescriptorProto(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "name", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "input_type", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "output_type", nil)
|
||||
case 4:
|
||||
b = p.appendSingularField(b, "options", (*SourcePath).appendMethodOptions)
|
||||
case 5:
|
||||
b = p.appendSingularField(b, "client_streaming", nil)
|
||||
case 6:
|
||||
b = p.appendSingularField(b, "server_streaming", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendServiceOptions(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 33:
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendFieldOptions(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "ctype", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "packed", nil)
|
||||
case 6:
|
||||
b = p.appendSingularField(b, "jstype", nil)
|
||||
case 5:
|
||||
b = p.appendSingularField(b, "lazy", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 10:
|
||||
b = p.appendSingularField(b, "weak", nil)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendUninterpretedOption(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 2:
|
||||
b = p.appendRepeatedField(b, "name", (*SourcePath).appendUninterpretedOption_NamePart)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "identifier_value", nil)
|
||||
case 4:
|
||||
b = p.appendSingularField(b, "positive_int_value", nil)
|
||||
case 5:
|
||||
b = p.appendSingularField(b, "negative_int_value", nil)
|
||||
case 6:
|
||||
b = p.appendSingularField(b, "double_value", nil)
|
||||
case 7:
|
||||
b = p.appendSingularField(b, "string_value", nil)
|
||||
case 8:
|
||||
b = p.appendSingularField(b, "aggregate_value", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendSourceCodeInfo_Location(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendRepeatedField(b, "path", nil)
|
||||
case 2:
|
||||
b = p.appendRepeatedField(b, "span", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "leading_comments", nil)
|
||||
case 4:
|
||||
b = p.appendSingularField(b, "trailing_comments", nil)
|
||||
case 6:
|
||||
b = p.appendRepeatedField(b, "leading_detached_comments", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendExtensionRangeOptions(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendOneofOptions(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendEnumValueOptions(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendMethodOptions(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 33:
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 34:
|
||||
b = p.appendSingularField(b, "idempotency_level", nil)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendUninterpretedOption_NamePart(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "name_part", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "is_extension", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
35
vendor/google.golang.org/protobuf/reflect/protoreflect/type.go
generated
vendored
35
vendor/google.golang.org/protobuf/reflect/protoreflect/type.go
generated
vendored
@@ -232,11 +232,15 @@ type MessageDescriptor interface {
|
||||
type isMessageDescriptor interface{ ProtoType(MessageDescriptor) }
|
||||
|
||||
// MessageType encapsulates a MessageDescriptor with a concrete Go implementation.
|
||||
// It is recommended that implementations of this interface also implement the
|
||||
// MessageFieldTypes interface.
|
||||
type MessageType interface {
|
||||
// New returns a newly allocated empty message.
|
||||
// It may return nil for synthetic messages representing a map entry.
|
||||
New() Message
|
||||
|
||||
// Zero returns an empty, read-only message.
|
||||
// It may return nil for synthetic messages representing a map entry.
|
||||
Zero() Message
|
||||
|
||||
// Descriptor returns the message descriptor.
|
||||
@@ -245,6 +249,26 @@ type MessageType interface {
|
||||
Descriptor() MessageDescriptor
|
||||
}
|
||||
|
||||
// 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.
|
||||
// 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.
|
||||
// It returns nil if the ith field is not a message or group kind.
|
||||
// It panics if out of bounds.
|
||||
//
|
||||
// Invariant: mt.Message(i).Descriptor() == mt.Descriptor().Fields(i).Message()
|
||||
Message(i int) MessageType
|
||||
}
|
||||
|
||||
// MessageDescriptors is a list of message declarations.
|
||||
type MessageDescriptors interface {
|
||||
// Len reports the number of messages.
|
||||
@@ -279,8 +303,15 @@ type FieldDescriptor interface {
|
||||
|
||||
// JSONName reports the name used for JSON serialization.
|
||||
// It is usually the camel-cased form of the field name.
|
||||
// Extension fields are represented by the full name surrounded by brackets.
|
||||
JSONName() string
|
||||
|
||||
// TextName reports the name used for text serialization.
|
||||
// It is usually the name of the field, except that groups use the name
|
||||
// of the inlined message, and extension fields are represented by the
|
||||
// full name surrounded by brackets.
|
||||
TextName() string
|
||||
|
||||
// HasPresence reports whether the field distinguishes between unpopulated
|
||||
// and default values.
|
||||
HasPresence() bool
|
||||
@@ -371,6 +402,9 @@ type FieldDescriptors interface {
|
||||
// ByJSONName returns the FieldDescriptor for a field with s as the JSON name.
|
||||
// It returns nil if not found.
|
||||
ByJSONName(s string) FieldDescriptor
|
||||
// ByTextName returns the FieldDescriptor for a field with s as the text name.
|
||||
// It returns nil if not found.
|
||||
ByTextName(s string) FieldDescriptor
|
||||
// ByNumber returns the FieldDescriptor for a field numbered n.
|
||||
// It returns nil if not found.
|
||||
ByNumber(n FieldNumber) FieldDescriptor
|
||||
@@ -446,6 +480,7 @@ type ExtensionDescriptors interface {
|
||||
// relative to the parent that it is declared within.
|
||||
//
|
||||
// For example:
|
||||
//
|
||||
// syntax = "proto2";
|
||||
// package example;
|
||||
// message FooMessage {
|
||||
|
||||
1
vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go
generated
vendored
1
vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go
generated
vendored
@@ -2,6 +2,7 @@
|
||||
// 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
|
||||
|
||||
package protoreflect
|
||||
|
||||
29
vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go
generated
vendored
29
vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go
generated
vendored
@@ -41,6 +41,32 @@ import (
|
||||
// Converting to/from a Value and a concrete Go value panics on type mismatch.
|
||||
// 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.
|
||||
//
|
||||
// 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,
|
||||
// always references the source object.
|
||||
//
|
||||
// For example:
|
||||
//
|
||||
// // Append a 0 to a "repeated int32" field.
|
||||
// // Since the Value returned by Mutable is guaranteed to alias
|
||||
// // the source message, modifying the Value modifies the message.
|
||||
// message.Mutable(fieldDesc).(List).Append(protoreflect.ValueOfInt32(0))
|
||||
//
|
||||
// // Assign [0] to a "repeated int32" field by creating a new Value,
|
||||
// // modifying it, and assigning it.
|
||||
// list := message.NewField(fieldDesc).(List)
|
||||
// list.Append(protoreflect.ValueOfInt32(0))
|
||||
// message.Set(fieldDesc, list)
|
||||
// // ERROR: Since it is not defined whether Set aliases the source,
|
||||
// // appending to the List here may or may not modify the message.
|
||||
// list.Append(protoreflect.ValueOfInt32(0))
|
||||
//
|
||||
// Some operations, such as Message.Get, may return an "empty, read-only"
|
||||
// composite Value. Modifying an empty, read-only value panics.
|
||||
type Value value
|
||||
|
||||
// The protoreflect API uses a custom Value union type instead of interface{}
|
||||
@@ -85,6 +111,8 @@ func ValueOf(v interface{}) Value {
|
||||
return ValueOfEnum(v)
|
||||
case Message, List, Map:
|
||||
return valueOfIface(v)
|
||||
case ProtoMessage:
|
||||
panic(fmt.Sprintf("invalid proto.Message(%T) type, expected a protoreflect.Message type", v))
|
||||
default:
|
||||
panic(fmt.Sprintf("invalid type: %T", v))
|
||||
}
|
||||
@@ -365,6 +393,7 @@ func (v Value) MapKey() MapKey {
|
||||
// ╚═════════╧═════════════════════════════════════╝
|
||||
//
|
||||
// A MapKey is constructed and accessed through a Value:
|
||||
//
|
||||
// k := ValueOf("hash").MapKey() // convert string to MapKey
|
||||
// s := k.String() // convert MapKey to string
|
||||
//
|
||||
|
||||
1
vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go
generated
vendored
1
vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go
generated
vendored
@@ -2,6 +2,7 @@
|
||||
// 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
|
||||
|
||||
package protoreflect
|
||||
|
||||
Reference in New Issue
Block a user