mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-28 00:19:56 +00:00
TUN-8052: Update go to 1.21.5
Also update golang.org/x/net and google.golang.org/grpc to fix vulnerabilities, although cloudflared is using them in a way that is not exposed to those risks
This commit is contained in:
2
vendor/google.golang.org/protobuf/encoding/protojson/doc.go
generated
vendored
2
vendor/google.golang.org/protobuf/encoding/protojson/doc.go
generated
vendored
@@ -4,7 +4,7 @@
|
||||
|
||||
// Package protojson marshals and unmarshals protocol buffer messages as JSON
|
||||
// format. It follows the guide at
|
||||
// https://developers.google.com/protocol-buffers/docs/proto3#json.
|
||||
// https://protobuf.dev/programming-guides/proto3#json.
|
||||
//
|
||||
// This package produces a different output than the standard "encoding/json"
|
||||
// package, which does not operate correctly on protocol buffer messages.
|
||||
|
14
vendor/google.golang.org/protobuf/encoding/protojson/encode.go
generated
vendored
14
vendor/google.golang.org/protobuf/encoding/protojson/encode.go
generated
vendored
@@ -106,13 +106,19 @@ func (o MarshalOptions) Format(m proto.Message) string {
|
||||
// MarshalOptions. Do not depend on the output being stable. It may change over
|
||||
// time across different versions of the program.
|
||||
func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) {
|
||||
return o.marshal(m)
|
||||
return o.marshal(nil, m)
|
||||
}
|
||||
|
||||
// MarshalAppend appends the JSON format encoding of m to b,
|
||||
// returning the result.
|
||||
func (o MarshalOptions) MarshalAppend(b []byte, m proto.Message) ([]byte, error) {
|
||||
return o.marshal(b, m)
|
||||
}
|
||||
|
||||
// marshal is a centralized function that all marshal operations go through.
|
||||
// For profiling purposes, avoid changing the name of this function or
|
||||
// introducing other code paths for marshal that do not go through this.
|
||||
func (o MarshalOptions) marshal(m proto.Message) ([]byte, error) {
|
||||
func (o MarshalOptions) marshal(b []byte, m proto.Message) ([]byte, error) {
|
||||
if o.Multiline && o.Indent == "" {
|
||||
o.Indent = defaultIndent
|
||||
}
|
||||
@@ -120,7 +126,7 @@ func (o MarshalOptions) marshal(m proto.Message) ([]byte, error) {
|
||||
o.Resolver = protoregistry.GlobalTypes
|
||||
}
|
||||
|
||||
internalEnc, err := json.NewEncoder(o.Indent)
|
||||
internalEnc, err := json.NewEncoder(b, o.Indent)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -128,7 +134,7 @@ func (o MarshalOptions) marshal(m proto.Message) ([]byte, error) {
|
||||
// Treat nil message interface as an empty message,
|
||||
// in which case the output in an empty JSON object.
|
||||
if m == nil {
|
||||
return []byte("{}"), nil
|
||||
return append(b, '{', '}'), nil
|
||||
}
|
||||
|
||||
enc := encoder{internalEnc, o}
|
||||
|
12
vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go
generated
vendored
12
vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go
generated
vendored
@@ -814,16 +814,22 @@ func (d decoder) unmarshalTimestamp(m protoreflect.Message) error {
|
||||
return d.unexpectedTokenError(tok)
|
||||
}
|
||||
|
||||
t, err := time.Parse(time.RFC3339Nano, tok.ParsedString())
|
||||
s := tok.ParsedString()
|
||||
t, err := time.Parse(time.RFC3339Nano, s)
|
||||
if err != nil {
|
||||
return d.newError(tok.Pos(), "invalid %v value %v", genid.Timestamp_message_fullname, tok.RawString())
|
||||
}
|
||||
// Validate seconds. No need to validate nanos because time.Parse would have
|
||||
// covered that already.
|
||||
// Validate seconds.
|
||||
secs := t.Unix()
|
||||
if secs < minTimestampSeconds || secs > maxTimestampSeconds {
|
||||
return d.newError(tok.Pos(), "%v value out of range: %v", genid.Timestamp_message_fullname, tok.RawString())
|
||||
}
|
||||
// Validate subseconds.
|
||||
i := strings.LastIndexByte(s, '.') // start of subsecond field
|
||||
j := strings.LastIndexAny(s, "Z-+") // start of timezone field
|
||||
if i >= 0 && j >= i && j-i > len(".999999999") {
|
||||
return d.newError(tok.Pos(), "invalid %v value %v", genid.Timestamp_message_fullname, tok.RawString())
|
||||
}
|
||||
|
||||
fds := m.Descriptor().Fields()
|
||||
fdSeconds := fds.ByNumber(genid.Timestamp_Seconds_field_number)
|
||||
|
14
vendor/google.golang.org/protobuf/encoding/prototext/encode.go
generated
vendored
14
vendor/google.golang.org/protobuf/encoding/prototext/encode.go
generated
vendored
@@ -101,13 +101,19 @@ func (o MarshalOptions) Format(m proto.Message) string {
|
||||
// MarshalOptions object. Do not depend on the output being stable. It may
|
||||
// change over time across different versions of the program.
|
||||
func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) {
|
||||
return o.marshal(m)
|
||||
return o.marshal(nil, m)
|
||||
}
|
||||
|
||||
// MarshalAppend appends the textproto format encoding of m to b,
|
||||
// returning the result.
|
||||
func (o MarshalOptions) MarshalAppend(b []byte, m proto.Message) ([]byte, error) {
|
||||
return o.marshal(b, m)
|
||||
}
|
||||
|
||||
// marshal is a centralized function that all marshal operations go through.
|
||||
// For profiling purposes, avoid changing the name of this function or
|
||||
// introducing other code paths for marshal that do not go through this.
|
||||
func (o MarshalOptions) marshal(m proto.Message) ([]byte, error) {
|
||||
func (o MarshalOptions) marshal(b []byte, m proto.Message) ([]byte, error) {
|
||||
var delims = [2]byte{'{', '}'}
|
||||
|
||||
if o.Multiline && o.Indent == "" {
|
||||
@@ -117,7 +123,7 @@ func (o MarshalOptions) marshal(m proto.Message) ([]byte, error) {
|
||||
o.Resolver = protoregistry.GlobalTypes
|
||||
}
|
||||
|
||||
internalEnc, err := text.NewEncoder(o.Indent, delims, o.EmitASCII)
|
||||
internalEnc, err := text.NewEncoder(b, o.Indent, delims, o.EmitASCII)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -125,7 +131,7 @@ func (o MarshalOptions) marshal(m proto.Message) ([]byte, error) {
|
||||
// Treat nil message interface as an empty message,
|
||||
// in which case there is nothing to output.
|
||||
if m == nil {
|
||||
return []byte{}, nil
|
||||
return b, nil
|
||||
}
|
||||
|
||||
enc := encoder{internalEnc, o}
|
||||
|
8
vendor/google.golang.org/protobuf/encoding/protowire/wire.go
generated
vendored
8
vendor/google.golang.org/protobuf/encoding/protowire/wire.go
generated
vendored
@@ -3,7 +3,7 @@
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package protowire parses and formats the raw wire encoding.
|
||||
// See https://developers.google.com/protocol-buffers/docs/encoding.
|
||||
// See https://protobuf.dev/programming-guides/encoding.
|
||||
//
|
||||
// For marshaling and unmarshaling entire protobuf messages,
|
||||
// use the "google.golang.org/protobuf/proto" package instead.
|
||||
@@ -29,12 +29,8 @@ const (
|
||||
)
|
||||
|
||||
// IsValid reports whether the field number is semantically valid.
|
||||
//
|
||||
// Note that while numbers within the reserved range are semantically invalid,
|
||||
// they are syntactically valid in the wire format.
|
||||
// Implementations may treat records with reserved field numbers as unknown.
|
||||
func (n Number) IsValid() bool {
|
||||
return MinValidNumber <= n && n < FirstReservedNumber || LastReservedNumber < n && n <= MaxValidNumber
|
||||
return MinValidNumber <= n && n <= MaxValidNumber
|
||||
}
|
||||
|
||||
// Type represents the wire type.
|
||||
|
2
vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
generated
vendored
2
vendor/google.golang.org/protobuf/internal/encoding/json/decode.go
generated
vendored
@@ -294,7 +294,7 @@ func (d *Decoder) isValueNext() bool {
|
||||
}
|
||||
|
||||
// consumeToken constructs a Token for given Kind with raw value derived from
|
||||
// current d.in and given size, and consumes the given size-lenght of it.
|
||||
// current d.in and given size, and consumes the given size-length of it.
|
||||
func (d *Decoder) consumeToken(kind Kind, size int) Token {
|
||||
tok := Token{
|
||||
kind: kind,
|
||||
|
10
vendor/google.golang.org/protobuf/internal/encoding/json/encode.go
generated
vendored
10
vendor/google.golang.org/protobuf/internal/encoding/json/encode.go
generated
vendored
@@ -41,8 +41,10 @@ type Encoder struct {
|
||||
//
|
||||
// If indent is a non-empty string, it causes every entry for an Array or Object
|
||||
// to be preceded by the indent and trailed by a newline.
|
||||
func NewEncoder(indent string) (*Encoder, error) {
|
||||
e := &Encoder{}
|
||||
func NewEncoder(buf []byte, indent string) (*Encoder, error) {
|
||||
e := &Encoder{
|
||||
out: buf,
|
||||
}
|
||||
if len(indent) > 0 {
|
||||
if strings.Trim(indent, " \t") != "" {
|
||||
return nil, errors.New("indent may only be composed of space or tab characters")
|
||||
@@ -176,13 +178,13 @@ func appendFloat(out []byte, n float64, bitSize int) []byte {
|
||||
// WriteInt writes out the given signed integer in JSON number value.
|
||||
func (e *Encoder) WriteInt(n int64) {
|
||||
e.prepareNext(scalar)
|
||||
e.out = append(e.out, strconv.FormatInt(n, 10)...)
|
||||
e.out = strconv.AppendInt(e.out, n, 10)
|
||||
}
|
||||
|
||||
// WriteUint writes out the given unsigned integer in JSON number value.
|
||||
func (e *Encoder) WriteUint(n uint64) {
|
||||
e.prepareNext(scalar)
|
||||
e.out = append(e.out, strconv.FormatUint(n, 10)...)
|
||||
e.out = strconv.AppendUint(e.out, n, 10)
|
||||
}
|
||||
|
||||
// StartObject writes out the '{' symbol.
|
||||
|
5
vendor/google.golang.org/protobuf/internal/encoding/text/decode.go
generated
vendored
5
vendor/google.golang.org/protobuf/internal/encoding/text/decode.go
generated
vendored
@@ -412,12 +412,13 @@ func (d *Decoder) parseFieldName() (tok Token, err error) {
|
||||
// Field number. Identify if input is a valid number that is not negative
|
||||
// and is decimal integer within 32-bit range.
|
||||
if num := parseNumber(d.in); num.size > 0 {
|
||||
str := num.string(d.in)
|
||||
if !num.neg && num.kind == numDec {
|
||||
if _, err := strconv.ParseInt(string(d.in[:num.size]), 10, 32); err == nil {
|
||||
if _, err := strconv.ParseInt(str, 10, 32); err == nil {
|
||||
return d.consumeToken(Name, num.size, uint8(FieldNumber)), nil
|
||||
}
|
||||
}
|
||||
return Token{}, d.newSyntaxError("invalid field number: %s", d.in[:num.size])
|
||||
return Token{}, d.newSyntaxError("invalid field number: %s", str)
|
||||
}
|
||||
|
||||
return Token{}, d.newSyntaxError("invalid field name: %s", errId(d.in))
|
||||
|
43
vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go
generated
vendored
43
vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go
generated
vendored
@@ -15,17 +15,12 @@ func (d *Decoder) parseNumberValue() (Token, bool) {
|
||||
if num.neg {
|
||||
numAttrs |= isNegative
|
||||
}
|
||||
strSize := num.size
|
||||
last := num.size - 1
|
||||
if num.kind == numFloat && (d.in[last] == 'f' || d.in[last] == 'F') {
|
||||
strSize = last
|
||||
}
|
||||
tok := Token{
|
||||
kind: Scalar,
|
||||
attrs: numberValue,
|
||||
pos: len(d.orig) - len(d.in),
|
||||
raw: d.in[:num.size],
|
||||
str: string(d.in[:strSize]),
|
||||
str: num.string(d.in),
|
||||
numAttrs: numAttrs,
|
||||
}
|
||||
d.consume(num.size)
|
||||
@@ -46,6 +41,27 @@ type number struct {
|
||||
kind uint8
|
||||
neg bool
|
||||
size int
|
||||
// if neg, this is the length of whitespace and comments between
|
||||
// the minus sign and the rest fo the number literal
|
||||
sep int
|
||||
}
|
||||
|
||||
func (num number) string(data []byte) string {
|
||||
strSize := num.size
|
||||
last := num.size - 1
|
||||
if num.kind == numFloat && (data[last] == 'f' || data[last] == 'F') {
|
||||
strSize = last
|
||||
}
|
||||
if num.neg && num.sep > 0 {
|
||||
// strip whitespace/comments between negative sign and the rest
|
||||
strLen := strSize - num.sep
|
||||
str := make([]byte, strLen)
|
||||
str[0] = data[0]
|
||||
copy(str[1:], data[num.sep+1:strSize])
|
||||
return string(str)
|
||||
}
|
||||
return string(data[:strSize])
|
||||
|
||||
}
|
||||
|
||||
// parseNumber constructs a number object from given input. It allows for the
|
||||
@@ -67,19 +83,22 @@ func parseNumber(input []byte) number {
|
||||
}
|
||||
|
||||
// Optional -
|
||||
var sep int
|
||||
if s[0] == '-' {
|
||||
neg = true
|
||||
s = s[1:]
|
||||
size++
|
||||
// Consume any whitespace or comments between the
|
||||
// negative sign and the rest of the number
|
||||
lenBefore := len(s)
|
||||
s = consume(s, 0)
|
||||
sep = lenBefore - len(s)
|
||||
size += sep
|
||||
if len(s) == 0 {
|
||||
return number{}
|
||||
}
|
||||
}
|
||||
|
||||
// C++ allows for whitespace and comments in between the negative sign and
|
||||
// the rest of the number. This logic currently does not but is consistent
|
||||
// with v1.
|
||||
|
||||
switch {
|
||||
case s[0] == '0':
|
||||
if len(s) > 1 {
|
||||
@@ -116,7 +135,7 @@ func parseNumber(input []byte) number {
|
||||
if len(s) > 0 && !isDelim(s[0]) {
|
||||
return number{}
|
||||
}
|
||||
return number{kind: kind, neg: neg, size: size}
|
||||
return number{kind: kind, neg: neg, size: size, sep: sep}
|
||||
}
|
||||
}
|
||||
s = s[1:]
|
||||
@@ -188,5 +207,5 @@ func parseNumber(input []byte) number {
|
||||
return number{}
|
||||
}
|
||||
|
||||
return number{kind: kind, neg: neg, size: size}
|
||||
return number{kind: kind, neg: neg, size: size, sep: sep}
|
||||
}
|
||||
|
10
vendor/google.golang.org/protobuf/internal/encoding/text/encode.go
generated
vendored
10
vendor/google.golang.org/protobuf/internal/encoding/text/encode.go
generated
vendored
@@ -53,8 +53,10 @@ type encoderState struct {
|
||||
// If outputASCII is true, strings will be serialized in such a way that
|
||||
// multi-byte UTF-8 sequences are escaped. This property ensures that the
|
||||
// overall output is ASCII (as opposed to UTF-8).
|
||||
func NewEncoder(indent string, delims [2]byte, outputASCII bool) (*Encoder, error) {
|
||||
e := &Encoder{}
|
||||
func NewEncoder(buf []byte, indent string, delims [2]byte, outputASCII bool) (*Encoder, error) {
|
||||
e := &Encoder{
|
||||
encoderState: encoderState{out: buf},
|
||||
}
|
||||
if len(indent) > 0 {
|
||||
if strings.Trim(indent, " \t") != "" {
|
||||
return nil, errors.New("indent may only be composed of space and tab characters")
|
||||
@@ -195,13 +197,13 @@ func appendFloat(out []byte, n float64, bitSize int) []byte {
|
||||
// WriteInt writes out the given signed integer value.
|
||||
func (e *Encoder) WriteInt(n int64) {
|
||||
e.prepareNext(scalar)
|
||||
e.out = append(e.out, strconv.FormatInt(n, 10)...)
|
||||
e.out = strconv.AppendInt(e.out, n, 10)
|
||||
}
|
||||
|
||||
// WriteUint writes out the given unsigned integer value.
|
||||
func (e *Encoder) WriteUint(n uint64) {
|
||||
e.prepareNext(scalar)
|
||||
e.out = append(e.out, strconv.FormatUint(n, 10)...)
|
||||
e.out = strconv.AppendUint(e.out, n, 10)
|
||||
}
|
||||
|
||||
// WriteLiteral writes out the given string as a literal value without quotes.
|
||||
|
138
vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go
generated
vendored
138
vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go
generated
vendored
@@ -50,6 +50,7 @@ const (
|
||||
FileDescriptorProto_Options_field_name protoreflect.Name = "options"
|
||||
FileDescriptorProto_SourceCodeInfo_field_name protoreflect.Name = "source_code_info"
|
||||
FileDescriptorProto_Syntax_field_name protoreflect.Name = "syntax"
|
||||
FileDescriptorProto_Edition_field_name protoreflect.Name = "edition"
|
||||
|
||||
FileDescriptorProto_Name_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.name"
|
||||
FileDescriptorProto_Package_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.package"
|
||||
@@ -63,6 +64,7 @@ const (
|
||||
FileDescriptorProto_Options_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.options"
|
||||
FileDescriptorProto_SourceCodeInfo_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.source_code_info"
|
||||
FileDescriptorProto_Syntax_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.syntax"
|
||||
FileDescriptorProto_Edition_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.edition"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.FileDescriptorProto.
|
||||
@@ -79,6 +81,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
|
||||
)
|
||||
|
||||
// Names for google.protobuf.DescriptorProto.
|
||||
@@ -180,13 +183,58 @@ const (
|
||||
// Field names for google.protobuf.ExtensionRangeOptions.
|
||||
const (
|
||||
ExtensionRangeOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
ExtensionRangeOptions_Declaration_field_name protoreflect.Name = "declaration"
|
||||
ExtensionRangeOptions_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_Verification_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.verification"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.ExtensionRangeOptions.
|
||||
const (
|
||||
ExtensionRangeOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
ExtensionRangeOptions_Declaration_field_number protoreflect.FieldNumber = 2
|
||||
ExtensionRangeOptions_Verification_field_number protoreflect.FieldNumber = 3
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.ExtensionRangeOptions.VerificationState.
|
||||
const (
|
||||
ExtensionRangeOptions_VerificationState_enum_fullname = "google.protobuf.ExtensionRangeOptions.VerificationState"
|
||||
ExtensionRangeOptions_VerificationState_enum_name = "VerificationState"
|
||||
)
|
||||
|
||||
// Names for google.protobuf.ExtensionRangeOptions.Declaration.
|
||||
const (
|
||||
ExtensionRangeOptions_Declaration_message_name protoreflect.Name = "Declaration"
|
||||
ExtensionRangeOptions_Declaration_message_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration"
|
||||
)
|
||||
|
||||
// Field names for google.protobuf.ExtensionRangeOptions.Declaration.
|
||||
const (
|
||||
ExtensionRangeOptions_Declaration_Number_field_name protoreflect.Name = "number"
|
||||
ExtensionRangeOptions_Declaration_FullName_field_name protoreflect.Name = "full_name"
|
||||
ExtensionRangeOptions_Declaration_Type_field_name protoreflect.Name = "type"
|
||||
ExtensionRangeOptions_Declaration_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_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"
|
||||
)
|
||||
|
||||
// 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
|
||||
)
|
||||
|
||||
// Names for google.protobuf.FieldDescriptorProto.
|
||||
@@ -494,26 +542,29 @@ const (
|
||||
|
||||
// Field names for google.protobuf.MessageOptions.
|
||||
const (
|
||||
MessageOptions_MessageSetWireFormat_field_name protoreflect.Name = "message_set_wire_format"
|
||||
MessageOptions_NoStandardDescriptorAccessor_field_name protoreflect.Name = "no_standard_descriptor_accessor"
|
||||
MessageOptions_Deprecated_field_name protoreflect.Name = "deprecated"
|
||||
MessageOptions_MapEntry_field_name protoreflect.Name = "map_entry"
|
||||
MessageOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
MessageOptions_MessageSetWireFormat_field_name protoreflect.Name = "message_set_wire_format"
|
||||
MessageOptions_NoStandardDescriptorAccessor_field_name protoreflect.Name = "no_standard_descriptor_accessor"
|
||||
MessageOptions_Deprecated_field_name protoreflect.Name = "deprecated"
|
||||
MessageOptions_MapEntry_field_name protoreflect.Name = "map_entry"
|
||||
MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_name protoreflect.Name = "deprecated_legacy_json_field_conflicts"
|
||||
MessageOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
|
||||
MessageOptions_MessageSetWireFormat_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.message_set_wire_format"
|
||||
MessageOptions_NoStandardDescriptorAccessor_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.no_standard_descriptor_accessor"
|
||||
MessageOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.deprecated"
|
||||
MessageOptions_MapEntry_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.map_entry"
|
||||
MessageOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.uninterpreted_option"
|
||||
MessageOptions_MessageSetWireFormat_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.message_set_wire_format"
|
||||
MessageOptions_NoStandardDescriptorAccessor_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.no_standard_descriptor_accessor"
|
||||
MessageOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.deprecated"
|
||||
MessageOptions_MapEntry_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.map_entry"
|
||||
MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.deprecated_legacy_json_field_conflicts"
|
||||
MessageOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.uninterpreted_option"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.MessageOptions.
|
||||
const (
|
||||
MessageOptions_MessageSetWireFormat_field_number protoreflect.FieldNumber = 1
|
||||
MessageOptions_NoStandardDescriptorAccessor_field_number protoreflect.FieldNumber = 2
|
||||
MessageOptions_Deprecated_field_number protoreflect.FieldNumber = 3
|
||||
MessageOptions_MapEntry_field_number protoreflect.FieldNumber = 7
|
||||
MessageOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
MessageOptions_MessageSetWireFormat_field_number protoreflect.FieldNumber = 1
|
||||
MessageOptions_NoStandardDescriptorAccessor_field_number protoreflect.FieldNumber = 2
|
||||
MessageOptions_Deprecated_field_number protoreflect.FieldNumber = 3
|
||||
MessageOptions_MapEntry_field_number protoreflect.FieldNumber = 7
|
||||
MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_number protoreflect.FieldNumber = 11
|
||||
MessageOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
)
|
||||
|
||||
// Names for google.protobuf.FieldOptions.
|
||||
@@ -528,16 +579,26 @@ const (
|
||||
FieldOptions_Packed_field_name protoreflect.Name = "packed"
|
||||
FieldOptions_Jstype_field_name protoreflect.Name = "jstype"
|
||||
FieldOptions_Lazy_field_name protoreflect.Name = "lazy"
|
||||
FieldOptions_UnverifiedLazy_field_name protoreflect.Name = "unverified_lazy"
|
||||
FieldOptions_Deprecated_field_name protoreflect.Name = "deprecated"
|
||||
FieldOptions_Weak_field_name protoreflect.Name = "weak"
|
||||
FieldOptions_DebugRedact_field_name protoreflect.Name = "debug_redact"
|
||||
FieldOptions_Retention_field_name protoreflect.Name = "retention"
|
||||
FieldOptions_Target_field_name protoreflect.Name = "target"
|
||||
FieldOptions_Targets_field_name protoreflect.Name = "targets"
|
||||
FieldOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
|
||||
FieldOptions_Ctype_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.ctype"
|
||||
FieldOptions_Packed_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.packed"
|
||||
FieldOptions_Jstype_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.jstype"
|
||||
FieldOptions_Lazy_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.lazy"
|
||||
FieldOptions_UnverifiedLazy_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.unverified_lazy"
|
||||
FieldOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.deprecated"
|
||||
FieldOptions_Weak_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.weak"
|
||||
FieldOptions_DebugRedact_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.debug_redact"
|
||||
FieldOptions_Retention_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.retention"
|
||||
FieldOptions_Target_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.target"
|
||||
FieldOptions_Targets_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.targets"
|
||||
FieldOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.uninterpreted_option"
|
||||
)
|
||||
|
||||
@@ -547,8 +608,13 @@ const (
|
||||
FieldOptions_Packed_field_number protoreflect.FieldNumber = 2
|
||||
FieldOptions_Jstype_field_number protoreflect.FieldNumber = 6
|
||||
FieldOptions_Lazy_field_number protoreflect.FieldNumber = 5
|
||||
FieldOptions_UnverifiedLazy_field_number protoreflect.FieldNumber = 15
|
||||
FieldOptions_Deprecated_field_number protoreflect.FieldNumber = 3
|
||||
FieldOptions_Weak_field_number protoreflect.FieldNumber = 10
|
||||
FieldOptions_DebugRedact_field_number protoreflect.FieldNumber = 16
|
||||
FieldOptions_Retention_field_number protoreflect.FieldNumber = 17
|
||||
FieldOptions_Target_field_number protoreflect.FieldNumber = 18
|
||||
FieldOptions_Targets_field_number protoreflect.FieldNumber = 19
|
||||
FieldOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
)
|
||||
|
||||
@@ -564,6 +630,18 @@ const (
|
||||
FieldOptions_JSType_enum_name = "JSType"
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FieldOptions.OptionRetention.
|
||||
const (
|
||||
FieldOptions_OptionRetention_enum_fullname = "google.protobuf.FieldOptions.OptionRetention"
|
||||
FieldOptions_OptionRetention_enum_name = "OptionRetention"
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.FieldOptions.OptionTargetType.
|
||||
const (
|
||||
FieldOptions_OptionTargetType_enum_fullname = "google.protobuf.FieldOptions.OptionTargetType"
|
||||
FieldOptions_OptionTargetType_enum_name = "OptionTargetType"
|
||||
)
|
||||
|
||||
// Names for google.protobuf.OneofOptions.
|
||||
const (
|
||||
OneofOptions_message_name protoreflect.Name = "OneofOptions"
|
||||
@@ -590,20 +668,23 @@ const (
|
||||
|
||||
// Field names for google.protobuf.EnumOptions.
|
||||
const (
|
||||
EnumOptions_AllowAlias_field_name protoreflect.Name = "allow_alias"
|
||||
EnumOptions_Deprecated_field_name protoreflect.Name = "deprecated"
|
||||
EnumOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
EnumOptions_AllowAlias_field_name protoreflect.Name = "allow_alias"
|
||||
EnumOptions_Deprecated_field_name protoreflect.Name = "deprecated"
|
||||
EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_name protoreflect.Name = "deprecated_legacy_json_field_conflicts"
|
||||
EnumOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option"
|
||||
|
||||
EnumOptions_AllowAlias_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.allow_alias"
|
||||
EnumOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.deprecated"
|
||||
EnumOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.uninterpreted_option"
|
||||
EnumOptions_AllowAlias_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.allow_alias"
|
||||
EnumOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.deprecated"
|
||||
EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.deprecated_legacy_json_field_conflicts"
|
||||
EnumOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.uninterpreted_option"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.EnumOptions.
|
||||
const (
|
||||
EnumOptions_AllowAlias_field_number protoreflect.FieldNumber = 2
|
||||
EnumOptions_Deprecated_field_number protoreflect.FieldNumber = 3
|
||||
EnumOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
EnumOptions_AllowAlias_field_number protoreflect.FieldNumber = 2
|
||||
EnumOptions_Deprecated_field_number protoreflect.FieldNumber = 3
|
||||
EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_number protoreflect.FieldNumber = 6
|
||||
EnumOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999
|
||||
)
|
||||
|
||||
// Names for google.protobuf.EnumValueOptions.
|
||||
@@ -813,11 +894,13 @@ const (
|
||||
GeneratedCodeInfo_Annotation_SourceFile_field_name protoreflect.Name = "source_file"
|
||||
GeneratedCodeInfo_Annotation_Begin_field_name protoreflect.Name = "begin"
|
||||
GeneratedCodeInfo_Annotation_End_field_name protoreflect.Name = "end"
|
||||
GeneratedCodeInfo_Annotation_Semantic_field_name protoreflect.Name = "semantic"
|
||||
|
||||
GeneratedCodeInfo_Annotation_Path_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.path"
|
||||
GeneratedCodeInfo_Annotation_SourceFile_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.source_file"
|
||||
GeneratedCodeInfo_Annotation_Begin_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.begin"
|
||||
GeneratedCodeInfo_Annotation_End_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.end"
|
||||
GeneratedCodeInfo_Annotation_Semantic_field_fullname protoreflect.FullName = "google.protobuf.GeneratedCodeInfo.Annotation.semantic"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.GeneratedCodeInfo.Annotation.
|
||||
@@ -826,4 +909,11 @@ const (
|
||||
GeneratedCodeInfo_Annotation_SourceFile_field_number protoreflect.FieldNumber = 2
|
||||
GeneratedCodeInfo_Annotation_Begin_field_number protoreflect.FieldNumber = 3
|
||||
GeneratedCodeInfo_Annotation_End_field_number protoreflect.FieldNumber = 4
|
||||
GeneratedCodeInfo_Annotation_Semantic_field_number protoreflect.FieldNumber = 5
|
||||
)
|
||||
|
||||
// Full and short names for google.protobuf.GeneratedCodeInfo.Annotation.Semantic.
|
||||
const (
|
||||
GeneratedCodeInfo_Annotation_Semantic_enum_fullname = "google.protobuf.GeneratedCodeInfo.Annotation.Semantic"
|
||||
GeneratedCodeInfo_Annotation_Semantic_enum_name = "Semantic"
|
||||
)
|
||||
|
6
vendor/google.golang.org/protobuf/internal/genid/type_gen.go
generated
vendored
6
vendor/google.golang.org/protobuf/internal/genid/type_gen.go
generated
vendored
@@ -32,6 +32,7 @@ const (
|
||||
Type_Options_field_name protoreflect.Name = "options"
|
||||
Type_SourceContext_field_name protoreflect.Name = "source_context"
|
||||
Type_Syntax_field_name protoreflect.Name = "syntax"
|
||||
Type_Edition_field_name protoreflect.Name = "edition"
|
||||
|
||||
Type_Name_field_fullname protoreflect.FullName = "google.protobuf.Type.name"
|
||||
Type_Fields_field_fullname protoreflect.FullName = "google.protobuf.Type.fields"
|
||||
@@ -39,6 +40,7 @@ const (
|
||||
Type_Options_field_fullname protoreflect.FullName = "google.protobuf.Type.options"
|
||||
Type_SourceContext_field_fullname protoreflect.FullName = "google.protobuf.Type.source_context"
|
||||
Type_Syntax_field_fullname protoreflect.FullName = "google.protobuf.Type.syntax"
|
||||
Type_Edition_field_fullname protoreflect.FullName = "google.protobuf.Type.edition"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.Type.
|
||||
@@ -49,6 +51,7 @@ const (
|
||||
Type_Options_field_number protoreflect.FieldNumber = 4
|
||||
Type_SourceContext_field_number protoreflect.FieldNumber = 5
|
||||
Type_Syntax_field_number protoreflect.FieldNumber = 6
|
||||
Type_Edition_field_number protoreflect.FieldNumber = 7
|
||||
)
|
||||
|
||||
// Names for google.protobuf.Field.
|
||||
@@ -121,12 +124,14 @@ const (
|
||||
Enum_Options_field_name protoreflect.Name = "options"
|
||||
Enum_SourceContext_field_name protoreflect.Name = "source_context"
|
||||
Enum_Syntax_field_name protoreflect.Name = "syntax"
|
||||
Enum_Edition_field_name protoreflect.Name = "edition"
|
||||
|
||||
Enum_Name_field_fullname protoreflect.FullName = "google.protobuf.Enum.name"
|
||||
Enum_Enumvalue_field_fullname protoreflect.FullName = "google.protobuf.Enum.enumvalue"
|
||||
Enum_Options_field_fullname protoreflect.FullName = "google.protobuf.Enum.options"
|
||||
Enum_SourceContext_field_fullname protoreflect.FullName = "google.protobuf.Enum.source_context"
|
||||
Enum_Syntax_field_fullname protoreflect.FullName = "google.protobuf.Enum.syntax"
|
||||
Enum_Edition_field_fullname protoreflect.FullName = "google.protobuf.Enum.edition"
|
||||
)
|
||||
|
||||
// Field numbers for google.protobuf.Enum.
|
||||
@@ -136,6 +141,7 @@ const (
|
||||
Enum_Options_field_number protoreflect.FieldNumber = 3
|
||||
Enum_SourceContext_field_number protoreflect.FieldNumber = 4
|
||||
Enum_Syntax_field_number protoreflect.FieldNumber = 5
|
||||
Enum_Edition_field_number protoreflect.FieldNumber = 6
|
||||
)
|
||||
|
||||
// Names for google.protobuf.EnumValue.
|
||||
|
1
vendor/google.golang.org/protobuf/internal/impl/convert.go
generated
vendored
1
vendor/google.golang.org/protobuf/internal/impl/convert.go
generated
vendored
@@ -59,7 +59,6 @@ func NewConverter(t reflect.Type, fd protoreflect.FieldDescriptor) Converter {
|
||||
default:
|
||||
return newSingularConverter(t, fd)
|
||||
}
|
||||
panic(fmt.Sprintf("invalid Go type %v for field %v", t, fd.FullName()))
|
||||
}
|
||||
|
||||
var (
|
||||
|
2
vendor/google.golang.org/protobuf/internal/order/order.go
generated
vendored
2
vendor/google.golang.org/protobuf/internal/order/order.go
generated
vendored
@@ -33,7 +33,7 @@ var (
|
||||
return !inOneof(ox) && inOneof(oy)
|
||||
}
|
||||
// Fields in disjoint oneof sets are sorted by declaration index.
|
||||
if ox != nil && oy != nil && ox != oy {
|
||||
if inOneof(ox) && inOneof(oy) && ox != oy {
|
||||
return ox.Index() < oy.Index()
|
||||
}
|
||||
// Fields sorted by field number.
|
||||
|
2
vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go
generated
vendored
2
vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go
generated
vendored
@@ -87,7 +87,7 @@ func (sb *Builder) grow(n int) {
|
||||
// Unlike strings.Builder, we do not need to copy over the contents
|
||||
// of the old buffer since our builder provides no API for
|
||||
// retrieving previously created strings.
|
||||
sb.buf = make([]byte, 2*(cap(sb.buf)+n))
|
||||
sb.buf = make([]byte, 0, 2*(cap(sb.buf)+n))
|
||||
}
|
||||
|
||||
func (sb *Builder) last(n int) string {
|
||||
|
4
vendor/google.golang.org/protobuf/internal/version/version.go
generated
vendored
4
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 = 28
|
||||
Patch = 1
|
||||
Minor = 31
|
||||
Patch = 0
|
||||
PreRelease = ""
|
||||
)
|
||||
|
||||
|
9
vendor/google.golang.org/protobuf/proto/doc.go
generated
vendored
9
vendor/google.golang.org/protobuf/proto/doc.go
generated
vendored
@@ -5,16 +5,13 @@
|
||||
// Package proto provides functions operating on protocol buffer messages.
|
||||
//
|
||||
// For documentation on protocol buffers in general, see:
|
||||
//
|
||||
// https://developers.google.com/protocol-buffers
|
||||
// https://protobuf.dev.
|
||||
//
|
||||
// For a tutorial on using protocol buffers with Go, see:
|
||||
//
|
||||
// https://developers.google.com/protocol-buffers/docs/gotutorial
|
||||
// https://protobuf.dev/getting-started/gotutorial.
|
||||
//
|
||||
// For a guide to generated Go protocol buffer code, see:
|
||||
//
|
||||
// https://developers.google.com/protocol-buffers/docs/reference/go-generated
|
||||
// https://protobuf.dev/reference/go/go-generated.
|
||||
//
|
||||
// # Binary serialization
|
||||
//
|
||||
|
172
vendor/google.golang.org/protobuf/proto/equal.go
generated
vendored
172
vendor/google.golang.org/protobuf/proto/equal.go
generated
vendored
@@ -5,30 +5,39 @@
|
||||
package proto
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"math"
|
||||
"reflect"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
)
|
||||
|
||||
// Equal reports whether two messages are equal.
|
||||
// If two messages marshal to the same bytes under deterministic serialization,
|
||||
// then Equal is guaranteed to report true.
|
||||
// Equal reports whether two messages are equal,
|
||||
// by recursively comparing the fields of the message.
|
||||
//
|
||||
// Two messages are equal if they belong to the same message descriptor,
|
||||
// have the same set of populated known and extension field values,
|
||||
// and the same set of unknown fields values. If either of the top-level
|
||||
// messages are invalid, then Equal reports true only if both are invalid.
|
||||
// - Bytes fields are equal if they contain identical bytes.
|
||||
// Empty bytes (regardless of nil-ness) are considered equal.
|
||||
//
|
||||
// Scalar values are compared with the equivalent of the == operator in Go,
|
||||
// except bytes values which are compared using bytes.Equal and
|
||||
// floating point values which specially treat NaNs as equal.
|
||||
// Message values are compared by recursively calling Equal.
|
||||
// Lists are equal if each element value is also equal.
|
||||
// Maps are equal if they have the same set of keys, where the pair of values
|
||||
// for each key is also equal.
|
||||
// - Floating-point fields are equal if they contain the same value.
|
||||
// Unlike the == operator, a NaN is equal to another NaN.
|
||||
//
|
||||
// - Other scalar fields are equal if they contain the same value.
|
||||
//
|
||||
// - Message fields are equal if they have
|
||||
// the same set of populated known and extension field values, and
|
||||
// the same set of unknown fields values.
|
||||
//
|
||||
// - Lists are equal if they are the same length and
|
||||
// each corresponding element is equal.
|
||||
//
|
||||
// - Maps are equal if they have the same set of keys and
|
||||
// the corresponding value for each key is equal.
|
||||
//
|
||||
// An invalid message is not equal to a valid message.
|
||||
// An invalid message is only equal to another invalid message of the
|
||||
// same type. An invalid message often corresponds to a nil pointer
|
||||
// of the concrete message type. For example, (*pb.M)(nil) is not equal
|
||||
// to &pb.M{}.
|
||||
// If two valid messages marshal to the same bytes under deterministic
|
||||
// serialization, then Equal is guaranteed to report true.
|
||||
func Equal(x, y Message) bool {
|
||||
if x == nil || y == nil {
|
||||
return x == nil && y == nil
|
||||
@@ -42,130 +51,7 @@ func Equal(x, y Message) bool {
|
||||
if mx.IsValid() != my.IsValid() {
|
||||
return false
|
||||
}
|
||||
return equalMessage(mx, my)
|
||||
}
|
||||
|
||||
// equalMessage compares two messages.
|
||||
func equalMessage(mx, my protoreflect.Message) bool {
|
||||
if mx.Descriptor() != my.Descriptor() {
|
||||
return false
|
||||
}
|
||||
|
||||
nx := 0
|
||||
equal := true
|
||||
mx.Range(func(fd protoreflect.FieldDescriptor, vx protoreflect.Value) bool {
|
||||
nx++
|
||||
vy := my.Get(fd)
|
||||
equal = my.Has(fd) && equalField(fd, vx, vy)
|
||||
return equal
|
||||
})
|
||||
if !equal {
|
||||
return false
|
||||
}
|
||||
ny := 0
|
||||
my.Range(func(fd protoreflect.FieldDescriptor, vx protoreflect.Value) bool {
|
||||
ny++
|
||||
return true
|
||||
})
|
||||
if nx != ny {
|
||||
return false
|
||||
}
|
||||
|
||||
return equalUnknown(mx.GetUnknown(), my.GetUnknown())
|
||||
}
|
||||
|
||||
// equalField compares two fields.
|
||||
func equalField(fd protoreflect.FieldDescriptor, x, y protoreflect.Value) bool {
|
||||
switch {
|
||||
case fd.IsList():
|
||||
return equalList(fd, x.List(), y.List())
|
||||
case fd.IsMap():
|
||||
return equalMap(fd, x.Map(), y.Map())
|
||||
default:
|
||||
return equalValue(fd, x, y)
|
||||
}
|
||||
}
|
||||
|
||||
// equalMap compares two maps.
|
||||
func equalMap(fd protoreflect.FieldDescriptor, x, y protoreflect.Map) bool {
|
||||
if x.Len() != y.Len() {
|
||||
return false
|
||||
}
|
||||
equal := true
|
||||
x.Range(func(k protoreflect.MapKey, vx protoreflect.Value) bool {
|
||||
vy := y.Get(k)
|
||||
equal = y.Has(k) && equalValue(fd.MapValue(), vx, vy)
|
||||
return equal
|
||||
})
|
||||
return equal
|
||||
}
|
||||
|
||||
// equalList compares two lists.
|
||||
func equalList(fd protoreflect.FieldDescriptor, x, y protoreflect.List) bool {
|
||||
if x.Len() != y.Len() {
|
||||
return false
|
||||
}
|
||||
for i := x.Len() - 1; i >= 0; i-- {
|
||||
if !equalValue(fd, x.Get(i), y.Get(i)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// equalValue compares two singular values.
|
||||
func equalValue(fd protoreflect.FieldDescriptor, x, y protoreflect.Value) bool {
|
||||
switch fd.Kind() {
|
||||
case protoreflect.BoolKind:
|
||||
return x.Bool() == y.Bool()
|
||||
case protoreflect.EnumKind:
|
||||
return x.Enum() == y.Enum()
|
||||
case protoreflect.Int32Kind, protoreflect.Sint32Kind,
|
||||
protoreflect.Int64Kind, protoreflect.Sint64Kind,
|
||||
protoreflect.Sfixed32Kind, protoreflect.Sfixed64Kind:
|
||||
return x.Int() == y.Int()
|
||||
case protoreflect.Uint32Kind, protoreflect.Uint64Kind,
|
||||
protoreflect.Fixed32Kind, protoreflect.Fixed64Kind:
|
||||
return x.Uint() == y.Uint()
|
||||
case protoreflect.FloatKind, protoreflect.DoubleKind:
|
||||
fx := x.Float()
|
||||
fy := y.Float()
|
||||
if math.IsNaN(fx) || math.IsNaN(fy) {
|
||||
return math.IsNaN(fx) && math.IsNaN(fy)
|
||||
}
|
||||
return fx == fy
|
||||
case protoreflect.StringKind:
|
||||
return x.String() == y.String()
|
||||
case protoreflect.BytesKind:
|
||||
return bytes.Equal(x.Bytes(), y.Bytes())
|
||||
case protoreflect.MessageKind, protoreflect.GroupKind:
|
||||
return equalMessage(x.Message(), y.Message())
|
||||
default:
|
||||
return x.Interface() == y.Interface()
|
||||
}
|
||||
}
|
||||
|
||||
// equalUnknown compares unknown fields by direct comparison on the raw bytes
|
||||
// of each individual field number.
|
||||
func equalUnknown(x, y protoreflect.RawFields) bool {
|
||||
if len(x) != len(y) {
|
||||
return false
|
||||
}
|
||||
if bytes.Equal([]byte(x), []byte(y)) {
|
||||
return true
|
||||
}
|
||||
|
||||
mx := make(map[protoreflect.FieldNumber]protoreflect.RawFields)
|
||||
my := make(map[protoreflect.FieldNumber]protoreflect.RawFields)
|
||||
for len(x) > 0 {
|
||||
fnum, _, n := protowire.ConsumeField(x)
|
||||
mx[fnum] = append(mx[fnum], x[:n]...)
|
||||
x = x[n:]
|
||||
}
|
||||
for len(y) > 0 {
|
||||
fnum, _, n := protowire.ConsumeField(y)
|
||||
my[fnum] = append(my[fnum], y[:n]...)
|
||||
y = y[n:]
|
||||
}
|
||||
return reflect.DeepEqual(mx, my)
|
||||
vx := protoreflect.ValueOfMessage(mx)
|
||||
vy := protoreflect.ValueOfMessage(my)
|
||||
return vx.Equal(vy)
|
||||
}
|
||||
|
10
vendor/google.golang.org/protobuf/proto/size.go
generated
vendored
10
vendor/google.golang.org/protobuf/proto/size.go
generated
vendored
@@ -73,23 +73,27 @@ func (o MarshalOptions) sizeField(fd protoreflect.FieldDescriptor, value protore
|
||||
}
|
||||
|
||||
func (o MarshalOptions) sizeList(num protowire.Number, fd protoreflect.FieldDescriptor, list protoreflect.List) (size int) {
|
||||
sizeTag := protowire.SizeTag(num)
|
||||
|
||||
if fd.IsPacked() && list.Len() > 0 {
|
||||
content := 0
|
||||
for i, llen := 0, list.Len(); i < llen; i++ {
|
||||
content += o.sizeSingular(num, fd.Kind(), list.Get(i))
|
||||
}
|
||||
return protowire.SizeTag(num) + protowire.SizeBytes(content)
|
||||
return sizeTag + protowire.SizeBytes(content)
|
||||
}
|
||||
|
||||
for i, llen := 0, list.Len(); i < llen; i++ {
|
||||
size += protowire.SizeTag(num) + o.sizeSingular(num, fd.Kind(), list.Get(i))
|
||||
size += sizeTag + o.sizeSingular(num, fd.Kind(), list.Get(i))
|
||||
}
|
||||
return size
|
||||
}
|
||||
|
||||
func (o MarshalOptions) sizeMap(num protowire.Number, fd protoreflect.FieldDescriptor, mapv protoreflect.Map) (size int) {
|
||||
sizeTag := protowire.SizeTag(num)
|
||||
|
||||
mapv.Range(func(key protoreflect.MapKey, value protoreflect.Value) bool {
|
||||
size += protowire.SizeTag(num)
|
||||
size += sizeTag
|
||||
size += protowire.SizeBytes(o.sizeField(fd.MapKey(), key.Value()) + o.sizeField(fd.MapValue(), value))
|
||||
return true
|
||||
})
|
||||
|
41
vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go
generated
vendored
41
vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go
generated
vendored
@@ -35,6 +35,8 @@ func (p *SourcePath) appendFileDescriptorProto(b []byte) []byte {
|
||||
b = p.appendSingularField(b, "source_code_info", (*SourcePath).appendSourceCodeInfo)
|
||||
case 12:
|
||||
b = p.appendSingularField(b, "syntax", nil)
|
||||
case 13:
|
||||
b = p.appendSingularField(b, "edition", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -236,6 +238,8 @@ func (p *SourcePath) appendMessageOptions(b []byte) []byte {
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 7:
|
||||
b = p.appendSingularField(b, "map_entry", nil)
|
||||
case 11:
|
||||
b = p.appendSingularField(b, "deprecated_legacy_json_field_conflicts", nil)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
@@ -279,6 +283,8 @@ func (p *SourcePath) appendEnumOptions(b []byte) []byte {
|
||||
b = p.appendSingularField(b, "allow_alias", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 6:
|
||||
b = p.appendSingularField(b, "deprecated_legacy_json_field_conflicts", nil)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
@@ -345,10 +351,20 @@ func (p *SourcePath) appendFieldOptions(b []byte) []byte {
|
||||
b = p.appendSingularField(b, "jstype", nil)
|
||||
case 5:
|
||||
b = p.appendSingularField(b, "lazy", nil)
|
||||
case 15:
|
||||
b = p.appendSingularField(b, "unverified_lazy", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "deprecated", nil)
|
||||
case 10:
|
||||
b = p.appendSingularField(b, "weak", nil)
|
||||
case 16:
|
||||
b = p.appendSingularField(b, "debug_redact", nil)
|
||||
case 17:
|
||||
b = p.appendSingularField(b, "retention", nil)
|
||||
case 18:
|
||||
b = p.appendSingularField(b, "target", nil)
|
||||
case 19:
|
||||
b = p.appendRepeatedField(b, "targets", nil)
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
}
|
||||
@@ -404,6 +420,10 @@ func (p *SourcePath) appendExtensionRangeOptions(b []byte) []byte {
|
||||
switch (*p)[0] {
|
||||
case 999:
|
||||
b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption)
|
||||
case 2:
|
||||
b = p.appendRepeatedField(b, "declaration", (*SourcePath).appendExtensionRangeOptions_Declaration)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "verification", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -459,3 +479,24 @@ func (p *SourcePath) appendUninterpretedOption_NamePart(b []byte) []byte {
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (p *SourcePath) appendExtensionRangeOptions_Declaration(b []byte) []byte {
|
||||
if len(*p) == 0 {
|
||||
return b
|
||||
}
|
||||
switch (*p)[0] {
|
||||
case 1:
|
||||
b = p.appendSingularField(b, "number", nil)
|
||||
case 2:
|
||||
b = p.appendSingularField(b, "full_name", nil)
|
||||
case 3:
|
||||
b = p.appendSingularField(b, "type", nil)
|
||||
case 4:
|
||||
b = p.appendSingularField(b, "is_repeated", nil)
|
||||
case 5:
|
||||
b = p.appendSingularField(b, "reserved", nil)
|
||||
case 6:
|
||||
b = p.appendSingularField(b, "repeated", nil)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
2
vendor/google.golang.org/protobuf/reflect/protoreflect/value.go
generated
vendored
2
vendor/google.golang.org/protobuf/reflect/protoreflect/value.go
generated
vendored
@@ -148,7 +148,7 @@ type Message interface {
|
||||
// be preserved in marshaling or other operations.
|
||||
IsValid() bool
|
||||
|
||||
// ProtoMethods returns optional fast-path implementions of various operations.
|
||||
// ProtoMethods returns optional fast-path implementations of various operations.
|
||||
// This method may return nil.
|
||||
//
|
||||
// The returned methods type is identical to
|
||||
|
168
vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go
generated
vendored
Normal file
168
vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go
generated
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
// Copyright 2022 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package protoreflect
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"math"
|
||||
"reflect"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
)
|
||||
|
||||
// Equal reports whether v1 and v2 are recursively equal.
|
||||
//
|
||||
// - Values of different types are always unequal.
|
||||
//
|
||||
// - Bytes values are equal if they contain identical bytes.
|
||||
// Empty bytes (regardless of nil-ness) are considered equal.
|
||||
//
|
||||
// - Floating point values are equal if they contain the same value.
|
||||
// Unlike the == operator, a NaN is equal to another NaN.
|
||||
//
|
||||
// - Enums are equal if they contain the same number.
|
||||
// Since Value does not contain an enum descriptor,
|
||||
// enum values do not consider the type of the enum.
|
||||
//
|
||||
// - Other scalar values are equal if they contain the same value.
|
||||
//
|
||||
// - Message values are equal if they belong to the same message descriptor,
|
||||
// have the same set of populated known and extension field values,
|
||||
// and the same set of unknown fields values.
|
||||
//
|
||||
// - Lists are equal if they are the same length and
|
||||
// each corresponding element is equal.
|
||||
//
|
||||
// - Maps are equal if they have the same set of keys and
|
||||
// the corresponding value for each key is equal.
|
||||
func (v1 Value) Equal(v2 Value) bool {
|
||||
return equalValue(v1, v2)
|
||||
}
|
||||
|
||||
func equalValue(x, y Value) bool {
|
||||
eqType := x.typ == y.typ
|
||||
switch x.typ {
|
||||
case nilType:
|
||||
return eqType
|
||||
case boolType:
|
||||
return eqType && x.Bool() == y.Bool()
|
||||
case int32Type, int64Type:
|
||||
return eqType && x.Int() == y.Int()
|
||||
case uint32Type, uint64Type:
|
||||
return eqType && x.Uint() == y.Uint()
|
||||
case float32Type, float64Type:
|
||||
return eqType && equalFloat(x.Float(), y.Float())
|
||||
case stringType:
|
||||
return eqType && x.String() == y.String()
|
||||
case bytesType:
|
||||
return eqType && bytes.Equal(x.Bytes(), y.Bytes())
|
||||
case enumType:
|
||||
return eqType && x.Enum() == y.Enum()
|
||||
default:
|
||||
switch x := x.Interface().(type) {
|
||||
case Message:
|
||||
y, ok := y.Interface().(Message)
|
||||
return ok && equalMessage(x, y)
|
||||
case List:
|
||||
y, ok := y.Interface().(List)
|
||||
return ok && equalList(x, y)
|
||||
case Map:
|
||||
y, ok := y.Interface().(Map)
|
||||
return ok && equalMap(x, y)
|
||||
default:
|
||||
panic(fmt.Sprintf("unknown type: %T", x))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// equalFloat compares two floats, where NaNs are treated as equal.
|
||||
func equalFloat(x, y float64) bool {
|
||||
if math.IsNaN(x) || math.IsNaN(y) {
|
||||
return math.IsNaN(x) && math.IsNaN(y)
|
||||
}
|
||||
return x == y
|
||||
}
|
||||
|
||||
// equalMessage compares two messages.
|
||||
func equalMessage(mx, my Message) bool {
|
||||
if mx.Descriptor() != my.Descriptor() {
|
||||
return false
|
||||
}
|
||||
|
||||
nx := 0
|
||||
equal := true
|
||||
mx.Range(func(fd FieldDescriptor, vx Value) bool {
|
||||
nx++
|
||||
vy := my.Get(fd)
|
||||
equal = my.Has(fd) && equalValue(vx, vy)
|
||||
return equal
|
||||
})
|
||||
if !equal {
|
||||
return false
|
||||
}
|
||||
ny := 0
|
||||
my.Range(func(fd FieldDescriptor, vx Value) bool {
|
||||
ny++
|
||||
return true
|
||||
})
|
||||
if nx != ny {
|
||||
return false
|
||||
}
|
||||
|
||||
return equalUnknown(mx.GetUnknown(), my.GetUnknown())
|
||||
}
|
||||
|
||||
// equalList compares two lists.
|
||||
func equalList(x, y List) bool {
|
||||
if x.Len() != y.Len() {
|
||||
return false
|
||||
}
|
||||
for i := x.Len() - 1; i >= 0; i-- {
|
||||
if !equalValue(x.Get(i), y.Get(i)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// equalMap compares two maps.
|
||||
func equalMap(x, y Map) bool {
|
||||
if x.Len() != y.Len() {
|
||||
return false
|
||||
}
|
||||
equal := true
|
||||
x.Range(func(k MapKey, vx Value) bool {
|
||||
vy := y.Get(k)
|
||||
equal = y.Has(k) && equalValue(vx, vy)
|
||||
return equal
|
||||
})
|
||||
return equal
|
||||
}
|
||||
|
||||
// equalUnknown compares unknown fields by direct comparison on the raw bytes
|
||||
// of each individual field number.
|
||||
func equalUnknown(x, y RawFields) bool {
|
||||
if len(x) != len(y) {
|
||||
return false
|
||||
}
|
||||
if bytes.Equal([]byte(x), []byte(y)) {
|
||||
return true
|
||||
}
|
||||
|
||||
mx := make(map[FieldNumber]RawFields)
|
||||
my := make(map[FieldNumber]RawFields)
|
||||
for len(x) > 0 {
|
||||
fnum, _, n := protowire.ConsumeField(x)
|
||||
mx[fnum] = append(mx[fnum], x[:n]...)
|
||||
x = x[n:]
|
||||
}
|
||||
for len(y) > 0 {
|
||||
fnum, _, n := protowire.ConsumeField(y)
|
||||
my[fnum] = append(my[fnum], y[:n]...)
|
||||
y = y[n:]
|
||||
}
|
||||
return reflect.DeepEqual(mx, my)
|
||||
}
|
4
vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go
generated
vendored
4
vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go
generated
vendored
@@ -54,11 +54,11 @@ import (
|
||||
// // Append a 0 to a "repeated int32" field.
|
||||
// // Since the Value returned by Mutable is guaranteed to alias
|
||||
// // the source message, modifying the Value modifies the message.
|
||||
// message.Mutable(fieldDesc).(List).Append(protoreflect.ValueOfInt32(0))
|
||||
// message.Mutable(fieldDesc).List().Append(protoreflect.ValueOfInt32(0))
|
||||
//
|
||||
// // Assign [0] to a "repeated int32" field by creating a new Value,
|
||||
// // modifying it, and assigning it.
|
||||
// list := message.NewField(fieldDesc).(List)
|
||||
// list := message.NewField(fieldDesc).List()
|
||||
// list.Append(protoreflect.ValueOfInt32(0))
|
||||
// message.Set(fieldDesc, list)
|
||||
// // ERROR: Since it is not defined whether Set aliases the source,
|
||||
|
2
vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go
generated
vendored
2
vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go
generated
vendored
@@ -46,7 +46,7 @@ var conflictPolicy = "panic" // "panic" | "warn" | "ignore"
|
||||
// It is a variable so that the behavior is easily overridden in another file.
|
||||
var ignoreConflict = func(d protoreflect.Descriptor, err error) bool {
|
||||
const env = "GOLANG_PROTOBUF_REGISTRATION_CONFLICT"
|
||||
const faq = "https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict"
|
||||
const faq = "https://protobuf.dev/reference/go/faq#namespace-conflict"
|
||||
policy := conflictPolicy
|
||||
if v := os.Getenv(env); v != "" {
|
||||
policy = v
|
||||
|
1878
vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go
generated
vendored
1878
vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go
generated
vendored
File diff suppressed because it is too large
Load Diff
125
vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go
generated
vendored
125
vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go
generated
vendored
@@ -37,8 +37,7 @@
|
||||
// It is functionally a tuple of the full name of the remote message type and
|
||||
// the serialized bytes of the remote message value.
|
||||
//
|
||||
//
|
||||
// Constructing an Any
|
||||
// # Constructing an Any
|
||||
//
|
||||
// An Any message containing another message value is constructed using New:
|
||||
//
|
||||
@@ -48,8 +47,7 @@
|
||||
// }
|
||||
// ... // make use of any
|
||||
//
|
||||
//
|
||||
// Unmarshaling an Any
|
||||
// # Unmarshaling an Any
|
||||
//
|
||||
// With a populated Any message, the underlying message can be serialized into
|
||||
// a remote concrete message value in a few ways.
|
||||
@@ -95,8 +93,7 @@
|
||||
// listed in the case clauses are linked into the Go binary and therefore also
|
||||
// registered in the global registry.
|
||||
//
|
||||
//
|
||||
// Type checking an Any
|
||||
// # Type checking an Any
|
||||
//
|
||||
// In order to type check whether an Any message represents some other message,
|
||||
// then use the MessageIs method:
|
||||
@@ -115,7 +112,6 @@
|
||||
// }
|
||||
// ... // make use of m
|
||||
// }
|
||||
//
|
||||
package anypb
|
||||
|
||||
import (
|
||||
@@ -136,45 +132,49 @@ import (
|
||||
//
|
||||
// Example 1: Pack and unpack a message in C++.
|
||||
//
|
||||
// Foo foo = ...;
|
||||
// Any any;
|
||||
// any.PackFrom(foo);
|
||||
// ...
|
||||
// if (any.UnpackTo(&foo)) {
|
||||
// ...
|
||||
// }
|
||||
// Foo foo = ...;
|
||||
// Any any;
|
||||
// any.PackFrom(foo);
|
||||
// ...
|
||||
// if (any.UnpackTo(&foo)) {
|
||||
// ...
|
||||
// }
|
||||
//
|
||||
// Example 2: Pack and unpack a message in Java.
|
||||
//
|
||||
// Foo foo = ...;
|
||||
// Any any = Any.pack(foo);
|
||||
// ...
|
||||
// if (any.is(Foo.class)) {
|
||||
// foo = any.unpack(Foo.class);
|
||||
// }
|
||||
// Foo foo = ...;
|
||||
// Any any = Any.pack(foo);
|
||||
// ...
|
||||
// if (any.is(Foo.class)) {
|
||||
// foo = any.unpack(Foo.class);
|
||||
// }
|
||||
// // or ...
|
||||
// if (any.isSameTypeAs(Foo.getDefaultInstance())) {
|
||||
// foo = any.unpack(Foo.getDefaultInstance());
|
||||
// }
|
||||
//
|
||||
// Example 3: Pack and unpack a message in Python.
|
||||
// Example 3: Pack and unpack a message in Python.
|
||||
//
|
||||
// foo = Foo(...)
|
||||
// any = Any()
|
||||
// any.Pack(foo)
|
||||
// ...
|
||||
// if any.Is(Foo.DESCRIPTOR):
|
||||
// any.Unpack(foo)
|
||||
// ...
|
||||
// foo = Foo(...)
|
||||
// any = Any()
|
||||
// any.Pack(foo)
|
||||
// ...
|
||||
// if any.Is(Foo.DESCRIPTOR):
|
||||
// any.Unpack(foo)
|
||||
// ...
|
||||
//
|
||||
// Example 4: Pack and unpack a message in Go
|
||||
// Example 4: Pack and unpack a message in Go
|
||||
//
|
||||
// foo := &pb.Foo{...}
|
||||
// any, err := anypb.New(foo)
|
||||
// if err != nil {
|
||||
// ...
|
||||
// }
|
||||
// ...
|
||||
// foo := &pb.Foo{}
|
||||
// if err := any.UnmarshalTo(foo); err != nil {
|
||||
// ...
|
||||
// }
|
||||
// foo := &pb.Foo{...}
|
||||
// any, err := anypb.New(foo)
|
||||
// if err != nil {
|
||||
// ...
|
||||
// }
|
||||
// ...
|
||||
// foo := &pb.Foo{}
|
||||
// if err := any.UnmarshalTo(foo); err != nil {
|
||||
// ...
|
||||
// }
|
||||
//
|
||||
// The pack methods provided by protobuf library will by default use
|
||||
// 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
||||
@@ -182,35 +182,33 @@ import (
|
||||
// in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
||||
// name "y.z".
|
||||
//
|
||||
//
|
||||
// JSON
|
||||
// ====
|
||||
// The JSON representation of an `Any` value uses the regular
|
||||
// representation of the deserialized, embedded message, with an
|
||||
// additional field `@type` which contains the type URL. Example:
|
||||
//
|
||||
// package google.profile;
|
||||
// message Person {
|
||||
// string first_name = 1;
|
||||
// string last_name = 2;
|
||||
// }
|
||||
// package google.profile;
|
||||
// message Person {
|
||||
// string first_name = 1;
|
||||
// string last_name = 2;
|
||||
// }
|
||||
//
|
||||
// {
|
||||
// "@type": "type.googleapis.com/google.profile.Person",
|
||||
// "firstName": <string>,
|
||||
// "lastName": <string>
|
||||
// }
|
||||
// {
|
||||
// "@type": "type.googleapis.com/google.profile.Person",
|
||||
// "firstName": <string>,
|
||||
// "lastName": <string>
|
||||
// }
|
||||
//
|
||||
// If the embedded message type is well-known and has a custom JSON
|
||||
// representation, that representation will be embedded adding a field
|
||||
// `value` which holds the custom JSON in addition to the `@type`
|
||||
// field. Example (for message [google.protobuf.Duration][]):
|
||||
//
|
||||
// {
|
||||
// "@type": "type.googleapis.com/google.protobuf.Duration",
|
||||
// "value": "1.212s"
|
||||
// }
|
||||
//
|
||||
// {
|
||||
// "@type": "type.googleapis.com/google.protobuf.Duration",
|
||||
// "value": "1.212s"
|
||||
// }
|
||||
type Any struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -228,14 +226,14 @@ type Any struct {
|
||||
// scheme `http`, `https`, or no scheme, one can optionally set up a type
|
||||
// server that maps type URLs to message definitions as follows:
|
||||
//
|
||||
// * If no scheme is provided, `https` is assumed.
|
||||
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
||||
// value in binary format, or produce an error.
|
||||
// * Applications are allowed to cache lookup results based on the
|
||||
// URL, or have them precompiled into a binary to avoid any
|
||||
// lookup. Therefore, binary compatibility needs to be preserved
|
||||
// on changes to types. (Use versioned type names to manage
|
||||
// breaking changes.)
|
||||
// - If no scheme is provided, `https` is assumed.
|
||||
// - An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
||||
// value in binary format, or produce an error.
|
||||
// - Applications are allowed to cache lookup results based on the
|
||||
// URL, or have them precompiled into a binary to avoid any
|
||||
// lookup. Therefore, binary compatibility needs to be preserved
|
||||
// on changes to types. (Use versioned type names to manage
|
||||
// breaking changes.)
|
||||
//
|
||||
// Note: this functionality is not currently available in the official
|
||||
// protobuf release, and it is not used for type URLs beginning with
|
||||
@@ -243,7 +241,6 @@ type Any struct {
|
||||
//
|
||||
// Schemes other than `http`, `https` (or the empty scheme) might be
|
||||
// used with implementation specific semantics.
|
||||
//
|
||||
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
|
||||
// Must be a valid serialized protocol buffer of the above specified type.
|
||||
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
|
63
vendor/google.golang.org/protobuf/types/known/durationpb/duration.pb.go
generated
vendored
63
vendor/google.golang.org/protobuf/types/known/durationpb/duration.pb.go
generated
vendored
@@ -35,8 +35,7 @@
|
||||
//
|
||||
// The Duration message represents a signed span of time.
|
||||
//
|
||||
//
|
||||
// Conversion to a Go Duration
|
||||
// # Conversion to a Go Duration
|
||||
//
|
||||
// The AsDuration method can be used to convert a Duration message to a
|
||||
// standard Go time.Duration value:
|
||||
@@ -65,15 +64,13 @@
|
||||
// the resulting value to the closest representable value (e.g., math.MaxInt64
|
||||
// for positive overflow and math.MinInt64 for negative overflow).
|
||||
//
|
||||
//
|
||||
// Conversion from a Go Duration
|
||||
// # Conversion from a Go Duration
|
||||
//
|
||||
// The durationpb.New function can be used to construct a Duration message
|
||||
// from a standard Go time.Duration value:
|
||||
//
|
||||
// dur := durationpb.New(d)
|
||||
// ... // make use of d as a *durationpb.Duration
|
||||
//
|
||||
package durationpb
|
||||
|
||||
import (
|
||||
@@ -96,43 +93,43 @@ import (
|
||||
//
|
||||
// Example 1: Compute Duration from two Timestamps in pseudo code.
|
||||
//
|
||||
// Timestamp start = ...;
|
||||
// Timestamp end = ...;
|
||||
// Duration duration = ...;
|
||||
// Timestamp start = ...;
|
||||
// Timestamp end = ...;
|
||||
// Duration duration = ...;
|
||||
//
|
||||
// duration.seconds = end.seconds - start.seconds;
|
||||
// duration.nanos = end.nanos - start.nanos;
|
||||
// duration.seconds = end.seconds - start.seconds;
|
||||
// duration.nanos = end.nanos - start.nanos;
|
||||
//
|
||||
// if (duration.seconds < 0 && duration.nanos > 0) {
|
||||
// duration.seconds += 1;
|
||||
// duration.nanos -= 1000000000;
|
||||
// } else if (duration.seconds > 0 && duration.nanos < 0) {
|
||||
// duration.seconds -= 1;
|
||||
// duration.nanos += 1000000000;
|
||||
// }
|
||||
// if (duration.seconds < 0 && duration.nanos > 0) {
|
||||
// duration.seconds += 1;
|
||||
// duration.nanos -= 1000000000;
|
||||
// } else if (duration.seconds > 0 && duration.nanos < 0) {
|
||||
// duration.seconds -= 1;
|
||||
// duration.nanos += 1000000000;
|
||||
// }
|
||||
//
|
||||
// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
||||
//
|
||||
// Timestamp start = ...;
|
||||
// Duration duration = ...;
|
||||
// Timestamp end = ...;
|
||||
// Timestamp start = ...;
|
||||
// Duration duration = ...;
|
||||
// Timestamp end = ...;
|
||||
//
|
||||
// end.seconds = start.seconds + duration.seconds;
|
||||
// end.nanos = start.nanos + duration.nanos;
|
||||
// end.seconds = start.seconds + duration.seconds;
|
||||
// end.nanos = start.nanos + duration.nanos;
|
||||
//
|
||||
// if (end.nanos < 0) {
|
||||
// end.seconds -= 1;
|
||||
// end.nanos += 1000000000;
|
||||
// } else if (end.nanos >= 1000000000) {
|
||||
// end.seconds += 1;
|
||||
// end.nanos -= 1000000000;
|
||||
// }
|
||||
// if (end.nanos < 0) {
|
||||
// end.seconds -= 1;
|
||||
// end.nanos += 1000000000;
|
||||
// } else if (end.nanos >= 1000000000) {
|
||||
// end.seconds += 1;
|
||||
// end.nanos -= 1000000000;
|
||||
// }
|
||||
//
|
||||
// Example 3: Compute Duration from datetime.timedelta in Python.
|
||||
//
|
||||
// td = datetime.timedelta(days=3, minutes=10)
|
||||
// duration = Duration()
|
||||
// duration.FromTimedelta(td)
|
||||
// td = datetime.timedelta(days=3, minutes=10)
|
||||
// duration = Duration()
|
||||
// duration.FromTimedelta(td)
|
||||
//
|
||||
// # JSON Mapping
|
||||
//
|
||||
@@ -143,8 +140,6 @@ import (
|
||||
// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
||||
// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
||||
// microsecond should be expressed in JSON format as "3.000001s".
|
||||
//
|
||||
//
|
||||
type Duration struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
|
137
vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go
generated
vendored
137
vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go
generated
vendored
@@ -37,8 +37,7 @@
|
||||
// The paths are specific to some target message type,
|
||||
// which is not stored within the FieldMask message itself.
|
||||
//
|
||||
//
|
||||
// Constructing a FieldMask
|
||||
// # Constructing a FieldMask
|
||||
//
|
||||
// The New function is used construct a FieldMask:
|
||||
//
|
||||
@@ -61,8 +60,7 @@
|
||||
// ... // handle error
|
||||
// }
|
||||
//
|
||||
//
|
||||
// Type checking a FieldMask
|
||||
// # Type checking a FieldMask
|
||||
//
|
||||
// In order to verify that a FieldMask represents a set of fields that are
|
||||
// reachable from some target message type, use the IsValid method:
|
||||
@@ -89,8 +87,8 @@ import (
|
||||
|
||||
// `FieldMask` represents a set of symbolic field paths, for example:
|
||||
//
|
||||
// paths: "f.a"
|
||||
// paths: "f.b.d"
|
||||
// paths: "f.a"
|
||||
// paths: "f.b.d"
|
||||
//
|
||||
// Here `f` represents a field in some root message, `a` and `b`
|
||||
// fields in the message found in `f`, and `d` a field found in the
|
||||
@@ -107,27 +105,26 @@ import (
|
||||
// specified in the mask. For example, if the mask in the previous
|
||||
// example is applied to a response message as follows:
|
||||
//
|
||||
// f {
|
||||
// a : 22
|
||||
// b {
|
||||
// d : 1
|
||||
// x : 2
|
||||
// }
|
||||
// y : 13
|
||||
// }
|
||||
// z: 8
|
||||
// f {
|
||||
// a : 22
|
||||
// b {
|
||||
// d : 1
|
||||
// x : 2
|
||||
// }
|
||||
// y : 13
|
||||
// }
|
||||
// z: 8
|
||||
//
|
||||
// The result will not contain specific values for fields x,y and z
|
||||
// (their value will be set to the default, and omitted in proto text
|
||||
// output):
|
||||
//
|
||||
//
|
||||
// f {
|
||||
// a : 22
|
||||
// b {
|
||||
// d : 1
|
||||
// }
|
||||
// }
|
||||
// f {
|
||||
// a : 22
|
||||
// b {
|
||||
// d : 1
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// A repeated field is not allowed except at the last position of a
|
||||
// paths string.
|
||||
@@ -165,36 +162,36 @@ import (
|
||||
//
|
||||
// For example, given the target message:
|
||||
//
|
||||
// f {
|
||||
// b {
|
||||
// d: 1
|
||||
// x: 2
|
||||
// }
|
||||
// c: [1]
|
||||
// }
|
||||
// f {
|
||||
// b {
|
||||
// d: 1
|
||||
// x: 2
|
||||
// }
|
||||
// c: [1]
|
||||
// }
|
||||
//
|
||||
// And an update message:
|
||||
//
|
||||
// f {
|
||||
// b {
|
||||
// d: 10
|
||||
// }
|
||||
// c: [2]
|
||||
// }
|
||||
// f {
|
||||
// b {
|
||||
// d: 10
|
||||
// }
|
||||
// c: [2]
|
||||
// }
|
||||
//
|
||||
// then if the field mask is:
|
||||
//
|
||||
// paths: ["f.b", "f.c"]
|
||||
// paths: ["f.b", "f.c"]
|
||||
//
|
||||
// then the result will be:
|
||||
//
|
||||
// f {
|
||||
// b {
|
||||
// d: 10
|
||||
// x: 2
|
||||
// }
|
||||
// c: [1, 2]
|
||||
// }
|
||||
// f {
|
||||
// b {
|
||||
// d: 10
|
||||
// x: 2
|
||||
// }
|
||||
// c: [1, 2]
|
||||
// }
|
||||
//
|
||||
// An implementation may provide options to override this default behavior for
|
||||
// repeated and message fields.
|
||||
@@ -232,51 +229,51 @@ import (
|
||||
//
|
||||
// As an example, consider the following message declarations:
|
||||
//
|
||||
// message Profile {
|
||||
// User user = 1;
|
||||
// Photo photo = 2;
|
||||
// }
|
||||
// message User {
|
||||
// string display_name = 1;
|
||||
// string address = 2;
|
||||
// }
|
||||
// message Profile {
|
||||
// User user = 1;
|
||||
// Photo photo = 2;
|
||||
// }
|
||||
// message User {
|
||||
// string display_name = 1;
|
||||
// string address = 2;
|
||||
// }
|
||||
//
|
||||
// In proto a field mask for `Profile` may look as such:
|
||||
//
|
||||
// mask {
|
||||
// paths: "user.display_name"
|
||||
// paths: "photo"
|
||||
// }
|
||||
// mask {
|
||||
// paths: "user.display_name"
|
||||
// paths: "photo"
|
||||
// }
|
||||
//
|
||||
// In JSON, the same mask is represented as below:
|
||||
//
|
||||
// {
|
||||
// mask: "user.displayName,photo"
|
||||
// }
|
||||
// {
|
||||
// mask: "user.displayName,photo"
|
||||
// }
|
||||
//
|
||||
// # Field Masks and Oneof Fields
|
||||
//
|
||||
// Field masks treat fields in oneofs just as regular fields. Consider the
|
||||
// following message:
|
||||
//
|
||||
// message SampleMessage {
|
||||
// oneof test_oneof {
|
||||
// string name = 4;
|
||||
// SubMessage sub_message = 9;
|
||||
// }
|
||||
// }
|
||||
// message SampleMessage {
|
||||
// oneof test_oneof {
|
||||
// string name = 4;
|
||||
// SubMessage sub_message = 9;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// The field mask can be:
|
||||
//
|
||||
// mask {
|
||||
// paths: "name"
|
||||
// }
|
||||
// mask {
|
||||
// paths: "name"
|
||||
// }
|
||||
//
|
||||
// Or:
|
||||
//
|
||||
// mask {
|
||||
// paths: "sub_message"
|
||||
// }
|
||||
// mask {
|
||||
// paths: "sub_message"
|
||||
// }
|
||||
//
|
||||
// Note that oneof type names ("test_oneof" in this case) cannot be used in
|
||||
// paths.
|
||||
|
810
vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go
generated
vendored
Normal file
810
vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go
generated
vendored
Normal file
@@ -0,0 +1,810 @@
|
||||
// Protocol Buffers - Google's data interchange format
|
||||
// Copyright 2008 Google Inc. All rights reserved.
|
||||
// https://developers.google.com/protocol-buffers/
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: google/protobuf/struct.proto
|
||||
|
||||
// Package structpb contains generated types for google/protobuf/struct.proto.
|
||||
//
|
||||
// The messages (i.e., Value, Struct, and ListValue) defined in struct.proto are
|
||||
// used to represent arbitrary JSON. The Value message represents a JSON value,
|
||||
// the Struct message represents a JSON object, and the ListValue message
|
||||
// represents a JSON array. See https://json.org for more information.
|
||||
//
|
||||
// The Value, Struct, and ListValue types have generated MarshalJSON and
|
||||
// UnmarshalJSON methods such that they serialize JSON equivalent to what the
|
||||
// messages themselves represent. Use of these types with the
|
||||
// "google.golang.org/protobuf/encoding/protojson" package
|
||||
// ensures that they will be serialized as their JSON equivalent.
|
||||
//
|
||||
// # Conversion to and from a Go interface
|
||||
//
|
||||
// The standard Go "encoding/json" package has functionality to serialize
|
||||
// arbitrary types to a large degree. The Value.AsInterface, Struct.AsMap, and
|
||||
// ListValue.AsSlice methods can convert the protobuf message representation into
|
||||
// a form represented by interface{}, map[string]interface{}, and []interface{}.
|
||||
// This form can be used with other packages that operate on such data structures
|
||||
// and also directly with the standard json package.
|
||||
//
|
||||
// In order to convert the interface{}, map[string]interface{}, and []interface{}
|
||||
// forms back as Value, Struct, and ListValue messages, use the NewStruct,
|
||||
// NewList, and NewValue constructor functions.
|
||||
//
|
||||
// # Example usage
|
||||
//
|
||||
// Consider the following example JSON object:
|
||||
//
|
||||
// {
|
||||
// "firstName": "John",
|
||||
// "lastName": "Smith",
|
||||
// "isAlive": true,
|
||||
// "age": 27,
|
||||
// "address": {
|
||||
// "streetAddress": "21 2nd Street",
|
||||
// "city": "New York",
|
||||
// "state": "NY",
|
||||
// "postalCode": "10021-3100"
|
||||
// },
|
||||
// "phoneNumbers": [
|
||||
// {
|
||||
// "type": "home",
|
||||
// "number": "212 555-1234"
|
||||
// },
|
||||
// {
|
||||
// "type": "office",
|
||||
// "number": "646 555-4567"
|
||||
// }
|
||||
// ],
|
||||
// "children": [],
|
||||
// "spouse": null
|
||||
// }
|
||||
//
|
||||
// To construct a Value message representing the above JSON object:
|
||||
//
|
||||
// m, err := structpb.NewValue(map[string]interface{}{
|
||||
// "firstName": "John",
|
||||
// "lastName": "Smith",
|
||||
// "isAlive": true,
|
||||
// "age": 27,
|
||||
// "address": map[string]interface{}{
|
||||
// "streetAddress": "21 2nd Street",
|
||||
// "city": "New York",
|
||||
// "state": "NY",
|
||||
// "postalCode": "10021-3100",
|
||||
// },
|
||||
// "phoneNumbers": []interface{}{
|
||||
// map[string]interface{}{
|
||||
// "type": "home",
|
||||
// "number": "212 555-1234",
|
||||
// },
|
||||
// map[string]interface{}{
|
||||
// "type": "office",
|
||||
// "number": "646 555-4567",
|
||||
// },
|
||||
// },
|
||||
// "children": []interface{}{},
|
||||
// "spouse": nil,
|
||||
// })
|
||||
// if err != nil {
|
||||
// ... // handle error
|
||||
// }
|
||||
// ... // make use of m as a *structpb.Value
|
||||
package structpb
|
||||
|
||||
import (
|
||||
base64 "encoding/base64"
|
||||
protojson "google.golang.org/protobuf/encoding/protojson"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
math "math"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
utf8 "unicode/utf8"
|
||||
)
|
||||
|
||||
// `NullValue` is a singleton enumeration to represent the null value for the
|
||||
// `Value` type union.
|
||||
//
|
||||
// The JSON representation for `NullValue` is JSON `null`.
|
||||
type NullValue int32
|
||||
|
||||
const (
|
||||
// Null value.
|
||||
NullValue_NULL_VALUE NullValue = 0
|
||||
)
|
||||
|
||||
// Enum value maps for NullValue.
|
||||
var (
|
||||
NullValue_name = map[int32]string{
|
||||
0: "NULL_VALUE",
|
||||
}
|
||||
NullValue_value = map[string]int32{
|
||||
"NULL_VALUE": 0,
|
||||
}
|
||||
)
|
||||
|
||||
func (x NullValue) Enum() *NullValue {
|
||||
p := new(NullValue)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x NullValue) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (NullValue) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_google_protobuf_struct_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (NullValue) Type() protoreflect.EnumType {
|
||||
return &file_google_protobuf_struct_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x NullValue) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NullValue.Descriptor instead.
|
||||
func (NullValue) EnumDescriptor() ([]byte, []int) {
|
||||
return file_google_protobuf_struct_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// `Struct` represents a structured data value, consisting of fields
|
||||
// which map to dynamically typed values. In some languages, `Struct`
|
||||
// might be supported by a native representation. For example, in
|
||||
// scripting languages like JS a struct is represented as an
|
||||
// object. The details of that representation are described together
|
||||
// with the proto support for the language.
|
||||
//
|
||||
// The JSON representation for `Struct` is JSON object.
|
||||
type Struct struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Unordered map of dynamically typed values.
|
||||
Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
}
|
||||
|
||||
// NewStruct constructs a Struct from a general-purpose Go map.
|
||||
// The map keys must be valid UTF-8.
|
||||
// The map values are converted using NewValue.
|
||||
func NewStruct(v map[string]interface{}) (*Struct, error) {
|
||||
x := &Struct{Fields: make(map[string]*Value, len(v))}
|
||||
for k, v := range v {
|
||||
if !utf8.ValidString(k) {
|
||||
return nil, protoimpl.X.NewError("invalid UTF-8 in string: %q", k)
|
||||
}
|
||||
var err error
|
||||
x.Fields[k], err = NewValue(v)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
// AsMap converts x to a general-purpose Go map.
|
||||
// The map values are converted by calling Value.AsInterface.
|
||||
func (x *Struct) AsMap() map[string]interface{} {
|
||||
f := x.GetFields()
|
||||
vs := make(map[string]interface{}, len(f))
|
||||
for k, v := range f {
|
||||
vs[k] = v.AsInterface()
|
||||
}
|
||||
return vs
|
||||
}
|
||||
|
||||
func (x *Struct) MarshalJSON() ([]byte, error) {
|
||||
return protojson.Marshal(x)
|
||||
}
|
||||
|
||||
func (x *Struct) UnmarshalJSON(b []byte) error {
|
||||
return protojson.Unmarshal(b, x)
|
||||
}
|
||||
|
||||
func (x *Struct) Reset() {
|
||||
*x = Struct{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_google_protobuf_struct_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Struct) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Struct) ProtoMessage() {}
|
||||
|
||||
func (x *Struct) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_google_protobuf_struct_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Struct.ProtoReflect.Descriptor instead.
|
||||
func (*Struct) Descriptor() ([]byte, []int) {
|
||||
return file_google_protobuf_struct_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Struct) GetFields() map[string]*Value {
|
||||
if x != nil {
|
||||
return x.Fields
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// `Value` represents a dynamically typed value which can be either
|
||||
// null, a number, a string, a boolean, a recursive struct value, or a
|
||||
// list of values. A producer of value is expected to set one of these
|
||||
// variants. Absence of any variant indicates an error.
|
||||
//
|
||||
// The JSON representation for `Value` is JSON value.
|
||||
type Value struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The kind of value.
|
||||
//
|
||||
// Types that are assignable to Kind:
|
||||
//
|
||||
// *Value_NullValue
|
||||
// *Value_NumberValue
|
||||
// *Value_StringValue
|
||||
// *Value_BoolValue
|
||||
// *Value_StructValue
|
||||
// *Value_ListValue
|
||||
Kind isValue_Kind `protobuf_oneof:"kind"`
|
||||
}
|
||||
|
||||
// NewValue constructs a Value from a general-purpose Go interface.
|
||||
//
|
||||
// ╔════════════════════════╤════════════════════════════════════════════╗
|
||||
// ║ Go type │ Conversion ║
|
||||
// ╠════════════════════════╪════════════════════════════════════════════╣
|
||||
// ║ nil │ stored as NullValue ║
|
||||
// ║ bool │ stored as BoolValue ║
|
||||
// ║ int, int32, int64 │ stored as NumberValue ║
|
||||
// ║ uint, uint32, uint64 │ stored as NumberValue ║
|
||||
// ║ float32, float64 │ stored as NumberValue ║
|
||||
// ║ string │ stored as StringValue; must be valid UTF-8 ║
|
||||
// ║ []byte │ stored as StringValue; base64-encoded ║
|
||||
// ║ map[string]interface{} │ stored as StructValue ║
|
||||
// ║ []interface{} │ stored as ListValue ║
|
||||
// ╚════════════════════════╧════════════════════════════════════════════╝
|
||||
//
|
||||
// When converting an int64 or uint64 to a NumberValue, numeric precision loss
|
||||
// is possible since they are stored as a float64.
|
||||
func NewValue(v interface{}) (*Value, error) {
|
||||
switch v := v.(type) {
|
||||
case nil:
|
||||
return NewNullValue(), nil
|
||||
case bool:
|
||||
return NewBoolValue(v), nil
|
||||
case int:
|
||||
return NewNumberValue(float64(v)), nil
|
||||
case int32:
|
||||
return NewNumberValue(float64(v)), nil
|
||||
case int64:
|
||||
return NewNumberValue(float64(v)), nil
|
||||
case uint:
|
||||
return NewNumberValue(float64(v)), nil
|
||||
case uint32:
|
||||
return NewNumberValue(float64(v)), nil
|
||||
case uint64:
|
||||
return NewNumberValue(float64(v)), nil
|
||||
case float32:
|
||||
return NewNumberValue(float64(v)), nil
|
||||
case float64:
|
||||
return NewNumberValue(float64(v)), nil
|
||||
case string:
|
||||
if !utf8.ValidString(v) {
|
||||
return nil, protoimpl.X.NewError("invalid UTF-8 in string: %q", v)
|
||||
}
|
||||
return NewStringValue(v), nil
|
||||
case []byte:
|
||||
s := base64.StdEncoding.EncodeToString(v)
|
||||
return NewStringValue(s), nil
|
||||
case map[string]interface{}:
|
||||
v2, err := NewStruct(v)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return NewStructValue(v2), nil
|
||||
case []interface{}:
|
||||
v2, err := NewList(v)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return NewListValue(v2), nil
|
||||
default:
|
||||
return nil, protoimpl.X.NewError("invalid type: %T", v)
|
||||
}
|
||||
}
|
||||
|
||||
// NewNullValue constructs a new null Value.
|
||||
func NewNullValue() *Value {
|
||||
return &Value{Kind: &Value_NullValue{NullValue: NullValue_NULL_VALUE}}
|
||||
}
|
||||
|
||||
// NewBoolValue constructs a new boolean Value.
|
||||
func NewBoolValue(v bool) *Value {
|
||||
return &Value{Kind: &Value_BoolValue{BoolValue: v}}
|
||||
}
|
||||
|
||||
// NewNumberValue constructs a new number Value.
|
||||
func NewNumberValue(v float64) *Value {
|
||||
return &Value{Kind: &Value_NumberValue{NumberValue: v}}
|
||||
}
|
||||
|
||||
// NewStringValue constructs a new string Value.
|
||||
func NewStringValue(v string) *Value {
|
||||
return &Value{Kind: &Value_StringValue{StringValue: v}}
|
||||
}
|
||||
|
||||
// NewStructValue constructs a new struct Value.
|
||||
func NewStructValue(v *Struct) *Value {
|
||||
return &Value{Kind: &Value_StructValue{StructValue: v}}
|
||||
}
|
||||
|
||||
// NewListValue constructs a new list Value.
|
||||
func NewListValue(v *ListValue) *Value {
|
||||
return &Value{Kind: &Value_ListValue{ListValue: v}}
|
||||
}
|
||||
|
||||
// AsInterface converts x to a general-purpose Go interface.
|
||||
//
|
||||
// Calling Value.MarshalJSON and "encoding/json".Marshal on this output produce
|
||||
// semantically equivalent JSON (assuming no errors occur).
|
||||
//
|
||||
// Floating-point values (i.e., "NaN", "Infinity", and "-Infinity") are
|
||||
// converted as strings to remain compatible with MarshalJSON.
|
||||
func (x *Value) AsInterface() interface{} {
|
||||
switch v := x.GetKind().(type) {
|
||||
case *Value_NumberValue:
|
||||
if v != nil {
|
||||
switch {
|
||||
case math.IsNaN(v.NumberValue):
|
||||
return "NaN"
|
||||
case math.IsInf(v.NumberValue, +1):
|
||||
return "Infinity"
|
||||
case math.IsInf(v.NumberValue, -1):
|
||||
return "-Infinity"
|
||||
default:
|
||||
return v.NumberValue
|
||||
}
|
||||
}
|
||||
case *Value_StringValue:
|
||||
if v != nil {
|
||||
return v.StringValue
|
||||
}
|
||||
case *Value_BoolValue:
|
||||
if v != nil {
|
||||
return v.BoolValue
|
||||
}
|
||||
case *Value_StructValue:
|
||||
if v != nil {
|
||||
return v.StructValue.AsMap()
|
||||
}
|
||||
case *Value_ListValue:
|
||||
if v != nil {
|
||||
return v.ListValue.AsSlice()
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Value) MarshalJSON() ([]byte, error) {
|
||||
return protojson.Marshal(x)
|
||||
}
|
||||
|
||||
func (x *Value) UnmarshalJSON(b []byte) error {
|
||||
return protojson.Unmarshal(b, x)
|
||||
}
|
||||
|
||||
func (x *Value) Reset() {
|
||||
*x = Value{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_google_protobuf_struct_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Value) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Value) ProtoMessage() {}
|
||||
|
||||
func (x *Value) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_google_protobuf_struct_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Value.ProtoReflect.Descriptor instead.
|
||||
func (*Value) Descriptor() ([]byte, []int) {
|
||||
return file_google_protobuf_struct_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (m *Value) GetKind() isValue_Kind {
|
||||
if m != nil {
|
||||
return m.Kind
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Value) GetNullValue() NullValue {
|
||||
if x, ok := x.GetKind().(*Value_NullValue); ok {
|
||||
return x.NullValue
|
||||
}
|
||||
return NullValue_NULL_VALUE
|
||||
}
|
||||
|
||||
func (x *Value) GetNumberValue() float64 {
|
||||
if x, ok := x.GetKind().(*Value_NumberValue); ok {
|
||||
return x.NumberValue
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Value) GetStringValue() string {
|
||||
if x, ok := x.GetKind().(*Value_StringValue); ok {
|
||||
return x.StringValue
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Value) GetBoolValue() bool {
|
||||
if x, ok := x.GetKind().(*Value_BoolValue); ok {
|
||||
return x.BoolValue
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Value) GetStructValue() *Struct {
|
||||
if x, ok := x.GetKind().(*Value_StructValue); ok {
|
||||
return x.StructValue
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Value) GetListValue() *ListValue {
|
||||
if x, ok := x.GetKind().(*Value_ListValue); ok {
|
||||
return x.ListValue
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isValue_Kind interface {
|
||||
isValue_Kind()
|
||||
}
|
||||
|
||||
type Value_NullValue struct {
|
||||
// Represents a null value.
|
||||
NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"`
|
||||
}
|
||||
|
||||
type Value_NumberValue struct {
|
||||
// Represents a double value.
|
||||
NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,proto3,oneof"`
|
||||
}
|
||||
|
||||
type Value_StringValue struct {
|
||||
// Represents a string value.
|
||||
StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,proto3,oneof"`
|
||||
}
|
||||
|
||||
type Value_BoolValue struct {
|
||||
// Represents a boolean value.
|
||||
BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof"`
|
||||
}
|
||||
|
||||
type Value_StructValue struct {
|
||||
// Represents a structured value.
|
||||
StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,proto3,oneof"`
|
||||
}
|
||||
|
||||
type Value_ListValue struct {
|
||||
// Represents a repeated `Value`.
|
||||
ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*Value_NullValue) isValue_Kind() {}
|
||||
|
||||
func (*Value_NumberValue) isValue_Kind() {}
|
||||
|
||||
func (*Value_StringValue) isValue_Kind() {}
|
||||
|
||||
func (*Value_BoolValue) isValue_Kind() {}
|
||||
|
||||
func (*Value_StructValue) isValue_Kind() {}
|
||||
|
||||
func (*Value_ListValue) isValue_Kind() {}
|
||||
|
||||
// `ListValue` is a wrapper around a repeated field of values.
|
||||
//
|
||||
// The JSON representation for `ListValue` is JSON array.
|
||||
type ListValue struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Repeated field of dynamically typed values.
|
||||
Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
|
||||
}
|
||||
|
||||
// NewList constructs a ListValue from a general-purpose Go slice.
|
||||
// The slice elements are converted using NewValue.
|
||||
func NewList(v []interface{}) (*ListValue, error) {
|
||||
x := &ListValue{Values: make([]*Value, len(v))}
|
||||
for i, v := range v {
|
||||
var err error
|
||||
x.Values[i], err = NewValue(v)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
// AsSlice converts x to a general-purpose Go slice.
|
||||
// The slice elements are converted by calling Value.AsInterface.
|
||||
func (x *ListValue) AsSlice() []interface{} {
|
||||
vals := x.GetValues()
|
||||
vs := make([]interface{}, len(vals))
|
||||
for i, v := range vals {
|
||||
vs[i] = v.AsInterface()
|
||||
}
|
||||
return vs
|
||||
}
|
||||
|
||||
func (x *ListValue) MarshalJSON() ([]byte, error) {
|
||||
return protojson.Marshal(x)
|
||||
}
|
||||
|
||||
func (x *ListValue) UnmarshalJSON(b []byte) error {
|
||||
return protojson.Unmarshal(b, x)
|
||||
}
|
||||
|
||||
func (x *ListValue) Reset() {
|
||||
*x = ListValue{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_google_protobuf_struct_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListValue) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListValue) ProtoMessage() {}
|
||||
|
||||
func (x *ListValue) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_google_protobuf_struct_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListValue.ProtoReflect.Descriptor instead.
|
||||
func (*ListValue) Descriptor() ([]byte, []int) {
|
||||
return file_google_protobuf_struct_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ListValue) GetValues() []*Value {
|
||||
if x != nil {
|
||||
return x.Values
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_google_protobuf_struct_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_google_protobuf_struct_proto_rawDesc = []byte{
|
||||
0x0a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
|
||||
0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f,
|
||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22,
|
||||
0x98, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x12, 0x3b, 0x0a, 0x06, 0x66, 0x69,
|
||||
0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f,
|
||||
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72,
|
||||
0x75, 0x63, 0x74, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52,
|
||||
0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x51, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64,
|
||||
0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52,
|
||||
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb2, 0x02, 0x0a, 0x05, 0x56,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x56,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x12, 0x23, 0x0a, 0x0c, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x6e, 0x75, 0x6d, 0x62, 0x65,
|
||||
0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,
|
||||
0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b,
|
||||
0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62,
|
||||
0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48,
|
||||
0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3c, 0x0a, 0x0c,
|
||||
0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x73,
|
||||
0x74, 0x72, 0x75, 0x63, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x6c, 0x69,
|
||||
0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x69,
|
||||
0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x22,
|
||||
0x3b, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2e, 0x0a, 0x06,
|
||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67,
|
||||
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2a, 0x1b, 0x0a, 0x09,
|
||||
0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x55, 0x4c,
|
||||
0x4c, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x00, 0x42, 0x7f, 0x0a, 0x13, 0x63, 0x6f, 0x6d,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x42, 0x0b, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a,
|
||||
0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f,
|
||||
0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65,
|
||||
0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x70, 0x62,
|
||||
0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e, 0x47, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c,
|
||||
0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_google_protobuf_struct_proto_rawDescOnce sync.Once
|
||||
file_google_protobuf_struct_proto_rawDescData = file_google_protobuf_struct_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_google_protobuf_struct_proto_rawDescGZIP() []byte {
|
||||
file_google_protobuf_struct_proto_rawDescOnce.Do(func() {
|
||||
file_google_protobuf_struct_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_protobuf_struct_proto_rawDescData)
|
||||
})
|
||||
return file_google_protobuf_struct_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_google_protobuf_struct_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_google_protobuf_struct_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_google_protobuf_struct_proto_goTypes = []interface{}{
|
||||
(NullValue)(0), // 0: google.protobuf.NullValue
|
||||
(*Struct)(nil), // 1: google.protobuf.Struct
|
||||
(*Value)(nil), // 2: google.protobuf.Value
|
||||
(*ListValue)(nil), // 3: google.protobuf.ListValue
|
||||
nil, // 4: google.protobuf.Struct.FieldsEntry
|
||||
}
|
||||
var file_google_protobuf_struct_proto_depIdxs = []int32{
|
||||
4, // 0: google.protobuf.Struct.fields:type_name -> google.protobuf.Struct.FieldsEntry
|
||||
0, // 1: google.protobuf.Value.null_value:type_name -> google.protobuf.NullValue
|
||||
1, // 2: google.protobuf.Value.struct_value:type_name -> google.protobuf.Struct
|
||||
3, // 3: google.protobuf.Value.list_value:type_name -> google.protobuf.ListValue
|
||||
2, // 4: google.protobuf.ListValue.values:type_name -> google.protobuf.Value
|
||||
2, // 5: google.protobuf.Struct.FieldsEntry.value:type_name -> google.protobuf.Value
|
||||
6, // [6:6] is the sub-list for method output_type
|
||||
6, // [6:6] is the sub-list for method input_type
|
||||
6, // [6:6] is the sub-list for extension type_name
|
||||
6, // [6:6] is the sub-list for extension extendee
|
||||
0, // [0:6] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_google_protobuf_struct_proto_init() }
|
||||
func file_google_protobuf_struct_proto_init() {
|
||||
if File_google_protobuf_struct_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_google_protobuf_struct_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Struct); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_google_protobuf_struct_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Value); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_google_protobuf_struct_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListValue); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_google_protobuf_struct_proto_msgTypes[1].OneofWrappers = []interface{}{
|
||||
(*Value_NullValue)(nil),
|
||||
(*Value_NumberValue)(nil),
|
||||
(*Value_StringValue)(nil),
|
||||
(*Value_BoolValue)(nil),
|
||||
(*Value_StructValue)(nil),
|
||||
(*Value_ListValue)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_google_protobuf_struct_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_google_protobuf_struct_proto_goTypes,
|
||||
DependencyIndexes: file_google_protobuf_struct_proto_depIdxs,
|
||||
EnumInfos: file_google_protobuf_struct_proto_enumTypes,
|
||||
MessageInfos: file_google_protobuf_struct_proto_msgTypes,
|
||||
}.Build()
|
||||
File_google_protobuf_struct_proto = out.File
|
||||
file_google_protobuf_struct_proto_rawDesc = nil
|
||||
file_google_protobuf_struct_proto_goTypes = nil
|
||||
file_google_protobuf_struct_proto_depIdxs = nil
|
||||
}
|
63
vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go
generated
vendored
63
vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go
generated
vendored
@@ -36,8 +36,7 @@
|
||||
// The Timestamp message represents a timestamp,
|
||||
// an instant in time since the Unix epoch (January 1st, 1970).
|
||||
//
|
||||
//
|
||||
// Conversion to a Go Time
|
||||
// # Conversion to a Go Time
|
||||
//
|
||||
// The AsTime method can be used to convert a Timestamp message to a
|
||||
// standard Go time.Time value in UTC:
|
||||
@@ -59,8 +58,7 @@
|
||||
// ... // handle error
|
||||
// }
|
||||
//
|
||||
//
|
||||
// Conversion from a Go Time
|
||||
// # Conversion from a Go Time
|
||||
//
|
||||
// The timestamppb.New function can be used to construct a Timestamp message
|
||||
// from a standard Go time.Time value:
|
||||
@@ -72,7 +70,6 @@
|
||||
//
|
||||
// ts := timestamppb.Now()
|
||||
// ... // make use of ts as a *timestamppb.Timestamp
|
||||
//
|
||||
package timestamppb
|
||||
|
||||
import (
|
||||
@@ -101,52 +98,50 @@ import (
|
||||
//
|
||||
// Example 1: Compute Timestamp from POSIX `time()`.
|
||||
//
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds(time(NULL));
|
||||
// timestamp.set_nanos(0);
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds(time(NULL));
|
||||
// timestamp.set_nanos(0);
|
||||
//
|
||||
// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
||||
//
|
||||
// struct timeval tv;
|
||||
// gettimeofday(&tv, NULL);
|
||||
// struct timeval tv;
|
||||
// gettimeofday(&tv, NULL);
|
||||
//
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds(tv.tv_sec);
|
||||
// timestamp.set_nanos(tv.tv_usec * 1000);
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds(tv.tv_sec);
|
||||
// timestamp.set_nanos(tv.tv_usec * 1000);
|
||||
//
|
||||
// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
||||
//
|
||||
// FILETIME ft;
|
||||
// GetSystemTimeAsFileTime(&ft);
|
||||
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
||||
// FILETIME ft;
|
||||
// GetSystemTimeAsFileTime(&ft);
|
||||
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
||||
//
|
||||
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
||||
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
||||
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
||||
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
||||
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
||||
// Timestamp timestamp;
|
||||
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
||||
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
||||
//
|
||||
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
||||
//
|
||||
// long millis = System.currentTimeMillis();
|
||||
//
|
||||
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
||||
// .setNanos((int) ((millis % 1000) * 1000000)).build();
|
||||
// long millis = System.currentTimeMillis();
|
||||
//
|
||||
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
||||
// .setNanos((int) ((millis % 1000) * 1000000)).build();
|
||||
//
|
||||
// Example 5: Compute Timestamp from Java `Instant.now()`.
|
||||
//
|
||||
// Instant now = Instant.now();
|
||||
//
|
||||
// Timestamp timestamp =
|
||||
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
||||
// .setNanos(now.getNano()).build();
|
||||
// Instant now = Instant.now();
|
||||
//
|
||||
// Timestamp timestamp =
|
||||
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
||||
// .setNanos(now.getNano()).build();
|
||||
//
|
||||
// Example 6: Compute Timestamp from current time in Python.
|
||||
//
|
||||
// timestamp = Timestamp()
|
||||
// timestamp.GetCurrentTime()
|
||||
// timestamp = Timestamp()
|
||||
// timestamp.GetCurrentTime()
|
||||
//
|
||||
// # JSON Mapping
|
||||
//
|
||||
@@ -172,10 +167,8 @@ import (
|
||||
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
||||
// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
||||
// the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
||||
// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
|
||||
// ) to obtain a formatter capable of generating timestamps in this format.
|
||||
//
|
||||
//
|
||||
type Timestamp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
|
2
vendor/google.golang.org/protobuf/types/known/wrapperspb/wrappers.pb.go
generated
vendored
2
vendor/google.golang.org/protobuf/types/known/wrapperspb/wrappers.pb.go
generated
vendored
@@ -27,7 +27,7 @@
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
//
|
||||
// Wrappers for primitive (non-message) types. These types are useful
|
||||
// for embedding primitives in the `google.protobuf.Any` type and for places
|
||||
// where we need to distinguish between the absence of a primitive
|
||||
|
Reference in New Issue
Block a user