From a4da0a98c41daf51e4b41aba1abb0f21899da0b3 Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Thu, 14 Dec 2023 13:01:38 +0200 Subject: [PATCH] Update github.com/jhump/protoreflect v1.15.3 => v1.15.4 --- go.mod | 8 +- go.sum | 17 +- .../bufbuild/protocompile/.protoc_version | 2 +- .../bufbuild/protocompile/ast/enum.go | 10 +- .../bufbuild/protocompile/ast/field.go | 22 +- .../bufbuild/protocompile/ast/file.go | 101 +- .../bufbuild/protocompile/ast/file_info.go | 33 +- .../bufbuild/protocompile/ast/no_source.go | 18 + .../bufbuild/protocompile/ast/options.go | 28 +- .../bufbuild/protocompile/ast/ranges.go | 73 +- .../bufbuild/protocompile/ast/service.go | 6 +- .../bufbuild/protocompile/ast/walk.go | 398 +-- .../bufbuild/protocompile/compiler.go | 37 +- .../protocompile/internal/editions.go | 20 + .../bufbuild/protocompile/internal/options.go | 15 +- .../bufbuild/protocompile/internal/tags.go | 3 + .../bufbuild/protocompile/internal/util.go | 108 + .../protocompile/linker/descriptors.go | 243 +- .../bufbuild/protocompile/linker/linker.go | 14 +- .../protocompile/linker/pathkey_unsafe.go | 4 + .../bufbuild/protocompile/linker/resolve.go | 48 +- .../bufbuild/protocompile/linker/symbols.go | 196 +- .../bufbuild/protocompile/linker/validate.go | 89 +- .../bufbuild/protocompile/options/options.go | 562 ++-- .../protocompile/options/target_types.go | 152 + .../bufbuild/protocompile/parser/ast.go | 112 + .../bufbuild/protocompile/parser/lexer.go | 15 +- .../bufbuild/protocompile/parser/proto.y | 449 +-- .../bufbuild/protocompile/parser/proto.y.go | 1745 ++++++------ .../bufbuild/protocompile/parser/result.go | 216 +- .../bufbuild/protocompile/parser/validate.go | 199 +- .../bufbuild/protocompile/reporter/errors.go | 25 +- .../protocompile/reporter/reporter.go | 20 +- .../sourceinfo/source_code_info.go | 3 + .../protoreflect/desc/protoparse/errors.go | 9 +- .../protoreflect/desc/protoparse/parser.go | 53 +- .../protobuf/encoding/protojson/decode.go | 26 +- .../protobuf/encoding/protojson/doc.go | 2 +- .../protobuf/encoding/protojson/encode.go | 39 +- .../protobuf/encoding/prototext/decode.go | 8 +- .../protobuf/encoding/prototext/encode.go | 4 +- .../protobuf/encoding/protowire/wire.go | 28 +- .../protobuf/internal/descfmt/stringer.go | 183 +- .../protobuf/internal/genid/descriptor_gen.go | 212 +- .../protobuf/internal/impl/codec_gen.go | 113 +- .../protobuf/internal/impl/legacy_message.go | 19 +- .../protobuf/internal/impl/message.go | 17 +- .../protobuf/internal/impl/pointer_reflect.go | 36 + .../protobuf/internal/impl/pointer_unsafe.go | 40 + .../protobuf/internal/version/version.go | 2 +- .../protobuf/proto/decode.go | 2 +- .../google.golang.org/protobuf/proto/doc.go | 58 +- .../protobuf/proto/encode.go | 2 +- .../protobuf/proto/extension.go | 2 +- .../google.golang.org/protobuf/proto/merge.go | 2 +- .../google.golang.org/protobuf/proto/proto.go | 18 +- .../protobuf/reflect/protodesc/desc.go | 20 +- .../protobuf/reflect/protodesc/proto.go | 16 +- .../protobuf/reflect/protoreflect/proto.go | 78 +- .../reflect/protoreflect/source_gen.go | 62 +- .../protobuf/reflect/protoreflect/type.go | 44 +- .../protobuf/reflect/protoreflect/value.go | 24 +- .../reflect/protoreflect/value_equal.go | 8 +- .../reflect/protoreflect/value_union.go | 44 +- .../reflect/protoregistry/registry.go | 24 +- .../types/descriptorpb/descriptor.pb.go | 2467 ++++++++++++----- .../protobuf/types/dynamicpb/dynamic.go | 41 +- .../protobuf/types/dynamicpb/types.go | 25 +- .../protobuf/types/known/anypb/any.pb.go | 3 +- .../protobuf/types/pluginpb/plugin.pb.go | 161 +- vendor/modules.txt | 12 +- 71 files changed, 5874 insertions(+), 3021 deletions(-) create mode 100644 vendor/github.com/bufbuild/protocompile/internal/editions.go create mode 100644 vendor/github.com/bufbuild/protocompile/options/target_types.go diff --git a/go.mod b/go.mod index bb223032017c..7b515ce9295b 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/grafana/xk6-websockets v0.2.1 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/influxdata/influxdb1-client v0.0.0-20190402204710-8ff2fc3824fc - github.com/jhump/protoreflect v1.15.3 + github.com/jhump/protoreflect v1.15.4 github.com/klauspost/compress v1.17.4 github.com/mailru/easyjson v0.7.7 github.com/mattn/go-colorable v0.1.13 @@ -51,7 +51,7 @@ require ( golang.org/x/term v0.15.0 golang.org/x/time v0.5.0 google.golang.org/grpc v1.60.0 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.31.1-0.20231027082548-f4a6c1f6e5c1 gopkg.in/guregu/null.v3 v3.3.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -61,7 +61,7 @@ require ( buf.build/gen/go/prometheus/prometheus/protocolbuffers/go v1.31.0-20230627135113-9a12bc2590d2.1 // indirect github.com/andybalholm/cascadia v1.3.1 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bufbuild/protocompile v0.6.0 // indirect + github.com/bufbuild/protocompile v0.7.1 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chromedp/cdproto v0.0.0-20221023212508-67ada9507fb2 // indirect @@ -89,7 +89,7 @@ require ( github.com/tidwall/pretty v1.2.1 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect - golang.org/x/sync v0.4.0 // indirect + golang.org/x/sync v0.5.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect diff --git a/go.sum b/go.sum index db34d3f03c49..d9be5b349e15 100644 --- a/go.sum +++ b/go.sum @@ -21,8 +21,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao= github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y= -github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= -github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/bufbuild/protocompile v0.7.1 h1:Kd8fb6EshOHXNNRtYAmLAwy/PotlyFoN0iMbuwGNh0M= +github.com/bufbuild/protocompile v0.7.1/go.mod h1:+Etjg4guZoAqzVk2czwEQP12yaxLJ8DxuqCJ9qHdH94= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -85,7 +85,7 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= github.com/google/pprof v0.0.0-20230728192033-2ba5b33183c6 h1:ZgoomqkdjGbQ3+qQXCkvYMCDvGDNg2k5JJDjjdTB6jY= github.com/google/pprof v0.0.0-20230728192033-2ba5b33183c6/go.mod h1:Jh3hGz2jkYak8qXPD19ryItVnUgpgeqzdkY/D0EaeuA= @@ -116,8 +116,8 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20190402204710-8ff2fc3824fc h1:KpMgaYJRieDkHZJWY3LMafvtqS/U8xX6+lUN+OKpl/Y= github.com/influxdata/influxdb1-client v0.0.0-20190402204710-8ff2fc3824fc/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= -github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= +github.com/jhump/protoreflect v1.15.4 h1:mrwJhfQGGljwvR/jPEocli8KA6G9afbQpH8NY2wORcI= +github.com/jhump/protoreflect v1.15.4/go.mod h1:2B+zwrnMY3TTIqEK01OG/d3pyUycQBfDf+bx8fE2DNg= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -262,8 +262,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -331,8 +331,9 @@ google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.1-0.20231027082548-f4a6c1f6e5c1 h1:fk72uXZyuZiTtW5tgd63jyVK6582lF61nRC/kGv6vCA= +google.golang.org/protobuf v1.31.1-0.20231027082548-f4a6c1f6e5c1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/vendor/github.com/bufbuild/protocompile/.protoc_version b/vendor/github.com/bufbuild/protocompile/.protoc_version index 4266d8634808..a41944553777 100644 --- a/vendor/github.com/bufbuild/protocompile/.protoc_version +++ b/vendor/github.com/bufbuild/protocompile/.protoc_version @@ -1 +1 @@ -23.0 \ No newline at end of file +25.0-rc2 diff --git a/vendor/github.com/bufbuild/protocompile/ast/enum.go b/vendor/github.com/bufbuild/protocompile/ast/enum.go index 84a1b83961da..7f79161c432b 100644 --- a/vendor/github.com/bufbuild/protocompile/ast/enum.go +++ b/vendor/github.com/bufbuild/protocompile/ast/enum.go @@ -131,10 +131,10 @@ func NewEnumValueNode(name *IdentNode, equals *RuneNode, number IntValueNode, op if number == nil { panic("number is nil") } - if semicolon == nil { - panic("semicolon is nil") + numChildren := 3 + if semicolon != nil { + numChildren++ } - numChildren := 4 if opts != nil { numChildren++ } @@ -143,7 +143,9 @@ func NewEnumValueNode(name *IdentNode, equals *RuneNode, number IntValueNode, op if opts != nil { children = append(children, opts) } - children = append(children, semicolon) + if semicolon != nil { + children = append(children, semicolon) + } return &EnumValueNode{ compositeNode: compositeNode{ children: children, diff --git a/vendor/github.com/bufbuild/protocompile/ast/field.go b/vendor/github.com/bufbuild/protocompile/ast/field.go index 8c010bfc36f9..9a8063ffc31a 100644 --- a/vendor/github.com/bufbuild/protocompile/ast/field.go +++ b/vendor/github.com/bufbuild/protocompile/ast/field.go @@ -90,10 +90,10 @@ func NewFieldNode(label *KeywordNode, fieldType IdentValueNode, name *IdentNode, if tag == nil { panic("tag is nil") } - if semicolon == nil { - panic("semicolon is nil") + numChildren := 4 + if semicolon != nil { + numChildren++ } - numChildren := 5 if label != nil { numChildren++ } @@ -108,7 +108,9 @@ func NewFieldNode(label *KeywordNode, fieldType IdentValueNode, name *IdentNode, if opts != nil { children = append(children, opts) } - children = append(children, semicolon) + if semicolon != nil { + children = append(children, semicolon) + } return &FieldNode{ compositeNode: compositeNode{ @@ -541,19 +543,21 @@ func NewMapFieldNode(mapType *MapTypeNode, name *IdentNode, equals *RuneNode, ta if tag == nil { panic("tag is nil") } - if semicolon == nil { - panic("semicolon is nil") - } - numChildren := 5 + numChildren := 4 if opts != nil { numChildren++ } + if semicolon != nil { + numChildren++ + } children := make([]Node, 0, numChildren) children = append(children, mapType, name, equals, tag) if opts != nil { children = append(children, opts) } - children = append(children, semicolon) + if semicolon != nil { + children = append(children, semicolon) + } return &MapFieldNode{ compositeNode: compositeNode{ diff --git a/vendor/github.com/bufbuild/protocompile/ast/file.go b/vendor/github.com/bufbuild/protocompile/ast/file.go index 1e9bb9af0339..9c00a643e7a5 100644 --- a/vendor/github.com/bufbuild/protocompile/ast/file.go +++ b/vendor/github.com/bufbuild/protocompile/ast/file.go @@ -21,7 +21,6 @@ import "fmt" type FileDeclNode interface { Node Name() string - GetSyntax() Node NodeInfo(n Node) NodeInfo } @@ -34,8 +33,13 @@ type FileNode struct { compositeNode fileInfo *FileInfo - Syntax *SyntaxNode // nil if file has no syntax declaration - Decls []FileElement + // A file has either a Syntax or Edition node, never both. + // If both are nil, neither declaration is present and the + // file is assumed to use "proto2" syntax. + Syntax *SyntaxNode + Edition *EditionNode + + Decls []FileElement // This synthetic node allows access to final comments and whitespace EOF *RuneNode @@ -47,13 +51,31 @@ type FileNode struct { // This function panics if the concrete type of any element of decls is not // from this package. func NewFileNode(info *FileInfo, syntax *SyntaxNode, decls []FileElement, eof Token) *FileNode { + return newFileNode(info, syntax, nil, decls, eof) +} + +// NewFileNodeWithEdition creates a new *FileNode. The edition parameter is required. If a file +// has no edition declaration, use NewFileNode instead. +// +// This function panics if the concrete type of any element of decls is not +// from this package. +func NewFileNodeWithEdition(info *FileInfo, edition *EditionNode, decls []FileElement, eof Token) *FileNode { + if edition == nil { + panic("edition is nil") + } + return newFileNode(info, nil, edition, decls, eof) +} + +func newFileNode(info *FileInfo, syntax *SyntaxNode, edition *EditionNode, decls []FileElement, eof Token) *FileNode { numChildren := len(decls) + 1 - if syntax != nil { + if syntax != nil || edition != nil { numChildren++ } children := make([]Node, 0, numChildren) if syntax != nil { children = append(children, syntax) + } else if edition != nil { + children = append(children, edition) } for _, decl := range decls { switch decl := decl.(type) { @@ -74,6 +96,7 @@ func NewFileNode(info *FileInfo, syntax *SyntaxNode, decls []FileElement, eof To }, fileInfo: info, Syntax: syntax, + Edition: edition, Decls: decls, EOF: eofNode, } @@ -85,10 +108,6 @@ func NewEmptyFileNode(filename string) *FileNode { return NewFileNode(fileInfo, nil, nil, fileInfo.AddToken(0, 0)) } -func (f *FileNode) GetSyntax() Node { - return f.Syntax -} - func (f *FileNode) Name() string { return f.fileInfo.Name() } @@ -162,10 +181,12 @@ func NewSyntaxNode(keyword *KeywordNode, equals *RuneNode, syntax StringValueNod if syntax == nil { panic("syntax is nil") } + var children []Node if semicolon == nil { - panic("semicolon is nil") + children = []Node{keyword, equals, syntax} + } else { + children = []Node{keyword, equals, syntax, semicolon} } - children := []Node{keyword, equals, syntax, semicolon} return &SyntaxNode{ compositeNode: compositeNode{ children: children, @@ -177,6 +198,51 @@ func NewSyntaxNode(keyword *KeywordNode, equals *RuneNode, syntax StringValueNod } } +// EditionNode represents an edition declaration, which if present must be +// the first non-comment content. Example: +// +// edition = "2023"; +// +// Files may include either an edition node or a syntax node, but not both. +// If neither are present, the file is assumed to use proto2 syntax. +type EditionNode struct { + compositeNode + Keyword *KeywordNode + Equals *RuneNode + Edition StringValueNode + Semicolon *RuneNode +} + +// NewEditionNode creates a new *EditionNode. All four arguments must be non-nil: +// - keyword: The token corresponding to the "edition" keyword. +// - equals: The token corresponding to the "=" rune. +// - edition: The actual edition value, e.g. "2023". +// - semicolon: The token corresponding to the ";" rune that ends the declaration. +func NewEditionNode(keyword *KeywordNode, equals *RuneNode, edition StringValueNode, semicolon *RuneNode) *EditionNode { + if keyword == nil { + panic("keyword is nil") + } + if equals == nil { + panic("equals is nil") + } + if edition == nil { + panic("edition is nil") + } + if semicolon == nil { + panic("semicolon is nil") + } + children := []Node{keyword, equals, edition, semicolon} + return &EditionNode{ + compositeNode: compositeNode{ + children: children, + }, + Keyword: keyword, + Equals: equals, + Edition: edition, + Semicolon: semicolon, + } +} + // ImportNode represents an import statement. Example: // // import "google/protobuf/empty.proto"; @@ -209,10 +275,10 @@ func NewImportNode(keyword *KeywordNode, public *KeywordNode, weak *KeywordNode, if name == nil { panic("name is nil") } + numChildren := 2 if semicolon == nil { - panic("semicolon is nil") + numChildren++ } - numChildren := 3 if public != nil || weak != nil { numChildren++ } @@ -223,7 +289,10 @@ func NewImportNode(keyword *KeywordNode, public *KeywordNode, weak *KeywordNode, } else if weak != nil { children = append(children, weak) } - children = append(children, name, semicolon) + children = append(children, name) + if semicolon != nil { + children = append(children, semicolon) + } return &ImportNode{ compositeNode: compositeNode{ @@ -262,10 +331,12 @@ func NewPackageNode(keyword *KeywordNode, name IdentValueNode, semicolon *RuneNo if name == nil { panic("name is nil") } + var children []Node if semicolon == nil { - panic("semicolon is nil") + children = []Node{keyword, name} + } else { + children = []Node{keyword, name, semicolon} } - children := []Node{keyword, name, semicolon} return &PackageNode{ compositeNode: compositeNode{ children: children, diff --git a/vendor/github.com/bufbuild/protocompile/ast/file_info.go b/vendor/github.com/bufbuild/protocompile/ast/file_info.go index e71535ef0a9e..1a6b6b5a1905 100644 --- a/vendor/github.com/bufbuild/protocompile/ast/file_info.go +++ b/vendor/github.com/bufbuild/protocompile/ast/file_info.go @@ -163,10 +163,10 @@ func (f *FileInfo) TokenInfo(t Token) NodeInfo { func (f *FileInfo) nodeInfo(start, end int) NodeInfo { if start < 0 || start >= len(f.items) { - return NodeInfo{} + return NodeInfo{fileInfo: f} } if end < 0 || end >= len(f.items) { - return NodeInfo{} + return NodeInfo{fileInfo: f} } return NodeInfo{fileInfo: f, startIndex: start, endIndex: end} } @@ -399,8 +399,7 @@ type Item int // ItemInfo provides details about an item's location in the source file and // its contents. type ItemInfo interface { - Start() SourcePos - End() SourcePos + SourceSpan LeadingWhitespace() string RawText() string } @@ -598,6 +597,32 @@ func (pos SourcePos) String() string { return fmt.Sprintf("%s:%d:%d", pos.Filename, pos.Line, pos.Col) } +// SourceSpan represents a range of source positions. +type SourceSpan interface { + Start() SourcePos + End() SourcePos +} + +// NewSourceSpan creates a new span that covers the given range. +func NewSourceSpan(start SourcePos, end SourcePos) SourceSpan { + return sourceSpan{StartPos: start, EndPos: end} +} + +type sourceSpan struct { + StartPos SourcePos + EndPos SourcePos +} + +func (p sourceSpan) Start() SourcePos { + return p.StartPos +} + +func (p sourceSpan) End() SourcePos { + return p.EndPos +} + +var _ SourceSpan = sourceSpan{} + // Comments represents a range of sequential comments in a source file // (e.g. no interleaving items or AST nodes). type Comments struct { diff --git a/vendor/github.com/bufbuild/protocompile/ast/no_source.go b/vendor/github.com/bufbuild/protocompile/ast/no_source.go index 6448d8765132..dfe3c726f07f 100644 --- a/vendor/github.com/bufbuild/protocompile/ast/no_source.go +++ b/vendor/github.com/bufbuild/protocompile/ast/no_source.go @@ -20,6 +20,24 @@ func UnknownPos(filename string) SourcePos { return SourcePos{Filename: filename} } +// UnknownSpan is a placeholder span when only the source file +// name is known. +func UnknownSpan(filename string) SourceSpan { + return unknownSpan{filename: filename} +} + +type unknownSpan struct { + filename string +} + +func (s unknownSpan) Start() SourcePos { + return UnknownPos(s.filename) +} + +func (s unknownSpan) End() SourcePos { + return UnknownPos(s.filename) +} + // NoSourceNode is a placeholder AST node that implements numerous // interfaces in this package. It can be used to represent an AST // element for a file whose source is not available. diff --git a/vendor/github.com/bufbuild/protocompile/ast/options.go b/vendor/github.com/bufbuild/protocompile/ast/options.go index 5127e951dfb7..3377521952c6 100644 --- a/vendor/github.com/bufbuild/protocompile/ast/options.go +++ b/vendor/github.com/bufbuild/protocompile/ast/options.go @@ -71,10 +71,13 @@ func NewOptionNode(keyword *KeywordNode, name *OptionNameNode, equals *RuneNode, if val == nil { panic("val is nil") } + var children []Node if semicolon == nil { - panic("semicolon is nil") + children = []Node{keyword, name, equals, val} + } else { + children = []Node{keyword, name, equals, val, semicolon} } - children := []Node{keyword, name, equals, val, semicolon} + return &OptionNode{ compositeNode: compositeNode{ children: children, @@ -97,13 +100,18 @@ func NewCompactOptionNode(name *OptionNameNode, equals *RuneNode, val ValueNode) if name == nil { panic("name is nil") } - if equals == nil { - panic("equals is nil") + if equals == nil && val != nil { + panic("equals is nil but val is not") } - if val == nil { - panic("val is nil") + if val == nil && equals != nil { + panic("val is nil but equals is not") + } + var children []Node + if equals == nil && val == nil { + children = []Node{name} + } else { + children = []Node{name, equals, val} } - children := []Node{name, equals, val} return &OptionNode{ compositeNode: compositeNode{ children: children, @@ -332,10 +340,10 @@ func NewCompactOptionsNode(openBracket *RuneNode, opts []*OptionNode, commas []* if closeBracket == nil { panic("closeBracket is nil") } - if len(opts) == 0 { - panic("must have at least one part") + if len(opts) == 0 && len(commas) != 0 { + panic("opts is empty but commas is not") } - if len(commas) != len(opts)-1 { + if len(opts) > 0 && len(commas) != len(opts)-1 { panic(fmt.Sprintf("%d opts requires %d commas, not %d", len(opts), len(opts)-1, len(commas))) } children := make([]Node, 0, len(opts)*2+1) diff --git a/vendor/github.com/bufbuild/protocompile/ast/ranges.go b/vendor/github.com/bufbuild/protocompile/ast/ranges.go index cf9490899e23..fe05d0816ea6 100644 --- a/vendor/github.com/bufbuild/protocompile/ast/ranges.go +++ b/vendor/github.com/bufbuild/protocompile/ast/ranges.go @@ -207,13 +207,20 @@ func (n *RangeNode) EndValueAsInt32(min, max int32) (int32, bool) { // // reserved 1, 10-12, 15; // reserved "foo", "bar", "baz"; +// reserved foo, bar, baz; type ReservedNode struct { compositeNode Keyword *KeywordNode - // If non-empty, this node represents reserved ranges and Names will be empty. + // If non-empty, this node represents reserved ranges, and Names and Identifiers + // will be empty. Ranges []*RangeNode - // If non-empty, this node represents reserved names and Ranges will be empty. + // If non-empty, this node represents reserved names as string literals, and + // Ranges and Identifiers will be empty. String literals are used for reserved + // names in proto2 and proto3 syntax. Names []StringValueNode + // If non-empty, this node represents reserved names as identifiers, and Ranges + // and Names will be empty. Identifiers are used for reserved names in editions. + Identifiers []*IdentNode // Commas represent the separating ',' characters between options. The // length of this slice must be exactly len(Ranges)-1 or len(Names)-1, depending // on whether this node represents reserved ranges or reserved names. Each item @@ -283,16 +290,17 @@ func NewReservedNamesNode(keyword *KeywordNode, names []StringValueNode, commas if keyword == nil { panic("keyword is nil") } - if semicolon == nil { - panic("semicolon is nil") - } if len(names) == 0 { panic("must have at least one name") } if len(commas) != len(names)-1 { panic(fmt.Sprintf("%d names requires %d commas, not %d", len(names), len(names)-1, len(commas))) } - children := make([]Node, 0, len(names)*2+1) + numChildren := len(names) * 2 + if semicolon != nil { + numChildren++ + } + children := make([]Node, 0, numChildren) children = append(children, keyword) for i, name := range names { if i > 0 { @@ -306,7 +314,9 @@ func NewReservedNamesNode(keyword *KeywordNode, names []StringValueNode, commas } children = append(children, name) } - children = append(children, semicolon) + if semicolon != nil { + children = append(children, semicolon) + } return &ReservedNode{ compositeNode: compositeNode{ children: children, @@ -317,3 +327,52 @@ func NewReservedNamesNode(keyword *KeywordNode, names []StringValueNode, commas Semicolon: semicolon, } } + +// NewReservedIdentifiersNode creates a new *ReservedNode that represents reserved +// names. All args must be non-nil. +// - keyword: The token corresponding to the "reserved" keyword. +// - names: One or more names. +// - commas: Tokens that represent the "," runes that delimit the names. +// The length of commas must be one less than the length of names. +// - semicolon The token corresponding to the ";" rune that ends the declaration. +func NewReservedIdentifiersNode(keyword *KeywordNode, names []*IdentNode, commas []*RuneNode, semicolon *RuneNode) *ReservedNode { + if keyword == nil { + panic("keyword is nil") + } + if len(names) == 0 { + panic("must have at least one name") + } + if len(commas) != len(names)-1 { + panic(fmt.Sprintf("%d names requires %d commas, not %d", len(names), len(names)-1, len(commas))) + } + numChildren := len(names) * 2 + if semicolon != nil { + numChildren++ + } + children := make([]Node, 0, numChildren) + children = append(children, keyword) + for i, name := range names { + if i > 0 { + if commas[i-1] == nil { + panic(fmt.Sprintf("commas[%d] is nil", i-1)) + } + children = append(children, commas[i-1]) + } + if name == nil { + panic(fmt.Sprintf("names[%d] is nil", i)) + } + children = append(children, name) + } + if semicolon != nil { + children = append(children, semicolon) + } + return &ReservedNode{ + compositeNode: compositeNode{ + children: children, + }, + Keyword: keyword, + Identifiers: names, + Commas: commas, + Semicolon: semicolon, + } +} diff --git a/vendor/github.com/bufbuild/protocompile/ast/service.go b/vendor/github.com/bufbuild/protocompile/ast/service.go index 99987b248571..ca3e1ebbec3c 100644 --- a/vendor/github.com/bufbuild/protocompile/ast/service.go +++ b/vendor/github.com/bufbuild/protocompile/ast/service.go @@ -141,10 +141,12 @@ func NewRPCNode(keyword *KeywordNode, name *IdentNode, input *RPCTypeNode, retur if output == nil { panic("output is nil") } + var children []Node if semicolon == nil { - panic("semicolon is nil") + children = []Node{keyword, name, input, returns, output} + } else { + children = []Node{keyword, name, input, returns, output, semicolon} } - children := []Node{keyword, name, input, returns, output, semicolon} return &RPCNode{ compositeNode: compositeNode{ children: children, diff --git a/vendor/github.com/bufbuild/protocompile/ast/walk.go b/vendor/github.com/bufbuild/protocompile/ast/walk.go index 06e5f6d9ce6c..18c7fe491c07 100644 --- a/vendor/github.com/bufbuild/protocompile/ast/walk.go +++ b/vendor/github.com/bufbuild/protocompile/ast/walk.go @@ -103,6 +103,8 @@ func Visit(n Node, v Visitor) error { return v.VisitFileNode(n) case *SyntaxNode: return v.VisitSyntaxNode(n) + case *EditionNode: + return v.VisitEditionNode(n) case *PackageNode: return v.VisitPackageNode(n) case *ImportNode: @@ -242,9 +244,16 @@ func VisitChildren(n CompositeNode, v Visitor) error { // It consists of a number of functions, each of which matches a // concrete Node type. // -// Most visitor implementations will either embed NoOpVisitor (so as -// not to have to implement *all* of the methods) or will be instances -// of SimpleVisitor. +// NOTE: As the language evolves, new methods may be added to this +// interface to correspond to new grammar elements. That is why it +// cannot be directly implemented outside this package. Visitor +// implementations must embed NoOpVisitor and then implement the +// subset of methods of interest. If such an implementation is used +// with an AST that has newer elements, the visitor will not do +// anything in response to the new node types. +// +// An alternative to embedding NoOpVisitor is to use an instance of +// SimpleVisitor. // // Visitors can be supplied to a Walk operation or passed to a call // to Visit or VisitChildren. @@ -253,6 +262,8 @@ type Visitor interface { VisitFileNode(*FileNode) error // VisitSyntaxNode is invoked when visiting a *SyntaxNode in the AST. VisitSyntaxNode(*SyntaxNode) error + // VisitEditionNode is invoked when visiting an *EditionNode in the AST. + VisitEditionNode(*EditionNode) error // VisitPackageNode is invoked when visiting a *PackageNode in the AST. VisitPackageNode(*PackageNode) error // VisitImportNode is invoked when visiting an *ImportNode in the AST. @@ -327,6 +338,9 @@ type Visitor interface { VisitRuneNode(*RuneNode) error // VisitEmptyDeclNode is invoked when visiting a *EmptyDeclNode in the AST. VisitEmptyDeclNode(*EmptyDeclNode) error + + // Unexported method prevents callers from directly implementing. + isVisitor() } // NoOpVisitor is a visitor implementation that does nothing. All methods @@ -337,6 +351,8 @@ type NoOpVisitor struct{} var _ Visitor = NoOpVisitor{} +func (n NoOpVisitor) isVisitor() {} + func (n NoOpVisitor) VisitFileNode(_ *FileNode) error { return nil } @@ -345,6 +361,10 @@ func (n NoOpVisitor) VisitSyntaxNode(_ *SyntaxNode) error { return nil } +func (n NoOpVisitor) VisitEditionNode(_ *EditionNode) error { + return nil +} + func (n NoOpVisitor) VisitPackageNode(_ *PackageNode) error { return nil } @@ -522,6 +542,7 @@ func (n NoOpVisitor) VisitEmptyDeclNode(_ *EmptyDeclNode) error { type SimpleVisitor struct { DoVisitFileNode func(*FileNode) error DoVisitSyntaxNode func(*SyntaxNode) error + DoVisitEditionNode func(*EditionNode) error DoVisitPackageNode func(*PackageNode) error DoVisitImportNode func(*ImportNode) error DoVisitOptionNode func(*OptionNode) error @@ -576,335 +597,344 @@ type SimpleVisitor struct { var _ Visitor = (*SimpleVisitor)(nil) -func (b *SimpleVisitor) visitInterface(node Node) error { +func (v *SimpleVisitor) isVisitor() {} + +func (v *SimpleVisitor) visitInterface(node Node) error { switch n := node.(type) { case FieldDeclNode: - if b.DoVisitFieldDeclNode != nil { - return b.DoVisitFieldDeclNode(n) + if v.DoVisitFieldDeclNode != nil { + return v.DoVisitFieldDeclNode(n) } // *MapFieldNode and *GroupNode both implement both FieldDeclNode and // MessageDeclNode, so handle other case here - if fn, ok := n.(MessageDeclNode); ok && b.DoVisitMessageDeclNode != nil { - return b.DoVisitMessageDeclNode(fn) + if fn, ok := n.(MessageDeclNode); ok && v.DoVisitMessageDeclNode != nil { + return v.DoVisitMessageDeclNode(fn) } case MessageDeclNode: - if b.DoVisitMessageDeclNode != nil { - return b.DoVisitMessageDeclNode(n) + if v.DoVisitMessageDeclNode != nil { + return v.DoVisitMessageDeclNode(n) } case IdentValueNode: - if b.DoVisitIdentValueNode != nil { - return b.DoVisitIdentValueNode(n) + if v.DoVisitIdentValueNode != nil { + return v.DoVisitIdentValueNode(n) } case StringValueNode: - if b.DoVisitStringValueNode != nil { - return b.DoVisitStringValueNode(n) + if v.DoVisitStringValueNode != nil { + return v.DoVisitStringValueNode(n) } case IntValueNode: - if b.DoVisitIntValueNode != nil { - return b.DoVisitIntValueNode(n) + if v.DoVisitIntValueNode != nil { + return v.DoVisitIntValueNode(n) } // *UintLiteralNode implements both IntValueNode and FloatValueNode, // so handle other case here - if fn, ok := n.(FloatValueNode); ok && b.DoVisitFloatValueNode != nil { - return b.DoVisitFloatValueNode(fn) + if fn, ok := n.(FloatValueNode); ok && v.DoVisitFloatValueNode != nil { + return v.DoVisitFloatValueNode(fn) } case FloatValueNode: - if b.DoVisitFloatValueNode != nil { - return b.DoVisitFloatValueNode(n) + if v.DoVisitFloatValueNode != nil { + return v.DoVisitFloatValueNode(n) } } - if n, ok := node.(ValueNode); ok && b.DoVisitValueNode != nil { - return b.DoVisitValueNode(n) + if n, ok := node.(ValueNode); ok && v.DoVisitValueNode != nil { + return v.DoVisitValueNode(n) } switch n := node.(type) { case TerminalNode: - if b.DoVisitTerminalNode != nil { - return b.DoVisitTerminalNode(n) + if v.DoVisitTerminalNode != nil { + return v.DoVisitTerminalNode(n) } case CompositeNode: - if b.DoVisitCompositeNode != nil { - return b.DoVisitCompositeNode(n) + if v.DoVisitCompositeNode != nil { + return v.DoVisitCompositeNode(n) } } - if b.DoVisitNode != nil { - return b.DoVisitNode(node) + if v.DoVisitNode != nil { + return v.DoVisitNode(node) } return nil } -func (b *SimpleVisitor) VisitFileNode(node *FileNode) error { - if b.DoVisitFileNode != nil { - return b.DoVisitFileNode(node) +func (v *SimpleVisitor) VisitFileNode(node *FileNode) error { + if v.DoVisitFileNode != nil { + return v.DoVisitFileNode(node) + } + return v.visitInterface(node) +} + +func (v *SimpleVisitor) VisitSyntaxNode(node *SyntaxNode) error { + if v.DoVisitSyntaxNode != nil { + return v.DoVisitSyntaxNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitSyntaxNode(node *SyntaxNode) error { - if b.DoVisitSyntaxNode != nil { - return b.DoVisitSyntaxNode(node) +func (v *SimpleVisitor) VisitEditionNode(node *EditionNode) error { + if v.DoVisitEditionNode != nil { + return v.DoVisitEditionNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitPackageNode(node *PackageNode) error { - if b.DoVisitPackageNode != nil { - return b.DoVisitPackageNode(node) +func (v *SimpleVisitor) VisitPackageNode(node *PackageNode) error { + if v.DoVisitPackageNode != nil { + return v.DoVisitPackageNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitImportNode(node *ImportNode) error { - if b.DoVisitImportNode != nil { - return b.DoVisitImportNode(node) +func (v *SimpleVisitor) VisitImportNode(node *ImportNode) error { + if v.DoVisitImportNode != nil { + return v.DoVisitImportNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitOptionNode(node *OptionNode) error { - if b.DoVisitOptionNode != nil { - return b.DoVisitOptionNode(node) +func (v *SimpleVisitor) VisitOptionNode(node *OptionNode) error { + if v.DoVisitOptionNode != nil { + return v.DoVisitOptionNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitOptionNameNode(node *OptionNameNode) error { - if b.DoVisitOptionNameNode != nil { - return b.DoVisitOptionNameNode(node) +func (v *SimpleVisitor) VisitOptionNameNode(node *OptionNameNode) error { + if v.DoVisitOptionNameNode != nil { + return v.DoVisitOptionNameNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitFieldReferenceNode(node *FieldReferenceNode) error { - if b.DoVisitFieldReferenceNode != nil { - return b.DoVisitFieldReferenceNode(node) +func (v *SimpleVisitor) VisitFieldReferenceNode(node *FieldReferenceNode) error { + if v.DoVisitFieldReferenceNode != nil { + return v.DoVisitFieldReferenceNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitCompactOptionsNode(node *CompactOptionsNode) error { - if b.DoVisitCompactOptionsNode != nil { - return b.DoVisitCompactOptionsNode(node) +func (v *SimpleVisitor) VisitCompactOptionsNode(node *CompactOptionsNode) error { + if v.DoVisitCompactOptionsNode != nil { + return v.DoVisitCompactOptionsNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitMessageNode(node *MessageNode) error { - if b.DoVisitMessageNode != nil { - return b.DoVisitMessageNode(node) +func (v *SimpleVisitor) VisitMessageNode(node *MessageNode) error { + if v.DoVisitMessageNode != nil { + return v.DoVisitMessageNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitExtendNode(node *ExtendNode) error { - if b.DoVisitExtendNode != nil { - return b.DoVisitExtendNode(node) +func (v *SimpleVisitor) VisitExtendNode(node *ExtendNode) error { + if v.DoVisitExtendNode != nil { + return v.DoVisitExtendNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitExtensionRangeNode(node *ExtensionRangeNode) error { - if b.DoVisitExtensionRangeNode != nil { - return b.DoVisitExtensionRangeNode(node) +func (v *SimpleVisitor) VisitExtensionRangeNode(node *ExtensionRangeNode) error { + if v.DoVisitExtensionRangeNode != nil { + return v.DoVisitExtensionRangeNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitReservedNode(node *ReservedNode) error { - if b.DoVisitReservedNode != nil { - return b.DoVisitReservedNode(node) +func (v *SimpleVisitor) VisitReservedNode(node *ReservedNode) error { + if v.DoVisitReservedNode != nil { + return v.DoVisitReservedNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitRangeNode(node *RangeNode) error { - if b.DoVisitRangeNode != nil { - return b.DoVisitRangeNode(node) +func (v *SimpleVisitor) VisitRangeNode(node *RangeNode) error { + if v.DoVisitRangeNode != nil { + return v.DoVisitRangeNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitFieldNode(node *FieldNode) error { - if b.DoVisitFieldNode != nil { - return b.DoVisitFieldNode(node) +func (v *SimpleVisitor) VisitFieldNode(node *FieldNode) error { + if v.DoVisitFieldNode != nil { + return v.DoVisitFieldNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitGroupNode(node *GroupNode) error { - if b.DoVisitGroupNode != nil { - return b.DoVisitGroupNode(node) +func (v *SimpleVisitor) VisitGroupNode(node *GroupNode) error { + if v.DoVisitGroupNode != nil { + return v.DoVisitGroupNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitMapFieldNode(node *MapFieldNode) error { - if b.DoVisitMapFieldNode != nil { - return b.DoVisitMapFieldNode(node) +func (v *SimpleVisitor) VisitMapFieldNode(node *MapFieldNode) error { + if v.DoVisitMapFieldNode != nil { + return v.DoVisitMapFieldNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitMapTypeNode(node *MapTypeNode) error { - if b.DoVisitMapTypeNode != nil { - return b.DoVisitMapTypeNode(node) +func (v *SimpleVisitor) VisitMapTypeNode(node *MapTypeNode) error { + if v.DoVisitMapTypeNode != nil { + return v.DoVisitMapTypeNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitOneofNode(node *OneofNode) error { - if b.DoVisitOneofNode != nil { - return b.DoVisitOneofNode(node) +func (v *SimpleVisitor) VisitOneofNode(node *OneofNode) error { + if v.DoVisitOneofNode != nil { + return v.DoVisitOneofNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitEnumNode(node *EnumNode) error { - if b.DoVisitEnumNode != nil { - return b.DoVisitEnumNode(node) +func (v *SimpleVisitor) VisitEnumNode(node *EnumNode) error { + if v.DoVisitEnumNode != nil { + return v.DoVisitEnumNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitEnumValueNode(node *EnumValueNode) error { - if b.DoVisitEnumValueNode != nil { - return b.DoVisitEnumValueNode(node) +func (v *SimpleVisitor) VisitEnumValueNode(node *EnumValueNode) error { + if v.DoVisitEnumValueNode != nil { + return v.DoVisitEnumValueNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitServiceNode(node *ServiceNode) error { - if b.DoVisitServiceNode != nil { - return b.DoVisitServiceNode(node) +func (v *SimpleVisitor) VisitServiceNode(node *ServiceNode) error { + if v.DoVisitServiceNode != nil { + return v.DoVisitServiceNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitRPCNode(node *RPCNode) error { - if b.DoVisitRPCNode != nil { - return b.DoVisitRPCNode(node) +func (v *SimpleVisitor) VisitRPCNode(node *RPCNode) error { + if v.DoVisitRPCNode != nil { + return v.DoVisitRPCNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitRPCTypeNode(node *RPCTypeNode) error { - if b.DoVisitRPCTypeNode != nil { - return b.DoVisitRPCTypeNode(node) +func (v *SimpleVisitor) VisitRPCTypeNode(node *RPCTypeNode) error { + if v.DoVisitRPCTypeNode != nil { + return v.DoVisitRPCTypeNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitIdentNode(node *IdentNode) error { - if b.DoVisitIdentNode != nil { - return b.DoVisitIdentNode(node) +func (v *SimpleVisitor) VisitIdentNode(node *IdentNode) error { + if v.DoVisitIdentNode != nil { + return v.DoVisitIdentNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitCompoundIdentNode(node *CompoundIdentNode) error { - if b.DoVisitCompoundIdentNode != nil { - return b.DoVisitCompoundIdentNode(node) +func (v *SimpleVisitor) VisitCompoundIdentNode(node *CompoundIdentNode) error { + if v.DoVisitCompoundIdentNode != nil { + return v.DoVisitCompoundIdentNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitStringLiteralNode(node *StringLiteralNode) error { - if b.DoVisitStringLiteralNode != nil { - return b.DoVisitStringLiteralNode(node) +func (v *SimpleVisitor) VisitStringLiteralNode(node *StringLiteralNode) error { + if v.DoVisitStringLiteralNode != nil { + return v.DoVisitStringLiteralNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitCompoundStringLiteralNode(node *CompoundStringLiteralNode) error { - if b.DoVisitCompoundStringLiteralNode != nil { - return b.DoVisitCompoundStringLiteralNode(node) +func (v *SimpleVisitor) VisitCompoundStringLiteralNode(node *CompoundStringLiteralNode) error { + if v.DoVisitCompoundStringLiteralNode != nil { + return v.DoVisitCompoundStringLiteralNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitUintLiteralNode(node *UintLiteralNode) error { - if b.DoVisitUintLiteralNode != nil { - return b.DoVisitUintLiteralNode(node) +func (v *SimpleVisitor) VisitUintLiteralNode(node *UintLiteralNode) error { + if v.DoVisitUintLiteralNode != nil { + return v.DoVisitUintLiteralNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitPositiveUintLiteralNode(node *PositiveUintLiteralNode) error { - if b.DoVisitPositiveUintLiteralNode != nil { - return b.DoVisitPositiveUintLiteralNode(node) +func (v *SimpleVisitor) VisitPositiveUintLiteralNode(node *PositiveUintLiteralNode) error { + if v.DoVisitPositiveUintLiteralNode != nil { + return v.DoVisitPositiveUintLiteralNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitNegativeIntLiteralNode(node *NegativeIntLiteralNode) error { - if b.DoVisitNegativeIntLiteralNode != nil { - return b.DoVisitNegativeIntLiteralNode(node) +func (v *SimpleVisitor) VisitNegativeIntLiteralNode(node *NegativeIntLiteralNode) error { + if v.DoVisitNegativeIntLiteralNode != nil { + return v.DoVisitNegativeIntLiteralNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitFloatLiteralNode(node *FloatLiteralNode) error { - if b.DoVisitFloatLiteralNode != nil { - return b.DoVisitFloatLiteralNode(node) +func (v *SimpleVisitor) VisitFloatLiteralNode(node *FloatLiteralNode) error { + if v.DoVisitFloatLiteralNode != nil { + return v.DoVisitFloatLiteralNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitSpecialFloatLiteralNode(node *SpecialFloatLiteralNode) error { - if b.DoVisitSpecialFloatLiteralNode != nil { - return b.DoVisitSpecialFloatLiteralNode(node) +func (v *SimpleVisitor) VisitSpecialFloatLiteralNode(node *SpecialFloatLiteralNode) error { + if v.DoVisitSpecialFloatLiteralNode != nil { + return v.DoVisitSpecialFloatLiteralNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitSignedFloatLiteralNode(node *SignedFloatLiteralNode) error { - if b.DoVisitSignedFloatLiteralNode != nil { - return b.DoVisitSignedFloatLiteralNode(node) +func (v *SimpleVisitor) VisitSignedFloatLiteralNode(node *SignedFloatLiteralNode) error { + if v.DoVisitSignedFloatLiteralNode != nil { + return v.DoVisitSignedFloatLiteralNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitArrayLiteralNode(node *ArrayLiteralNode) error { - if b.DoVisitArrayLiteralNode != nil { - return b.DoVisitArrayLiteralNode(node) +func (v *SimpleVisitor) VisitArrayLiteralNode(node *ArrayLiteralNode) error { + if v.DoVisitArrayLiteralNode != nil { + return v.DoVisitArrayLiteralNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitMessageLiteralNode(node *MessageLiteralNode) error { - if b.DoVisitMessageLiteralNode != nil { - return b.DoVisitMessageLiteralNode(node) +func (v *SimpleVisitor) VisitMessageLiteralNode(node *MessageLiteralNode) error { + if v.DoVisitMessageLiteralNode != nil { + return v.DoVisitMessageLiteralNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitMessageFieldNode(node *MessageFieldNode) error { - if b.DoVisitMessageFieldNode != nil { - return b.DoVisitMessageFieldNode(node) +func (v *SimpleVisitor) VisitMessageFieldNode(node *MessageFieldNode) error { + if v.DoVisitMessageFieldNode != nil { + return v.DoVisitMessageFieldNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitKeywordNode(node *KeywordNode) error { - if b.DoVisitKeywordNode != nil { - return b.DoVisitKeywordNode(node) +func (v *SimpleVisitor) VisitKeywordNode(node *KeywordNode) error { + if v.DoVisitKeywordNode != nil { + return v.DoVisitKeywordNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitRuneNode(node *RuneNode) error { - if b.DoVisitRuneNode != nil { - return b.DoVisitRuneNode(node) +func (v *SimpleVisitor) VisitRuneNode(node *RuneNode) error { + if v.DoVisitRuneNode != nil { + return v.DoVisitRuneNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } -func (b *SimpleVisitor) VisitEmptyDeclNode(node *EmptyDeclNode) error { - if b.DoVisitEmptyDeclNode != nil { - return b.DoVisitEmptyDeclNode(node) +func (v *SimpleVisitor) VisitEmptyDeclNode(node *EmptyDeclNode) error { + if v.DoVisitEmptyDeclNode != nil { + return v.DoVisitEmptyDeclNode(node) } - return b.visitInterface(node) + return v.visitInterface(node) } diff --git a/vendor/github.com/bufbuild/protocompile/compiler.go b/vendor/github.com/bufbuild/protocompile/compiler.go index 18a9a0143531..70c9327f8931 100644 --- a/vendor/github.com/bufbuild/protocompile/compiler.go +++ b/vendor/github.com/bufbuild/protocompile/compiler.go @@ -447,16 +447,16 @@ func (t *task) asFile(ctx context.Context, name string, r SearchResult) (linker. results := make([]*result, len(fileDescriptorProto.Dependency)) checked := map[string]struct{}{} for i, dep := range fileDescriptorProto.Dependency { - pos := findImportPos(parseRes, dep) + span := findImportSpan(parseRes, dep) if name == dep { // doh! file imports itself - handleImportCycle(t.h, pos, []string{name}, dep) + handleImportCycle(t.h, span, []string{name}, dep) return nil, t.h.Error() } res := t.e.compile(ctx, dep) // check for dependency cycle to prevent deadlock - if err := t.e.checkForDependencyCycle(res, []string{name, dep}, pos, checked); err != nil { + if err := t.e.checkForDependencyCycle(res, []string{name, dep}, span, checked); err != nil { return nil, err } results[i] = res @@ -481,7 +481,7 @@ func (t *task) asFile(ctx context.Context, name string, r SearchResult) (linker. // it's usually considered immediately fatal. However, if the reason // we were resolving is due to an import, turn this into an error with // source position that pinpoints the import statement and report it. - return nil, reporter.Error(findImportPos(parseRes, res.name), rerr) + return nil, reporter.Error(findImportSpan(parseRes, res.name), rerr) } return nil, res.err } @@ -513,7 +513,7 @@ func (t *task) asFile(ctx context.Context, name string, r SearchResult) (linker. return t.link(parseRes, deps, overrideDescriptorProto) } -func (e *executor) checkForDependencyCycle(res *result, sequence []string, pos ast.SourcePos, checked map[string]struct{}) error { +func (e *executor) checkForDependencyCycle(res *result, sequence []string, span ast.SourceSpan, checked map[string]struct{}) error { if _, ok := checked[res.name]; ok { // already checked this one return nil @@ -524,7 +524,7 @@ func (e *executor) checkForDependencyCycle(res *result, sequence []string, pos a // is this a cycle? for _, file := range sequence { if file == dep { - handleImportCycle(e.h, pos, sequence, dep) + handleImportCycle(e.h, span, sequence, dep) return e.h.Error() } } @@ -535,14 +535,14 @@ func (e *executor) checkForDependencyCycle(res *result, sequence []string, pos a if depRes == nil { continue } - if err := e.checkForDependencyCycle(depRes, append(sequence, dep), pos, checked); err != nil { + if err := e.checkForDependencyCycle(depRes, append(sequence, dep), span, checked); err != nil { return err } } return nil } -func handleImportCycle(h *reporter.Handler, pos ast.SourcePos, importSequence []string, dep string) { +func handleImportCycle(h *reporter.Handler, span ast.SourceSpan, importSequence []string, dep string) { var buf bytes.Buffer buf.WriteString("cycle found in imports: ") for _, imp := range importSequence { @@ -550,23 +550,23 @@ func handleImportCycle(h *reporter.Handler, pos ast.SourcePos, importSequence [] } _, _ = fmt.Fprintf(&buf, "%q", dep) // error is saved and returned in caller - _ = h.HandleErrorf(pos, buf.String()) + _ = h.HandleErrorf(span, buf.String()) } -func findImportPos(res parser.Result, dep string) ast.SourcePos { +func findImportSpan(res parser.Result, dep string) ast.SourceSpan { root := res.AST() if root == nil { - return ast.UnknownPos(res.FileNode().Name()) + return ast.UnknownSpan(res.FileNode().Name()) } for _, decl := range root.Decls { if imp, ok := decl.(*ast.ImportNode); ok { if imp.Name.AsString() == dep { - return root.NodeInfo(imp.Name).Start() + return root.NodeInfo(imp.Name) } } } // this should never happen... - return ast.UnknownPos(res.FileNode().Name()) + return ast.UnknownSpan(res.FileNode().Name()) } func (t *task) link(parseRes parser.Result, deps linker.Files, overrideDescriptorProtoRes linker.File) (linker.File, error) { @@ -591,6 +591,9 @@ func (t *task) link(parseRes parser.Result, deps linker.Files, overrideDescripto if t.r.explicitFile { file.CheckForUnusedImports(t.h) } + if err := t.h.Error(); err != nil { + return nil, err + } if needsSourceInfo(parseRes, t.e.c.SourceInfoMode) { var srcInfoOpts []sourceinfo.GenerateOption @@ -601,6 +604,14 @@ func (t *task) link(parseRes parser.Result, deps linker.Files, overrideDescripto srcInfoOpts = append(srcInfoOpts, sourceinfo.WithExtraOptionLocations()) } parseRes.FileDescriptorProto().SourceCodeInfo = sourceinfo.GenerateSourceInfo(parseRes.AST(), optsIndex, srcInfoOpts...) + } else if t.e.c.SourceInfoMode == SourceInfoNone { + // If results came from unlinked FileDescriptorProto, it could have + // source info that we should strip. + parseRes.FileDescriptorProto().SourceCodeInfo = nil + } + if len(parseRes.FileDescriptorProto().GetSourceCodeInfo().GetLocation()) > 0 { + // If we have source code info in the descriptor proto at this point, + // we have to build the index of locations. file.PopulateSourceCodeInfo() } diff --git a/vendor/github.com/bufbuild/protocompile/internal/editions.go b/vendor/github.com/bufbuild/protocompile/internal/editions.go new file mode 100644 index 000000000000..bf6bf45f710f --- /dev/null +++ b/vendor/github.com/bufbuild/protocompile/internal/editions.go @@ -0,0 +1,20 @@ +// Copyright 2020-2023 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal + +// AllowEditions is set to true in tests to enable editions syntax for testing. +// This will be removed and editions will be allowed by non-test code once the +// implementation is complete. +var AllowEditions = false diff --git a/vendor/github.com/bufbuild/protocompile/internal/options.go b/vendor/github.com/bufbuild/protocompile/internal/options.go index b35d1c0eafea..e518e1ed9e13 100644 --- a/vendor/github.com/bufbuild/protocompile/internal/options.go +++ b/vendor/github.com/bufbuild/protocompile/internal/options.go @@ -26,21 +26,32 @@ type hasOptionNode interface { FileNode() ast.FileDeclNode // needed in order to query for NodeInfo } +func FindFirstOption(res hasOptionNode, handler *reporter.Handler, scope string, opts []*descriptorpb.UninterpretedOption, name string) (int, error) { + return findOption(res, handler, scope, opts, name, false, true) +} + func FindOption(res hasOptionNode, handler *reporter.Handler, scope string, opts []*descriptorpb.UninterpretedOption, name string) (int, error) { + return findOption(res, handler, scope, opts, name, true, false) +} + +func findOption(res hasOptionNode, handler *reporter.Handler, scope string, opts []*descriptorpb.UninterpretedOption, name string, exact, first bool) (int, error) { found := -1 for i, opt := range opts { - if len(opt.Name) != 1 { + if exact && len(opt.Name) != 1 { continue } if opt.Name[0].GetIsExtension() || opt.Name[0].GetNamePart() != name { continue } + if first { + return i, nil + } if found >= 0 { optNode := res.OptionNode(opt) fn := res.FileNode() node := optNode.GetName() nodeInfo := fn.NodeInfo(node) - return -1, handler.HandleErrorf(nodeInfo.Start(), "%s: option %s cannot be defined more than once", scope, name) + return -1, handler.HandleErrorf(nodeInfo, "%s: option %s cannot be defined more than once", scope, name) } found = i } diff --git a/vendor/github.com/bufbuild/protocompile/internal/tags.go b/vendor/github.com/bufbuild/protocompile/internal/tags.go index 7183dbaf05ba..387df7f39506 100644 --- a/vendor/github.com/bufbuild/protocompile/internal/tags.go +++ b/vendor/github.com/bufbuild/protocompile/internal/tags.go @@ -73,6 +73,9 @@ const ( // FileSyntaxTag is the tag number of the syntax element in a file // descriptor proto. FileSyntaxTag = 12 + // FileEditionTag is the tag number of the edition element in a file + // descriptor proto. + FileEditionTag = 14 // MessageNameTag is the tag number of the name element in a message // descriptor proto. MessageNameTag = 1 diff --git a/vendor/github.com/bufbuild/protocompile/internal/util.go b/vendor/github.com/bufbuild/protocompile/internal/util.go index 4ff19b11d586..c437d7fb2948 100644 --- a/vendor/github.com/bufbuild/protocompile/internal/util.go +++ b/vendor/github.com/bufbuild/protocompile/internal/util.go @@ -18,6 +18,8 @@ import ( "bytes" "unicode" "unicode/utf8" + + "google.golang.org/protobuf/reflect/protoreflect" ) // JSONName returns the default JSON name for a field with the given name. @@ -117,3 +119,109 @@ func WriteEscapedBytes(buf *bytes.Buffer, b []byte) { } } } + +// IsZeroLocation returns true if the given loc is a zero value +// (which is returned from queries that have no result). +func IsZeroLocation(loc protoreflect.SourceLocation) bool { + return loc.Path == nil && + loc.StartLine == 0 && + loc.StartColumn == 0 && + loc.EndLine == 0 && + loc.EndColumn == 0 && + loc.LeadingDetachedComments == nil && + loc.LeadingComments == "" && + loc.TrailingComments == "" && + loc.Next == 0 +} + +// ComputePath computes the source location path for the given descriptor. +// The boolean value indicates whether the result is valid. If the path +// cannot be computed for d, the function returns nil, false. +func ComputePath(d protoreflect.Descriptor) (protoreflect.SourcePath, bool) { + _, ok := d.(protoreflect.FileDescriptor) + if ok { + return nil, true + } + var path protoreflect.SourcePath + for { + p := d.Parent() + switch d := d.(type) { + case protoreflect.FileDescriptor: + return reverse(path), true + case protoreflect.MessageDescriptor: + path = append(path, int32(d.Index())) + switch p.(type) { + case protoreflect.FileDescriptor: + path = append(path, FileMessagesTag) + case protoreflect.MessageDescriptor: + path = append(path, MessageNestedMessagesTag) + default: + return nil, false + } + case protoreflect.FieldDescriptor: + path = append(path, int32(d.Index())) + switch p.(type) { + case protoreflect.FileDescriptor: + if d.IsExtension() { + path = append(path, FileExtensionsTag) + } else { + return nil, false + } + case protoreflect.MessageDescriptor: + if d.IsExtension() { + path = append(path, MessageExtensionsTag) + } else { + path = append(path, MessageFieldsTag) + } + default: + return nil, false + } + case protoreflect.OneofDescriptor: + path = append(path, int32(d.Index())) + if _, ok := p.(protoreflect.MessageDescriptor); ok { + path = append(path, MessageOneofsTag) + } else { + return nil, false + } + case protoreflect.EnumDescriptor: + path = append(path, int32(d.Index())) + switch p.(type) { + case protoreflect.FileDescriptor: + path = append(path, FileEnumsTag) + case protoreflect.MessageDescriptor: + path = append(path, MessageEnumsTag) + default: + return nil, false + } + case protoreflect.EnumValueDescriptor: + path = append(path, int32(d.Index())) + if _, ok := p.(protoreflect.EnumDescriptor); ok { + path = append(path, EnumValuesTag) + } else { + return nil, false + } + case protoreflect.ServiceDescriptor: + path = append(path, int32(d.Index())) + if _, ok := p.(protoreflect.FileDescriptor); ok { + path = append(path, FileServicesTag) + } else { + return nil, false + } + case protoreflect.MethodDescriptor: + path = append(path, int32(d.Index())) + if _, ok := p.(protoreflect.ServiceDescriptor); ok { + path = append(path, ServiceMethodsTag) + } else { + return nil, false + } + } + d = p + } +} + +func reverse(p protoreflect.SourcePath) protoreflect.SourcePath { + for i, j := 0, len(p)-1; i < j; i, j = i+1, j-1 { + p[i], p[j] = p[j], p[i] + } + return p +} diff --git a/vendor/github.com/bufbuild/protocompile/linker/descriptors.go b/vendor/github.com/bufbuild/protocompile/linker/descriptors.go index cd61e402295f..d4f82fbdc03b 100644 --- a/vendor/github.com/bufbuild/protocompile/linker/descriptors.go +++ b/vendor/github.com/bufbuild/protocompile/linker/descriptors.go @@ -21,7 +21,9 @@ import ( "unicode/utf8" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protodesc" "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/types/descriptorpb" "google.golang.org/protobuf/types/dynamicpb" @@ -31,6 +33,103 @@ import ( "github.com/bufbuild/protocompile/protoutil" ) +var ( + // These "noOp*" values are all descriptors. The protoreflect.Descriptor + // interface and its sub-interfaces are all marked with an unexported + // method so that they cannot be implemented outside of the google.golang.org/protobuf + // module. So, to provide implementations from this package, we must embed + // them. If we simply left the embedded interface field nil, then if/when + // new methods are added to the interfaces, it could induce panics in this + // package or users of this module (since trying to invoke one of these new + // methods would end up trying to call a method on a nil interface value). + // + // So instead of leaving the embedded interface fields nil, we embed an actual + // value. While new methods are unlikely to return the correct value (since + // the calls will be delegated to these no-op instances), it is a less + // dangerous latent bug than inducing a nil-dereference panic. + + noOpFile protoreflect.FileDescriptor + noOpMessage protoreflect.MessageDescriptor + noOpOneof protoreflect.OneofDescriptor + noOpField protoreflect.FieldDescriptor + noOpEnum protoreflect.EnumDescriptor + noOpEnumValue protoreflect.EnumValueDescriptor + noOpExtension protoreflect.ExtensionDescriptor + noOpService protoreflect.ServiceDescriptor + noOpMethod protoreflect.MethodDescriptor +) + +func init() { + noOpFile, _ = protodesc.NewFile( + &descriptorpb.FileDescriptorProto{ + Name: proto.String("no-op.proto"), + Syntax: proto.String("proto2"), + Dependency: []string{"google/protobuf/descriptor.proto"}, + MessageType: []*descriptorpb.DescriptorProto{ + { + Name: proto.String("NoOpMsg"), + Field: []*descriptorpb.FieldDescriptorProto{ + { + Name: proto.String("no_op"), + Type: descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(), + Label: descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(), + Number: proto.Int32(1), + JsonName: proto.String("noOp"), + OneofIndex: proto.Int32(0), + }, + }, + OneofDecl: []*descriptorpb.OneofDescriptorProto{ + { + Name: proto.String("no_op_oneof"), + }, + }, + }, + }, + EnumType: []*descriptorpb.EnumDescriptorProto{ + { + Name: proto.String("NoOpEnum"), + Value: []*descriptorpb.EnumValueDescriptorProto{ + { + Name: proto.String("NO_OP"), + Number: proto.Int32(0), + }, + }, + }, + }, + Extension: []*descriptorpb.FieldDescriptorProto{ + { + Extendee: proto.String(".google.protobuf.FileOptions"), + Name: proto.String("no_op"), + Type: descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(), + Label: descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(), + Number: proto.Int32(50000), + }, + }, + Service: []*descriptorpb.ServiceDescriptorProto{ + { + Name: proto.String("NoOpService"), + Method: []*descriptorpb.MethodDescriptorProto{ + { + Name: proto.String("NoOp"), + InputType: proto.String(".NoOpMsg"), + OutputType: proto.String(".NoOpMsg"), + }, + }, + }, + }, + }, + protoregistry.GlobalFiles, + ) + noOpMessage = noOpFile.Messages().Get(0) + noOpOneof = noOpMessage.Oneofs().Get(0) + noOpField = noOpMessage.Fields().Get(0) + noOpEnum = noOpFile.Enums().Get(0) + noOpEnumValue = noOpEnum.Values().Get(0) + noOpExtension = noOpFile.Extensions().Get(0) + noOpService = noOpFile.Services().Get(0) + noOpMethod = noOpService.Methods().Get(0) +} + // This file contains implementations of protoreflect.Descriptor. Note that // this is a hack since those interfaces have a "doNotImplement" tag // interface therein. We do just enough to make dynamicpb happy; constructing @@ -226,10 +325,19 @@ func (r *result) CanonicalProto() *descriptorpb.FileDescriptorProto { return fd } +func (r *result) storeOptionBytes(opts, origOpts proto.Message) { + optionBytes := r.optionBytes[origOpts] + if len(optionBytes) == 0 { + // If we don't know about this options message, leave it alone. + return + } + proto.Reset(opts) + opts.ProtoReflect().SetUnknown(optionBytes) +} + func (r *result) storeOptionBytesInFile(fd, origFd *descriptorpb.FileDescriptorProto) { if fd.Options != nil { - fd.Options.Reset() - fd.Options.ProtoReflect().SetUnknown(r.optionBytes[origFd.Options]) + r.storeOptionBytes(fd.Options, origFd.Options) } for i, md := range fd.MessageType { @@ -250,15 +358,13 @@ func (r *result) storeOptionBytesInFile(fd, origFd *descriptorpb.FileDescriptorP for i, sd := range fd.Service { origSd := origFd.Service[i] if sd.Options != nil { - sd.Options.Reset() - sd.Options.ProtoReflect().SetUnknown(r.optionBytes[origSd.Options]) + r.storeOptionBytes(sd.Options, origSd.Options) } for j, mtd := range sd.Method { origMtd := origSd.Method[j] if mtd.Options != nil { - mtd.Options.Reset() - mtd.Options.ProtoReflect().SetUnknown(r.optionBytes[origMtd.Options]) + r.storeOptionBytes(mtd.Options, origMtd.Options) } } } @@ -273,8 +379,7 @@ func (r *result) storeOptionBytesInMessage(md, origMd *descriptorpb.DescriptorPr } if md.Options != nil { - md.Options.Reset() - md.Options.ProtoReflect().SetUnknown(r.optionBytes[origMd.Options]) + r.storeOptionBytes(md.Options, origMd.Options) } for i, fld := range md.Field { @@ -285,16 +390,14 @@ func (r *result) storeOptionBytesInMessage(md, origMd *descriptorpb.DescriptorPr for i, ood := range md.OneofDecl { origOod := origMd.OneofDecl[i] if ood.Options != nil { - ood.Options.Reset() - ood.Options.ProtoReflect().SetUnknown(r.optionBytes[origOod.Options]) + r.storeOptionBytes(ood.Options, origOod.Options) } } for i, exr := range md.ExtensionRange { origExr := origMd.ExtensionRange[i] if exr.Options != nil { - exr.Options.Reset() - exr.Options.ProtoReflect().SetUnknown(r.optionBytes[origExr.Options]) + r.storeOptionBytes(exr.Options, origExr.Options) } } @@ -316,23 +419,20 @@ func (r *result) storeOptionBytesInMessage(md, origMd *descriptorpb.DescriptorPr func (r *result) storeOptionBytesInEnum(ed, origEd *descriptorpb.EnumDescriptorProto) { if ed.Options != nil { - ed.Options.Reset() - ed.Options.ProtoReflect().SetUnknown(r.optionBytes[origEd.Options]) + r.storeOptionBytes(ed.Options, origEd.Options) } for i, evd := range ed.Value { origEvd := origEd.Value[i] if evd.Options != nil { - evd.Options.Reset() - evd.Options.ProtoReflect().SetUnknown(r.optionBytes[origEvd.Options]) + r.storeOptionBytes(evd.Options, origEvd.Options) } } } func (r *result) storeOptionBytesInField(fld, origFld *descriptorpb.FieldDescriptorProto) { if fld.Options != nil { - fld.Options.Reset() - fld.Options.ProtoReflect().SetUnknown(r.optionBytes[origFld.Options]) + r.storeOptionBytes(fld.Options, origFld.Options) } } @@ -392,102 +492,13 @@ func (s *srcLocs) ByDescriptor(d protoreflect.Descriptor) protoreflect.SourceLoc if d.ParentFile() != s.file { return protoreflect.SourceLocation{} } - path, ok := computePath(d) + path, ok := internal.ComputePath(d) if !ok { return protoreflect.SourceLocation{} } return s.ByPath(path) } -func computePath(d protoreflect.Descriptor) (protoreflect.SourcePath, bool) { - _, ok := d.(protoreflect.FileDescriptor) - if ok { - return nil, true - } - var path protoreflect.SourcePath - for { - p := d.Parent() - switch d := d.(type) { - case protoreflect.FileDescriptor: - return reverse(path), true - case protoreflect.MessageDescriptor: - path = append(path, int32(d.Index())) - switch p.(type) { - case protoreflect.FileDescriptor: - path = append(path, internal.FileMessagesTag) - case protoreflect.MessageDescriptor: - path = append(path, internal.MessageNestedMessagesTag) - default: - return nil, false - } - case protoreflect.FieldDescriptor: - path = append(path, int32(d.Index())) - switch p.(type) { - case protoreflect.FileDescriptor: - if d.IsExtension() { - path = append(path, internal.FileExtensionsTag) - } else { - return nil, false - } - case protoreflect.MessageDescriptor: - if d.IsExtension() { - path = append(path, internal.MessageExtensionsTag) - } else { - path = append(path, internal.MessageFieldsTag) - } - default: - return nil, false - } - case protoreflect.OneofDescriptor: - path = append(path, int32(d.Index())) - if _, ok := p.(protoreflect.MessageDescriptor); ok { - path = append(path, internal.MessageOneofsTag) - } else { - return nil, false - } - case protoreflect.EnumDescriptor: - path = append(path, int32(d.Index())) - switch p.(type) { - case protoreflect.FileDescriptor: - path = append(path, internal.FileEnumsTag) - case protoreflect.MessageDescriptor: - path = append(path, internal.MessageEnumsTag) - default: - return nil, false - } - case protoreflect.EnumValueDescriptor: - path = append(path, int32(d.Index())) - if _, ok := p.(protoreflect.EnumDescriptor); ok { - path = append(path, internal.EnumValuesTag) - } else { - return nil, false - } - case protoreflect.ServiceDescriptor: - path = append(path, int32(d.Index())) - if _, ok := p.(protoreflect.FileDescriptor); ok { - path = append(path, internal.FileServicesTag) - } else { - return nil, false - } - case protoreflect.MethodDescriptor: - path = append(path, int32(d.Index())) - if _, ok := p.(protoreflect.ServiceDescriptor); ok { - path = append(path, internal.ServiceMethodsTag) - } else { - return nil, false - } - } - d = p - } -} - -func reverse(p protoreflect.SourcePath) protoreflect.SourcePath { - for i, j := 0, len(p)-1; i < j; i, j = i+1, j-1 { - p[i], p[j] = p[j], p[i] - } - return p -} - type msgDescriptors struct { protoreflect.MessageDescriptors msgs []*msgDescriptor @@ -541,7 +552,7 @@ var _ protoreflect.MessageDescriptor = (*msgDescriptor)(nil) var _ protoutil.DescriptorProtoWrapper = (*msgDescriptor)(nil) func (r *result) createMessageDescriptor(md *descriptorpb.DescriptorProto, parent protoreflect.Descriptor, index int, fqn string) *msgDescriptor { - ret := &msgDescriptor{file: r, parent: parent, index: index, proto: md, fqn: fqn} + ret := &msgDescriptor{MessageDescriptor: noOpMessage, file: r, parent: parent, index: index, proto: md, fqn: fqn} r.descriptors[fqn] = ret prefix := fqn + "." @@ -779,7 +790,7 @@ var _ protoreflect.EnumDescriptor = (*enumDescriptor)(nil) var _ protoutil.DescriptorProtoWrapper = (*enumDescriptor)(nil) func (r *result) createEnumDescriptor(ed *descriptorpb.EnumDescriptorProto, parent protoreflect.Descriptor, index int, fqn string) *enumDescriptor { - ret := &enumDescriptor{file: r, parent: parent, index: index, proto: ed, fqn: fqn} + ret := &enumDescriptor{EnumDescriptor: noOpEnum, file: r, parent: parent, index: index, proto: ed, fqn: fqn} r.descriptors[fqn] = ret // Unlike all other elements, the fully-qualified name of enum values @@ -930,7 +941,7 @@ var _ protoreflect.EnumValueDescriptor = (*enValDescriptor)(nil) var _ protoutil.DescriptorProtoWrapper = (*enValDescriptor)(nil) func (r *result) createEnumValueDescriptor(ed *descriptorpb.EnumValueDescriptorProto, parent *enumDescriptor, index int, fqn string) *enValDescriptor { - ret := &enValDescriptor{file: r, parent: parent, index: index, proto: ed, fqn: fqn} + ret := &enValDescriptor{EnumValueDescriptor: noOpEnumValue, file: r, parent: parent, index: index, proto: ed, fqn: fqn} r.descriptors[fqn] = ret return ret } @@ -1017,7 +1028,7 @@ type extTypeDescriptor struct { var _ protoutil.DescriptorProtoWrapper = &extTypeDescriptor{} func (r *result) createExtTypeDescriptor(fd *descriptorpb.FieldDescriptorProto, parent protoreflect.Descriptor, index int, fqn string) *extTypeDescriptor { - ret := &fldDescriptor{file: r, parent: parent, index: index, proto: fd, fqn: fqn} + ret := &fldDescriptor{FieldDescriptor: noOpExtension, file: r, parent: parent, index: index, proto: fd, fqn: fqn} r.descriptors[fqn] = ret return &extTypeDescriptor{ExtensionTypeDescriptor: dynamicpb.NewExtensionType(ret).TypeDescriptor(), field: ret} } @@ -1100,7 +1111,7 @@ var _ protoreflect.FieldDescriptor = (*fldDescriptor)(nil) var _ protoutil.DescriptorProtoWrapper = (*fldDescriptor)(nil) func (r *result) createFieldDescriptor(fd *descriptorpb.FieldDescriptorProto, parent *msgDescriptor, index int, fqn string) *fldDescriptor { - ret := &fldDescriptor{file: r, parent: parent, index: index, proto: fd, fqn: fqn} + ret := &fldDescriptor{FieldDescriptor: noOpField, file: r, parent: parent, index: index, proto: fd, fqn: fqn} r.descriptors[fqn] = ret return ret } @@ -1577,7 +1588,7 @@ var _ protoreflect.OneofDescriptor = (*oneofDescriptor)(nil) var _ protoutil.DescriptorProtoWrapper = (*oneofDescriptor)(nil) func (r *result) createOneofDescriptor(ood *descriptorpb.OneofDescriptorProto, parent *msgDescriptor, index int, fqn string) *oneofDescriptor { - ret := &oneofDescriptor{file: r, parent: parent, index: index, proto: ood, fqn: fqn} + ret := &oneofDescriptor{OneofDescriptor: noOpOneof, file: r, parent: parent, index: index, proto: ood, fqn: fqn} r.descriptors[fqn] = ret var fields []*fldDescriptor @@ -1688,7 +1699,7 @@ var _ protoreflect.ServiceDescriptor = (*svcDescriptor)(nil) var _ protoutil.DescriptorProtoWrapper = (*svcDescriptor)(nil) func (r *result) createServiceDescriptor(sd *descriptorpb.ServiceDescriptorProto, index int, fqn string) *svcDescriptor { - ret := &svcDescriptor{file: r, index: index, proto: sd, fqn: fqn} + ret := &svcDescriptor{ServiceDescriptor: noOpService, file: r, index: index, proto: sd, fqn: fqn} r.descriptors[fqn] = ret prefix := fqn + "." @@ -1786,7 +1797,7 @@ var _ protoreflect.MethodDescriptor = (*mtdDescriptor)(nil) var _ protoutil.DescriptorProtoWrapper = (*mtdDescriptor)(nil) func (r *result) createMethodDescriptor(mtd *descriptorpb.MethodDescriptorProto, parent *svcDescriptor, index int, fqn string) *mtdDescriptor { - ret := &mtdDescriptor{file: r, parent: parent, index: index, proto: mtd, fqn: fqn} + ret := &mtdDescriptor{MethodDescriptor: noOpMethod, file: r, parent: parent, index: index, proto: mtd, fqn: fqn} r.descriptors[fqn] = ret return ret } diff --git a/vendor/github.com/bufbuild/protocompile/linker/linker.go b/vendor/github.com/bufbuild/protocompile/linker/linker.go index 97f7bfc2f71e..cb70e84e3992 100644 --- a/vendor/github.com/bufbuild/protocompile/linker/linker.go +++ b/vendor/github.com/bufbuild/protocompile/linker/linker.go @@ -60,6 +60,7 @@ func Link(parsed parser.Result, dependencies Files, symbols *Symbols, handler *r } r := &result{ + FileDescriptor: noOpFile, Result: parsed, deps: dependencies, descriptors: map[string]protoreflect.Descriptor{}, @@ -131,8 +132,8 @@ type Result interface { // will be serialized in a canonical way. The "canonical" way matches // the way that "protoc" emits option values, which is a way that // mostly matches the way options are defined in source, including - // ordering and de-structuring. Unlike the FileDescriptorProto() method, this - // method is more expensive and results in a new descriptor proto + // ordering and de-structuring. Unlike the FileDescriptorProto() method, + // this method is more expensive and results in a new descriptor proto // being constructed with each call. // // The returned value will have all options (fields of the various @@ -140,6 +141,15 @@ type Result interface { // fields. So the returned value will serialize as desired, but it // is otherwise not useful since all option values are treated as // unknown. + // + // Note that CanonicalProto is a no-op if the options in this file + // were not interpreted by this module (e.g. the underlying descriptor + // proto was provided, with options already interpreted, instead of + // parsed from source). If the underlying descriptor proto was provided, + // but with a mix of interpreted and uninterpreted options, this method + // will effectively clear the already-interpreted fields and only the + // options actually interpreted by the compile operation will be + // retained. CanonicalProto() *descriptorpb.FileDescriptorProto // RemoveAST drops the AST information from this result. diff --git a/vendor/github.com/bufbuild/protocompile/linker/pathkey_unsafe.go b/vendor/github.com/bufbuild/protocompile/linker/pathkey_unsafe.go index e947604c38f0..62861bb07930 100644 --- a/vendor/github.com/bufbuild/protocompile/linker/pathkey_unsafe.go +++ b/vendor/github.com/bufbuild/protocompile/linker/pathkey_unsafe.go @@ -30,6 +30,10 @@ import ( var pathElementType = reflect.TypeOf(protoreflect.SourcePath{}).Elem() func pathKey(p protoreflect.SourcePath) interface{} { + if p == nil { + // Reflection code below doesn't work with nil slices + return [0]int32{} + } hdr := (*reflect.SliceHeader)(unsafe.Pointer(reflect.ValueOf(&p).Pointer())) array := reflect.NewAt(reflect.ArrayOf(hdr.Len, pathElementType), unsafe.Pointer(hdr.Data)) return array.Elem().Interface() diff --git a/vendor/github.com/bufbuild/protocompile/linker/resolve.go b/vendor/github.com/bufbuild/protocompile/linker/resolve.go index 08e2cdda8ba1..438a8cd65645 100644 --- a/vendor/github.com/bufbuild/protocompile/linker/resolve.go +++ b/vendor/github.com/bufbuild/protocompile/linker/resolve.go @@ -111,16 +111,16 @@ func (r *result) CheckForUnusedImports(handler *reporter.Handler) { if isPublic { continue } - pos := ast.UnknownPos(fd.GetName()) + span := ast.UnknownSpan(fd.GetName()) if file != nil { for _, decl := range file.Decls { imp, ok := decl.(*ast.ImportNode) if ok && imp.Name.AsString() == dep { - pos = file.NodeInfo(imp).Start() + span = file.NodeInfo(imp) } } } - handler.HandleWarningWithPos(pos, errUnusedImport(dep)) + handler.HandleWarningWithPos(span, errUnusedImport(dep)) } } } @@ -209,7 +209,7 @@ func (r *result) resolveReferences(handler *reporter.Handler, s *Symbols) error if r.Syntax() == protoreflect.Proto3 && !allowedProto3Extendee(d.field.proto.GetExtendee()) { file := r.FileNode() node := r.FieldNode(d.field.proto).FieldExtendee() - if err := handler.HandleErrorf(file.NodeInfo(node).Start(), "extend blocks in proto3 can only be used to define custom options"); err != nil { + if err := handler.HandleErrorf(file.NodeInfo(node), "extend blocks in proto3 can only be used to define custom options"); err != nil { return err } } @@ -301,14 +301,14 @@ func resolveFieldTypes(f *fldDescriptor, handler *reporter.Handler, s *Symbols, scope := fmt.Sprintf("extension %s", f.fqn) dsc := r.resolve(fld.GetExtendee(), false, scopes) if dsc == nil { - return handler.HandleErrorf(file.NodeInfo(node.FieldExtendee()).Start(), "unknown extendee type %s", fld.GetExtendee()) + return handler.HandleErrorf(file.NodeInfo(node.FieldExtendee()), "unknown extendee type %s", fld.GetExtendee()) } if isSentinelDescriptor(dsc) { - return handler.HandleErrorf(file.NodeInfo(node.FieldExtendee()).Start(), "unknown extendee type %s; resolved to %s which is not defined; consider using a leading dot", fld.GetExtendee(), dsc.FullName()) + return handler.HandleErrorf(file.NodeInfo(node.FieldExtendee()), "unknown extendee type %s; resolved to %s which is not defined; consider using a leading dot", fld.GetExtendee(), dsc.FullName()) } extd, ok := dsc.(protoreflect.MessageDescriptor) if !ok { - return handler.HandleErrorf(file.NodeInfo(node.FieldExtendee()).Start(), "extendee is invalid: %s is %s, not a message", dsc.FullName(), descriptorTypeWithArticle(dsc)) + return handler.HandleErrorf(file.NodeInfo(node.FieldExtendee()), "extendee is invalid: %s is %s, not a message", dsc.FullName(), descriptorTypeWithArticle(dsc)) } f.extendee = extd extendeeName := "." + string(dsc.FullName()) @@ -326,12 +326,12 @@ func resolveFieldTypes(f *fldDescriptor, handler *reporter.Handler, s *Symbols, } } if !found { - if err := handler.HandleErrorf(file.NodeInfo(node.FieldTag()).Start(), "%s: tag %d is not in valid range for extended type %s", scope, tag, dsc.FullName()); err != nil { + if err := handler.HandleErrorf(file.NodeInfo(node.FieldTag()), "%s: tag %d is not in valid range for extended type %s", scope, tag, dsc.FullName()); err != nil { return err } } else { // make sure tag is not a duplicate - if err := s.AddExtension(packageFor(dsc), dsc.FullName(), tag, file.NodeInfo(node.FieldTag()).Start(), handler); err != nil { + if err := s.AddExtension(packageFor(dsc), dsc.FullName(), tag, file.NodeInfo(node.FieldTag()), handler); err != nil { return err } } @@ -348,10 +348,10 @@ func resolveFieldTypes(f *fldDescriptor, handler *reporter.Handler, s *Symbols, dsc := r.resolve(fld.GetTypeName(), true, scopes) if dsc == nil { - return handler.HandleErrorf(file.NodeInfo(node.FieldType()).Start(), "%s: unknown type %s", scope, fld.GetTypeName()) + return handler.HandleErrorf(file.NodeInfo(node.FieldType()), "%s: unknown type %s", scope, fld.GetTypeName()) } if isSentinelDescriptor(dsc) { - return handler.HandleErrorf(file.NodeInfo(node.FieldType()).Start(), "%s: unknown type %s; resolved to %s which is not defined; consider using a leading dot", scope, fld.GetTypeName(), dsc.FullName()) + return handler.HandleErrorf(file.NodeInfo(node.FieldType()), "%s: unknown type %s; resolved to %s which is not defined; consider using a leading dot", scope, fld.GetTypeName(), dsc.FullName()) } switch dsc := dsc.(type) { case protoreflect.MessageDescriptor: @@ -379,7 +379,7 @@ func resolveFieldTypes(f *fldDescriptor, handler *reporter.Handler, s *Symbols, } } if !isValid { - return handler.HandleErrorf(file.NodeInfo(node.FieldType()).Start(), "%s: %s is a synthetic map entry and may not be referenced explicitly", scope, dsc.FullName()) + return handler.HandleErrorf(file.NodeInfo(node.FieldType()), "%s: %s is a synthetic map entry and may not be referenced explicitly", scope, dsc.FullName()) } } typeName := "." + string(dsc.FullName()) @@ -390,7 +390,7 @@ func resolveFieldTypes(f *fldDescriptor, handler *reporter.Handler, s *Symbols, // if type was tentatively unset, we now know it's actually a message fld.Type = descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum() } else if fld.GetType() != descriptorpb.FieldDescriptorProto_TYPE_MESSAGE && fld.GetType() != descriptorpb.FieldDescriptorProto_TYPE_GROUP { - return handler.HandleErrorf(file.NodeInfo(node.FieldType()).Start(), "%s: descriptor proto indicates type %v but should be %v", scope, fld.GetType(), descriptorpb.FieldDescriptorProto_TYPE_MESSAGE) + return handler.HandleErrorf(file.NodeInfo(node.FieldType()), "%s: descriptor proto indicates type %v but should be %v", scope, fld.GetType(), descriptorpb.FieldDescriptorProto_TYPE_MESSAGE) } f.msgType = dsc case protoreflect.EnumDescriptor: @@ -398,7 +398,7 @@ func resolveFieldTypes(f *fldDescriptor, handler *reporter.Handler, s *Symbols, enumIsProto3 := dsc.Syntax() == protoreflect.Proto3 if fld.GetExtendee() == "" && proto3 && !enumIsProto3 { // fields in a proto3 message cannot refer to proto2 enums - return handler.HandleErrorf(file.NodeInfo(node.FieldType()).Start(), "%s: cannot use proto2 enum %s in a proto3 message", scope, fld.GetTypeName()) + return handler.HandleErrorf(file.NodeInfo(node.FieldType()), "%s: cannot use proto2 enum %s in a proto3 message", scope, fld.GetTypeName()) } typeName := "." + string(dsc.FullName()) if fld.GetTypeName() != typeName { @@ -408,11 +408,11 @@ func resolveFieldTypes(f *fldDescriptor, handler *reporter.Handler, s *Symbols, // the type was tentatively unset, but now we know it's actually an enum fld.Type = descriptorpb.FieldDescriptorProto_TYPE_ENUM.Enum() } else if fld.GetType() != descriptorpb.FieldDescriptorProto_TYPE_ENUM { - return handler.HandleErrorf(file.NodeInfo(node.FieldType()).Start(), "%s: descriptor proto indicates type %v but should be %v", scope, fld.GetType(), descriptorpb.FieldDescriptorProto_TYPE_ENUM) + return handler.HandleErrorf(file.NodeInfo(node.FieldType()), "%s: descriptor proto indicates type %v but should be %v", scope, fld.GetType(), descriptorpb.FieldDescriptorProto_TYPE_ENUM) } f.enumType = dsc default: - return handler.HandleErrorf(file.NodeInfo(node.FieldType()).Start(), "%s: invalid type: %s is %s, not a message or enum", scope, dsc.FullName(), descriptorTypeWithArticle(dsc)) + return handler.HandleErrorf(file.NodeInfo(node.FieldType()), "%s: invalid type: %s is %s, not a message or enum", scope, dsc.FullName(), descriptorTypeWithArticle(dsc)) } return nil } @@ -440,15 +440,15 @@ func resolveMethodTypes(m *mtdDescriptor, handler *reporter.Handler, scopes []sc node := r.MethodNode(mtd) dsc := r.resolve(mtd.GetInputType(), false, scopes) if dsc == nil { - if err := handler.HandleErrorf(file.NodeInfo(node.GetInputType()).Start(), "%s: unknown request type %s", scope, mtd.GetInputType()); err != nil { + if err := handler.HandleErrorf(file.NodeInfo(node.GetInputType()), "%s: unknown request type %s", scope, mtd.GetInputType()); err != nil { return err } } else if isSentinelDescriptor(dsc) { - if err := handler.HandleErrorf(file.NodeInfo(node.GetInputType()).Start(), "%s: unknown request type %s; resolved to %s which is not defined; consider using a leading dot", scope, mtd.GetInputType(), dsc.FullName()); err != nil { + if err := handler.HandleErrorf(file.NodeInfo(node.GetInputType()), "%s: unknown request type %s; resolved to %s which is not defined; consider using a leading dot", scope, mtd.GetInputType(), dsc.FullName()); err != nil { return err } } else if msg, ok := dsc.(protoreflect.MessageDescriptor); !ok { - if err := handler.HandleErrorf(file.NodeInfo(node.GetInputType()).Start(), "%s: invalid request type: %s is %s, not a message", scope, dsc.FullName(), descriptorTypeWithArticle(dsc)); err != nil { + if err := handler.HandleErrorf(file.NodeInfo(node.GetInputType()), "%s: invalid request type: %s is %s, not a message", scope, dsc.FullName(), descriptorTypeWithArticle(dsc)); err != nil { return err } } else { @@ -462,15 +462,15 @@ func resolveMethodTypes(m *mtdDescriptor, handler *reporter.Handler, scopes []sc // TODO: make input and output type resolution more DRY dsc = r.resolve(mtd.GetOutputType(), false, scopes) if dsc == nil { - if err := handler.HandleErrorf(file.NodeInfo(node.GetOutputType()).Start(), "%s: unknown response type %s", scope, mtd.GetOutputType()); err != nil { + if err := handler.HandleErrorf(file.NodeInfo(node.GetOutputType()), "%s: unknown response type %s", scope, mtd.GetOutputType()); err != nil { return err } } else if isSentinelDescriptor(dsc) { - if err := handler.HandleErrorf(file.NodeInfo(node.GetOutputType()).Start(), "%s: unknown response type %s; resolved to %s which is not defined; consider using a leading dot", scope, mtd.GetOutputType(), dsc.FullName()); err != nil { + if err := handler.HandleErrorf(file.NodeInfo(node.GetOutputType()), "%s: unknown response type %s; resolved to %s which is not defined; consider using a leading dot", scope, mtd.GetOutputType(), dsc.FullName()); err != nil { return err } } else if msg, ok := dsc.(protoreflect.MessageDescriptor); !ok { - if err := handler.HandleErrorf(file.NodeInfo(node.GetOutputType()).Start(), "%s: invalid response type: %s is %s, not a message", scope, dsc.FullName(), descriptorTypeWithArticle(dsc)); err != nil { + if err := handler.HandleErrorf(file.NodeInfo(node.GetOutputType()), "%s: invalid response type: %s is %s, not a message", scope, dsc.FullName(), descriptorTypeWithArticle(dsc)); err != nil { return err } } else { @@ -499,7 +499,7 @@ opts: node := r.OptionNamePartNode(nm) fqn, err := r.resolveExtensionName(nm.GetNamePart(), scopes) if err != nil { - if err := handler.HandleErrorf(file.NodeInfo(node).Start(), "%v%v", mc, err); err != nil { + if err := handler.HandleErrorf(file.NodeInfo(node), "%v%v", mc, err); err != nil { return err } continue opts @@ -549,7 +549,7 @@ func (r *result) resolveOptionValue(handler *reporter.Handler, mc *internal.Mess scopes := scopes[:1] // first scope is file, the rest are enclosing messages fqn, err := r.resolveExtensionName(string(fld.Name.Name.AsIdentifier()), scopes) if err != nil { - if err := handler.HandleErrorf(r.FileNode().NodeInfo(fld.Name.Name).Start(), "%v%v", mc, err); err != nil { + if err := handler.HandleErrorf(r.FileNode().NodeInfo(fld.Name.Name), "%v%v", mc, err); err != nil { return err } } else { diff --git a/vendor/github.com/bufbuild/protocompile/linker/symbols.go b/vendor/github.com/bufbuild/protocompile/linker/symbols.go index d214eb77ffeb..94baa9cae9c7 100644 --- a/vendor/github.com/bufbuild/protocompile/linker/symbols.go +++ b/vendor/github.com/bufbuild/protocompile/linker/symbols.go @@ -54,7 +54,7 @@ type extNumber struct { } type symbolEntry struct { - pos ast.SourcePos + span ast.SourceSpan isEnumValue bool isPackage bool } @@ -74,13 +74,13 @@ func (s *Symbols) Import(fd protoreflect.FileDescriptor, handler *reporter.Handl fd = f.FileDescriptor } - var pkgPos ast.SourcePos + var pkgSpan ast.SourceSpan if res, ok := fd.(*result); ok { - pkgPos = packageNameStart(res) + pkgSpan = packageNameSpan(res) } else { - pkgPos = sourcePositionForPackage(fd) + pkgSpan = sourceSpanForPackage(fd) } - pkg, err := s.importPackages(pkgPos, fd.Package(), handler) + pkg, err := s.importPackages(pkgSpan, fd.Package(), handler) if err != nil || pkg == nil { return err } @@ -121,9 +121,9 @@ func (s *Symbols) importFileWithExtensions(pkg *packageSymbols, fd protoreflect. if !ok || !fld.IsExtension() { return nil } - pos := sourcePositionForNumber(fld) + span := sourceSpanForNumber(fld) extendee := fld.ContainingMessage() - return s.AddExtension(packageFor(extendee), extendee.FullName(), fld.Number(), pos, handler) + return s.AddExtension(packageFor(extendee), extendee.FullName(), fld.Number(), span, handler) }) } @@ -151,7 +151,7 @@ func (s *packageSymbols) importFile(fd protoreflect.FileDescriptor, handler *rep return true, nil } -func (s *Symbols) importPackages(pkgPos ast.SourcePos, pkg protoreflect.FullName, handler *reporter.Handler) (*packageSymbols, error) { +func (s *Symbols) importPackages(pkgSpan ast.SourceSpan, pkg protoreflect.FullName, handler *reporter.Handler) (*packageSymbols, error) { if pkg == "" { return &s.pkgTrie, nil } @@ -164,7 +164,7 @@ func (s *Symbols) importPackages(pkgPos ast.SourcePos, pkg protoreflect.FullName cur := &s.pkgTrie for _, p := range parts { var err error - cur, err = cur.importPackage(pkgPos, protoreflect.FullName(p), handler) + cur, err = cur.importPackage(pkgSpan, protoreflect.FullName(p), handler) if err != nil { return nil, err } @@ -176,7 +176,7 @@ func (s *Symbols) importPackages(pkgPos ast.SourcePos, pkg protoreflect.FullName return cur, nil } -func (s *packageSymbols) importPackage(pkgPos ast.SourcePos, pkg protoreflect.FullName, handler *reporter.Handler) (*packageSymbols, error) { +func (s *packageSymbols) importPackage(pkgSpan ast.SourceSpan, pkg protoreflect.FullName, handler *reporter.Handler) (*packageSymbols, error) { s.mu.RLock() existing, ok := s.symbols[pkg] var child *packageSymbols @@ -189,7 +189,7 @@ func (s *packageSymbols) importPackage(pkgPos ast.SourcePos, pkg protoreflect.Fu // package already exists return child, nil } else if ok { - return nil, reportSymbolCollision(pkgPos, pkg, false, existing, handler) + return nil, reportSymbolCollision(pkgSpan, pkg, false, existing, handler) } s.mu.Lock() @@ -200,12 +200,12 @@ func (s *packageSymbols) importPackage(pkgPos ast.SourcePos, pkg protoreflect.Fu // package already exists return s.children[pkg], nil } else if ok { - return nil, reportSymbolCollision(pkgPos, pkg, false, existing, handler) + return nil, reportSymbolCollision(pkgSpan, pkg, false, existing, handler) } if s.symbols == nil { s.symbols = map[protoreflect.FullName]symbolEntry{} } - s.symbols[pkg] = symbolEntry{pos: pkgPos, isPackage: true} + s.symbols[pkg] = symbolEntry{span: pkgSpan, isPackage: true} child = &packageSymbols{} if s.children == nil { s.children = map[protoreflect.FullName]*packageSymbols{} @@ -239,7 +239,7 @@ func (s *Symbols) getPackage(pkg protoreflect.FullName) *packageSymbols { return cur } -func reportSymbolCollision(pos ast.SourcePos, fqn protoreflect.FullName, additionIsEnumVal bool, existing symbolEntry, handler *reporter.Handler) error { +func reportSymbolCollision(span ast.SourceSpan, fqn protoreflect.FullName, additionIsEnumVal bool, existing symbolEntry, handler *reporter.Handler) error { // because of weird scoping for enum values, provide more context in error message // if this conflict is with an enum value var isPkg, suffix string @@ -249,12 +249,12 @@ func reportSymbolCollision(pos ast.SourcePos, fqn protoreflect.FullName, additio if existing.isPackage { isPkg = " as a package" } - orig := existing.pos - conflict := pos - if posLess(conflict, orig) { + orig := existing.span + conflict := span + if posLess(conflict.Start(), orig.Start()) { orig, conflict = conflict, orig } - return handler.HandleErrorf(conflict, "symbol %q already defined%s at %v%s", fqn, isPkg, orig, suffix) + return handler.HandleErrorf(conflict, "symbol %q already defined%s at %v%s", fqn, isPkg, orig.Start(), suffix) } func posLess(a, b ast.SourcePos) bool { @@ -269,10 +269,10 @@ func posLess(a, b ast.SourcePos) bool { func (s *packageSymbols) checkFileLocked(f protoreflect.FileDescriptor, handler *reporter.Handler) error { return walk.Descriptors(f, func(d protoreflect.Descriptor) error { - pos := sourcePositionFor(d) + span := sourceSpanFor(d) if existing, ok := s.symbols[d.FullName()]; ok { _, isEnumVal := d.(protoreflect.EnumValueDescriptor) - if err := reportSymbolCollision(pos, d.FullName(), isEnumVal, existing, handler); err != nil { + if err := reportSymbolCollision(span, d.FullName(), isEnumVal, existing, handler); err != nil { return err } } @@ -280,26 +280,33 @@ func (s *packageSymbols) checkFileLocked(f protoreflect.FileDescriptor, handler }) } -func sourcePositionForPackage(fd protoreflect.FileDescriptor) ast.SourcePos { +func sourceSpanForPackage(fd protoreflect.FileDescriptor) ast.SourceSpan { loc := fd.SourceLocations().ByPath([]int32{internal.FilePackageTag}) - if isZeroLoc(loc) { - return ast.UnknownPos(fd.Path()) - } - return ast.SourcePos{ - Filename: fd.Path(), - Line: loc.StartLine, - Col: loc.StartColumn, - } + if internal.IsZeroLocation(loc) { + return ast.UnknownSpan(fd.Path()) + } + return ast.NewSourceSpan( + ast.SourcePos{ + Filename: fd.Path(), + Line: loc.StartLine, + Col: loc.StartColumn, + }, + ast.SourcePos{ + Filename: fd.Path(), + Line: loc.EndLine, + Col: loc.EndColumn, + }, + ) } -func sourcePositionFor(d protoreflect.Descriptor) ast.SourcePos { +func sourceSpanFor(d protoreflect.Descriptor) ast.SourceSpan { file := d.ParentFile() if file == nil { - return ast.UnknownPos(unknownFilePath) + return ast.UnknownSpan(unknownFilePath) } - path, ok := computePath(d) + path, ok := internal.ComputePath(d) if !ok { - return ast.UnknownPos(file.Path()) + return ast.UnknownSpan(file.Path()) } namePath := path switch d.(type) { @@ -322,50 +329,57 @@ func sourcePositionFor(d protoreflect.Descriptor) ast.SourcePos { // descriptor, sans name field } loc := file.SourceLocations().ByPath(namePath) - if isZeroLoc(loc) { + if internal.IsZeroLocation(loc) { loc = file.SourceLocations().ByPath(path) - if isZeroLoc(loc) { - return ast.UnknownPos(file.Path()) + if internal.IsZeroLocation(loc) { + return ast.UnknownSpan(file.Path()) } } - return ast.SourcePos{ - Filename: file.Path(), - Line: loc.StartLine, - Col: loc.StartColumn, - } + + return ast.NewSourceSpan( + ast.SourcePos{ + Filename: file.Path(), + Line: loc.StartLine, + Col: loc.StartColumn, + }, + ast.SourcePos{ + Filename: file.Path(), + Line: loc.EndLine, + Col: loc.EndColumn, + }, + ) } -func sourcePositionForNumber(fd protoreflect.FieldDescriptor) ast.SourcePos { +func sourceSpanForNumber(fd protoreflect.FieldDescriptor) ast.SourceSpan { file := fd.ParentFile() if file == nil { - return ast.UnknownPos(unknownFilePath) + return ast.UnknownSpan(unknownFilePath) } - path, ok := computePath(fd) + path, ok := internal.ComputePath(fd) if !ok { - return ast.UnknownPos(file.Path()) + return ast.UnknownSpan(file.Path()) } numberPath := path numberPath = append(numberPath, internal.FieldNumberTag) loc := file.SourceLocations().ByPath(numberPath) - if isZeroLoc(loc) { + if internal.IsZeroLocation(loc) { loc = file.SourceLocations().ByPath(path) - if isZeroLoc(loc) { - return ast.UnknownPos(file.Path()) + if internal.IsZeroLocation(loc) { + return ast.UnknownSpan(file.Path()) } } - return ast.SourcePos{ - Filename: file.Path(), - Line: loc.StartLine, - Col: loc.StartColumn, - } -} - -func isZeroLoc(loc protoreflect.SourceLocation) bool { - return loc.Path == nil && - loc.StartLine == 0 && - loc.StartColumn == 0 && - loc.EndLine == 0 && - loc.EndColumn == 0 + return ast.NewSourceSpan( + ast.SourcePos{ + Filename: file.Path(), + Line: loc.StartLine, + Col: loc.StartColumn, + }, + ast.SourcePos{ + Filename: file.Path(), + Line: loc.EndLine, + Col: loc.EndColumn, + }, + ) } func (s *packageSymbols) commitFileLocked(f protoreflect.FileDescriptor) { @@ -376,10 +390,10 @@ func (s *packageSymbols) commitFileLocked(f protoreflect.FileDescriptor) { s.exts = map[extNumber]ast.SourcePos{} } _ = walk.Descriptors(f, func(d protoreflect.Descriptor) error { - pos := sourcePositionFor(d) + span := sourceSpanFor(d) name := d.FullName() _, isEnumValue := d.(protoreflect.EnumValueDescriptor) - s.symbols[name] = symbolEntry{pos: pos, isEnumValue: isEnumValue} + s.symbols[name] = symbolEntry{span: span, isEnumValue: isEnumValue} return nil }) @@ -406,14 +420,14 @@ func (s *Symbols) importResultWithExtensions(pkg *packageSymbols, r *result, han } file := r.FileNode() node := r.FieldNode(fd.FieldDescriptorProto()) - pos := file.NodeInfo(node.FieldTag()).Start() + info := file.NodeInfo(node.FieldTag()) extendee := fd.ContainingMessage() - return s.AddExtension(packageFor(extendee), extendee.FullName(), fd.Number(), pos, handler) + return s.AddExtension(packageFor(extendee), extendee.FullName(), fd.Number(), info, handler) }) } func (s *Symbols) importResult(r *result, handler *reporter.Handler) error { - pkg, err := s.importPackages(packageNameStart(r), r.Package(), handler) + pkg, err := s.importPackages(packageNameSpan(r), r.Package(), handler) if err != nil || pkg == nil { return err } @@ -450,22 +464,22 @@ func (s *packageSymbols) checkResultLocked(r *result, handler *reporter.Handler) _, isEnumVal := d.(*descriptorpb.EnumValueDescriptorProto) file := r.FileNode() node := r.Node(d) - pos := nameStart(file, node) + span := nameSpan(file, node) // check symbols already in this symbol table if existing, ok := s.symbols[fqn]; ok { - if err := reportSymbolCollision(pos, fqn, isEnumVal, existing, handler); err != nil { + if err := reportSymbolCollision(span, fqn, isEnumVal, existing, handler); err != nil { return err } } // also check symbols from this result (that are not yet in symbol table) if existing, ok := resultSyms[fqn]; ok { - if err := reportSymbolCollision(pos, fqn, isEnumVal, existing, handler); err != nil { + if err := reportSymbolCollision(span, fqn, isEnumVal, existing, handler); err != nil { return err } } resultSyms[fqn] = symbolEntry{ - pos: pos, + span: span, isEnumValue: isEnumVal, } @@ -473,36 +487,36 @@ func (s *packageSymbols) checkResultLocked(r *result, handler *reporter.Handler) }) } -func packageNameStart(r *result) ast.SourcePos { +func packageNameSpan(r *result) ast.SourceSpan { if node, ok := r.FileNode().(*ast.FileNode); ok { for _, decl := range node.Decls { if pkgNode, ok := decl.(*ast.PackageNode); ok { - return r.FileNode().NodeInfo(pkgNode.Name).Start() + return r.FileNode().NodeInfo(pkgNode.Name) } } } - return ast.UnknownPos(r.Path()) + return ast.UnknownSpan(r.Path()) } -func nameStart(file ast.FileDeclNode, n ast.Node) ast.SourcePos { +func nameSpan(file ast.FileDeclNode, n ast.Node) ast.SourceSpan { // TODO: maybe ast package needs a NamedNode interface to simplify this? switch n := n.(type) { case ast.FieldDeclNode: - return file.NodeInfo(n.FieldName()).Start() + return file.NodeInfo(n.FieldName()) case ast.MessageDeclNode: - return file.NodeInfo(n.MessageName()).Start() + return file.NodeInfo(n.MessageName()) case ast.OneofDeclNode: - return file.NodeInfo(n.OneofName()).Start() + return file.NodeInfo(n.OneofName()) case ast.EnumValueDeclNode: - return file.NodeInfo(n.GetName()).Start() + return file.NodeInfo(n.GetName()) case *ast.EnumNode: - return file.NodeInfo(n.Name).Start() + return file.NodeInfo(n.Name) case *ast.ServiceNode: - return file.NodeInfo(n.Name).Start() + return file.NodeInfo(n.Name) case ast.RPCDeclNode: - return file.NodeInfo(n.GetName()).Start() + return file.NodeInfo(n.GetName()) default: - return file.NodeInfo(n).Start() + return file.NodeInfo(n) } } @@ -514,9 +528,9 @@ func (s *packageSymbols) commitResultLocked(r *result) { s.exts = map[extNumber]ast.SourcePos{} } _ = walk.DescriptorProtos(r.FileDescriptorProto(), func(fqn protoreflect.FullName, d proto.Message) error { - pos := nameStart(r.FileNode(), r.Node(d)) + span := nameSpan(r.FileNode(), r.Node(d)) _, isEnumValue := d.(protoreflect.EnumValueDescriptor) - s.symbols[fqn] = symbolEntry{pos: pos, isEnumValue: isEnumValue} + s.symbols[fqn] = symbolEntry{span: span, isEnumValue: isEnumValue} return nil }) @@ -526,21 +540,21 @@ func (s *packageSymbols) commitResultLocked(r *result) { s.files[r] = struct{}{} } -func (s *Symbols) AddExtension(pkg, extendee protoreflect.FullName, tag protoreflect.FieldNumber, pos ast.SourcePos, handler *reporter.Handler) error { +func (s *Symbols) AddExtension(pkg, extendee protoreflect.FullName, tag protoreflect.FieldNumber, span ast.SourceSpan, handler *reporter.Handler) error { if pkg != "" { if !strings.HasPrefix(string(extendee), string(pkg)+".") { - return handler.HandleErrorf(pos, "could not register extension: extendee %q does not match package %q", extendee, pkg) + return handler.HandleErrorf(span, "could not register extension: extendee %q does not match package %q", extendee, pkg) } } pkgSyms := s.getPackage(pkg) if pkgSyms == nil { // should never happen - return handler.HandleErrorf(pos, "could not register extension: missing package symbols for %q", pkg) + return handler.HandleErrorf(span, "could not register extension: missing package symbols for %q", pkg) } - return pkgSyms.addExtension(extendee, tag, pos, handler) + return pkgSyms.addExtension(extendee, tag, span, handler) } -func (s *packageSymbols) addExtension(extendee protoreflect.FullName, tag protoreflect.FieldNumber, pos ast.SourcePos, handler *reporter.Handler) error { +func (s *packageSymbols) addExtension(extendee protoreflect.FullName, tag protoreflect.FieldNumber, span ast.SourceSpan, handler *reporter.Handler) error { s.mu.Lock() defer s.mu.Unlock() @@ -550,11 +564,11 @@ func (s *packageSymbols) addExtension(extendee protoreflect.FullName, tag protor extNum := extNumber{extendee: extendee, tag: tag} if existing, ok := s.exts[extNum]; ok { - if err := handler.HandleErrorf(pos, "extension with tag %d for message %s already defined at %v", tag, extendee, existing); err != nil { + if err := handler.HandleErrorf(span, "extension with tag %d for message %s already defined at %v", tag, extendee, existing); err != nil { return err } } else { - s.exts[extNum] = pos + s.exts[extNum] = span.Start() } return nil } diff --git a/vendor/github.com/bufbuild/protocompile/linker/validate.go b/vendor/github.com/bufbuild/protocompile/linker/validate.go index 06db6af1f731..32c735905e09 100644 --- a/vendor/github.com/bufbuild/protocompile/linker/validate.go +++ b/vendor/github.com/bufbuild/protocompile/linker/validate.go @@ -25,29 +25,36 @@ import ( "github.com/bufbuild/protocompile/internal" "github.com/bufbuild/protocompile/reporter" + "github.com/bufbuild/protocompile/walk" ) // ValidateOptions runs some validation checks on the result that can only // be done after options are interpreted. func (r *result) ValidateOptions(handler *reporter.Handler) error { - if err := r.validateExtensions(r, handler); err != nil { - return err - } - return r.validateJSONNamesInFile(handler) -} - -func (r *result) validateExtensions(d hasExtensionsAndMessages, handler *reporter.Handler) error { - for i := 0; i < d.Extensions().Len(); i++ { - if err := r.validateExtension(d.Extensions().Get(i), handler); err != nil { - return err - } - } - for i := 0; i < d.Messages().Len(); i++ { - if err := r.validateExtensions(d.Messages().Get(i), handler); err != nil { - return err + return walk.Descriptors(r, func(d protoreflect.Descriptor) error { + switch d := d.(type) { + case protoreflect.FieldDescriptor: + if d.IsExtension() { + if err := r.validateExtension(d, handler); err != nil { + return err + } + } + if err := r.validatePacked(d, handler); err != nil { + return err + } + case protoreflect.MessageDescriptor: + md := d.(*msgDescriptor) //nolint:errcheck + if err := r.validateJSONNamesInMessage(md.proto, handler); err != nil { + return err + } + case protoreflect.EnumDescriptor: + ed := d.(*enumDescriptor) //nolint:errcheck + if err := r.validateJSONNamesInEnum(ed.proto, handler); err != nil { + return err + } } - } - return nil + return nil + }) } func (r *result) validateExtension(fld protoreflect.FieldDescriptor, handler *reporter.Handler) error { @@ -63,37 +70,51 @@ func (r *result) validateExtension(fld protoreflect.FieldDescriptor, handler *re // themselves (no scalar extensions) if fld.Kind() != protoreflect.MessageKind { file := r.FileNode() - pos := file.NodeInfo(r.FieldNode(fd.proto).FieldType()).Start() - return handler.HandleErrorf(pos, "messages with message-set wire format cannot contain scalar extensions, only messages") + info := file.NodeInfo(r.FieldNode(fd.proto).FieldType()) + return handler.HandleErrorf(info, "messages with message-set wire format cannot contain scalar extensions, only messages") } if fld.Cardinality() == protoreflect.Repeated { file := r.FileNode() - pos := file.NodeInfo(r.FieldNode(fd.proto).FieldLabel()).Start() - return handler.HandleErrorf(pos, "messages with message-set wire format cannot contain repeated extensions, only optional") + info := file.NodeInfo(r.FieldNode(fd.proto).FieldLabel()) + return handler.HandleErrorf(info, "messages with message-set wire format cannot contain repeated extensions, only optional") } } else if fld.Number() > internal.MaxNormalTag { // In validateBasic() we just made sure these were within bounds for any message. But // now that things are linked, we can check if the extendee is messageset wire format // and, if not, enforce tighter limit. file := r.FileNode() - pos := file.NodeInfo(r.FieldNode(fd.proto).FieldTag()).Start() - return handler.HandleErrorf(pos, "tag number %d is higher than max allowed tag number (%d)", fld.Number(), internal.MaxNormalTag) + info := file.NodeInfo(r.FieldNode(fd.proto).FieldTag()) + return handler.HandleErrorf(info, "tag number %d is higher than max allowed tag number (%d)", fld.Number(), internal.MaxNormalTag) } return nil } -func (r *result) validateJSONNamesInFile(handler *reporter.Handler) error { - for _, md := range r.FileDescriptorProto().GetMessageType() { - if err := r.validateJSONNamesInMessage(md, handler); err != nil { - return err - } +func (r *result) validatePacked(fld protoreflect.FieldDescriptor, handler *reporter.Handler) error { + if xtd, ok := fld.(protoreflect.ExtensionTypeDescriptor); ok { + fld = xtd.Descriptor() } - for _, ed := range r.FileDescriptorProto().GetEnumType() { - if err := r.validateJSONNamesInEnum(ed, handler); err != nil { + + fd := fld.(*fldDescriptor) //nolint:errcheck + if !fd.proto.GetOptions().GetPacked() { + // if packed isn't true, nothing to validate + return nil + } + if fd.proto.GetLabel() != descriptorpb.FieldDescriptorProto_LABEL_REPEATED { + file := r.FileNode() + info := file.NodeInfo(r.FieldNode(fd.proto).FieldLabel()) + err := handler.HandleErrorf(info, "packed option is only allowed on repeated fields") + if err != nil { return err } } + switch fd.proto.GetType() { + case descriptorpb.FieldDescriptorProto_TYPE_STRING, descriptorpb.FieldDescriptorProto_TYPE_BYTES, + descriptorpb.FieldDescriptorProto_TYPE_MESSAGE, descriptorpb.FieldDescriptorProto_TYPE_GROUP: + file := r.FileNode() + info := file.NodeInfo(r.FieldNode(fd.proto).FieldType()) + return handler.HandleErrorf(info, "packed option is only allowed on numeric, boolean, and enum fields") + } return nil } @@ -132,8 +153,8 @@ func (r *result) validateJSONNamesInEnum(ed *descriptorpb.EnumDescriptorProto, h // Since proto2 did not originally have a JSON format, we report conflicts as just warnings if r.Syntax() != protoreflect.Proto3 { - handler.HandleWarningWithPos(r.FileNode().NodeInfo(fldNode).Start(), conflictErr) - } else if err := handler.HandleErrorf(r.FileNode().NodeInfo(fldNode).Start(), conflictErr.Error()); err != nil { + handler.HandleWarningWithPos(r.FileNode().NodeInfo(fldNode), conflictErr) + } else if err := handler.HandleErrorf(r.FileNode().NodeInfo(fldNode), conflictErr.Error()); err != nil { return err } } else { @@ -176,8 +197,8 @@ func (r *result) validateFieldJSONNames(md *descriptorpb.DescriptorProto, useCus if !existing.custom { srcCustomStr = "default" } - pos := r.FileNode().NodeInfo(fldNode).Start() - conflictErr := reporter.Errorf(pos, "%s: %s JSON name %q conflicts with %s JSON name of field %s, defined at %v", + info := r.FileNode().NodeInfo(fldNode) + conflictErr := reporter.Errorf(info, "%s: %s JSON name %q conflicts with %s JSON name of field %s, defined at %v", scope, customStr, name, srcCustomStr, existing.source.GetName(), r.FileNode().NodeInfo(r.FieldNode(existing.source)).Start()) // Since proto2 did not originally have default JSON names, we report conflicts diff --git a/vendor/github.com/bufbuild/protocompile/options/options.go b/vendor/github.com/bufbuild/protocompile/options/options.go index fd1813d47a5f..222fe8e169e0 100644 --- a/vendor/github.com/bufbuild/protocompile/options/options.go +++ b/vendor/github.com/bufbuild/protocompile/options/options.go @@ -49,6 +49,16 @@ import ( "github.com/bufbuild/protocompile/sourceinfo" ) +const ( + // featuresFieldName is the name of a field in every options message. + featuresFieldName = "features" +) + +var ( + featureSetType = (*descriptorpb.FeatureSet)(nil).ProtoReflect().Type() + featureSetName = featureSetType.Descriptor().FullName() +) + type interpreter struct { file file resolver linker.Resolver @@ -144,15 +154,9 @@ func interpretOptions(lenient bool, file file, res linker.Resolver, handler *rep if prefix != "" { prefix += "." } - opts := fd.GetOptions() - if opts != nil { - if len(opts.UninterpretedOption) > 0 { - remain, err := interp.interpretOptions(fd.GetName(), fd, opts, opts.UninterpretedOption) - if err != nil { - return nil, err - } - opts.UninterpretedOption = remain - } + err := interpretElementOptions(&interp, fd.GetName(), targetTypeFile, fd) + if err != nil { + return nil, err } for _, md := range fd.GetMessageType() { fqn := prefix + md.GetName() @@ -174,23 +178,15 @@ func interpretOptions(lenient bool, file file, res linker.Resolver, handler *rep } for _, sd := range fd.GetService() { fqn := prefix + sd.GetName() - opts := sd.GetOptions() - if len(opts.GetUninterpretedOption()) > 0 { - remain, err := interp.interpretOptions(fqn, sd, opts, opts.UninterpretedOption) - if err != nil { - return nil, err - } - opts.UninterpretedOption = remain + err := interpretElementOptions(&interp, fqn, targetTypeService, sd) + if err != nil { + return nil, err } for _, mtd := range sd.GetMethod() { mtdFqn := fqn + "." + mtd.GetName() - opts := mtd.GetOptions() - if len(opts.GetUninterpretedOption()) > 0 { - remain, err := interp.interpretOptions(mtdFqn, mtd, opts, opts.UninterpretedOption) - if err != nil { - return nil, err - } - opts.UninterpretedOption = remain + err := interpretElementOptions(&interp, mtdFqn, targetTypeMethod, mtd) + if err != nil { + return nil, err } } } @@ -250,15 +246,9 @@ func (interp *interpreter) nodeInfo(n ast.Node) ast.NodeInfo { } func (interp *interpreter) interpretMessageOptions(fqn string, md *descriptorpb.DescriptorProto) error { - opts := md.GetOptions() - if opts != nil { - if len(opts.UninterpretedOption) > 0 { - remain, err := interp.interpretOptions(fqn, md, opts, opts.UninterpretedOption) - if err != nil { - return err - } - opts.UninterpretedOption = remain - } + err := interpretElementOptions(interp, fqn, targetTypeMessage, md) + if err != nil { + return err } for _, fld := range md.GetField() { fldFqn := fqn + "." + fld.GetName() @@ -268,13 +258,9 @@ func (interp *interpreter) interpretMessageOptions(fqn string, md *descriptorpb. } for _, ood := range md.GetOneofDecl() { oodFqn := fqn + "." + ood.GetName() - opts := ood.GetOptions() - if len(opts.GetUninterpretedOption()) > 0 { - remain, err := interp.interpretOptions(oodFqn, ood, opts, opts.UninterpretedOption) - if err != nil { - return err - } - opts.UninterpretedOption = remain + err := interpretElementOptions(interp, oodFqn, targetTypeOneof, ood) + if err != nil { + return err } } for _, fld := range md.GetExtension() { @@ -285,13 +271,9 @@ func (interp *interpreter) interpretMessageOptions(fqn string, md *descriptorpb. } for _, er := range md.GetExtensionRange() { erFqn := fmt.Sprintf("%s.%d-%d", fqn, er.GetStart(), er.GetEnd()) - opts := er.GetOptions() - if len(opts.GetUninterpretedOption()) > 0 { - remain, err := interp.interpretOptions(erFqn, er, opts, opts.UninterpretedOption) - if err != nil { - return err - } - opts.UninterpretedOption = remain + err := interpretElementOptions(interp, erFqn, targetTypeExtensionRange, er) + if err != nil { + return err } } for _, nmd := range md.GetNestedType() { @@ -306,16 +288,75 @@ func (interp *interpreter) interpretMessageOptions(fqn string, md *descriptorpb. return err } } + + // We also copy features for map fields down to their synthesized key and value fields. + for _, fld := range md.GetField() { + entryName := internal.InitCap(internal.JSONName(fld.GetName())) + "Entry" + if fld.GetLabel() != descriptorpb.FieldDescriptorProto_LABEL_REPEATED || + fld.GetType() != descriptorpb.FieldDescriptorProto_TYPE_MESSAGE && + fld.GetTypeName() != "."+fqn+"."+entryName { + // can't be a map field + continue + } + if fld.Options == nil || fld.Options.Features == nil { + // no features to propagate + continue + } + for _, nmd := range md.GetNestedType() { + if nmd.GetName() == entryName { + // found the entry message + if !nmd.GetOptions().GetMapEntry() { + break // not a map + } + for _, mapField := range nmd.Field { + if mapField.Options == nil { + mapField.Options = &descriptorpb.FieldOptions{} + } + features := proto.Clone(fld.Options.Features).(*descriptorpb.FeatureSet) //nolint:errcheck + if mapField.Options.Features != nil { + proto.Merge(features, mapField.Options.Features) + } + mapField.Options.Features = features + } + break + } + } + } + return nil } +var emptyFieldOptions = &descriptorpb.FieldOptions{} + func (interp *interpreter) interpretFieldOptions(fqn string, fld *descriptorpb.FieldDescriptorProto) error { opts := fld.GetOptions() + emptyOptionsAlreadyPresent := opts != nil && len(opts.GetUninterpretedOption()) == 0 + + // First process pseudo-options + if len(opts.GetUninterpretedOption()) > 0 { + if err := interp.interpretFieldPseudoOptions(fqn, fld, opts); err != nil { + return err + } + } + + // Must re-check length of uninterpreted options since above step could remove some. if len(opts.GetUninterpretedOption()) == 0 { + // If the message has no other interpreted options, we clear it out. But don't + // do that if the descriptor came in with empty options or if it already has + // interpreted option fields. + if opts != nil && !emptyOptionsAlreadyPresent && proto.Equal(fld.Options, emptyFieldOptions) { + fld.Options = nil + } return nil } - uo := opts.UninterpretedOption + + // Then process actual options. + return interpretElementOptions(interp, fqn, targetTypeField, fld) +} + +func (interp *interpreter) interpretFieldPseudoOptions(fqn string, fld *descriptorpb.FieldDescriptorProto, opts *descriptorpb.FieldOptions) error { scope := fmt.Sprintf("field %s", fqn) + uo := opts.UninterpretedOption // process json_name pseudo-option index, err := internal.FindOption(interp.file, interp.reporter, scope, uo, "json_name") @@ -326,13 +367,13 @@ func (interp *interpreter) interpretFieldOptions(fqn string, fld *descriptorpb.F opt := uo[index] optNode := interp.file.OptionNode(opt) if opt.StringValue == nil { - return interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetValue()).Start(), "%s: expecting string value for json_name option", scope) + return interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetValue()), "%s: expecting string value for json_name option", scope) } jsonName := string(opt.StringValue) // Extensions don't support custom json_name values. // If the value is already set (via the descriptor) and doesn't match the default value, return an error. if fld.GetExtendee() != "" && jsonName != "" && jsonName != internal.JSONName(fld.GetName()) { - return interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetName()).Start(), "%s: option json_name is not allowed on extensions", scope) + return interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetName()), "%s: option json_name is not allowed on extensions", scope) } // attribute source code info if on, ok := optNode.(*ast.OptionNode); ok { @@ -340,7 +381,7 @@ func (interp *interpreter) interpretFieldOptions(fqn string, fld *descriptorpb.F } uo = internal.RemoveOption(uo, index) if strings.HasPrefix(jsonName, "[") && strings.HasSuffix(jsonName, "]") { - return interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetValue()).Start(), "%s: option json_name value cannot start with '[' and end with ']'; that is reserved for representing extensions", scope) + return interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetValue()), "%s: option json_name value cannot start with '[' and end with ']'; that is reserved for representing extensions", scope) } fld.JsonName = proto.String(jsonName) } @@ -357,14 +398,7 @@ func (interp *interpreter) interpretFieldOptions(fqn string, fld *descriptorpb.F uo = internal.RemoveOption(uo, index) } - if len(uo) == 0 { - // no real options, only pseudo-options above? clear out options - fld.Options = nil - } else if remain, err := interp.interpretOptions(fqn, fld, opts, uo); err != nil { - return err - } else { - opts.UninterpretedOption = remain - } + opts.UninterpretedOption = uo return nil } @@ -376,10 +410,10 @@ func (interp *interpreter) processDefaultOption(scope string, fqn string, fld *d opt := uos[found] optNode := interp.file.OptionNode(opt) if fld.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_REPEATED { - return -1, interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetName()).Start(), "%s: default value cannot be set because field is repeated", scope) + return -1, interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetName()), "%s: default value cannot be set because field is repeated", scope) } if fld.GetType() == descriptorpb.FieldDescriptorProto_TYPE_GROUP || fld.GetType() == descriptorpb.FieldDescriptorProto_TYPE_MESSAGE { - return -1, interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetName()).Start(), "%s: default value cannot be set because field is a message", scope) + return -1, interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetName()), "%s: default value cannot be set because field is a message", scope) } mc := &internal.MessageContext{ File: interp.file, @@ -434,12 +468,12 @@ func (interp *interpreter) processDefaultOption(scope string, fqn string, fld *d func (interp *interpreter) defaultValue(mc *internal.MessageContext, fld *descriptorpb.FieldDescriptorProto, val ast.ValueNode) (interface{}, error) { if _, ok := val.(*ast.MessageLiteralNode); ok { - return -1, reporter.Errorf(interp.nodeInfo(val).Start(), "%vdefault value cannot be a message", mc) + return -1, reporter.Errorf(interp.nodeInfo(val), "%vdefault value cannot be a message", mc) } if fld.GetType() == descriptorpb.FieldDescriptorProto_TYPE_ENUM { ed := resolveDescriptor[protoreflect.EnumDescriptor](interp.resolver, fld.GetTypeName()) if ed == nil { - return -1, reporter.Errorf(interp.nodeInfo(val).Start(), "%vunable to resolve enum type %q for field %q", mc, fld.GetTypeName(), fld.GetName()) + return -1, reporter.Errorf(interp.nodeInfo(val), "%vunable to resolve enum type %q for field %q", mc, fld.GetTypeName(), fld.GetName()) } _, name, err := interp.enumFieldValue(mc, ed, val, false) if err != nil { @@ -452,12 +486,12 @@ func (interp *interpreter) defaultValue(mc *internal.MessageContext, fld *descri func (interp *interpreter) defaultValueFromProto(mc *internal.MessageContext, fld *descriptorpb.FieldDescriptorProto, opt *descriptorpb.UninterpretedOption, node ast.Node) (interface{}, error) { if opt.AggregateValue != nil { - return -1, reporter.Errorf(interp.nodeInfo(node).Start(), "%vdefault value cannot be a message", mc) + return -1, reporter.Errorf(interp.nodeInfo(node), "%vdefault value cannot be a message", mc) } if fld.GetType() == descriptorpb.FieldDescriptorProto_TYPE_ENUM { ed := resolveDescriptor[protoreflect.EnumDescriptor](interp.resolver, fld.GetTypeName()) if ed == nil { - return -1, reporter.Errorf(interp.nodeInfo(node).Start(), "%vunable to resolve enum type %q for field %q", mc, fld.GetTypeName(), fld.GetName()) + return -1, reporter.Errorf(interp.nodeInfo(node), "%vunable to resolve enum type %q for field %q", mc, fld.GetTypeName(), fld.GetName()) } _, name, err := interp.enumFieldValueFromProto(mc, ed, opt, node) if err != nil { @@ -475,25 +509,15 @@ func encodeDefaultBytes(b []byte) string { } func (interp *interpreter) interpretEnumOptions(fqn string, ed *descriptorpb.EnumDescriptorProto) error { - opts := ed.GetOptions() - if opts != nil { - if len(opts.UninterpretedOption) > 0 { - remain, err := interp.interpretOptions(fqn, ed, opts, opts.UninterpretedOption) - if err != nil { - return err - } - opts.UninterpretedOption = remain - } + err := interpretElementOptions(interp, fqn, targetTypeEnum, ed) + if err != nil { + return err } for _, evd := range ed.GetValue() { evdFqn := fqn + "." + evd.GetName() - opts := evd.GetOptions() - if len(opts.GetUninterpretedOption()) > 0 { - remain, err := interp.interpretOptions(evdFqn, evd, opts, opts.UninterpretedOption) - if err != nil { - return err - } - opts.UninterpretedOption = remain + err := interpretElementOptions(interp, evdFqn, targetTypeEnumValue, evd) + if err != nil { + return err } } return nil @@ -811,12 +835,35 @@ type optionsContainer interface { AddOptionBytes(pm proto.Message, opts []byte) } +func interpretElementOptions[Elem elementType[OptsStruct, Opts], OptsStruct any, Opts optionsType[OptsStruct]]( + interp *interpreter, + fqn string, + target *targetType[Elem, OptsStruct, Opts], + elem Elem, +) error { + opts := elem.GetOptions() + uo := opts.GetUninterpretedOption() + if len(uo) > 0 { + remain, err := interp.interpretOptions(fqn, target.t, elem, opts, uo) + if err != nil { + return err + } + target.setUninterpretedOptions(opts, remain) + } + return nil +} + // interpretOptions processes the options in uninterpreted, which are interpreted as fields -// of the given opts message. On success, it will usually return nil, nil. But if the current +// of the given opts message. The first return value is the features to use for child elements. +// On success, the latter two return values will usually be nil, nil. But if the current // operation is lenient, it may return a non-nil slice of uninterpreted options on success. -// In such a case, the returned value is the remaining slice of options which could not be -// interpreted. -func (interp *interpreter) interpretOptions(fqn string, element, opts proto.Message, uninterpreted []*descriptorpb.UninterpretedOption) ([]*descriptorpb.UninterpretedOption, error) { +// In such a case, the returned slice contains the options which could not be interpreted. +func (interp *interpreter) interpretOptions( + fqn string, + targetType descriptorpb.FieldOptions_OptionTargetType, + element, opts proto.Message, + uninterpreted []*descriptorpb.UninterpretedOption, +) ([]*descriptorpb.UninterpretedOption, error) { optsDesc := opts.ProtoReflect().Descriptor() optsFqn := string(optsDesc.FullName()) var msg protoreflect.Message @@ -825,7 +872,7 @@ func (interp *interpreter) interpretOptions(fqn string, element, opts proto.Mess dm := dynamicpb.NewMessage(md) if err := cloneInto(dm, opts, nil); err != nil { node := interp.file.Node(element) - return nil, interp.reporter.HandleError(reporter.Error(interp.nodeInfo(node).Start(), err)) + return nil, interp.reporter.HandleError(reporter.Error(interp.nodeInfo(node), err)) } msg = dm } else { @@ -839,6 +886,7 @@ func (interp *interpreter) interpretOptions(fqn string, element, opts proto.Mess } var remain []*descriptorpb.UninterpretedOption results := make([]*interpretedOption, 0, len(uninterpreted)) + var featuresInfo []*interpretedOption for _, uo := range uninterpreted { node := interp.file.OptionNode(uo) if !uo.Name[0].GetIsExtension() && uo.Name[0].GetNamePart() == "uninterpreted_option" { @@ -847,7 +895,7 @@ func (interp *interpreter) interpretOptions(fqn string, element, opts proto.Mess continue } // uninterpreted_option might be found reflectively, but is not actually valid for use - if err := interp.reporter.HandleErrorf(interp.nodeInfo(node.GetName()).Start(), "%vinvalid option 'uninterpreted_option'", mc); err != nil { + if err := interp.reporter.HandleErrorf(interp.nodeInfo(node.GetName()), "%vinvalid option 'uninterpreted_option'", mc); err != nil { return nil, err } } @@ -862,11 +910,19 @@ func (interp *interpreter) interpretOptions(fqn string, element, opts proto.Mess } res.unknown = !isKnownField(optsDesc, res) results = append(results, res) + if !uo.Name[0].GetIsExtension() && uo.Name[0].GetNamePart() == featuresFieldName { + featuresInfo = append(featuresInfo, res) + } if optn, ok := node.(*ast.OptionNode); ok { - interp.index[optn] = res.toSourceInfo() + si := res.toSourceInfo() + interp.index[optn] = si } } + if err := interp.validateFeatures(targetType, msg, featuresInfo); err != nil && !interp.lenient { + return nil, err + } + if interp.lenient { // If we're lenient, then we don't want to clobber the passed in message // and leave it partially populated. So we convert into a copy first @@ -895,7 +951,7 @@ func (interp *interpreter) interpretOptions(fqn string, element, opts proto.Mess if err := validateRecursive(msg, ""); err != nil { node := interp.file.Node(element) - if err := interp.reporter.HandleErrorf(interp.nodeInfo(node).Start(), "error in %s options: %v", descriptorType(element), err); err != nil { + if err := interp.reporter.HandleErrorf(interp.nodeInfo(node), "error in %s options: %v", descriptorType(element), err); err != nil { return nil, err } } @@ -903,8 +959,9 @@ func (interp *interpreter) interpretOptions(fqn string, element, opts proto.Mess // now try to convert into the passed in message and fail if not successful if err := cloneInto(opts, msg.Interface(), interp.resolver); err != nil { node := interp.file.Node(element) - return nil, interp.reporter.HandleError(reporter.Error(interp.nodeInfo(node).Start(), err)) + return nil, interp.reporter.HandleError(reporter.Error(interp.nodeInfo(node), err)) } + if interp.container != nil { b, err := interp.toOptionBytes(mc, results) if err != nil { @@ -916,6 +973,109 @@ func (interp *interpreter) interpretOptions(fqn string, element, opts proto.Mess return nil, nil } +func (interp *interpreter) validateFeatures( + targetType descriptorpb.FieldOptions_OptionTargetType, + opts protoreflect.Message, + featuresInfo []*interpretedOption, +) error { + fld := opts.Descriptor().Fields().ByName(featuresFieldName) + if fld == nil { + // no features to resolve + return nil + } + if fld.IsList() || fld.Message() == nil || fld.Message().FullName() != featureSetName { + // features field doesn't look right... abort + // TODO: should this return an error? + return nil + } + features := opts.Get(fld).Message() + var err error + features.Range(func(featureField protoreflect.FieldDescriptor, _ protoreflect.Value) bool { + opts, ok := featureField.Options().(*descriptorpb.FieldOptions) + if !ok { + return true + } + targetTypes := opts.GetTargets() + var allowed bool + for _, allowedType := range targetTypes { + if allowedType == targetType { + allowed = true + break + } + } + if !allowed { + allowedTypes := make([]string, len(targetTypes)) + for i, t := range opts.Targets { + allowedTypes[i] = targetTypeString(t) + } + pos := interp.positionOfFeature(featuresInfo, fld.Number(), featureField.Number()) + if len(opts.Targets) == 1 && opts.Targets[0] == descriptorpb.FieldOptions_TARGET_TYPE_UNKNOWN { + err = interp.reporter.HandleErrorf(pos, "feature field %q may not be used explicitly", featureField.Name()) + } else { + err = interp.reporter.HandleErrorf(pos, "feature %q is allowed on [%s], not on %s", featureField.Name(), strings.Join(allowedTypes, ","), targetTypeString(targetType)) + } + } + return err == nil + }) + return err +} + +func (interp *interpreter) positionOfFeature(featuresInfo []*interpretedOption, fieldNumbers ...protoreflect.FieldNumber) ast.SourceSpan { + if interp.file.AST() == nil { + return ast.UnknownSpan(interp.file.FileDescriptorProto().GetName()) + } + for _, info := range featuresInfo { + matched, remainingNumbers, node := matchInterpretedOption(info, fieldNumbers) + if !matched { + continue + } + if len(remainingNumbers) > 0 { + node = findInterpretedFieldForFeature(&(info.interpretedField), remainingNumbers) + } + if node != nil { + return interp.file.FileNode().NodeInfo(node) + } + } + return ast.UnknownSpan(interp.file.FileDescriptorProto().GetName()) +} + +func matchInterpretedOption(info *interpretedOption, path []protoreflect.FieldNumber) (bool, []protoreflect.FieldNumber, ast.Node) { + for i := 0; i < len(path) && i < len(info.pathPrefix); i++ { + if info.pathPrefix[i] != int32(path[i]) { + return false, nil, nil + } + } + if len(path) <= len(info.pathPrefix) { + // no more path elements to match + node := info.node + if optsNode, ok := node.(*ast.OptionNode); ok { + // Do we need to check this? It should always be true... + if len(optsNode.Name.Parts) == len(info.pathPrefix)+1 { + node = optsNode.Name.Parts[len(path)-1] + } + } + return true, nil, node + } + if info.number != int32(path[len(info.pathPrefix)]) { + return false, nil, nil + } + return true, path[len(info.pathPrefix)+1:], info.node +} + +func findInterpretedFieldForFeature(opt *interpretedField, path []protoreflect.FieldNumber) ast.Node { + if len(path) == 0 { + return opt.node + } + for _, fld := range opt.value.msgVal { + if fld.number == int32(path[0]) { + if res := findInterpretedFieldForFeature(fld, path[1:]); res != nil { + return res + } + } + } + return nil +} + // isKnownField returns true if the given option is for a known field of the // given options message descriptor and will be serialized using the expected // wire type for that known field. @@ -978,6 +1138,10 @@ func wireTypeForKind(kind protoreflect.Kind) protowire.Type { } } +func targetTypeString(t descriptorpb.FieldOptions_OptionTargetType) string { + return strings.ToLower(strings.ReplaceAll(strings.TrimPrefix(t.String(), "TARGET_TYPE_"), "_", " ")) +} + func cloneInto(dest proto.Message, src proto.Message, res linker.Resolver) error { if dest.ProtoReflect().Descriptor() == src.ProtoReflect().Descriptor() { proto.Reset(dest) @@ -1013,8 +1177,8 @@ func (interp *interpreter) toOptionBytes(mc *internal.MessageContext, results [] b, err = res.appendOptionBytes(b) if err != nil { if _, ok := err.(reporter.ErrorWithPos); !ok { - pos := ast.SourcePos{Filename: interp.file.AST().Name()} - err = reporter.Errorf(pos, "%sfailed to encode options: %w", mc, err) + span := ast.UnknownSpan(interp.file.AST().Name()) + err = reporter.Errorf(span, "%sfailed to encode options: %w", mc, err) } if err := interp.reporter.HandleError(err); err != nil { return nil, err @@ -1095,21 +1259,21 @@ func (interp *interpreter) interpretField(mc *internal.MessageContext, msg proto var err error fld, err = interp.resolveExtensionType(extName) if errors.Is(err, protoregistry.NotFound) { - return nil, interp.reporter.HandleErrorf(interp.nodeInfo(node).Start(), + return nil, interp.reporter.HandleErrorf(interp.nodeInfo(node), "%vunrecognized extension %s of %s", mc, extName, msg.Descriptor().FullName()) } else if err != nil { - return nil, interp.reporter.HandleErrorWithPos(interp.nodeInfo(node).Start(), err) + return nil, interp.reporter.HandleErrorWithPos(interp.nodeInfo(node), err) } if fld.ContainingMessage().FullName() != msg.Descriptor().FullName() { - return nil, interp.reporter.HandleErrorf(interp.nodeInfo(node).Start(), + return nil, interp.reporter.HandleErrorf(interp.nodeInfo(node), "%vextension %s should extend %s but instead extends %s", mc, extName, msg.Descriptor().FullName(), fld.ContainingMessage().FullName()) } } else { fld = msg.Descriptor().Fields().ByName(protoreflect.Name(nm.GetNamePart())) if fld == nil { - return nil, interp.reporter.HandleErrorf(interp.nodeInfo(node).Start(), + return nil, interp.reporter.HandleErrorf(interp.nodeInfo(node), "%vfield %s of %s does not exist", mc, nm.GetNamePart(), msg.Descriptor().FullName()) } @@ -1120,12 +1284,12 @@ func (interp *interpreter) interpretField(mc *internal.MessageContext, msg proto nextnode := interp.file.OptionNamePartNode(nextnm) k := fld.Kind() if k != protoreflect.MessageKind && k != protoreflect.GroupKind { - return nil, interp.reporter.HandleErrorf(interp.nodeInfo(nextnode).Start(), + return nil, interp.reporter.HandleErrorf(interp.nodeInfo(nextnode), "%vcannot set field %s because %s is not a message", mc, nextnm.GetNamePart(), nm.GetNamePart()) } if fld.Cardinality() == protoreflect.Repeated { - return nil, interp.reporter.HandleErrorf(interp.nodeInfo(nextnode).Start(), + return nil, interp.reporter.HandleErrorf(interp.nodeInfo(nextnode), "%vcannot set field %s because %s is repeated (must use an aggregate)", mc, nextnm.GetNamePart(), nm.GetNamePart()) } @@ -1137,13 +1301,14 @@ func (interp *interpreter) interpretField(mc *internal.MessageContext, msg proto if ood := fld.ContainingOneof(); ood != nil { existingFld := msg.WhichOneof(ood) if existingFld != nil && existingFld.Number() != fld.Number() { - return nil, interp.reporter.HandleErrorf(interp.nodeInfo(node).Start(), + return nil, interp.reporter.HandleErrorf(interp.nodeInfo(node), "%voneof %q already has field %q set", mc, ood.Name(), fieldName(existingFld)) } } - fdm = dynamicpb.NewMessage(fld.Message()) - msg.Set(fld, protoreflect.ValueOfMessage(fdm)) + fldVal := msg.NewField(fld) + fdm = fldVal.Message() + msg.Set(fld, fldVal) } // recurse to set next part of name return interp.interpretField(mc, fdm, opt, nameIndex+1, append(pathPrefix, int32(fld.Number()))) @@ -1189,7 +1354,7 @@ func (interp *interpreter) setOptionField(mc *internal.MessageContext, msg proto if sl, ok := v.([]ast.ValueNode); ok { // handle slices a little differently than the others if fld.Cardinality() != protoreflect.Repeated { - return interpretedFieldValue{}, 0, reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue is an array but field is not repeated", mc) + return interpretedFieldValue{}, 0, reporter.Errorf(interp.nodeInfo(val), "%vvalue is an array but field is not repeated", mc) } origPath := mc.OptAggPath defer func() { @@ -1200,7 +1365,7 @@ func (interp *interpreter) setOptionField(mc *internal.MessageContext, msg proto var firstIndex int for index, item := range sl { mc.OptAggPath = fmt.Sprintf("%s[%d]", origPath, index) - value, err := interp.fieldValue(mc, fld, item, insideMsgLiteral) + value, err := interp.fieldValue(mc, msg, fld, item, insideMsgLiteral) if err != nil { return interpretedFieldValue{}, 0, err } @@ -1209,7 +1374,7 @@ func (interp *interpreter) setOptionField(mc *internal.MessageContext, msg proto if index == 0 { firstIndex = mv.Len() } - setMapEntry(fld, mv, &value) + setMapEntry(fld, msg, mv, &value) } else { lv := msg.Mutable(fld).List() if index == 0 { @@ -1229,7 +1394,7 @@ func (interp *interpreter) setOptionField(mc *internal.MessageContext, msg proto }, firstIndex, nil } - value, err := interp.fieldValue(mc, fld, val, insideMsgLiteral) + value, err := interp.fieldValue(mc, msg, fld, val, insideMsgLiteral) if err != nil { return interpretedFieldValue{}, 0, err } @@ -1237,7 +1402,7 @@ func (interp *interpreter) setOptionField(mc *internal.MessageContext, msg proto if ood := fld.ContainingOneof(); ood != nil { existingFld := msg.WhichOneof(ood) if existingFld != nil && existingFld.Number() != fld.Number() { - return interpretedFieldValue{}, 0, reporter.Errorf(interp.nodeInfo(name).Start(), "%voneof %q already has field %q set", mc, ood.Name(), fieldName(existingFld)) + return interpretedFieldValue{}, 0, reporter.Errorf(interp.nodeInfo(name), "%voneof %q already has field %q set", mc, ood.Name(), fieldName(existingFld)) } } @@ -1246,14 +1411,14 @@ func (interp *interpreter) setOptionField(mc *internal.MessageContext, msg proto case fld.IsMap(): mv := msg.Mutable(fld).Map() index = mv.Len() - setMapEntry(fld, mv, &value) + setMapEntry(fld, msg, mv, &value) case fld.IsList(): lv := msg.Mutable(fld).List() index = lv.Len() lv.Append(value.val) default: if msg.Has(fld) { - return interpretedFieldValue{}, 0, reporter.Errorf(interp.nodeInfo(name).Start(), "%vnon-repeated option field %s already set", mc, fieldName(fld)) + return interpretedFieldValue{}, 0, reporter.Errorf(interp.nodeInfo(name), "%vnon-repeated option field %s already set", mc, fieldName(fld)) } msg.Set(fld, value.val) } @@ -1277,7 +1442,7 @@ func (interp *interpreter) setOptionFieldFromProto(mc *internal.MessageContext, case protoreflect.MessageKind, protoreflect.GroupKind: if opt.AggregateValue == nil { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(node).Start(), "%vexpecting message, got %s", mc, optionValueKind(opt)) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(node), "%vexpecting message, got %s", mc, optionValueKind(opt)) } // We must parse the text format from the aggregate value string fmd := fld.Message() @@ -1287,13 +1452,13 @@ func (interp *interpreter) setOptionFieldFromProto(mc *internal.MessageContext, AllowPartial: true, }.Unmarshal([]byte(opt.GetAggregateValue()), tmpMsg) if err != nil { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(node).Start(), "%vfailed to parse message literal %w", mc, err) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(node), "%vfailed to parse message literal %w", mc, err) } msgData, err := proto.MarshalOptions{ AllowPartial: true, }.Marshal(tmpMsg) if err != nil { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(node).Start(), "%vfailed to serialize data from message literal %w", mc, err) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(node), "%vfailed to serialize data from message literal %w", mc, err) } var data []byte if k == protoreflect.GroupKind { @@ -1320,14 +1485,14 @@ func (interp *interpreter) setOptionFieldFromProto(mc *internal.MessageContext, if ood := fld.ContainingOneof(); ood != nil { existingFld := msg.WhichOneof(ood) if existingFld != nil && existingFld.Number() != fld.Number() { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(name).Start(), "%voneof %q already has field %q set", mc, ood.Name(), fieldName(existingFld)) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(name), "%voneof %q already has field %q set", mc, ood.Name(), fieldName(existingFld)) } } switch { case value.preserialized != nil: if !fld.IsList() && !fld.IsMap() && msg.Has(fld) { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(name).Start(), "%vnon-repeated option field %s already set", mc, fieldName(fld)) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(name), "%vnon-repeated option field %s already set", mc, fieldName(fld)) } // We have to merge the bytes for this field into the message. // TODO: if a map field, error if key for this entry already set? @@ -1337,20 +1502,20 @@ func (interp *interpreter) setOptionFieldFromProto(mc *internal.MessageContext, Merge: true, }.Unmarshal(value.preserialized, msg.Interface()) if err != nil { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(name).Start(), "%v failed to set value for field %v: %w", mc, fieldName(fld), err) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(name), "%v failed to set value for field %v: %w", mc, fieldName(fld), err) } case fld.IsList(): msg.Mutable(fld).List().Append(value.val) default: if msg.Has(fld) { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(name).Start(), "%vnon-repeated option field %s already set", mc, fieldName(fld)) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(name), "%vnon-repeated option field %s already set", mc, fieldName(fld)) } msg.Set(fld, value.val) } return value, nil } -func setMapEntry(fld protoreflect.FieldDescriptor, mapVal protoreflect.Map, value *interpretedFieldValue) { +func setMapEntry(fld protoreflect.FieldDescriptor, msg protoreflect.Message, mapVal protoreflect.Map, value *interpretedFieldValue) { entry := value.val.Message() keyFld, valFld := fld.MapKey(), fld.MapValue() // if an entry is missing a key or value, we add in an explicit @@ -1365,8 +1530,27 @@ func setMapEntry(fld protoreflect.FieldDescriptor, mapVal protoreflect.Map, valu } key := entry.Get(keyFld) val := entry.Get(valFld) - if dm, ok := val.Interface().(*dynamicpb.Message); ok && (dm == nil || !dm.IsValid()) { - val = protoreflect.ValueOfMessage(dynamicpb.NewMessage(valFld.Message())) + if fld.MapValue().Kind() == protoreflect.MessageKind { + // Replace any nil/invalid values with an empty message + dm, valIsDynamic := val.Interface().(*dynamicpb.Message) + if (valIsDynamic && dm == nil) || !val.Message().IsValid() { + val = protoreflect.ValueOfMessage(dynamicpb.NewMessage(valFld.Message())) + } + _, containerIsDynamic := msg.Interface().(*dynamicpb.Message) + if valIsDynamic && !containerIsDynamic { + // This happens because we create dynamic messages to represent map entries, + // but the container of the map may expect a non-dynamic, generated type. + dest := mapVal.NewValue() + _, destIsDynamic := dest.Message().Interface().(*dynamicpb.Message) + if !destIsDynamic { + // reflection Set methods do not support cases where destination is + // generated but source is dynamic (or vice versa). But proto.Merge + // *DOES* support that, as long as dest and source use the same + // descriptor. + proto.Merge(dest.Message().Interface(), val.Message().Interface()) + val = dest + } + } } // TODO: error if key is already present mapVal.Set(key.MapKey(), val) @@ -1552,7 +1736,7 @@ func optionValueKind(opt *descriptorpb.UninterpretedOption) string { // fieldValue computes a compile-time value (constant or list or message literal) for the given // AST node val. The value in val must be assignable to the field fld. -func (interp *interpreter) fieldValue(mc *internal.MessageContext, fld protoreflect.FieldDescriptor, val ast.ValueNode, insideMsgLiteral bool) (interpretedFieldValue, error) { +func (interp *interpreter) fieldValue(mc *internal.MessageContext, msg protoreflect.Message, fld protoreflect.FieldDescriptor, val ast.ValueNode, insideMsgLiteral bool) (interpretedFieldValue, error) { k := fld.Kind() switch k { case protoreflect.EnumKind: @@ -1565,10 +1749,22 @@ func (interp *interpreter) fieldValue(mc *internal.MessageContext, fld protorefl case protoreflect.MessageKind, protoreflect.GroupKind: v := val.Value() if aggs, ok := v.([]*ast.MessageFieldNode); ok { - fmd := fld.Message() - return interp.messageLiteralValue(mc, aggs, fmd) + var childMsg protoreflect.Message + switch { + case fld.IsList(): + // List of messages + val := msg.NewField(fld) + childMsg = val.List().NewElement().Message() + case fld.IsMap(): + // No generated type for map entries, so we use a dynamic type + childMsg = dynamicpb.NewMessage(fld.Message()) + default: + // Normal message field + childMsg = msg.NewField(fld).Message() + } + return interp.messageLiteralValue(mc, aggs, childMsg) } - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting message, got %s", mc, valueKind(v)) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(val), "%vexpecting message, got %s", mc, valueKind(v)) default: v, err := interp.scalarFieldValue(mc, descriptorpb.FieldDescriptorProto_Type(k), val, insideMsgLiteral) @@ -1589,34 +1785,34 @@ func (interp *interpreter) enumFieldValue(mc *internal.MessageContext, ed protor name := protoreflect.Name(v) ev := ed.Values().ByName(name) if ev == nil { - return 0, "", reporter.Errorf(interp.nodeInfo(val).Start(), "%venum %s has no value named %s", mc, ed.FullName(), v) + return 0, "", reporter.Errorf(interp.nodeInfo(val), "%venum %s has no value named %s", mc, ed.FullName(), v) } return ev.Number(), name, nil case int64: if !allowNumber { - return 0, "", reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting enum name, got %s", mc, valueKind(v)) + return 0, "", reporter.Errorf(interp.nodeInfo(val), "%vexpecting enum name, got %s", mc, valueKind(v)) } if v > math.MaxInt32 || v < math.MinInt32 { - return 0, "", reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for an enum", mc, v) + return 0, "", reporter.Errorf(interp.nodeInfo(val), "%vvalue %d is out of range for an enum", mc, v) } num = protoreflect.EnumNumber(v) case uint64: if !allowNumber { - return 0, "", reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting enum name, got %s", mc, valueKind(v)) + return 0, "", reporter.Errorf(interp.nodeInfo(val), "%vexpecting enum name, got %s", mc, valueKind(v)) } if v > math.MaxInt32 { - return 0, "", reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for an enum", mc, v) + return 0, "", reporter.Errorf(interp.nodeInfo(val), "%vvalue %d is out of range for an enum", mc, v) } num = protoreflect.EnumNumber(v) default: - return 0, "", reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting enum, got %s", mc, valueKind(v)) + return 0, "", reporter.Errorf(interp.nodeInfo(val), "%vexpecting enum, got %s", mc, valueKind(v)) } ev := ed.Values().ByNumber(num) if ev != nil { return num, ev.Name(), nil } if ed.Syntax() != protoreflect.Proto3 { - return 0, "", reporter.Errorf(interp.nodeInfo(val).Start(), "%vclosed enum %s has no value with number %d", mc, ed.FullName(), num) + return 0, "", reporter.Errorf(interp.nodeInfo(val), "%vclosed enum %s has no value with number %d", mc, ed.FullName(), num) } // unknown value, but enum is open, so we allow it and return blank name return num, "", nil @@ -1633,11 +1829,11 @@ func (interp *interpreter) enumFieldValueFromProto(mc *internal.MessageContext, name := protoreflect.Name(opt.GetIdentifierValue()) ev := ed.Values().ByName(name) if ev == nil { - return 0, "", reporter.Errorf(interp.nodeInfo(node).Start(), "%venum %s has no value named %s", mc, ed.FullName(), name) + return 0, "", reporter.Errorf(interp.nodeInfo(node), "%venum %s has no value named %s", mc, ed.FullName(), name) } return ev.Number(), name, nil default: - return 0, "", reporter.Errorf(interp.nodeInfo(node).Start(), "%vexpecting enum, got %s", mc, optionValueKind(opt)) + return 0, "", reporter.Errorf(interp.nodeInfo(node), "%vexpecting enum, got %s", mc, optionValueKind(opt)) } } @@ -1670,67 +1866,67 @@ func (interp *interpreter) scalarFieldValue(mc *internal.MessageContext, fldType } } } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting bool, got %s", mc, valueKind(v)) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vexpecting bool, got %s", mc, valueKind(v)) case descriptorpb.FieldDescriptorProto_TYPE_BYTES: if str, ok := v.(string); ok { return []byte(str), nil } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting bytes, got %s", mc, valueKind(v)) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vexpecting bytes, got %s", mc, valueKind(v)) case descriptorpb.FieldDescriptorProto_TYPE_STRING: if str, ok := v.(string); ok { return str, nil } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting string, got %s", mc, valueKind(v)) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vexpecting string, got %s", mc, valueKind(v)) case descriptorpb.FieldDescriptorProto_TYPE_INT32, descriptorpb.FieldDescriptorProto_TYPE_SINT32, descriptorpb.FieldDescriptorProto_TYPE_SFIXED32: if i, ok := v.(int64); ok { if i > math.MaxInt32 || i < math.MinInt32 { - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for int32", mc, i) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vvalue %d is out of range for int32", mc, i) } return int32(i), nil } if ui, ok := v.(uint64); ok { if ui > math.MaxInt32 { - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for int32", mc, ui) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vvalue %d is out of range for int32", mc, ui) } return int32(ui), nil } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting int32, got %s", mc, valueKind(v)) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vexpecting int32, got %s", mc, valueKind(v)) case descriptorpb.FieldDescriptorProto_TYPE_UINT32, descriptorpb.FieldDescriptorProto_TYPE_FIXED32: if i, ok := v.(int64); ok { if i > math.MaxUint32 || i < 0 { - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for uint32", mc, i) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vvalue %d is out of range for uint32", mc, i) } return uint32(i), nil } if ui, ok := v.(uint64); ok { if ui > math.MaxUint32 { - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for uint32", mc, ui) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vvalue %d is out of range for uint32", mc, ui) } return uint32(ui), nil } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting uint32, got %s", mc, valueKind(v)) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vexpecting uint32, got %s", mc, valueKind(v)) case descriptorpb.FieldDescriptorProto_TYPE_INT64, descriptorpb.FieldDescriptorProto_TYPE_SINT64, descriptorpb.FieldDescriptorProto_TYPE_SFIXED64: if i, ok := v.(int64); ok { return i, nil } if ui, ok := v.(uint64); ok { if ui > math.MaxInt64 { - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for int64", mc, ui) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vvalue %d is out of range for int64", mc, ui) } return int64(ui), nil } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting int64, got %s", mc, valueKind(v)) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vexpecting int64, got %s", mc, valueKind(v)) case descriptorpb.FieldDescriptorProto_TYPE_UINT64, descriptorpb.FieldDescriptorProto_TYPE_FIXED64: if i, ok := v.(int64); ok { if i < 0 { - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for uint64", mc, i) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vvalue %d is out of range for uint64", mc, i) } return uint64(i), nil } if ui, ok := v.(uint64); ok { return ui, nil } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting uint64, got %s", mc, valueKind(v)) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vexpecting uint64, got %s", mc, valueKind(v)) case descriptorpb.FieldDescriptorProto_TYPE_DOUBLE: if id, ok := v.(ast.Identifier); ok { switch id { @@ -1749,7 +1945,7 @@ func (interp *interpreter) scalarFieldValue(mc *internal.MessageContext, fldType if u, ok := v.(uint64); ok { return float64(u), nil } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting double, got %s", mc, valueKind(v)) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vexpecting double, got %s", mc, valueKind(v)) case descriptorpb.FieldDescriptorProto_TYPE_FLOAT: if id, ok := v.(ast.Identifier); ok { switch id { @@ -1768,9 +1964,9 @@ func (interp *interpreter) scalarFieldValue(mc *internal.MessageContext, fldType if u, ok := v.(uint64); ok { return float32(u), nil } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting float, got %s", mc, valueKind(v)) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vexpecting float, got %s", mc, valueKind(v)) default: - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vunrecognized field type: %s", mc, fldType) + return nil, reporter.Errorf(interp.nodeInfo(val), "%vunrecognized field type: %s", mc, fldType) } } @@ -1787,49 +1983,49 @@ func (interp *interpreter) scalarFieldValueFromProto(mc *internal.MessageContext return false, nil } } - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vexpecting bool, got %s", mc, optionValueKind(opt)) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vexpecting bool, got %s", mc, optionValueKind(opt)) case descriptorpb.FieldDescriptorProto_TYPE_BYTES: if opt.StringValue != nil { return opt.GetStringValue(), nil } - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vexpecting bytes, got %s", mc, optionValueKind(opt)) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vexpecting bytes, got %s", mc, optionValueKind(opt)) case descriptorpb.FieldDescriptorProto_TYPE_STRING: if opt.StringValue != nil { return string(opt.GetStringValue()), nil } - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vexpecting string, got %s", mc, optionValueKind(opt)) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vexpecting string, got %s", mc, optionValueKind(opt)) case descriptorpb.FieldDescriptorProto_TYPE_INT32, descriptorpb.FieldDescriptorProto_TYPE_SINT32, descriptorpb.FieldDescriptorProto_TYPE_SFIXED32: if opt.NegativeIntValue != nil { i := opt.GetNegativeIntValue() if i > math.MaxInt32 || i < math.MinInt32 { - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vvalue %d is out of range for int32", mc, i) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vvalue %d is out of range for int32", mc, i) } return int32(i), nil } if opt.PositiveIntValue != nil { ui := opt.GetPositiveIntValue() if ui > math.MaxInt32 { - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vvalue %d is out of range for int32", mc, ui) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vvalue %d is out of range for int32", mc, ui) } return int32(ui), nil } - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vexpecting int32, got %s", mc, optionValueKind(opt)) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vexpecting int32, got %s", mc, optionValueKind(opt)) case descriptorpb.FieldDescriptorProto_TYPE_UINT32, descriptorpb.FieldDescriptorProto_TYPE_FIXED32: if opt.NegativeIntValue != nil { i := opt.GetNegativeIntValue() if i > math.MaxUint32 || i < 0 { - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vvalue %d is out of range for uint32", mc, i) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vvalue %d is out of range for uint32", mc, i) } return uint32(i), nil } if opt.PositiveIntValue != nil { ui := opt.GetPositiveIntValue() if ui > math.MaxUint32 { - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vvalue %d is out of range for uint32", mc, ui) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vvalue %d is out of range for uint32", mc, ui) } return uint32(ui), nil } - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vexpecting uint32, got %s", mc, optionValueKind(opt)) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vexpecting uint32, got %s", mc, optionValueKind(opt)) case descriptorpb.FieldDescriptorProto_TYPE_INT64, descriptorpb.FieldDescriptorProto_TYPE_SINT64, descriptorpb.FieldDescriptorProto_TYPE_SFIXED64: if opt.NegativeIntValue != nil { return opt.GetNegativeIntValue(), nil @@ -1837,16 +2033,16 @@ func (interp *interpreter) scalarFieldValueFromProto(mc *internal.MessageContext if opt.PositiveIntValue != nil { ui := opt.GetPositiveIntValue() if ui > math.MaxInt64 { - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vvalue %d is out of range for int64", mc, ui) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vvalue %d is out of range for int64", mc, ui) } return int64(ui), nil } - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vexpecting int64, got %s", mc, optionValueKind(opt)) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vexpecting int64, got %s", mc, optionValueKind(opt)) case descriptorpb.FieldDescriptorProto_TYPE_UINT64, descriptorpb.FieldDescriptorProto_TYPE_FIXED64: if opt.NegativeIntValue != nil { i := opt.GetNegativeIntValue() if i < 0 { - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vvalue %d is out of range for uint64", mc, i) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vvalue %d is out of range for uint64", mc, i) } // should not be possible since i should always be negative... return uint64(i), nil @@ -1854,7 +2050,7 @@ func (interp *interpreter) scalarFieldValueFromProto(mc *internal.MessageContext if opt.PositiveIntValue != nil { return opt.GetPositiveIntValue(), nil } - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vexpecting uint64, got %s", mc, optionValueKind(opt)) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vexpecting uint64, got %s", mc, optionValueKind(opt)) case descriptorpb.FieldDescriptorProto_TYPE_DOUBLE: if opt.IdentifierValue != nil { switch opt.GetIdentifierValue() { @@ -1873,7 +2069,7 @@ func (interp *interpreter) scalarFieldValueFromProto(mc *internal.MessageContext if opt.PositiveIntValue != nil { return float64(opt.GetPositiveIntValue()), nil } - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vexpecting double, got %s", mc, optionValueKind(opt)) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vexpecting double, got %s", mc, optionValueKind(opt)) case descriptorpb.FieldDescriptorProto_TYPE_FLOAT: if opt.IdentifierValue != nil { switch opt.GetIdentifierValue() { @@ -1892,9 +2088,9 @@ func (interp *interpreter) scalarFieldValueFromProto(mc *internal.MessageContext if opt.PositiveIntValue != nil { return float32(opt.GetPositiveIntValue()), nil } - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vexpecting float, got %s", mc, optionValueKind(opt)) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vexpecting float, got %s", mc, optionValueKind(opt)) default: - return nil, reporter.Errorf(interp.nodeInfo(node).Start(), "%vunrecognized field type: %s", mc, fldType) + return nil, reporter.Errorf(interp.nodeInfo(node), "%vunrecognized field type: %s", mc, fldType) } } @@ -1925,8 +2121,8 @@ func descriptorType(m proto.Message) string { } } -func (interp *interpreter) messageLiteralValue(mc *internal.MessageContext, fieldNodes []*ast.MessageFieldNode, fmd protoreflect.MessageDescriptor) (interpretedFieldValue, error) { - fdm := dynamicpb.NewMessage(fmd) +func (interp *interpreter) messageLiteralValue(mc *internal.MessageContext, fieldNodes []*ast.MessageFieldNode, msg protoreflect.Message) (interpretedFieldValue, error) { + fmd := msg.Descriptor() origPath := mc.OptAggPath defer func() { mc.OptAggPath = origPath @@ -1944,34 +2140,34 @@ func (interp *interpreter) messageLiteralValue(mc *internal.MessageContext, fiel } if fieldNode.Name.IsAnyTypeReference() { if fmd.FullName() != "google.protobuf.Any" { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name.URLPrefix).Start(), "%vtype references are only allowed for google.protobuf.Any, but this type is %s", mc, fmd.FullName()) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name.URLPrefix), "%vtype references are only allowed for google.protobuf.Any, but this type is %s", mc, fmd.FullName()) } if foundAnyNode { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name.URLPrefix).Start(), "%vmultiple any type references are not allowed", mc) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name.URLPrefix), "%vmultiple any type references are not allowed", mc) } foundAnyNode = true urlPrefix := fieldNode.Name.URLPrefix.AsIdentifier() msgName := fieldNode.Name.Name.AsIdentifier() fullURL := fmt.Sprintf("%s/%s", urlPrefix, msgName) - // TODO: Support other URLs dynamically -- the caller of protoparse - // should be able to provide a fldNode custom resolver that can resolve type + // TODO: Support other URLs dynamically -- the caller of protocompile + // should be able to provide a custom resolver that can resolve type // URLs into message descriptors. The default resolver would be // implemented as below, only accepting "type.googleapis.com" and // "type.googleprod.com" as hosts/prefixes and using the compiled // file's transitive closure to find the named message. if urlPrefix != "type.googleapis.com" && urlPrefix != "type.googleprod.com" { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name.URLPrefix).Start(), "%vcould not resolve type reference %s", mc, fullURL) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name.URLPrefix), "%vcould not resolve type reference %s", mc, fullURL) } anyFields, ok := fieldNode.Val.Value().([]*ast.MessageFieldNode) if !ok { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Val).Start(), "%vtype references for google.protobuf.Any must have message literal value", mc) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Val), "%vtype references for google.protobuf.Any must have message literal value", mc) } anyMd := resolveDescriptor[protoreflect.MessageDescriptor](interp.resolver, string(msgName)) if anyMd == nil { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name.URLPrefix).Start(), "%vcould not resolve type reference %s", mc, fullURL) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name.URLPrefix), "%vcould not resolve type reference %s", mc, fullURL) } // parse the message value - msgVal, err := interp.messageLiteralValue(mc, anyFields, anyMd) + msgVal, err := interp.messageLiteralValue(mc, anyFields, dynamicpb.NewMessage(anyMd)) if err != nil { return interpretedFieldValue{}, err } @@ -1981,18 +2177,18 @@ func (interp *interpreter) messageLiteralValue(mc *internal.MessageContext, fiel // bytes value = 2 typeURLDescriptor := fmd.Fields().ByNumber(1) if typeURLDescriptor == nil || typeURLDescriptor.Kind() != protoreflect.StringKind { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name).Start(), "%vfailed to set type_url string field on Any: %w", mc, err) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name), "%vfailed to set type_url string field on Any: %w", mc, err) } - fdm.Set(typeURLDescriptor, protoreflect.ValueOfString(fullURL)) + msg.Set(typeURLDescriptor, protoreflect.ValueOfString(fullURL)) valueDescriptor := fmd.Fields().ByNumber(2) if valueDescriptor == nil || valueDescriptor.Kind() != protoreflect.BytesKind { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name).Start(), "%vfailed to set value bytes field on Any: %w", mc, err) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name), "%vfailed to set value bytes field on Any: %w", mc, err) } b, err := proto.MarshalOptions{Deterministic: true}.Marshal(msgVal.val.Message().Interface()) if err != nil { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Val).Start(), "%vfailed to serialize message value: %w", mc, err) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Val), "%vfailed to serialize message value: %w", mc, err) } - fdm.Set(valueDescriptor, protoreflect.ValueOfBytes(b)) + msg.Set(valueDescriptor, protoreflect.ValueOfBytes(b)) } else { var ffld protoreflect.FieldDescriptor var err error @@ -2018,7 +2214,7 @@ func (interp *interpreter) messageLiteralValue(mc *internal.MessageContext, fiel // ...but only regular fields, not extensions that are groups... if ffld != nil && ffld.Kind() == protoreflect.GroupKind && ffld.Message().Name() != protoreflect.Name(fieldNode.Name.Value()) { // this is kind of silly to fail here, but this mimics protoc behavior - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name).Start(), "%vfield %s not found (did you mean the group named %s?)", mc, fieldNode.Name.Value(), ffld.Message().Name()) + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name), "%vfield %s not found (did you mean the group named %s?)", mc, fieldNode.Name.Value(), ffld.Message().Name()) } if ffld == nil { err = protoregistry.NotFound @@ -2035,17 +2231,17 @@ func (interp *interpreter) messageLiteralValue(mc *internal.MessageContext, fiel } } if errors.Is(err, protoregistry.NotFound) { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name).Start(), + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name), "%vfield %s not found", mc, string(fieldNode.Name.Name.AsIdentifier())) } else if err != nil { - return interpretedFieldValue{}, reporter.Error(interp.nodeInfo(fieldNode.Name).Start(), err) + return interpretedFieldValue{}, reporter.Error(interp.nodeInfo(fieldNode.Name), err) } if fieldNode.Sep == nil && ffld.Message() == nil { // If there is no separator, the field type should be a message. // Otherwise it is an error in the text format. - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Val).Start(), "syntax error: unexpected value, expecting ':'") + return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Val), "syntax error: unexpected value, expecting ':'") } - res, index, err := interp.setOptionField(mc, fdm, ffld, fieldNode.Name, fieldNode.Val, true) + res, index, err := interp.setOptionField(mc, msg, ffld, fieldNode.Name, fieldNode.Val, true) if err != nil { return interpretedFieldValue{}, err } @@ -2061,7 +2257,7 @@ func (interp *interpreter) messageLiteralValue(mc *internal.MessageContext, fiel } } return interpretedFieldValue{ - val: protoreflect.ValueOfMessage(fdm), + val: protoreflect.ValueOfMessage(msg), msgVal: flds, }, nil } diff --git a/vendor/github.com/bufbuild/protocompile/options/target_types.go b/vendor/github.com/bufbuild/protocompile/options/target_types.go new file mode 100644 index 000000000000..5604eeba403f --- /dev/null +++ b/vendor/github.com/bufbuild/protocompile/options/target_types.go @@ -0,0 +1,152 @@ +// Copyright 2020-2023 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package options + +import ( + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/descriptorpb" +) + +type optionsType[T any] interface { + *T + proto.Message + GetFeatures() *descriptorpb.FeatureSet + GetUninterpretedOption() []*descriptorpb.UninterpretedOption +} + +type elementType[OptsStruct any, Opts optionsType[OptsStruct]] interface { + proto.Message + GetOptions() Opts +} + +type targetType[Elem elementType[OptsStruct, Opts], OptsStruct any, Opts optionsType[OptsStruct]] struct { + t descriptorpb.FieldOptions_OptionTargetType + setUninterpretedOptions func(opts Opts, uninterpreted []*descriptorpb.UninterpretedOption) + setOptions func(elem Elem, opts Opts) +} + +var ( + targetTypeFile = newTargetType[*descriptorpb.FileDescriptorProto]( + descriptorpb.FieldOptions_TARGET_TYPE_FILE, setUninterpretedFileOptions, setFileOptions, + ) + targetTypeMessage = newTargetType[*descriptorpb.DescriptorProto]( + descriptorpb.FieldOptions_TARGET_TYPE_MESSAGE, setUninterpretedMessageOptions, setMessageOptions, + ) + targetTypeField = newTargetType[*descriptorpb.FieldDescriptorProto]( + descriptorpb.FieldOptions_TARGET_TYPE_FIELD, setUninterpretedFieldOptions, setFieldOptions, + ) + targetTypeOneof = newTargetType[*descriptorpb.OneofDescriptorProto]( + descriptorpb.FieldOptions_TARGET_TYPE_ONEOF, setUninterpretedOneofOptions, setOneofOptions, + ) + targetTypeExtensionRange = newTargetType[*descriptorpb.DescriptorProto_ExtensionRange]( + descriptorpb.FieldOptions_TARGET_TYPE_EXTENSION_RANGE, setUninterpretedExtensionRangeOptions, setExtensionRangeOptions, + ) + targetTypeEnum = newTargetType[*descriptorpb.EnumDescriptorProto]( + descriptorpb.FieldOptions_TARGET_TYPE_ENUM, setUninterpretedEnumOptions, setEnumOptions, + ) + targetTypeEnumValue = newTargetType[*descriptorpb.EnumValueDescriptorProto]( + descriptorpb.FieldOptions_TARGET_TYPE_ENUM_ENTRY, setUninterpretedEnumValueOptions, setEnumValueOptions, + ) + targetTypeService = newTargetType[*descriptorpb.ServiceDescriptorProto]( + descriptorpb.FieldOptions_TARGET_TYPE_SERVICE, setUninterpretedServiceOptions, setServiceOptions, + ) + targetTypeMethod = newTargetType[*descriptorpb.MethodDescriptorProto]( + descriptorpb.FieldOptions_TARGET_TYPE_METHOD, setUninterpretedMethodOptions, setMethodOptions, + ) +) + +func newTargetType[Elem elementType[OptsStruct, Opts], OptsStruct any, Opts optionsType[OptsStruct]]( + t descriptorpb.FieldOptions_OptionTargetType, + setUninterpretedOptions func(opts Opts, uninterpreted []*descriptorpb.UninterpretedOption), + setOptions func(elem Elem, opts Opts), +) *targetType[Elem, OptsStruct, Opts] { + return &targetType[Elem, OptsStruct, Opts]{ + t: t, + setUninterpretedOptions: setUninterpretedOptions, + setOptions: setOptions, + } +} + +func setUninterpretedFileOptions(opts *descriptorpb.FileOptions, uninterpreted []*descriptorpb.UninterpretedOption) { + opts.UninterpretedOption = uninterpreted +} + +func setUninterpretedMessageOptions(opts *descriptorpb.MessageOptions, uninterpreted []*descriptorpb.UninterpretedOption) { + opts.UninterpretedOption = uninterpreted +} + +func setUninterpretedFieldOptions(opts *descriptorpb.FieldOptions, uninterpreted []*descriptorpb.UninterpretedOption) { + opts.UninterpretedOption = uninterpreted +} + +func setUninterpretedOneofOptions(opts *descriptorpb.OneofOptions, uninterpreted []*descriptorpb.UninterpretedOption) { + opts.UninterpretedOption = uninterpreted +} + +func setUninterpretedExtensionRangeOptions(opts *descriptorpb.ExtensionRangeOptions, uninterpreted []*descriptorpb.UninterpretedOption) { + opts.UninterpretedOption = uninterpreted +} + +func setUninterpretedEnumOptions(opts *descriptorpb.EnumOptions, uninterpreted []*descriptorpb.UninterpretedOption) { + opts.UninterpretedOption = uninterpreted +} + +func setUninterpretedEnumValueOptions(opts *descriptorpb.EnumValueOptions, uninterpreted []*descriptorpb.UninterpretedOption) { + opts.UninterpretedOption = uninterpreted +} + +func setUninterpretedServiceOptions(opts *descriptorpb.ServiceOptions, uninterpreted []*descriptorpb.UninterpretedOption) { + opts.UninterpretedOption = uninterpreted +} + +func setUninterpretedMethodOptions(opts *descriptorpb.MethodOptions, uninterpreted []*descriptorpb.UninterpretedOption) { + opts.UninterpretedOption = uninterpreted +} + +func setFileOptions(desc *descriptorpb.FileDescriptorProto, opts *descriptorpb.FileOptions) { + desc.Options = opts +} + +func setMessageOptions(desc *descriptorpb.DescriptorProto, opts *descriptorpb.MessageOptions) { + desc.Options = opts +} + +func setFieldOptions(desc *descriptorpb.FieldDescriptorProto, opts *descriptorpb.FieldOptions) { + desc.Options = opts +} + +func setOneofOptions(desc *descriptorpb.OneofDescriptorProto, opts *descriptorpb.OneofOptions) { + desc.Options = opts +} + +func setExtensionRangeOptions(desc *descriptorpb.DescriptorProto_ExtensionRange, opts *descriptorpb.ExtensionRangeOptions) { + desc.Options = opts +} + +func setEnumOptions(desc *descriptorpb.EnumDescriptorProto, opts *descriptorpb.EnumOptions) { + desc.Options = opts +} + +func setEnumValueOptions(desc *descriptorpb.EnumValueDescriptorProto, opts *descriptorpb.EnumValueOptions) { + desc.Options = opts +} + +func setServiceOptions(desc *descriptorpb.ServiceDescriptorProto, opts *descriptorpb.ServiceOptions) { + desc.Options = opts +} + +func setMethodOptions(desc *descriptorpb.MethodDescriptorProto, opts *descriptorpb.MethodOptions) { + desc.Options = opts +} diff --git a/vendor/github.com/bufbuild/protocompile/parser/ast.go b/vendor/github.com/bufbuild/protocompile/parser/ast.go index ac6dd9f4a1ea..a22c14730a1d 100644 --- a/vendor/github.com/bufbuild/protocompile/parser/ast.go +++ b/vendor/github.com/bufbuild/protocompile/parser/ast.go @@ -32,7 +32,9 @@ func toStringValueNode(strs []*ast.StringLiteralNode) ast.StringValueNode { } type nameSlices struct { + // only names or idents will be set, never both names []ast.StringValueNode + idents []*ast.IdentNode commas []*ast.RuneNode } @@ -88,3 +90,113 @@ func (list *messageFieldList) toNodes() ([]*ast.MessageFieldNode, []*ast.RuneNod } return fields, delimiters } + +func newEmptyDeclNodes(semicolons []*ast.RuneNode) []*ast.EmptyDeclNode { + emptyDecls := make([]*ast.EmptyDeclNode, len(semicolons)) + for i, semicolon := range semicolons { + emptyDecls[i] = ast.NewEmptyDeclNode(semicolon) + } + return emptyDecls +} + +func newServiceElements(semicolons []*ast.RuneNode, elements []ast.ServiceElement) []ast.ServiceElement { + elems := make([]ast.ServiceElement, 0, len(semicolons)+len(elements)) + for _, semicolon := range semicolons { + elems = append(elems, ast.NewEmptyDeclNode(semicolon)) + } + elems = append(elems, elements...) + return elems +} + +func newMethodElements(semicolons []*ast.RuneNode, elements []ast.RPCElement) []ast.RPCElement { + elems := make([]ast.RPCElement, 0, len(semicolons)+len(elements)) + for _, semicolon := range semicolons { + elems = append(elems, ast.NewEmptyDeclNode(semicolon)) + } + elems = append(elems, elements...) + return elems +} + +func newFileElements(semicolons []*ast.RuneNode, elements []ast.FileElement) []ast.FileElement { + elems := make([]ast.FileElement, 0, len(semicolons)+len(elements)) + for _, semicolon := range semicolons { + elems = append(elems, ast.NewEmptyDeclNode(semicolon)) + } + elems = append(elems, elements...) + return elems +} + +func newEnumElements(semicolons []*ast.RuneNode, elements []ast.EnumElement) []ast.EnumElement { + elems := make([]ast.EnumElement, 0, len(semicolons)+len(elements)) + for _, semicolon := range semicolons { + elems = append(elems, ast.NewEmptyDeclNode(semicolon)) + } + elems = append(elems, elements...) + return elems +} + +func newMessageElements(semicolons []*ast.RuneNode, elements []ast.MessageElement) []ast.MessageElement { + elems := make([]ast.MessageElement, 0, len(semicolons)+len(elements)) + for _, semicolon := range semicolons { + elems = append(elems, ast.NewEmptyDeclNode(semicolon)) + } + elems = append(elems, elements...) + return elems +} + +type nodeWithEmptyDecls[T ast.Node] struct { + Node T + EmptyDecls []*ast.EmptyDeclNode +} + +func newNodeWithEmptyDecls[T ast.Node](node T, extraSemicolons []*ast.RuneNode) nodeWithEmptyDecls[T] { + return nodeWithEmptyDecls[T]{ + Node: node, + EmptyDecls: newEmptyDeclNodes(extraSemicolons), + } +} + +func toServiceElements[T ast.ServiceElement](nodes nodeWithEmptyDecls[T]) []ast.ServiceElement { + elements := make([]ast.ServiceElement, 1+len(nodes.EmptyDecls)) + elements[0] = nodes.Node + for i, emptyDecl := range nodes.EmptyDecls { + elements[i+1] = emptyDecl + } + return elements +} + +func toMethodElements[T ast.RPCElement](nodes nodeWithEmptyDecls[T]) []ast.RPCElement { + elements := make([]ast.RPCElement, 1+len(nodes.EmptyDecls)) + elements[0] = nodes.Node + for i, emptyDecl := range nodes.EmptyDecls { + elements[i+1] = emptyDecl + } + return elements +} + +func toFileElements[T ast.FileElement](nodes nodeWithEmptyDecls[T]) []ast.FileElement { + elements := make([]ast.FileElement, 1+len(nodes.EmptyDecls)) + elements[0] = nodes.Node + for i, emptyDecl := range nodes.EmptyDecls { + elements[i+1] = emptyDecl + } + return elements +} + +func toEnumElements[T ast.EnumElement](nodes nodeWithEmptyDecls[T]) []ast.EnumElement { + elements := make([]ast.EnumElement, 1+len(nodes.EmptyDecls)) + elements[0] = nodes.Node + for i, emptyDecl := range nodes.EmptyDecls { + elements[i+1] = emptyDecl + } + return elements +} + +func toMessageElements[T ast.MessageElement](nodes nodeWithEmptyDecls[T]) []ast.MessageElement { + elements := make([]ast.MessageElement, 1+len(nodes.EmptyDecls)) + elements[0] = nodes.Node + for i, emptyDecl := range nodes.EmptyDecls { + elements[i+1] = emptyDecl + } + return elements +} diff --git a/vendor/github.com/bufbuild/protocompile/parser/lexer.go b/vendor/github.com/bufbuild/protocompile/parser/lexer.go index fcc59780b5a6..a98b0cd81184 100644 --- a/vendor/github.com/bufbuild/protocompile/parser/lexer.go +++ b/vendor/github.com/bufbuild/protocompile/parser/lexer.go @@ -113,6 +113,7 @@ func newLexer(in io.Reader, filename string, handler *reporter.Handler) (*protoL var keywords = map[string]int{ "syntax": _SYNTAX, + "edition": _EDITION, "import": _IMPORT, "weak": _WEAK, "public": _PUBLIC, @@ -741,7 +742,8 @@ func (l *protoLex) skipToEndOfBlockComment(lval *protoSymType) (ok, hasErr bool) func (l *protoLex) addSourceError(err error) (reporter.ErrorWithPos, bool) { ewp, ok := err.(reporter.ErrorWithPos) if !ok { - ewp = reporter.Error(l.prev(), err) + // TODO: Store the previous span instead of just the position. + ewp = reporter.Error(ast.NewSourceSpan(l.prev(), l.prev()), err) } handlerErr := l.handler.HandleError(ewp) return ewp, handlerErr == nil @@ -751,10 +753,19 @@ func (l *protoLex) Error(s string) { _, _ = l.addSourceError(errors.New(s)) } +// TODO: Accept both a start and end offset, and use that to create a span. func (l *protoLex) errWithCurrentPos(err error, offset int) reporter.ErrorWithPos { if ewp, ok := err.(reporter.ErrorWithPos); ok { return ewp } pos := l.info.SourcePos(l.input.offset() + offset) - return reporter.Error(pos, err) + return reporter.Error(ast.NewSourceSpan(pos, pos), err) +} + +func (l *protoLex) requireSemicolon(semicolons []*ast.RuneNode) (*ast.RuneNode, []*ast.RuneNode) { + if len(semicolons) == 0 { + l.Error("expected ';'") + return nil, nil + } + return semicolons[0], semicolons[1:] } diff --git a/vendor/github.com/bufbuild/protocompile/parser/proto.y b/vendor/github.com/bufbuild/protocompile/parser/proto.y index ac87d7b65c8d..151fa4e6cc57 100644 --- a/vendor/github.com/bufbuild/protocompile/parser/proto.y +++ b/vendor/github.com/bufbuild/protocompile/parser/proto.y @@ -16,37 +16,36 @@ import ( %union{ file *ast.FileNode syn *ast.SyntaxNode - fileElement ast.FileElement + ed *ast.EditionNode fileElements []ast.FileElement - pkg *ast.PackageNode - imprt *ast.ImportNode - msg *ast.MessageNode - msgElement ast.MessageElement + pkg nodeWithEmptyDecls[*ast.PackageNode] + imprt nodeWithEmptyDecls[*ast.ImportNode] + msg nodeWithEmptyDecls[*ast.MessageNode] msgElements []ast.MessageElement fld *ast.FieldNode - mapFld *ast.MapFieldNode + msgFld nodeWithEmptyDecls[*ast.FieldNode] + mapFld nodeWithEmptyDecls[*ast.MapFieldNode] mapType *ast.MapTypeNode grp *ast.GroupNode - oo *ast.OneofNode + msgGrp nodeWithEmptyDecls[*ast.GroupNode] + oo nodeWithEmptyDecls[*ast.OneofNode] ooElement ast.OneofElement ooElements []ast.OneofElement - ext *ast.ExtensionRangeNode - resvd *ast.ReservedNode - en *ast.EnumNode - enElement ast.EnumElement + ext nodeWithEmptyDecls[*ast.ExtensionRangeNode] + resvd nodeWithEmptyDecls[*ast.ReservedNode] + en nodeWithEmptyDecls[*ast.EnumNode] enElements []ast.EnumElement - env *ast.EnumValueNode - extend *ast.ExtendNode + env nodeWithEmptyDecls[*ast.EnumValueNode] + extend nodeWithEmptyDecls[*ast.ExtendNode] extElement ast.ExtendElement extElements []ast.ExtendElement - svc *ast.ServiceNode - svcElement ast.ServiceElement + svc nodeWithEmptyDecls[*ast.ServiceNode] svcElements []ast.ServiceElement - mtd *ast.RPCNode + mtd nodeWithEmptyDecls[*ast.RPCNode] mtdMsgType *ast.RPCTypeNode - mtdElement ast.RPCElement mtdElements []ast.RPCElement - opt *ast.OptionNode + optRaw *ast.OptionNode + opt nodeWithEmptyDecls[*ast.OptionNode] opts *compactOptionSlices ref *ast.FieldReferenceNode optNms *fieldRefSlices @@ -67,6 +66,7 @@ import ( f *ast.FloatLiteralNode id *ast.IdentNode b *ast.RuneNode + bs []*ast.RuneNode err error } @@ -74,11 +74,12 @@ import ( // really a field name in the above union struct %type file %type syntaxDecl -%type fileElement -%type fileElements +%type editionDecl +%type fileBody fileElement fileElements %type importDecl %type packageDecl -%type optionDecl compactOption +%type compactOption oneofOptionDecl +%type optionDecl %type compactOptionDecls %type extensionName messageLiteralFieldName %type optionName @@ -91,43 +92,43 @@ import ( %type listElements messageLiterals %type messageLiteralFieldEntry messageLiteralFields messageTextFormat %type messageLiteralField -%type messageFieldDecl oneofFieldDecl extensionFieldDecl +%type messageFieldDecl +%type oneofFieldDecl extensionFieldDecl %type oneofDecl %type groupDecl oneofGroupDecl +%type messageGroupDecl %type mapFieldDecl %type mapType %type messageDecl -%type messageElement -%type messageElements messageBody +%type messageElement messageElements messageBody %type oneofElement %type oneofElements oneofBody -%type fieldNames +%type fieldNameStrings fieldNameIdents %type msgReserved enumReserved reservedNames %type tagRange enumValueRange %type tagRanges enumValueRanges %type extensionRangeDecl %type enumDecl -%type enumElement -%type enumElements enumBody +%type enumElement enumElements enumBody %type enumValueDecl %type extensionDecl %type extensionElement %type extensionElements extensionBody %type stringLit %type serviceDecl -%type serviceElement -%type serviceElements serviceBody +%type serviceElement serviceElements serviceBody %type methodDecl -%type methodElement -%type methodElements methodBody +%type methodElement methodElements methodBody %type methodMessageType +%type semicolon +%type semicolons semicolonList // same for terminals %token _STRING_LIT %token _INT_LIT %token _FLOAT_LIT %token _NAME -%token _SYNTAX _IMPORT _WEAK _PUBLIC _PACKAGE _OPTION _TRUE _FALSE _INF _NAN _REPEATED _OPTIONAL _REQUIRED +%token _SYNTAX _EDITION _IMPORT _WEAK _PUBLIC _PACKAGE _OPTION _TRUE _FALSE _INF _NAN _REPEATED _OPTIONAL _REQUIRED %token _DOUBLE _FLOAT _INT32 _INT64 _UINT32 _UINT64 _SINT32 _SINT64 _FIXED32 _FIXED64 _SFIXED32 _SFIXED64 %token _BOOL _STRING _BYTES _GROUP _ONEOF _MAP _EXTENSIONS _TO _MAX _RESERVED _ENUM _MESSAGE _EXTEND %token _SERVICE _RPC _STREAM _RETURNS @@ -143,62 +144,87 @@ file : syntaxDecl { $$ = ast.NewFileNode(lex.info, $1, nil, lex.eof) lex.res = $$ } - | fileElements { + | editionDecl { + lex := protolex.(*protoLex) + $$ = ast.NewFileNodeWithEdition(lex.info, $1, nil, lex.eof) + lex.res = $$ + } + | fileBody { lex := protolex.(*protoLex) $$ = ast.NewFileNode(lex.info, nil, $1, lex.eof) lex.res = $$ } - | syntaxDecl fileElements { + | syntaxDecl fileBody { lex := protolex.(*protoLex) $$ = ast.NewFileNode(lex.info, $1, $2, lex.eof) lex.res = $$ } + | editionDecl fileBody { + lex := protolex.(*protoLex) + $$ = ast.NewFileNodeWithEdition(lex.info, $1, $2, lex.eof) + lex.res = $$ + } | { lex := protolex.(*protoLex) $$ = ast.NewFileNode(lex.info, nil, nil, lex.eof) lex.res = $$ } +fileBody : semicolons fileElements { + $$ = newFileElements($1, $2) + } + fileElements : fileElements fileElement { - if $2 != nil { - $$ = append($1, $2) - } else { - $$ = $1 - } + $$ = append($1, $2...) } | fileElement { - if $1 != nil { - $$ = []ast.FileElement{$1} - } else { - $$ = nil - } + $$ = $1 } fileElement : importDecl { - $$ = $1 + $$ = toFileElements($1) } | packageDecl { - $$ = $1 + $$ = toFileElements($1) } | optionDecl { - $$ = $1 + $$ = toFileElements($1) } | messageDecl { - $$ = $1 + $$ = toFileElements($1) } | enumDecl { - $$ = $1 + $$ = toFileElements($1) } | extensionDecl { - $$ = $1 + $$ = toFileElements($1) } | serviceDecl { + $$ = toFileElements($1) + } + | error { + $$ = nil + } + +semicolonList : ';' { + $$ = []*ast.RuneNode{$1} + } + | semicolonList ';' { + $$ = append($1, $2) + } + +semicolons : semicolonList { $$ = $1 } - | ';' { - $$ = ast.NewEmptyDeclNode($1) + | { + $$ = nil } - | error { + +semicolon : ';' { + $$ = $1 + } | + { + protolex.(*protoLex).Error("expected ';'") $$ = nil } @@ -206,18 +232,26 @@ syntaxDecl : _SYNTAX '=' stringLit ';' { $$ = ast.NewSyntaxNode($1.ToKeyword(), $2, toStringValueNode($3), $4) } -importDecl : _IMPORT stringLit ';' { - $$ = ast.NewImportNode($1.ToKeyword(), nil, nil, toStringValueNode($2), $3) +editionDecl : _EDITION '=' stringLit ';' { + $$ = ast.NewEditionNode($1.ToKeyword(), $2, toStringValueNode($3), $4) } - | _IMPORT _WEAK stringLit ';' { - $$ = ast.NewImportNode($1.ToKeyword(), nil, $2.ToKeyword(), toStringValueNode($3), $4) + +importDecl : _IMPORT stringLit semicolons { + semi, extra := protolex.(*protoLex).requireSemicolon($3) + $$ = newNodeWithEmptyDecls(ast.NewImportNode($1.ToKeyword(), nil, nil, toStringValueNode($2), semi), extra) } - | _IMPORT _PUBLIC stringLit ';' { - $$ = ast.NewImportNode($1.ToKeyword(), $2.ToKeyword(), nil, toStringValueNode($3), $4) + | _IMPORT _WEAK stringLit semicolons { + semi, extra := protolex.(*protoLex).requireSemicolon($4) + $$ = newNodeWithEmptyDecls(ast.NewImportNode($1.ToKeyword(), nil, $2.ToKeyword(), toStringValueNode($3), semi), extra) + } + | _IMPORT _PUBLIC stringLit semicolons { + semi, extra := protolex.(*protoLex).requireSemicolon($4) + $$ = newNodeWithEmptyDecls(ast.NewImportNode($1.ToKeyword(), $2.ToKeyword(), nil, toStringValueNode($3), semi), extra) } -packageDecl : _PACKAGE qualifiedIdentifier ';' { - $$ = ast.NewPackageNode($1.ToKeyword(), $2.toIdentValueNode(nil), $3) +packageDecl : _PACKAGE qualifiedIdentifier semicolons { + semi, extra := protolex.(*protoLex).requireSemicolon($3) + $$ = newNodeWithEmptyDecls(ast.NewPackageNode($1.ToKeyword(), $2.toIdentValueNode(nil), semi), extra) } qualifiedIdentifier : identifier { @@ -278,11 +312,17 @@ mtdElementIdent : mtdElementName { $$ = $1 } -optionDecl : _OPTION optionName '=' optionValue ';' { +oneofOptionDecl : _OPTION optionName '=' optionValue semicolon { optName := ast.NewOptionNameNode($2.refs, $2.dots) $$ = ast.NewOptionNode($1.ToKeyword(), optName, $3, $4, $5) } +optionDecl : _OPTION optionName '=' optionValue semicolons { + optName := ast.NewOptionNameNode($2.refs, $2.dots) + semi, extra := protolex.(*protoLex).requireSemicolon($5) + $$ = newNodeWithEmptyDecls(ast.NewOptionNode($1.ToKeyword(), optName, $3, $4, semi), extra) + } + optionName : identifier { fieldReferenceNode := ast.NewFieldReferenceNode($1) $$ = &fieldRefSlices{refs: []*ast.FieldReferenceNode{fieldReferenceNode}} @@ -411,14 +451,14 @@ messageLiteralFieldEntry : messageLiteralField { } messageLiteralField : messageLiteralFieldName ':' value { - if $1 != nil { + if $1 != nil && $2 != nil { $$ = ast.NewMessageFieldNode($1, $2, $3) } else { $$ = nil } } | messageLiteralFieldName messageValue { - if $1 != nil { + if $1 != nil && $2 != nil { $$ = ast.NewMessageFieldNode($1, nil, $2) } else { $$ = nil @@ -472,7 +512,7 @@ listLiteral : '[' listElements ']' { $$ = ast.NewArrayLiteralNode($1, nil, nil, $2) } | '[' error ']' { - $$ = nil + $$ = ast.NewArrayLiteralNode($1, nil, nil, $3) } listElements : listElement { @@ -498,7 +538,7 @@ listOfMessagesLiteral : '[' messageLiterals ']' { $$ = ast.NewArrayLiteralNode($1, nil, nil, $2) } | '[' error ']' { - $$ = nil + $$ = ast.NewArrayLiteralNode($1, nil, nil, $3) } messageLiterals : messageLiteral { @@ -559,6 +599,10 @@ fieldCardinality : _REQUIRED compactOptions: '[' compactOptionDecls ']' { $$ = ast.NewCompactOptionsNode($1, $2.options, $2.commas, $3) } + | '[' ']' { + protolex.(*protoLex).Error("compact options must have at least one option") + $$ = ast.NewCompactOptionsNode($1, nil, nil, $2) + } compactOptionDecls : compactOption { $$ = &compactOptionSlices{options: []*ast.OptionNode{$1}} @@ -572,6 +616,11 @@ compactOptionDecls : compactOption { compactOption: optionName '=' optionValue { optName := ast.NewOptionNameNode($1.refs, $1.dots) $$ = ast.NewCompactOptionNode(optName, $2, $3) + } | + optionName { + optName := ast.NewOptionNameNode($1.refs, $1.dots) + protolex.(*protoLex).Error("compact option must have a value") + $$ = ast.NewCompactOptionNode(optName, nil, nil) } groupDecl : fieldCardinality _GROUP identifier '=' _INT_LIT '{' messageBody '}' { @@ -581,8 +630,15 @@ groupDecl : fieldCardinality _GROUP identifier '=' _INT_LIT '{' messageBody '}' $$ = ast.NewGroupNode($1.ToKeyword(), $2.ToKeyword(), $3, $4, $5, $6, $7, $8, $9) } -oneofDecl : _ONEOF identifier '{' oneofBody '}' { - $$ = ast.NewOneofNode($1.ToKeyword(), $2, $3, $4, $5) +messageGroupDecl : fieldCardinality _GROUP identifier '=' _INT_LIT '{' messageBody '}' semicolons { + $$ = newNodeWithEmptyDecls(ast.NewGroupNode($1.ToKeyword(), $2.ToKeyword(), $3, $4, $5, nil, $6, $7, $8), $9) + } + | fieldCardinality _GROUP identifier '=' _INT_LIT compactOptions '{' messageBody '}' semicolons { + $$ = newNodeWithEmptyDecls(ast.NewGroupNode($1.ToKeyword(), $2.ToKeyword(), $3, $4, $5, $6, $7, $8, $9), $10) + } + +oneofDecl : _ONEOF identifier '{' oneofBody '}' semicolons { + $$ = newNodeWithEmptyDecls(ast.NewOneofNode($1.ToKeyword(), $2, $3, $4, $5), $6) } oneofBody : { @@ -605,7 +661,7 @@ oneofElements : oneofElements oneofElement { } } -oneofElement : optionDecl { +oneofElement : oneofOptionDecl { $$ = $1 } | oneofFieldDecl { @@ -621,10 +677,10 @@ oneofElement : optionDecl { $$ = nil } -oneofFieldDecl : oneofElementTypeIdent identifier '=' _INT_LIT ';' { +oneofFieldDecl : oneofElementTypeIdent identifier '=' _INT_LIT semicolon { $$ = ast.NewFieldNode(nil, $1, $2, $3, $4, nil, $5) } - | oneofElementTypeIdent identifier '=' _INT_LIT compactOptions ';' { + | oneofElementTypeIdent identifier '=' _INT_LIT compactOptions semicolon { $$ = ast.NewFieldNode(nil, $1, $2, $3, $4, $5, $6) } @@ -635,11 +691,13 @@ oneofGroupDecl : _GROUP identifier '=' _INT_LIT '{' messageBody '}' { $$ = ast.NewGroupNode(nil, $1.ToKeyword(), $2, $3, $4, $5, $6, $7, $8) } -mapFieldDecl : mapType identifier '=' _INT_LIT ';' { - $$ = ast.NewMapFieldNode($1, $2, $3, $4, nil, $5) +mapFieldDecl : mapType identifier '=' _INT_LIT semicolons { + semi, extra := protolex.(*protoLex).requireSemicolon($5) + $$ = newNodeWithEmptyDecls(ast.NewMapFieldNode($1, $2, $3, $4, nil, semi), extra) } - | mapType identifier '=' _INT_LIT compactOptions ';' { - $$ = ast.NewMapFieldNode($1, $2, $3, $4, $5, $6) + | mapType identifier '=' _INT_LIT compactOptions semicolons { + semi, extra := protolex.(*protoLex).requireSemicolon($6) + $$ = newNodeWithEmptyDecls(ast.NewMapFieldNode($1, $2, $3, $4, $5, semi), extra) } mapType : _MAP '<' mapKeyType ',' typeName '>' { @@ -659,11 +717,14 @@ mapKeyType : _INT32 | _BOOL | _STRING -extensionRangeDecl : _EXTENSIONS tagRanges ';' { - $$ = ast.NewExtensionRangeNode($1.ToKeyword(), $2.ranges, $2.commas, nil, $3) +extensionRangeDecl : _EXTENSIONS tagRanges ';' semicolons { + // TODO: Tolerate a missing semicolon here. This currnelty creates a shift/reduce conflict + // between `extensions 1 to 10` and `extensions 1` followed by `to = 10`. + $$ = newNodeWithEmptyDecls(ast.NewExtensionRangeNode($1.ToKeyword(), $2.ranges, $2.commas, nil, $3), $4) } - | _EXTENSIONS tagRanges compactOptions ';' { - $$ = ast.NewExtensionRangeNode($1.ToKeyword(), $2.ranges, $2.commas, $3, $4) + | _EXTENSIONS tagRanges compactOptions semicolons { + semi, extra := protolex.(*protoLex).requireSemicolon($4) + $$ = newNodeWithEmptyDecls(ast.NewExtensionRangeNode($1.ToKeyword(), $2.ranges, $2.commas, $3, semi), extra) } tagRanges : tagRange { @@ -711,152 +772,158 @@ enumValueNumber : _INT_LIT { $$ = ast.NewNegativeIntLiteralNode($1, $2) } -msgReserved : _RESERVED tagRanges ';' { - $$ = ast.NewReservedRangesNode($1.ToKeyword(), $2.ranges, $2.commas, $3) +msgReserved : _RESERVED tagRanges ';' semicolons { + // TODO: Tolerate a missing semicolon here. This currnelty creates a shift/reduce conflict + // between `reserved 1 to 10` and `reserved 1` followed by `to = 10`. + $$ = newNodeWithEmptyDecls(ast.NewReservedRangesNode($1.ToKeyword(), $2.ranges, $2.commas, $3), $4) } | reservedNames -enumReserved : _RESERVED enumValueRanges ';' { - $$ = ast.NewReservedRangesNode($1.ToKeyword(), $2.ranges, $2.commas, $3) +enumReserved : _RESERVED enumValueRanges ';' semicolons { + // TODO: Tolerate a missing semicolon here. This currnelty creates a shift/reduce conflict + // between `reserved 1 to 10` and `reserved 1` followed by `to = 10`. + $$ = newNodeWithEmptyDecls(ast.NewReservedRangesNode($1.ToKeyword(), $2.ranges, $2.commas, $3), $4) } | reservedNames -reservedNames : _RESERVED fieldNames ';' { - $$ = ast.NewReservedNamesNode($1.ToKeyword(), $2.names, $2.commas, $3) +reservedNames : _RESERVED fieldNameStrings semicolons { + semi, extra := protolex.(*protoLex).requireSemicolon($3) + $$ = newNodeWithEmptyDecls(ast.NewReservedNamesNode($1.ToKeyword(), $2.names, $2.commas, semi), extra) + } + | _RESERVED fieldNameIdents semicolons { + semi, extra := protolex.(*protoLex).requireSemicolon($3) + $$ = newNodeWithEmptyDecls(ast.NewReservedIdentifiersNode($1.ToKeyword(), $2.idents, $2.commas, semi), extra) } -fieldNames : stringLit { +fieldNameStrings : stringLit { $$ = &nameSlices{names: []ast.StringValueNode{toStringValueNode($1)}} } - | fieldNames ',' stringLit { + | fieldNameStrings ',' stringLit { $1.names = append($1.names, toStringValueNode($3)) $1.commas = append($1.commas, $2) $$ = $1 } -enumDecl : _ENUM identifier '{' enumBody '}' { - $$ = ast.NewEnumNode($1.ToKeyword(), $2, $3, $4, $5) +fieldNameIdents : identifier { + $$ = &nameSlices{idents: []*ast.IdentNode{$1}} + } + | fieldNameIdents ',' identifier { + $1.idents = append($1.idents, $3) + $1.commas = append($1.commas, $2) + $$ = $1 } -enumBody : { - $$ = nil +enumDecl : _ENUM identifier '{' enumBody '}' semicolons { + $$ = newNodeWithEmptyDecls(ast.NewEnumNode($1.ToKeyword(), $2, $3, $4, $5), $6) + } + +enumBody : semicolons { + $$ = newEnumElements($1, nil) + } + | semicolons enumElements { + $$ = newEnumElements($1, $2) } - | enumElements enumElements : enumElements enumElement { - if $2 != nil { - $$ = append($1, $2) - } else { - $$ = $1 - } + $$ = append($1, $2...) } | enumElement { - if $1 != nil { - $$ = []ast.EnumElement{$1} - } else { - $$ = nil - } + $$ = $1 } enumElement : optionDecl { - $$ = $1 + $$ = toEnumElements($1) } | enumValueDecl { - $$ = $1 + $$ = toEnumElements($1) } | enumReserved { - $$ = $1 - } - | ';' { - $$ = ast.NewEmptyDeclNode($1) + $$ = toEnumElements($1) } | error { $$ = nil } -enumValueDecl : enumValueName '=' enumValueNumber ';' { - $$ = ast.NewEnumValueNode($1, $2, $3, nil, $4) +enumValueDecl : enumValueName '=' enumValueNumber semicolons { + semi, extra := protolex.(*protoLex).requireSemicolon($4) + $$ = newNodeWithEmptyDecls(ast.NewEnumValueNode($1, $2, $3, nil, semi), extra) } - | enumValueName '=' enumValueNumber compactOptions ';' { - $$ = ast.NewEnumValueNode($1, $2, $3, $4, $5) + | enumValueName '=' enumValueNumber compactOptions semicolons { + semi, extra := protolex.(*protoLex).requireSemicolon($5) + $$ = newNodeWithEmptyDecls(ast.NewEnumValueNode($1, $2, $3, $4, semi), extra) } -messageDecl : _MESSAGE identifier '{' messageBody '}' { - $$ = ast.NewMessageNode($1.ToKeyword(), $2, $3, $4, $5) +messageDecl : _MESSAGE identifier '{' messageBody '}' semicolons { + $$ = newNodeWithEmptyDecls(ast.NewMessageNode($1.ToKeyword(), $2, $3, $4, $5), $6) } -messageBody : { - $$ = nil +messageBody : semicolons { + $$ = newMessageElements($1, nil) + } + | semicolons messageElements { + $$ = newMessageElements($1, $2) } - | messageElements messageElements : messageElements messageElement { - if $2 != nil { - $$ = append($1, $2) - } else { - $$ = $1 - } + $$ = append($1, $2...) } | messageElement { - if $1 != nil { - $$ = []ast.MessageElement{$1} - } else { - $$ = nil - } + $$ = $1 } messageElement : messageFieldDecl { - $$ = $1 + $$ = toMessageElements($1) } | enumDecl { - $$ = $1 + $$ = toMessageElements($1) } | messageDecl { - $$ = $1 + $$ = toMessageElements($1) } | extensionDecl { - $$ = $1 + $$ = toMessageElements($1) } | extensionRangeDecl { - $$ = $1 + $$ = toMessageElements($1) } - | groupDecl { - $$ = $1 + | messageGroupDecl { + $$ = toMessageElements($1) } | optionDecl { - $$ = $1 + $$ = toMessageElements($1) } | oneofDecl { - $$ = $1 + $$ = toMessageElements($1) } | mapFieldDecl { - $$ = $1 + $$ = toMessageElements($1) } | msgReserved { - $$ = $1 - } - | ';' { - $$ = ast.NewEmptyDeclNode($1) + $$ = toMessageElements($1) } | error { $$ = nil } -messageFieldDecl : fieldCardinality notGroupElementTypeIdent identifier '=' _INT_LIT ';' { - $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, nil, $6) +messageFieldDecl : fieldCardinality notGroupElementTypeIdent identifier '=' _INT_LIT semicolons { + semis, extra := protolex.(*protoLex).requireSemicolon($6) + $$ = newNodeWithEmptyDecls(ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, nil, semis), extra) } - | fieldCardinality notGroupElementTypeIdent identifier '=' _INT_LIT compactOptions ';' { - $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, $6, $7) + | fieldCardinality notGroupElementTypeIdent identifier '=' _INT_LIT compactOptions semicolons { + semis, extra := protolex.(*protoLex).requireSemicolon($7) + $$ = newNodeWithEmptyDecls(ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, $6, semis), extra) } - | msgElementTypeIdent identifier '=' _INT_LIT ';' { - $$ = ast.NewFieldNode(nil, $1, $2, $3, $4, nil, $5) + | msgElementTypeIdent identifier '=' _INT_LIT semicolons { + semis, extra := protolex.(*protoLex).requireSemicolon($5) + $$ = newNodeWithEmptyDecls(ast.NewFieldNode(nil, $1, $2, $3, $4, nil, semis), extra) } - | msgElementTypeIdent identifier '=' _INT_LIT compactOptions ';' { - $$ = ast.NewFieldNode(nil, $1, $2, $3, $4, $5, $6) + | msgElementTypeIdent identifier '=' _INT_LIT compactOptions semicolons { + semis, extra := protolex.(*protoLex).requireSemicolon($6) + $$ = newNodeWithEmptyDecls(ast.NewFieldNode(nil, $1, $2, $3, $4, $5, semis), extra) } -extensionDecl : _EXTEND typeName '{' extensionBody '}' { - $$ = ast.NewExtendNode($1.ToKeyword(), $2, $3, $4, $5) +extensionDecl : _EXTEND typeName '{' extensionBody '}' semicolons { + $$ = newNodeWithEmptyDecls(ast.NewExtendNode($1.ToKeyword(), $2, $3, $4, $5), $6) } extensionBody : { @@ -892,64 +959,56 @@ extensionElement : extensionFieldDecl { $$ = nil } -extensionFieldDecl : fieldCardinality notGroupElementTypeIdent identifier '=' _INT_LIT ';' { +extensionFieldDecl : fieldCardinality notGroupElementTypeIdent identifier '=' _INT_LIT semicolon { $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, nil, $6) } - | fieldCardinality notGroupElementTypeIdent identifier '=' _INT_LIT compactOptions ';' { + | fieldCardinality notGroupElementTypeIdent identifier '=' _INT_LIT compactOptions semicolon { $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, $6, $7) } - | extElementTypeIdent identifier '=' _INT_LIT ';' { + | extElementTypeIdent identifier '=' _INT_LIT semicolon { $$ = ast.NewFieldNode(nil, $1, $2, $3, $4, nil, $5) } - | extElementTypeIdent identifier '=' _INT_LIT compactOptions ';' { + | extElementTypeIdent identifier '=' _INT_LIT compactOptions semicolon { $$ = ast.NewFieldNode(nil, $1, $2, $3, $4, $5, $6) } -serviceDecl : _SERVICE identifier '{' serviceBody '}' { - $$ = ast.NewServiceNode($1.ToKeyword(), $2, $3, $4, $5) +serviceDecl : _SERVICE identifier '{' serviceBody '}' semicolons { + $$ = newNodeWithEmptyDecls(ast.NewServiceNode($1.ToKeyword(), $2, $3, $4, $5), $6) } -serviceBody : { - $$ = nil +serviceBody : semicolons { + $$ = newServiceElements($1, nil) + } + | semicolons serviceElements { + $$ = newServiceElements($1, $2) } - | serviceElements serviceElements : serviceElements serviceElement { - if $2 != nil { - $$ = append($1, $2) - } else { - $$ = $1 - } + $$ = append($1, $2...) } | serviceElement { - if $1 != nil { - $$ = []ast.ServiceElement{$1} - } else { - $$ = nil - } + $$ = $1 } // NB: doc suggests support for "stream" declaration, separate from "rpc", but // it does not appear to be supported in protoc (doc is likely from grammar for // Google-internal version of protoc, with support for streaming stubby) serviceElement : optionDecl { - $$ = $1 + $$ = toServiceElements($1) } | methodDecl { - $$ = $1 - } - | ';' { - $$ = ast.NewEmptyDeclNode($1) + $$ = toServiceElements($1) } | error { $$ = nil } -methodDecl : _RPC identifier methodMessageType _RETURNS methodMessageType ';' { - $$ = ast.NewRPCNode($1.ToKeyword(), $2, $3, $4.ToKeyword(), $5, $6) +methodDecl : _RPC identifier methodMessageType _RETURNS methodMessageType semicolons { + semi, extra := protolex.(*protoLex).requireSemicolon($6) + $$ = newNodeWithEmptyDecls(ast.NewRPCNode($1.ToKeyword(), $2, $3, $4.ToKeyword(), $5, semi), extra) } - | _RPC identifier methodMessageType _RETURNS methodMessageType '{' methodBody '}' { - $$ = ast.NewRPCNodeWithBody($1.ToKeyword(), $2, $3, $4.ToKeyword(), $5, $6, $7, $8) + | _RPC identifier methodMessageType _RETURNS methodMessageType '{' methodBody '}' semicolons { + $$ = newNodeWithEmptyDecls(ast.NewRPCNodeWithBody($1.ToKeyword(), $2, $3, $4.ToKeyword(), $5, $6, $7, $8), $9) } methodMessageType : '(' _STREAM typeName ')' { @@ -959,31 +1018,22 @@ methodMessageType : '(' _STREAM typeName ')' { $$ = ast.NewRPCTypeNode($1, nil, $2, $3) } -methodBody : { - $$ = nil +methodBody : semicolons { + $$ = newMethodElements($1, nil) + } + | semicolons methodElements { + $$ = newMethodElements($1, $2) } - | methodElements methodElements : methodElements methodElement { - if $2 != nil { - $$ = append($1, $2) - } else { - $$ = $1 - } + $$ = append($1, $2...) } | methodElement { - if $1 != nil { - $$ = []ast.RPCElement{$1} - } else { - $$ = nil - } + $$ = $1 } methodElement : optionDecl { - $$ = $1 - } - | ';' { - $$ = ast.NewEmptyDeclNode($1) + $$ = toMethodElements($1) } | error { $$ = nil @@ -993,6 +1043,7 @@ methodElement : optionDecl { // option, group, optional, required, and repeated msgElementName : _NAME | _SYNTAX + | _EDITION | _IMPORT | _WEAK | _PUBLIC @@ -1027,6 +1078,7 @@ msgElementName : _NAME // excludes group, optional, required, and repeated extElementName : _NAME | _SYNTAX + | _EDITION | _IMPORT | _WEAK | _PUBLIC @@ -1068,6 +1120,7 @@ extElementName : _NAME // excludes reserved, option enumValueName : _NAME | _SYNTAX + | _EDITION | _IMPORT | _WEAK | _PUBLIC @@ -1111,6 +1164,7 @@ enumValueName : _NAME // excludes group, option, optional, required, and repeated oneofElementName : _NAME | _SYNTAX + | _EDITION | _IMPORT | _WEAK | _PUBLIC @@ -1151,6 +1205,7 @@ oneofElementName : _NAME // excludes group notGroupElementName : _NAME | _SYNTAX + | _EDITION | _IMPORT | _WEAK | _PUBLIC @@ -1195,6 +1250,7 @@ notGroupElementName : _NAME // excludes stream mtdElementName : _NAME | _SYNTAX + | _EDITION | _IMPORT | _WEAK | _PUBLIC @@ -1238,6 +1294,7 @@ mtdElementName : _NAME identifier : _NAME | _SYNTAX + | _EDITION | _IMPORT | _WEAK | _PUBLIC diff --git a/vendor/github.com/bufbuild/protocompile/parser/proto.y.go b/vendor/github.com/bufbuild/protocompile/parser/proto.y.go index 144055d746a9..17ee65ac4213 100644 --- a/vendor/github.com/bufbuild/protocompile/parser/proto.y.go +++ b/vendor/github.com/bufbuild/protocompile/parser/proto.y.go @@ -29,37 +29,36 @@ type protoSymType struct { yys int file *ast.FileNode syn *ast.SyntaxNode - fileElement ast.FileElement + ed *ast.EditionNode fileElements []ast.FileElement - pkg *ast.PackageNode - imprt *ast.ImportNode - msg *ast.MessageNode - msgElement ast.MessageElement + pkg nodeWithEmptyDecls[*ast.PackageNode] + imprt nodeWithEmptyDecls[*ast.ImportNode] + msg nodeWithEmptyDecls[*ast.MessageNode] msgElements []ast.MessageElement fld *ast.FieldNode - mapFld *ast.MapFieldNode + msgFld nodeWithEmptyDecls[*ast.FieldNode] + mapFld nodeWithEmptyDecls[*ast.MapFieldNode] mapType *ast.MapTypeNode grp *ast.GroupNode - oo *ast.OneofNode + msgGrp nodeWithEmptyDecls[*ast.GroupNode] + oo nodeWithEmptyDecls[*ast.OneofNode] ooElement ast.OneofElement ooElements []ast.OneofElement - ext *ast.ExtensionRangeNode - resvd *ast.ReservedNode - en *ast.EnumNode - enElement ast.EnumElement + ext nodeWithEmptyDecls[*ast.ExtensionRangeNode] + resvd nodeWithEmptyDecls[*ast.ReservedNode] + en nodeWithEmptyDecls[*ast.EnumNode] enElements []ast.EnumElement - env *ast.EnumValueNode - extend *ast.ExtendNode + env nodeWithEmptyDecls[*ast.EnumValueNode] + extend nodeWithEmptyDecls[*ast.ExtendNode] extElement ast.ExtendElement extElements []ast.ExtendElement - svc *ast.ServiceNode - svcElement ast.ServiceElement + svc nodeWithEmptyDecls[*ast.ServiceNode] svcElements []ast.ServiceElement - mtd *ast.RPCNode + mtd nodeWithEmptyDecls[*ast.RPCNode] mtdMsgType *ast.RPCTypeNode - mtdElement ast.RPCElement mtdElements []ast.RPCElement - opt *ast.OptionNode + optRaw *ast.OptionNode + opt nodeWithEmptyDecls[*ast.OptionNode] opts *compactOptionSlices ref *ast.FieldReferenceNode optNms *fieldRefSlices @@ -80,6 +79,7 @@ type protoSymType struct { f *ast.FloatLiteralNode id *ast.IdentNode b *ast.RuneNode + bs []*ast.RuneNode err error } @@ -88,48 +88,49 @@ const _INT_LIT = 57347 const _FLOAT_LIT = 57348 const _NAME = 57349 const _SYNTAX = 57350 -const _IMPORT = 57351 -const _WEAK = 57352 -const _PUBLIC = 57353 -const _PACKAGE = 57354 -const _OPTION = 57355 -const _TRUE = 57356 -const _FALSE = 57357 -const _INF = 57358 -const _NAN = 57359 -const _REPEATED = 57360 -const _OPTIONAL = 57361 -const _REQUIRED = 57362 -const _DOUBLE = 57363 -const _FLOAT = 57364 -const _INT32 = 57365 -const _INT64 = 57366 -const _UINT32 = 57367 -const _UINT64 = 57368 -const _SINT32 = 57369 -const _SINT64 = 57370 -const _FIXED32 = 57371 -const _FIXED64 = 57372 -const _SFIXED32 = 57373 -const _SFIXED64 = 57374 -const _BOOL = 57375 -const _STRING = 57376 -const _BYTES = 57377 -const _GROUP = 57378 -const _ONEOF = 57379 -const _MAP = 57380 -const _EXTENSIONS = 57381 -const _TO = 57382 -const _MAX = 57383 -const _RESERVED = 57384 -const _ENUM = 57385 -const _MESSAGE = 57386 -const _EXTEND = 57387 -const _SERVICE = 57388 -const _RPC = 57389 -const _STREAM = 57390 -const _RETURNS = 57391 -const _ERROR = 57392 +const _EDITION = 57351 +const _IMPORT = 57352 +const _WEAK = 57353 +const _PUBLIC = 57354 +const _PACKAGE = 57355 +const _OPTION = 57356 +const _TRUE = 57357 +const _FALSE = 57358 +const _INF = 57359 +const _NAN = 57360 +const _REPEATED = 57361 +const _OPTIONAL = 57362 +const _REQUIRED = 57363 +const _DOUBLE = 57364 +const _FLOAT = 57365 +const _INT32 = 57366 +const _INT64 = 57367 +const _UINT32 = 57368 +const _UINT64 = 57369 +const _SINT32 = 57370 +const _SINT64 = 57371 +const _FIXED32 = 57372 +const _FIXED64 = 57373 +const _SFIXED32 = 57374 +const _SFIXED64 = 57375 +const _BOOL = 57376 +const _STRING = 57377 +const _BYTES = 57378 +const _GROUP = 57379 +const _ONEOF = 57380 +const _MAP = 57381 +const _EXTENSIONS = 57382 +const _TO = 57383 +const _MAX = 57384 +const _RESERVED = 57385 +const _ENUM = 57386 +const _MESSAGE = 57387 +const _EXTEND = 57388 +const _SERVICE = 57389 +const _RPC = 57390 +const _STREAM = 57391 +const _RETURNS = 57392 +const _ERROR = 57393 var protoToknames = [...]string{ "$end", @@ -140,6 +141,7 @@ var protoToknames = [...]string{ "_FLOAT_LIT", "_NAME", "_SYNTAX", + "_EDITION", "_IMPORT", "_WEAK", "_PUBLIC", @@ -220,396 +222,430 @@ const protoInitialStackSize = 16 var protoExca = [...]int16{ -1, 0, - 1, 4, - -2, 0, + 1, 6, + -2, 21, -1, 1, 1, -1, -2, 0, -1, 2, 1, 1, - -2, 0, + -2, 21, -1, 3, 1, 2, + -2, 21, + -1, 14, + 1, 7, -2, 0, - -1, 22, - 1, 3, - -2, 0, - -1, 94, - 55, 176, - -2, 0, - -1, 95, - 55, 164, + -1, 108, + 56, 212, -2, 0, - -1, 96, - 55, 197, + -1, 129, + 56, 192, -2, 0, - -1, 98, - 55, 210, + -1, 131, + 56, 181, -2, 0, - -1, 118, - 55, 177, + -1, 133, + 56, 213, -2, 0, - -1, 178, - 55, 165, + -1, 187, + 56, 225, -2, 0, - -1, 230, - 55, 198, + -1, 192, + 56, 67, + 62, 67, -2, 0, - -1, 280, - 55, 211, + -1, 205, + 56, 193, -2, 0, - -1, 291, - 55, 57, - 61, 57, + -1, 262, + 56, 182, -2, 0, - -1, 408, - 55, 114, + -1, 368, + 56, 226, -2, 0, - -1, 464, - 55, 115, + -1, 449, + 56, 128, -2, 0, - -1, 613, - 55, 176, + -1, 505, + 56, 129, -2, 0, - -1, 629, - 55, 222, + -1, 686, + 56, 236, -2, 0, - -1, 634, - 55, 176, - -2, 0, - -1, 640, - 55, 223, - -2, 0, - -1, 649, - 55, 176, - -2, 0, - -1, 656, - 55, 176, + -1, 696, + 56, 237, -2, 0, } const protoPrivate = 57344 -const protoLast = 1542 +const protoLast = 1895 var protoAct = [...]int16{ - 117, 126, 8, 404, 8, 8, 641, 393, 439, 574, - 30, 103, 104, 459, 80, 465, 435, 369, 368, 106, - 354, 81, 437, 288, 8, 281, 306, 290, 75, 78, - 79, 138, 83, 125, 132, 25, 231, 179, 29, 353, - 119, 76, 610, 293, 84, 580, 87, 88, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 451, 93, 630, 605, 116, 289, 180, 447, 105, - 282, 102, 108, 114, 97, 450, 90, 90, 296, 389, - 109, 609, 363, 587, 579, 612, 449, 403, 394, 608, - 295, 586, 578, 395, 649, 405, 647, 187, 625, 613, - 233, 235, 406, 615, 115, 370, 601, 406, 596, 584, - 516, 406, 406, 406, 352, 436, 356, 357, 406, 370, - 109, 406, 624, 406, 406, 406, 577, 360, 394, 304, - 28, 370, 109, 515, 446, 362, 387, 388, 429, 90, - 394, 520, 606, 411, 386, 410, 428, 358, 385, 588, - 180, 412, 14, 405, 89, 656, 384, 92, 4, 15, - 91, 90, 16, 17, 371, 594, 400, 377, 92, 361, - 659, 657, 14, 653, 651, 645, 360, 589, 371, 15, - 187, 285, 16, 17, 382, 628, 365, 629, 644, 379, - 371, 372, 17, 19, 18, 20, 21, 364, 303, 17, - 634, 408, 13, 98, 523, 96, 95, 94, 86, 86, - 86, 86, 654, 19, 18, 20, 21, 376, 638, 635, - 627, 623, 13, 617, 599, 591, 286, 456, 374, 287, - 378, 284, 375, 621, 233, 235, 620, 373, 643, 521, - 453, 452, 433, 409, 402, 366, 24, 461, 430, 407, - 28, 355, 282, 637, 636, 600, 101, 100, 99, 85, - 583, 123, 11, 582, 11, 11, 522, 381, 302, 300, - 299, 297, 295, 391, 121, 10, 380, 10, 10, 301, - 460, 298, 513, 462, 11, 355, 398, 399, 396, 383, - 122, 9, 5, 9, 9, 455, 23, 10, 74, 431, - 401, 415, 416, 417, 418, 419, 420, 421, 422, 423, - 424, 425, 426, 9, 28, 23, 86, 28, 639, 3, - 26, 27, 22, 640, 283, 279, 280, 12, 229, 230, - 181, 177, 178, 124, 367, 182, 129, 359, 463, 464, - 118, 136, 413, 128, 468, 127, 232, 467, 120, 292, - 291, 445, 571, 525, 427, 470, 432, 236, 434, 133, - 526, 307, 472, 237, 142, 185, 528, 309, 474, 108, - 108, 438, 438, 239, 448, 295, 145, 414, 390, 392, - 466, 454, 442, 440, 107, 294, 458, 75, 443, 7, - 6, 2, 1, 0, 0, 0, 457, 0, 0, 0, - 0, 517, 514, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 518, 519, 0, - 576, 0, 108, 0, 575, 0, 0, 0, 0, 585, - 0, 0, 0, 0, 0, 0, 466, 0, 0, 0, - 0, 0, 581, 0, 0, 0, 0, 0, 0, 0, - 590, 592, 593, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 595, 0, 0, 0, 0, + 129, 7, 128, 7, 7, 569, 18, 697, 385, 484, + 500, 114, 428, 92, 501, 479, 506, 91, 445, 412, + 413, 117, 396, 189, 40, 369, 115, 426, 395, 224, + 263, 317, 21, 20, 32, 34, 19, 98, 191, 39, + 101, 85, 134, 138, 87, 206, 36, 623, 490, 436, + 692, 86, 89, 90, 439, 94, 102, 381, 120, 99, + 100, 631, 622, 447, 102, 438, 386, 489, 444, 630, + 621, 387, 571, 625, 9, 488, 446, 656, 645, 440, + 675, 652, 414, 447, 127, 120, 480, 447, 414, 447, + 447, 447, 407, 386, 669, 379, 380, 487, 560, 102, + 111, 112, 120, 378, 653, 472, 105, 109, 131, 9, + 386, 187, 116, 471, 9, 188, 435, 455, 451, 566, + 639, 704, 453, 377, 664, 632, 446, 113, 119, 125, + 710, 376, 104, 104, 9, 419, 213, 678, 264, 103, + 405, 102, 415, 671, 365, 196, 708, 104, 415, 126, + 701, 695, 694, 687, 683, 9, 633, 674, 366, 374, + 367, 270, 210, 208, 364, 313, 209, 261, 204, 449, + 110, 108, 107, 218, 106, 96, 314, 5, 6, 96, + 96, 9, 571, 635, 315, 31, 666, 665, 493, 492, + 23, 476, 475, 450, 370, 443, 421, 410, 24, 13, + 12, 25, 26, 572, 502, 390, 473, 372, 383, 448, + 96, 388, 213, 203, 201, 200, 198, 196, 699, 26, + 682, 15, 9, 681, 9, 202, 627, 199, 97, 95, + 26, 375, 28, 27, 29, 30, 35, 626, 210, 208, + 406, 503, 209, 568, 394, 403, 398, 399, 404, 218, + 393, 391, 400, 373, 567, 556, 33, 8, 397, 494, + 478, 474, 408, 37, 38, 33, 685, 696, 371, 264, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 4, 186, 368, 10, 11, 22, 132, 133, + 265, 403, 270, 409, 404, 130, 262, 211, 411, 266, + 216, 402, 401, 504, 505, 205, 222, 215, 212, 509, + 136, 214, 135, 508, 416, 207, 193, 192, 434, 481, + 574, 512, 139, 219, 575, 318, 514, 143, 225, 268, + 577, 320, 516, 420, 145, 228, 457, 382, 384, 429, + 118, 417, 418, 195, 498, 507, 17, 16, 14, 3, + 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 423, 0, + 0, 0, 0, 0, 0, 370, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, - 0, 0, 0, 0, 0, 0, 602, 0, 0, 0, - 598, 0, 0, 0, 0, 0, 0, 0, 0, 604, - 603, 0, 0, 0, 0, 0, 0, 0, 0, 607, + 422, 0, 0, 0, 424, 0, 0, 0, 425, 0, + 437, 0, 452, 454, 0, 119, 119, 427, 427, 431, + 432, 196, 0, 0, 0, 0, 0, 441, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 456, 470, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 486, 477, 495, 496, 0, 0, 0, + 0, 0, 557, 491, 0, 119, 0, 485, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 497, + 0, 561, 86, 564, 0, 558, 0, 0, 0, 0, + 559, 0, 0, 0, 0, 0, 0, 0, 0, 562, + 0, 563, 0, 0, 565, 628, 0, 570, 0, 0, + 0, 0, 624, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 629, 0, 0, 0, 0, 0, 0, + 0, 0, 634, 0, 0, 0, 636, 0, 0, 640, + 0, 0, 0, 0, 0, 0, 86, 637, 638, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 641, 0, 0, + 0, 0, 0, 644, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 647, 642, 649, 0, 643, 0, + 0, 0, 0, 0, 0, 0, 646, 648, 650, 0, + 654, 651, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 614, 616, 611, 0, - 0, 0, 0, 0, 0, 0, 105, 0, 75, 108, - 619, 618, 0, 0, 626, 622, 0, 0, 0, 0, - 0, 0, 0, 0, 633, 0, 0, 631, 576, 632, - 108, 0, 575, 0, 0, 0, 0, 0, 0, 0, - 0, 642, 0, 0, 0, 646, 0, 0, 0, 0, - 648, 650, 642, 0, 0, 0, 0, 652, 0, 0, - 655, 0, 0, 0, 0, 0, 573, 658, 28, 113, - 110, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 658, 0, + 660, 0, 655, 0, 663, 486, 0, 0, 0, 0, + 0, 116, 661, 668, 662, 657, 659, 119, 670, 485, + 0, 673, 0, 0, 672, 0, 86, 119, 0, 677, + 679, 0, 0, 0, 667, 0, 0, 0, 0, 0, + 0, 0, 0, 116, 684, 686, 680, 0, 676, 0, + 0, 688, 0, 0, 0, 0, 689, 690, 700, 119, + 0, 0, 0, 698, 0, 703, 705, 702, 0, 0, + 691, 693, 707, 698, 706, 0, 483, 709, 33, 124, + 121, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 0, 0, 0, 0, 109, 0, - 0, 0, 0, 0, 0, 0, 394, 112, 111, 0, - 0, 0, 572, 28, 113, 110, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 0, 0, 0, 0, 120, + 0, 0, 0, 0, 0, 0, 0, 386, 123, 122, + 0, 0, 0, 482, 33, 124, 121, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 0, 0, 0, 0, 120, 0, 0, 0, 0, + 0, 0, 0, 386, 123, 122, 0, 0, 430, 33, + 124, 121, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 0, 0, 0, 0, + 120, 0, 0, 0, 0, 0, 0, 0, 386, 123, + 122, 33, 124, 121, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 0, 0, + 0, 0, 120, 0, 0, 0, 0, 0, 0, 0, + 0, 123, 122, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 194, 88, 0, 0, 499, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 0, - 0, 0, 0, 109, 0, 0, 0, 0, 0, 0, - 0, 394, 112, 111, 0, 0, 441, 28, 113, 110, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 433, 0, 194, 0, 0, 0, 197, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 0, 0, 0, 0, 0, 190, 0, 0, + 0, 0, 0, 0, 0, 194, 0, 0, 0, 197, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 0, 0, 0, 0, 109, 0, 0, - 0, 0, 0, 0, 0, 394, 112, 111, 28, 113, - 110, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, + 414, 197, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 415, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 0, 0, 0, 0, 109, 0, - 0, 0, 0, 0, 293, 0, 0, 112, 111, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 444, 0, 293, 0, 0, 0, 296, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 0, 0, 0, 0, 0, 0, 0, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 296, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 88, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 131, 0, 0, 0, 77, - 146, 147, 148, 149, 150, 151, 17, 152, 153, 154, - 155, 141, 140, 139, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 0, - 135, 144, 134, 171, 172, 137, 19, 18, 20, 173, - 174, 175, 176, 0, 0, 130, 0, 0, 0, 0, - 0, 0, 143, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 82, 529, 530, 531, 532, - 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, - 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, - 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 524, 570, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 527, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 305, 339, - 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 0, 0, 0, 0, 0, 234, 0, 0, - 0, 308, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 141, 140, 139, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 0, 0, 0, 0, 0, - 469, 0, 0, 0, 238, 475, 476, 477, 478, 479, - 480, 17, 481, 482, 483, 484, 0, 0, 0, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, - 496, 497, 498, 499, 471, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 511, 512, 0, 0, - 0, 0, 0, 184, 0, 0, 0, 473, 188, 189, - 190, 191, 192, 193, 17, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 186, 222, 223, 224, 225, 226, 227, - 228, 397, 0, 183, 0, 0, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 93, 578, 579, 580, 581, 582, + 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, + 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 617, 618, 619, 573, 620, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 576, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 392, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 0, 0, 0, 0, 0, 217, 0, + 0, 0, 319, 229, 230, 231, 232, 233, 234, 235, + 26, 236, 237, 238, 239, 142, 141, 140, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 0, 221, 227, 220, 255, 256, 223, + 28, 27, 29, 257, 258, 259, 260, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 226, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 350, 316, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, + 363, 0, 0, 0, 0, 0, 137, 0, 0, 0, + 319, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 142, 141, 140, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 0, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 0, 0, 0, 0, 0, + 510, 0, 0, 0, 144, 517, 518, 519, 520, 521, + 522, 523, 511, 524, 525, 526, 527, 0, 0, 0, + 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, + 538, 539, 540, 541, 542, 513, 543, 544, 545, 546, + 547, 548, 549, 550, 551, 552, 553, 554, 555, 0, + 0, 0, 0, 0, 0, 0, 33, 397, 515, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 267, 0, 0, 0, 0, 271, 272, + 273, 274, 275, 276, 277, 26, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 269, 306, 307, 308, 309, 310, + 311, 312, 389, 0, 0, 0, 0, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, } var protoPact = [...]int16{ - 180, -1000, 200, 200, 225, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, 340, 1492, 1024, 1492, 1492, - 1136, 1492, 200, -1000, 343, 237, 343, 343, -1000, 132, + 169, -1000, 128, 128, -1000, 148, 147, 188, 132, -1000, + -1000, -1000, 261, 261, 188, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, 252, 1844, 1264, 1844, 1844, 1324, + 1844, -1000, 176, -1000, 175, -1000, 171, 261, 261, 81, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, 87, -1000, -1000, 1324, 119, + 117, 116, 39, 1844, 115, -1000, -1000, -1000, -1000, 171, + 171, -1000, 1844, 897, 1264, 17, 128, 128, 1594, 39, + 128, -1000, -1000, -1000, 128, -1000, -1000, 206, -1000, -1000, + 1081, -1000, 210, 208, -1000, -1000, -1000, -1000, 112, 1486, + 111, 1751, 109, 1594, -1000, -1000, -1000, 131, 1540, 1844, + -1000, -1000, -1000, 84, 1844, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, 139, -1000, -1000, 1136, 183, 182, - 181, 110, 1492, 179, 236, -1000, -1000, 235, 234, -1000, - 1492, 844, 1024, 29, 1083, 1401, 1295, 110, 209, -1000, - -1000, -1000, -1000, 207, -1000, -1000, 342, -1000, -1000, 41, - -1000, 295, 293, -1000, -1000, -1000, -1000, 173, 1083, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, 1242, 1492, 310, 1492, 1492, 276, -1000, -1000, - -1000, -1000, 140, 1492, 50, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, 104, 205, -1000, 103, + -1000, -1000, 1143, 70, 42, 3, -1000, 1800, -1000, -1000, + -1000, -1000, -1000, -1000, 128, 1486, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 1432, 1844, + 253, 1844, 1844, 1702, -1000, 80, 1844, 29, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, 172, 1401, -1000, - -1000, -1000, -1000, -1000, -1000, 224, 156, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, 128, 1751, -1000, -1000, -1000, -1000, -1000, 145, 1205, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 166, - 1295, -1000, -1000, -1000, 206, 1242, 1492, 138, 1492, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 164, - 209, -1000, -1000, -1000, -1000, -1000, 1492, -1000, 159, -1000, - -1000, 963, 126, 114, 56, -1000, 1449, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, 1492, 1492, 137, 1492, -1000, + -1000, -1000, -1000, 128, -1000, -1000, 1844, 1844, 75, 1844, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, 223, 65, -1000, 239, 177, 222, 123, 121, - 342, 1492, 110, 308, -1000, -1000, 144, 116, -1000, 238, - -1000, 324, -1000, -1000, -1000, 1492, 221, 1492, 110, -1000, - -1000, 80, -1000, -1000, -1000, -1000, -1000, -1000, 719, 719, - -1000, -1000, -1000, -1000, 902, 96, 48, 23, 220, 219, - 1492, 110, 320, -1000, 205, 310, 1024, 272, 1348, 307, - -1000, -1000, 343, -1000, 103, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, 88, 144, -1000, - 130, -1000, 218, 291, -1000, 185, 1189, -1000, -1000, -1000, - -1000, 654, -1000, 95, -1000, 54, -1000, -23, -1000, -1000, - 1492, -1000, 288, 285, -1000, 87, -1000, -1000, 53, -1000, - 128, -1000, -1000, 152, 1348, -1000, -1000, -1000, -1000, 203, - 1492, 1492, 136, 1492, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, 144, 1844, 39, 128, 205, -1000, + -1000, -1000, -1000, 1844, -1000, -1000, -1000, -1000, -1000, -1000, + 770, 770, -1000, -1000, -1000, -1000, 1019, 47, -4, 10, + -1000, -1000, 1844, 1844, 143, 15, -1000, 168, 114, 141, + 65, 61, 56, 206, -1000, 1844, 39, 246, -1000, -1000, + 83, 52, -1000, 165, -1000, 256, -1000, 140, 139, 1844, + 39, 255, -1000, -1000, -1000, 20, -1000, -1000, -1000, -1000, + 704, -1000, 35, -1000, 6, -1000, -21, -1000, -1000, 1844, + -1000, 137, 136, 254, 128, 128, 253, 956, 199, 1648, + 250, 128, -1000, 261, -1000, 1844, -1000, 37, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + 21, 83, 128, 77, -1000, 249, 238, -1000, 19, 153, + 1378, 1, -1000, -22, -1000, -1000, -1000, -1000, -1000, 30, + -1000, 4, 232, 221, 21, -1000, -1000, -1000, 0, -1000, + -1000, 73, -1000, -1000, 100, 1648, -1000, -1000, -1000, -1000, + 130, 1264, 1844, 1844, 60, 1844, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, 86, 342, 1136, -1000, 202, -1000, -1000, - -1000, 280, 84, 80, 1136, 28, 113, 1492, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, 21, -1000, 206, -1000, + 1324, -1000, 128, -1000, -1000, -1000, -1000, 23, 19, -1000, + 129, -1000, 20, 1324, 14, 44, 1844, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, 51, -1000, -26, -1000, -1000, -1000, -1000, -1000, 108, - -1000, 47, 75, 81, -1000, 201, -1000, 1024, 844, -1000, - -1000, -1000, 215, 212, 1492, 110, -1000, 199, 91, -1000, - 76, -1000, 198, 163, 27, -1000, 1492, 110, -1000, 783, - -1000, -1000, -1000, 1083, 176, -1000, 197, -1000, -1000, -1000, - 279, 278, -1000, -1000, -1000, -1000, 196, -1000, -1000, 216, - -1000, -1000, -1000, 150, 1083, -1000, 74, 70, -1000, 149, - 216, -1000, -1000, -1000, -1000, -1000, 148, -1000, 190, 1083, - 131, -1000, -1000, -1000, -1000, 146, 1083, -1000, 145, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, + -1000, -1000, 835, -1000, -1000, -1000, 22, 21, -1000, 128, + -1000, 1264, 897, 128, -1000, -1000, 72, 135, 134, 1844, + 39, -1000, 128, 32, -1000, 128, 88, -1000, 129, -1000, + 102, 13, -1000, 1844, 39, -1000, 128, 82, -1000, 128, + -1000, -1000, -1000, -1000, 897, 218, 215, -1000, -1000, -1000, + 98, 128, -1000, -1000, 128, -1000, -1000, 97, 128, -1000, + 129, 19, -5, -1000, 96, 95, 216, 128, 94, -1000, + -1000, 129, 128, 66, -1000, 128, 216, -1000, -1000, -1000, + -1000, 128, -1000, 90, 128, -1000, -1000, -1000, -1000, 74, + -1000, } var protoPgo = [...]int16{ - 0, 422, 421, 322, 349, 420, 419, 1, 13, 416, - 41, 415, 310, 3, 22, 11, 12, 7, 8, 414, - 413, 9, 409, 408, 17, 10, 407, 406, 403, 398, - 397, 396, 395, 34, 21, 394, 393, 392, 391, 390, - 14, 389, 387, 385, 26, 383, 382, 381, 380, 27, - 23, 379, 378, 377, 376, 375, 33, 374, 373, 371, - 320, 40, 370, 0, 15, 369, 368, 367, 366, 365, - 31, 20, 18, 39, 364, 363, 304, 37, 362, 361, - 360, 291, 36, 359, 358, 19, 357, 25, 356, 355, - 354, 6, 353, 348, 16, + 0, 351, 350, 349, 282, 221, 348, 347, 346, 10, + 345, 6, 344, 44, 343, 14, 18, 27, 11, 26, + 8, 12, 340, 339, 9, 338, 337, 20, 24, 336, + 335, 334, 332, 331, 330, 329, 43, 13, 328, 327, + 326, 325, 324, 17, 323, 322, 321, 31, 320, 319, + 318, 317, 38, 23, 316, 315, 313, 312, 311, 310, + 309, 308, 307, 306, 36, 45, 305, 2, 16, 304, + 303, 302, 301, 300, 299, 29, 22, 19, 28, 298, + 297, 33, 30, 296, 295, 290, 32, 42, 289, 288, + 21, 287, 25, 284, 283, 268, 7, 267, 266, 15, + 5, 0, 257, } var protoR1 = [...]int8{ - 0, 1, 1, 1, 1, 4, 4, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 2, 5, 5, 5, - 6, 34, 34, 35, 35, 36, 36, 37, 37, 38, - 38, 39, 39, 7, 12, 12, 12, 12, 10, 15, - 15, 16, 16, 16, 19, 19, 19, 19, 19, 19, - 19, 19, 85, 85, 17, 17, 50, 49, 49, 48, - 48, 48, 48, 48, 48, 51, 51, 51, 11, 11, - 11, 11, 14, 14, 14, 23, 23, 18, 18, 18, - 20, 20, 20, 46, 46, 21, 21, 22, 22, 22, - 47, 47, 40, 40, 41, 41, 42, 42, 43, 43, - 44, 44, 45, 45, 33, 33, 33, 13, 9, 9, - 8, 56, 56, 55, 66, 66, 65, 65, 64, 64, - 64, 64, 64, 53, 53, 57, 57, 58, 58, 59, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 75, 75, 73, 73, 71, 71, 71, 74, - 74, 72, 72, 72, 24, 24, 68, 68, 69, 69, - 70, 67, 67, 76, 79, 79, 78, 78, 77, 77, - 77, 77, 77, 80, 80, 60, 63, 63, 62, 62, - 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, - 61, 61, 52, 52, 52, 52, 81, 84, 84, 83, - 83, 82, 82, 82, 82, 54, 54, 54, 54, 86, - 89, 89, 88, 88, 87, 87, 87, 87, 90, 90, - 94, 94, 93, 93, 92, 92, 91, 91, 91, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 30, + 0, 1, 1, 1, 1, 1, 1, 4, 6, 6, + 5, 5, 5, 5, 5, 5, 5, 5, 102, 102, + 101, 101, 100, 100, 2, 3, 7, 7, 7, 8, + 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, + 42, 42, 10, 11, 15, 15, 15, 15, 13, 18, + 18, 19, 19, 19, 22, 22, 22, 22, 22, 22, + 22, 22, 90, 90, 20, 20, 53, 52, 52, 51, + 51, 51, 51, 51, 51, 54, 54, 54, 14, 14, + 14, 14, 17, 17, 17, 26, 26, 21, 21, 21, + 23, 23, 23, 49, 49, 24, 24, 25, 25, 25, + 50, 50, 43, 43, 44, 44, 45, 45, 46, 46, + 47, 47, 48, 48, 36, 36, 36, 16, 16, 12, + 12, 9, 9, 59, 59, 61, 61, 58, 70, 70, + 69, 69, 68, 68, 68, 68, 68, 56, 56, 60, + 60, 62, 62, 63, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 80, 80, 78, 78, + 76, 76, 76, 79, 79, 77, 77, 77, 27, 27, + 73, 73, 74, 74, 75, 75, 71, 71, 72, 72, + 81, 84, 84, 83, 83, 82, 82, 82, 82, 85, + 85, 64, 67, 67, 66, 66, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 55, 55, 55, + 55, 86, 89, 89, 88, 88, 87, 87, 87, 87, + 57, 57, 57, 57, 91, 94, 94, 93, 93, 92, + 92, 92, 95, 95, 99, 99, 98, 98, 97, 97, + 96, 96, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 31, 31, 31, 31, 31, 31, 31, 31, 31, + 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, + 31, 31, 31, 31, 31, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, } var protoR2 = [...]int8{ - 0, 1, 1, 2, 0, 2, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 3, 4, 4, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 5, 1, 3, 1, 3, 3, 1, + 0, 1, 1, 1, 2, 2, 0, 2, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 1, 0, 1, 0, 4, 4, 3, 4, 4, 3, + 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, + 1, 3, 5, 5, 1, 3, 1, 3, 3, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 1, 2, 3, 2, 1, 1, 2, 1, 2, 2, 2, 2, 1, 3, 2, 3, 1, 3, 5, 3, 1, 1, 1, 1, 1, 1, 3, 2, 3, 2, 3, 1, 3, 1, 1, 3, 2, 3, 1, 3, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 1, 1, 3, 1, 3, - 3, 8, 9, 5, 0, 1, 2, 1, 1, 1, - 1, 2, 1, 5, 6, 7, 8, 5, 6, 6, + 1, 2, 1, 2, 1, 1, 1, 3, 2, 1, + 3, 3, 1, 8, 9, 9, 10, 6, 0, 1, + 2, 1, 1, 1, 1, 2, 1, 5, 6, 7, + 8, 5, 6, 6, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 4, 4, 1, 3, + 1, 3, 3, 1, 3, 1, 3, 3, 1, 2, + 4, 1, 4, 1, 3, 3, 1, 3, 1, 3, + 6, 1, 2, 2, 1, 1, 1, 1, 1, 4, + 5, 6, 1, 2, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 6, 7, 5, + 6, 6, 0, 1, 2, 1, 1, 1, 2, 1, + 6, 7, 5, 6, 6, 1, 2, 2, 1, 1, + 1, 1, 6, 9, 4, 3, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 4, 1, 3, 1, 3, 3, 1, - 3, 1, 3, 3, 1, 2, 3, 1, 3, 1, - 3, 1, 3, 5, 0, 1, 2, 1, 1, 1, - 1, 1, 1, 4, 5, 5, 0, 1, 2, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 6, 7, 5, 6, 5, 0, 1, 2, - 1, 1, 1, 2, 1, 6, 7, 5, 6, 5, - 0, 1, 2, 1, 1, 1, 1, 1, 6, 8, - 4, 3, 0, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -641,157 +677,169 @@ var protoR2 = [...]int8{ } var protoChk = [...]int16{ - -1000, -1, -2, -4, 8, -3, -5, -6, -7, -60, - -76, -81, -86, 52, 2, 9, 12, 13, 44, 43, - 45, 46, -4, -3, 51, -85, 10, 11, 4, -34, - -25, 7, 8, 9, 10, 11, 12, 13, 14, 15, + -1000, -1, -2, -3, -4, 8, 9, -101, -102, 53, + -4, -4, 52, 52, -6, -5, -7, -8, -11, -64, + -81, -86, -91, 2, 10, 13, 14, 45, 44, 46, + 47, 53, -90, 4, -90, -5, -90, 11, 12, -37, + -28, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, -12, -25, -10, 65, -25, -25, - -40, -34, 59, -25, -85, 52, 4, -85, -85, 52, - 59, 51, 59, -40, 54, 54, 54, -34, 54, 52, - 52, 52, -25, -15, -16, -17, -85, -19, -25, 54, - 6, 64, 63, 5, -25, -10, 66, -63, -62, -61, - -52, -76, -60, -81, -75, -56, -7, -55, -58, -68, - 52, 2, -33, -41, 39, 37, -59, 42, -70, 20, - 19, 18, -35, 59, 38, -27, 7, 8, 9, 10, - 11, 12, 14, 15, 16, 17, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 40, 41, 46, 47, 48, 49, -79, -78, -77, - -7, -80, -69, 52, 2, -32, 42, -70, 7, 8, - 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 43, 44, 45, 46, 47, 48, 49, -84, - -83, -82, -54, -56, 2, -33, -42, -36, 59, -28, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, -89, - -88, -87, -7, -90, 52, 2, 47, 52, -50, 55, - -49, -48, -51, 2, -11, -25, 67, 6, 16, 5, - 6, 16, 5, 55, -61, 36, -44, -38, 59, -30, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 46, 47, 48, 49, 50, -15, -28, -13, 66, -28, + -28, -43, -37, 60, -28, 53, 4, 53, -101, -90, + -90, -101, 60, 52, 60, -43, 55, 55, 55, -37, + 55, -101, -101, -28, -18, -19, -20, -90, -22, -28, + 55, 6, 65, 64, 5, -28, -13, 67, -67, -101, + -84, -101, -89, -88, -87, -57, -59, 2, -36, -45, + 21, 20, 19, -39, 60, -31, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, -94, -101, -101, -53, + 56, -52, -51, -54, 2, -14, -28, 68, 6, 17, + 5, 6, 17, 5, 56, -66, -65, -55, -81, -64, + -86, -80, -61, -11, -58, -62, -73, 2, -36, -44, + 40, 38, -63, 43, -75, -38, 60, 39, -30, 7, + 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 41, 42, 47, 48, 49, + 50, 56, -83, -82, -11, -85, -74, 2, -35, 43, + -75, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, -25, -73, -71, 5, -25, -25, -73, -67, - -85, 59, -34, 62, 55, -77, 51, -74, -72, -24, - 5, 64, 55, -82, 52, -44, -25, 59, -34, 55, - -87, -25, 55, -49, 60, 52, 60, 52, 53, 53, - -23, -18, -22, -17, 62, 67, -34, 2, -25, -25, - 59, -34, 51, 52, -13, 60, 67, 40, 54, 51, - 52, 52, 60, -25, -26, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, -24, 60, 52, - 40, 5, -25, 51, -25, -94, 65, -14, -16, -18, - -20, 67, -14, -50, 61, -47, 68, 2, -18, 68, - 57, 68, 51, 51, -25, 5, 52, -71, -9, -8, - -12, 5, 41, -66, -65, -64, -7, -53, -57, 2, - -43, 36, -37, 59, -29, 7, 8, 9, 10, 11, - 12, 14, 15, 16, 17, 21, 22, 23, 24, 25, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, + 48, 49, 50, 56, -87, 53, 37, -47, -41, 60, + -33, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, -28, 60, -37, 56, -93, -92, + -11, -95, 2, 48, 56, -52, 61, 53, 61, 53, + 54, 54, -26, -21, -25, -20, 63, 68, -37, 2, + -101, -65, 37, -47, -28, -78, -76, 5, -28, -28, + -78, -71, -72, -90, -28, 60, -37, 63, -101, -82, + 52, -79, -77, -27, 5, 65, -101, -28, -28, 60, + -37, 52, -28, -101, -92, -28, -17, -19, -21, -23, + 68, -17, -53, 62, -50, 69, 2, -21, 69, 58, + 69, -28, -28, 52, 53, -16, 61, 68, 41, 55, + 52, 53, -101, 61, -101, 61, -28, -29, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 5, -85, 60, 52, -13, -72, -24, - 41, 51, 5, 49, 48, -45, -39, 59, -31, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 49, -46, 68, 2, -21, -16, -18, 61, 68, 60, - 68, -34, 5, 5, 52, -13, 68, 60, 51, 55, - -64, 52, -25, -25, 59, -34, 52, -13, -40, 52, - 5, 52, -13, -94, -40, 66, 59, -34, 68, 60, - 68, -18, 68, 54, -13, 52, -13, 52, -8, -15, - 51, 51, -25, 52, 61, 52, -13, 52, 52, 54, - 66, -25, -21, -63, 54, 52, 5, 5, 52, -93, - -92, -91, -7, 52, 2, 55, -63, 52, -13, 54, - -13, 55, -91, 55, 52, -63, 54, 55, -63, 55, + -27, 61, 53, 41, 5, 52, 52, -28, 5, -99, + 66, -49, 69, 2, -24, -19, -21, 62, 69, 61, + 69, -37, 52, 52, 5, -101, -101, -76, -12, 69, + -9, -15, 5, 42, -70, -69, -68, -10, -56, -60, + 2, 14, -46, 37, -40, 60, -32, 7, 8, 9, + 10, 11, 12, 13, 15, 16, 17, 18, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 5, -101, -90, -28, + 61, -101, -16, -77, -101, -27, 42, 5, 5, -100, + -16, 53, 50, 49, -48, -42, 60, -34, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 50, 69, 61, 69, -21, 69, 5, 5, -101, -16, + 69, 61, 52, 56, -68, 53, -15, -28, -28, 60, + -37, -101, -16, -43, -101, 55, -16, -100, -16, -100, + -99, -43, 67, 60, -37, -24, 55, -16, -101, -16, + -101, -9, -18, -101, 52, 52, 52, -28, -101, 62, + -67, 55, -100, -101, 55, 67, -28, -67, 55, -101, + -18, 5, 5, 56, -67, -98, -101, 56, -67, -100, + -100, -16, 55, -16, 56, 56, -97, -96, -11, 2, + -101, 56, -100, -67, 55, -101, -96, -101, 56, -67, + 56, } var protoDef = [...]int16{ - -2, -2, -2, -2, 0, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, - 0, 0, -2, 5, 0, 0, 0, 0, 52, 0, - 21, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 0, 34, 36, 0, 0, 0, - 0, 92, 0, 0, 0, 17, 53, 0, 0, 20, - 0, 0, 0, 0, -2, -2, -2, 93, -2, 16, - 18, 19, 22, 0, 39, 40, 41, 42, 43, 0, - 44, 0, 0, 49, 35, 37, 38, 0, -2, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 0, 0, 0, 0, 0, 0, 157, 104, - 105, 106, 94, 0, 254, 23, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + -2, -2, -2, -2, 3, 0, 0, 0, 20, 18, + 4, 5, 0, 0, -2, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 0, 0, 0, 0, 0, 0, + 0, 19, 0, 62, 0, 8, 21, 0, 0, 21, + 30, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 0, 44, 46, 0, 0, + 0, 0, 102, 0, 0, 24, 63, 25, 26, 21, + 21, 29, 0, 0, 0, 0, 21, 21, -2, 103, + 21, 27, 28, 31, 21, 49, 50, 51, 52, 53, + 0, 54, 0, 0, 59, 45, 47, 48, 0, -2, + 0, -2, 0, -2, 215, 216, 217, 219, 0, 0, + 114, 115, 116, 106, 0, 34, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 0, -2, 43, 0, + 65, 66, -2, 69, 74, 0, 78, 0, 55, 58, + 61, 56, 57, 60, 21, -2, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 0, 0, + 0, 0, 0, 0, 171, 104, 0, 268, 32, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 255, 256, 257, 258, 259, 260, 0, -2, 167, - 168, 169, 170, 171, 172, 0, 0, 159, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, 339, 340, 0, - -2, 200, 201, 202, 204, 0, 0, 96, 0, 25, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 0, - -2, 213, 214, 215, 216, 217, 0, 33, 0, 55, - 56, -2, 59, 64, 0, 68, 0, 45, 48, 51, - 46, 47, 50, 175, 178, 0, 0, 100, 0, 29, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 0, 0, 144, 146, 0, 0, 0, 0, - 161, 0, 95, 0, 163, 166, 0, 0, 149, 151, - 154, 0, 196, 199, 203, 0, 0, 0, 97, 209, - 212, 0, 54, 58, 60, 61, 62, 63, 0, 0, - 66, 75, 76, 77, 0, 0, 0, 0, 0, 0, - 0, 101, 0, 142, 0, 0, 0, 0, -2, 0, - 156, 160, 0, 24, 0, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 0, 0, 158, - 0, 155, 0, 0, 26, 0, 0, 67, 72, 73, - 74, 0, 65, 0, 79, 0, 88, 0, 90, 69, - 0, 71, 0, 0, 30, 0, 143, 145, 0, 108, - 0, 147, 148, 0, -2, 117, 118, 119, 120, 122, - 0, 0, 98, 0, 27, 341, 342, 343, 344, 345, - 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, - 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, - 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, - 376, 377, 378, 0, 162, 0, 173, 0, 150, 152, - 153, 0, 0, 0, 0, 0, 102, 0, 31, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, - 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, - 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, - 462, 0, 81, 0, 83, 85, 86, 78, 87, 0, - 89, 0, 0, 0, 194, 0, 107, 0, 0, 113, - 116, 121, 0, 0, 0, 99, 127, 0, 0, 174, - 0, 207, 0, 0, 0, 221, 0, 103, 80, 0, - 82, 91, 70, -2, 0, 192, 0, 195, 109, 110, - 0, 0, 28, 128, 129, 205, 0, 208, 218, -2, - 220, 32, 84, 0, -2, 193, 0, 0, 206, 0, - -2, 225, 226, 227, 228, 111, 0, 123, 0, -2, - 0, 219, 224, 112, 124, 0, -2, 125, 0, 126, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 269, 270, 271, 272, 273, + 274, 21, -2, 184, 185, 186, 187, 188, 0, 0, + 173, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 21, 214, 218, 0, 0, 110, 0, + 38, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, + 435, 436, 437, 438, 0, 0, 107, 21, -2, 228, + 229, 230, 231, 0, 64, 68, 70, 71, 72, 73, + 0, 0, 76, 85, 86, 87, 0, 0, 0, 0, + 191, 194, 0, 0, 0, 0, 158, 160, 0, 0, + 0, 21, 21, 176, 178, 0, 105, 0, 180, 183, + 0, 0, 163, 165, 168, 0, 211, 0, 0, 0, + 111, 0, 35, 224, 227, 0, 77, 82, 83, 84, + 0, 75, 0, 89, 0, 98, 0, 100, 79, 0, + 81, 0, 0, 0, 21, 21, 0, 0, 0, -2, + 0, 21, 174, 0, 175, 0, 33, 0, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 21, 0, 21, 0, 169, 0, 0, 39, 23, 0, + 0, 0, 91, 0, 93, 95, 96, 88, 97, 0, + 99, 0, 0, 0, 21, 156, 157, 159, 0, 118, + 119, 122, 161, 162, 0, -2, 131, 132, 133, 134, + 136, 0, 0, 0, 108, 0, 36, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 21, 170, 177, 179, + 0, 189, 21, 164, 172, 166, 167, 0, 23, 222, + 23, 22, 0, 0, 0, 112, 0, 40, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 90, 0, 92, 101, 80, 0, 21, 209, 21, + 117, 0, 0, 21, 130, 135, 0, 0, 0, 0, + 109, 141, 21, 0, 190, 21, 0, 220, 23, 223, + 21, 0, 235, 0, 113, 94, 21, 0, 207, 21, + 210, 120, 121, 127, 0, 0, 0, 37, 142, 143, + 0, 21, 221, 232, 21, 234, 41, 0, 21, 208, + 23, 23, 0, 123, 0, 0, -2, 21, 0, 42, + 137, 23, 21, 0, 124, 21, -2, 239, 240, 241, + 125, 21, 138, 0, 21, 233, 238, 126, 139, 0, + 140, } var protoTok1 = [...]int8{ 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 76, 3, 74, 73, 72, 70, 3, - 65, 66, 69, 63, 60, 64, 59, 57, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 53, 52, - 62, 51, 61, 58, 75, 3, 3, 3, 3, 3, + 3, 3, 3, 77, 3, 75, 74, 73, 71, 3, + 66, 67, 70, 64, 61, 65, 60, 58, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 54, 53, + 63, 52, 62, 59, 76, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 67, 56, 68, 71, 3, 78, 3, 3, 3, + 3, 68, 57, 69, 72, 3, 79, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 54, 3, 55, 77, + 3, 3, 3, 55, 3, 56, 78, } var protoTok2 = [...]int8{ @@ -799,7 +847,7 @@ var protoTok2 = [...]int8{ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, } var protoTok3 = [...]int8{ @@ -1152,267 +1200,320 @@ protodefault: protoDollar = protoS[protopt-1 : protopt+1] { lex := protolex.(*protoLex) - protoVAL.file = ast.NewFileNode(lex.info, nil, protoDollar[1].fileElements, lex.eof) + protoVAL.file = ast.NewFileNodeWithEdition(lex.info, protoDollar[1].ed, nil, lex.eof) lex.res = protoVAL.file } case 3: - protoDollar = protoS[protopt-2 : protopt+1] + protoDollar = protoS[protopt-1 : protopt+1] { lex := protolex.(*protoLex) - protoVAL.file = ast.NewFileNode(lex.info, protoDollar[1].syn, protoDollar[2].fileElements, lex.eof) + protoVAL.file = ast.NewFileNode(lex.info, nil, protoDollar[1].fileElements, lex.eof) lex.res = protoVAL.file } case 4: - protoDollar = protoS[protopt-0 : protopt+1] + protoDollar = protoS[protopt-2 : protopt+1] { lex := protolex.(*protoLex) - protoVAL.file = ast.NewFileNode(lex.info, nil, nil, lex.eof) + protoVAL.file = ast.NewFileNode(lex.info, protoDollar[1].syn, protoDollar[2].fileElements, lex.eof) lex.res = protoVAL.file } case 5: protoDollar = protoS[protopt-2 : protopt+1] { - if protoDollar[2].fileElement != nil { - protoVAL.fileElements = append(protoDollar[1].fileElements, protoDollar[2].fileElement) - } else { - protoVAL.fileElements = protoDollar[1].fileElements - } + lex := protolex.(*protoLex) + protoVAL.file = ast.NewFileNodeWithEdition(lex.info, protoDollar[1].ed, protoDollar[2].fileElements, lex.eof) + lex.res = protoVAL.file } case 6: - protoDollar = protoS[protopt-1 : protopt+1] + protoDollar = protoS[protopt-0 : protopt+1] { - if protoDollar[1].fileElement != nil { - protoVAL.fileElements = []ast.FileElement{protoDollar[1].fileElement} - } else { - protoVAL.fileElements = nil - } + lex := protolex.(*protoLex) + protoVAL.file = ast.NewFileNode(lex.info, nil, nil, lex.eof) + lex.res = protoVAL.file } case 7: - protoDollar = protoS[protopt-1 : protopt+1] + protoDollar = protoS[protopt-2 : protopt+1] { - protoVAL.fileElement = protoDollar[1].imprt + protoVAL.fileElements = newFileElements(protoDollar[1].bs, protoDollar[2].fileElements) } case 8: - protoDollar = protoS[protopt-1 : protopt+1] + protoDollar = protoS[protopt-2 : protopt+1] { - protoVAL.fileElement = protoDollar[1].pkg + protoVAL.fileElements = append(protoDollar[1].fileElements, protoDollar[2].fileElements...) } case 9: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.fileElement = protoDollar[1].opt + protoVAL.fileElements = protoDollar[1].fileElements } case 10: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.fileElement = protoDollar[1].msg + protoVAL.fileElements = toFileElements(protoDollar[1].imprt) } case 11: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.fileElement = protoDollar[1].en + protoVAL.fileElements = toFileElements(protoDollar[1].pkg) } case 12: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.fileElement = protoDollar[1].extend + protoVAL.fileElements = toFileElements(protoDollar[1].opt) } case 13: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.fileElement = protoDollar[1].svc + protoVAL.fileElements = toFileElements(protoDollar[1].msg) } case 14: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.fileElement = ast.NewEmptyDeclNode(protoDollar[1].b) + protoVAL.fileElements = toFileElements(protoDollar[1].en) } case 15: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.fileElement = nil + protoVAL.fileElements = toFileElements(protoDollar[1].extend) } case 16: + protoDollar = protoS[protopt-1 : protopt+1] + { + protoVAL.fileElements = toFileElements(protoDollar[1].svc) + } + case 17: + protoDollar = protoS[protopt-1 : protopt+1] + { + protoVAL.fileElements = nil + } + case 18: + protoDollar = protoS[protopt-1 : protopt+1] + { + protoVAL.bs = []*ast.RuneNode{protoDollar[1].b} + } + case 19: + protoDollar = protoS[protopt-2 : protopt+1] + { + protoVAL.bs = append(protoDollar[1].bs, protoDollar[2].b) + } + case 20: + protoDollar = protoS[protopt-1 : protopt+1] + { + protoVAL.bs = protoDollar[1].bs + } + case 21: + protoDollar = protoS[protopt-0 : protopt+1] + { + protoVAL.bs = nil + } + case 22: + protoDollar = protoS[protopt-1 : protopt+1] + { + protoVAL.b = protoDollar[1].b + } + case 23: + protoDollar = protoS[protopt-0 : protopt+1] + { + protolex.(*protoLex).Error("expected ';'") + protoVAL.b = nil + } + case 24: protoDollar = protoS[protopt-4 : protopt+1] { protoVAL.syn = ast.NewSyntaxNode(protoDollar[1].id.ToKeyword(), protoDollar[2].b, toStringValueNode(protoDollar[3].str), protoDollar[4].b) } - case 17: + case 25: + protoDollar = protoS[protopt-4 : protopt+1] + { + protoVAL.ed = ast.NewEditionNode(protoDollar[1].id.ToKeyword(), protoDollar[2].b, toStringValueNode(protoDollar[3].str), protoDollar[4].b) + } + case 26: protoDollar = protoS[protopt-3 : protopt+1] { - protoVAL.imprt = ast.NewImportNode(protoDollar[1].id.ToKeyword(), nil, nil, toStringValueNode(protoDollar[2].str), protoDollar[3].b) + semi, extra := protolex.(*protoLex).requireSemicolon(protoDollar[3].bs) + protoVAL.imprt = newNodeWithEmptyDecls(ast.NewImportNode(protoDollar[1].id.ToKeyword(), nil, nil, toStringValueNode(protoDollar[2].str), semi), extra) } - case 18: + case 27: protoDollar = protoS[protopt-4 : protopt+1] { - protoVAL.imprt = ast.NewImportNode(protoDollar[1].id.ToKeyword(), nil, protoDollar[2].id.ToKeyword(), toStringValueNode(protoDollar[3].str), protoDollar[4].b) + semi, extra := protolex.(*protoLex).requireSemicolon(protoDollar[4].bs) + protoVAL.imprt = newNodeWithEmptyDecls(ast.NewImportNode(protoDollar[1].id.ToKeyword(), nil, protoDollar[2].id.ToKeyword(), toStringValueNode(protoDollar[3].str), semi), extra) } - case 19: + case 28: protoDollar = protoS[protopt-4 : protopt+1] { - protoVAL.imprt = ast.NewImportNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id.ToKeyword(), nil, toStringValueNode(protoDollar[3].str), protoDollar[4].b) + semi, extra := protolex.(*protoLex).requireSemicolon(protoDollar[4].bs) + protoVAL.imprt = newNodeWithEmptyDecls(ast.NewImportNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id.ToKeyword(), nil, toStringValueNode(protoDollar[3].str), semi), extra) } - case 20: + case 29: protoDollar = protoS[protopt-3 : protopt+1] { - protoVAL.pkg = ast.NewPackageNode(protoDollar[1].id.ToKeyword(), protoDollar[2].cid.toIdentValueNode(nil), protoDollar[3].b) + semi, extra := protolex.(*protoLex).requireSemicolon(protoDollar[3].bs) + protoVAL.pkg = newNodeWithEmptyDecls(ast.NewPackageNode(protoDollar[1].id.ToKeyword(), protoDollar[2].cid.toIdentValueNode(nil), semi), extra) } - case 21: + case 30: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.cid = &identSlices{idents: []*ast.IdentNode{protoDollar[1].id}} } - case 22: + case 31: protoDollar = protoS[protopt-3 : protopt+1] { protoDollar[1].cid.idents = append(protoDollar[1].cid.idents, protoDollar[3].id) protoDollar[1].cid.dots = append(protoDollar[1].cid.dots, protoDollar[2].b) protoVAL.cid = protoDollar[1].cid } - case 23: + case 32: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.cid = &identSlices{idents: []*ast.IdentNode{protoDollar[1].id}} } - case 24: + case 33: protoDollar = protoS[protopt-3 : protopt+1] { protoDollar[1].cid.idents = append(protoDollar[1].cid.idents, protoDollar[3].id) protoDollar[1].cid.dots = append(protoDollar[1].cid.dots, protoDollar[2].b) protoVAL.cid = protoDollar[1].cid } - case 25: + case 34: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.cid = &identSlices{idents: []*ast.IdentNode{protoDollar[1].id}} } - case 26: + case 35: protoDollar = protoS[protopt-3 : protopt+1] { protoDollar[1].cid.idents = append(protoDollar[1].cid.idents, protoDollar[3].id) protoDollar[1].cid.dots = append(protoDollar[1].cid.dots, protoDollar[2].b) protoVAL.cid = protoDollar[1].cid } - case 27: + case 36: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.cid = &identSlices{idents: []*ast.IdentNode{protoDollar[1].id}} } - case 28: + case 37: protoDollar = protoS[protopt-3 : protopt+1] { protoDollar[1].cid.idents = append(protoDollar[1].cid.idents, protoDollar[3].id) protoDollar[1].cid.dots = append(protoDollar[1].cid.dots, protoDollar[2].b) protoVAL.cid = protoDollar[1].cid } - case 29: + case 38: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.cid = &identSlices{idents: []*ast.IdentNode{protoDollar[1].id}} } - case 30: + case 39: protoDollar = protoS[protopt-3 : protopt+1] { protoDollar[1].cid.idents = append(protoDollar[1].cid.idents, protoDollar[3].id) protoDollar[1].cid.dots = append(protoDollar[1].cid.dots, protoDollar[2].b) protoVAL.cid = protoDollar[1].cid } - case 31: + case 40: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.cid = &identSlices{idents: []*ast.IdentNode{protoDollar[1].id}} } - case 32: + case 41: protoDollar = protoS[protopt-3 : protopt+1] { protoDollar[1].cid.idents = append(protoDollar[1].cid.idents, protoDollar[3].id) protoDollar[1].cid.dots = append(protoDollar[1].cid.dots, protoDollar[2].b) protoVAL.cid = protoDollar[1].cid } - case 33: + case 42: protoDollar = protoS[protopt-5 : protopt+1] { optName := ast.NewOptionNameNode(protoDollar[2].optNms.refs, protoDollar[2].optNms.dots) - protoVAL.opt = ast.NewOptionNode(protoDollar[1].id.ToKeyword(), optName, protoDollar[3].b, protoDollar[4].v, protoDollar[5].b) + protoVAL.optRaw = ast.NewOptionNode(protoDollar[1].id.ToKeyword(), optName, protoDollar[3].b, protoDollar[4].v, protoDollar[5].b) } - case 34: + case 43: + protoDollar = protoS[protopt-5 : protopt+1] + { + optName := ast.NewOptionNameNode(protoDollar[2].optNms.refs, protoDollar[2].optNms.dots) + semi, extra := protolex.(*protoLex).requireSemicolon(protoDollar[5].bs) + protoVAL.opt = newNodeWithEmptyDecls(ast.NewOptionNode(protoDollar[1].id.ToKeyword(), optName, protoDollar[3].b, protoDollar[4].v, semi), extra) + } + case 44: protoDollar = protoS[protopt-1 : protopt+1] { fieldReferenceNode := ast.NewFieldReferenceNode(protoDollar[1].id) protoVAL.optNms = &fieldRefSlices{refs: []*ast.FieldReferenceNode{fieldReferenceNode}} } - case 35: + case 45: protoDollar = protoS[protopt-3 : protopt+1] { protoDollar[1].optNms.refs = append(protoDollar[1].optNms.refs, ast.NewFieldReferenceNode(protoDollar[3].id)) protoDollar[1].optNms.dots = append(protoDollar[1].optNms.dots, protoDollar[2].b) protoVAL.optNms = protoDollar[1].optNms } - case 36: + case 46: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.optNms = &fieldRefSlices{refs: []*ast.FieldReferenceNode{protoDollar[1].ref}} } - case 37: + case 47: protoDollar = protoS[protopt-3 : protopt+1] { protoDollar[1].optNms.refs = append(protoDollar[1].optNms.refs, protoDollar[3].ref) protoDollar[1].optNms.dots = append(protoDollar[1].optNms.dots, protoDollar[2].b) protoVAL.optNms = protoDollar[1].optNms } - case 38: + case 48: protoDollar = protoS[protopt-3 : protopt+1] { protoVAL.ref = ast.NewExtensionFieldReferenceNode(protoDollar[1].b, protoDollar[2].tid, protoDollar[3].b) } - case 41: + case 51: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.v = toStringValueNode(protoDollar[1].str) } - case 43: + case 53: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.v = protoDollar[1].id } - case 44: + case 54: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.v = protoDollar[1].f } - case 45: + case 55: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.v = ast.NewSignedFloatLiteralNode(protoDollar[1].b, protoDollar[2].f) } - case 46: + case 56: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.v = ast.NewSignedFloatLiteralNode(protoDollar[1].b, protoDollar[2].f) } - case 47: + case 57: protoDollar = protoS[protopt-2 : protopt+1] { f := ast.NewSpecialFloatLiteralNode(protoDollar[2].id.ToKeyword()) protoVAL.v = ast.NewSignedFloatLiteralNode(protoDollar[1].b, f) } - case 48: + case 58: protoDollar = protoS[protopt-2 : protopt+1] { f := ast.NewSpecialFloatLiteralNode(protoDollar[2].id.ToKeyword()) protoVAL.v = ast.NewSignedFloatLiteralNode(protoDollar[1].b, f) } - case 49: + case 59: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.v = protoDollar[1].i } - case 50: + case 60: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.v = ast.NewPositiveUintLiteralNode(protoDollar[1].b, protoDollar[2].i) } - case 51: + case 61: protoDollar = protoS[protopt-2 : protopt+1] { if protoDollar[2].i.Val > math.MaxInt64+1 { @@ -1422,17 +1523,17 @@ protodefault: protoVAL.v = ast.NewNegativeIntLiteralNode(protoDollar[1].b, protoDollar[2].i) } } - case 52: + case 62: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.str = []*ast.StringLiteralNode{protoDollar[1].s} } - case 53: + case 63: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.str = append(protoDollar[1].str, protoDollar[2].s) } - case 54: + case 64: protoDollar = protoS[protopt-3 : protopt+1] { if protoDollar[2].msgLitFlds == nil { @@ -1442,12 +1543,12 @@ protodefault: protoVAL.v = ast.NewMessageLiteralNode(protoDollar[1].b, fields, delimiters, protoDollar[3].b) } } - case 55: + case 65: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.v = ast.NewMessageLiteralNode(protoDollar[1].b, nil, nil, protoDollar[2].b) } - case 58: + case 68: protoDollar = protoS[protopt-2 : protopt+1] { if protoDollar[1].msgLitFlds != nil { @@ -1457,7 +1558,7 @@ protodefault: protoVAL.msgLitFlds = protoDollar[2].msgLitFlds } } - case 59: + case 69: protoDollar = protoS[protopt-1 : protopt+1] { if protoDollar[1].msgLitFld != nil { @@ -1466,7 +1567,7 @@ protodefault: protoVAL.msgLitFlds = nil } } - case 60: + case 70: protoDollar = protoS[protopt-2 : protopt+1] { if protoDollar[1].msgLitFld != nil { @@ -1475,7 +1576,7 @@ protodefault: protoVAL.msgLitFlds = nil } } - case 61: + case 71: protoDollar = protoS[protopt-2 : protopt+1] { if protoDollar[1].msgLitFld != nil { @@ -1484,65 +1585,65 @@ protodefault: protoVAL.msgLitFlds = nil } } - case 62: + case 72: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.msgLitFlds = nil } - case 63: + case 73: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.msgLitFlds = nil } - case 64: + case 74: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.msgLitFlds = nil } - case 65: + case 75: protoDollar = protoS[protopt-3 : protopt+1] { - if protoDollar[1].ref != nil { + if protoDollar[1].ref != nil && protoDollar[2].b != nil { protoVAL.msgLitFld = ast.NewMessageFieldNode(protoDollar[1].ref, protoDollar[2].b, protoDollar[3].v) } else { protoVAL.msgLitFld = nil } } - case 66: + case 76: protoDollar = protoS[protopt-2 : protopt+1] { - if protoDollar[1].ref != nil { + if protoDollar[1].ref != nil && protoDollar[2].v != nil { protoVAL.msgLitFld = ast.NewMessageFieldNode(protoDollar[1].ref, nil, protoDollar[2].v) } else { protoVAL.msgLitFld = nil } } - case 67: + case 77: protoDollar = protoS[protopt-3 : protopt+1] { protoVAL.msgLitFld = nil } - case 68: + case 78: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.ref = ast.NewFieldReferenceNode(protoDollar[1].id) } - case 69: + case 79: protoDollar = protoS[protopt-3 : protopt+1] { protoVAL.ref = ast.NewExtensionFieldReferenceNode(protoDollar[1].b, protoDollar[2].cid.toIdentValueNode(nil), protoDollar[3].b) } - case 70: + case 80: protoDollar = protoS[protopt-5 : protopt+1] { protoVAL.ref = ast.NewAnyTypeReferenceNode(protoDollar[1].b, protoDollar[2].cid.toIdentValueNode(nil), protoDollar[3].b, protoDollar[4].cid.toIdentValueNode(nil), protoDollar[5].b) } - case 71: + case 81: protoDollar = protoS[protopt-3 : protopt+1] { protoVAL.ref = nil } - case 78: + case 88: protoDollar = protoS[protopt-3 : protopt+1] { if protoDollar[2].msgLitFlds == nil { @@ -1552,12 +1653,12 @@ protodefault: protoVAL.v = ast.NewMessageLiteralNode(protoDollar[1].b, fields, delimiters, protoDollar[3].b) } } - case 79: + case 89: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.v = ast.NewMessageLiteralNode(protoDollar[1].b, nil, nil, protoDollar[2].b) } - case 80: + case 90: protoDollar = protoS[protopt-3 : protopt+1] { if protoDollar[2].sl == nil { @@ -1566,29 +1667,29 @@ protodefault: protoVAL.v = ast.NewArrayLiteralNode(protoDollar[1].b, protoDollar[2].sl.vals, protoDollar[2].sl.commas, protoDollar[3].b) } } - case 81: + case 91: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.v = ast.NewArrayLiteralNode(protoDollar[1].b, nil, nil, protoDollar[2].b) } - case 82: + case 92: protoDollar = protoS[protopt-3 : protopt+1] { - protoVAL.v = nil + protoVAL.v = ast.NewArrayLiteralNode(protoDollar[1].b, nil, nil, protoDollar[3].b) } - case 83: + case 93: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.sl = &valueSlices{vals: []ast.ValueNode{protoDollar[1].v}} } - case 84: + case 94: protoDollar = protoS[protopt-3 : protopt+1] { protoDollar[1].sl.vals = append(protoDollar[1].sl.vals, protoDollar[3].v) protoDollar[1].sl.commas = append(protoDollar[1].sl.commas, protoDollar[2].b) protoVAL.sl = protoDollar[1].sl } - case 87: + case 97: protoDollar = protoS[protopt-3 : protopt+1] { if protoDollar[2].sl == nil { @@ -1597,132 +1698,155 @@ protodefault: protoVAL.v = ast.NewArrayLiteralNode(protoDollar[1].b, protoDollar[2].sl.vals, protoDollar[2].sl.commas, protoDollar[3].b) } } - case 88: + case 98: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.v = ast.NewArrayLiteralNode(protoDollar[1].b, nil, nil, protoDollar[2].b) } - case 89: + case 99: protoDollar = protoS[protopt-3 : protopt+1] { - protoVAL.v = nil + protoVAL.v = ast.NewArrayLiteralNode(protoDollar[1].b, nil, nil, protoDollar[3].b) } - case 90: + case 100: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.sl = &valueSlices{vals: []ast.ValueNode{protoDollar[1].v}} } - case 91: + case 101: protoDollar = protoS[protopt-3 : protopt+1] { protoDollar[1].sl.vals = append(protoDollar[1].sl.vals, protoDollar[3].v) protoDollar[1].sl.commas = append(protoDollar[1].sl.commas, protoDollar[2].b) protoVAL.sl = protoDollar[1].sl } - case 92: + case 102: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.tid = protoDollar[1].cid.toIdentValueNode(nil) } - case 93: + case 103: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.tid = protoDollar[2].cid.toIdentValueNode(protoDollar[1].b) } - case 94: + case 104: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.tid = protoDollar[1].cid.toIdentValueNode(nil) } - case 95: + case 105: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.tid = protoDollar[2].cid.toIdentValueNode(protoDollar[1].b) } - case 96: + case 106: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.tid = protoDollar[1].cid.toIdentValueNode(nil) } - case 97: + case 107: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.tid = protoDollar[2].cid.toIdentValueNode(protoDollar[1].b) } - case 98: + case 108: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.tid = protoDollar[1].cid.toIdentValueNode(nil) } - case 99: + case 109: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.tid = protoDollar[2].cid.toIdentValueNode(protoDollar[1].b) } - case 100: + case 110: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.tid = protoDollar[1].cid.toIdentValueNode(nil) } - case 101: + case 111: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.tid = protoDollar[2].cid.toIdentValueNode(protoDollar[1].b) } - case 102: + case 112: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.tid = protoDollar[1].cid.toIdentValueNode(nil) } - case 103: + case 113: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.tid = protoDollar[2].cid.toIdentValueNode(protoDollar[1].b) } - case 107: + case 117: protoDollar = protoS[protopt-3 : protopt+1] { protoVAL.cmpctOpts = ast.NewCompactOptionsNode(protoDollar[1].b, protoDollar[2].opts.options, protoDollar[2].opts.commas, protoDollar[3].b) } - case 108: + case 118: + protoDollar = protoS[protopt-2 : protopt+1] + { + protolex.(*protoLex).Error("compact options must have at least one option") + protoVAL.cmpctOpts = ast.NewCompactOptionsNode(protoDollar[1].b, nil, nil, protoDollar[2].b) + } + case 119: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.opts = &compactOptionSlices{options: []*ast.OptionNode{protoDollar[1].opt}} + protoVAL.opts = &compactOptionSlices{options: []*ast.OptionNode{protoDollar[1].optRaw}} } - case 109: + case 120: protoDollar = protoS[protopt-3 : protopt+1] { - protoDollar[1].opts.options = append(protoDollar[1].opts.options, protoDollar[3].opt) + protoDollar[1].opts.options = append(protoDollar[1].opts.options, protoDollar[3].optRaw) protoDollar[1].opts.commas = append(protoDollar[1].opts.commas, protoDollar[2].b) protoVAL.opts = protoDollar[1].opts } - case 110: + case 121: protoDollar = protoS[protopt-3 : protopt+1] { optName := ast.NewOptionNameNode(protoDollar[1].optNms.refs, protoDollar[1].optNms.dots) - protoVAL.opt = ast.NewCompactOptionNode(optName, protoDollar[2].b, protoDollar[3].v) + protoVAL.optRaw = ast.NewCompactOptionNode(optName, protoDollar[2].b, protoDollar[3].v) } - case 111: + case 122: + protoDollar = protoS[protopt-1 : protopt+1] + { + optName := ast.NewOptionNameNode(protoDollar[1].optNms.refs, protoDollar[1].optNms.dots) + protolex.(*protoLex).Error("compact option must have a value") + protoVAL.optRaw = ast.NewCompactOptionNode(optName, nil, nil) + } + case 123: protoDollar = protoS[protopt-8 : protopt+1] { protoVAL.grp = ast.NewGroupNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id.ToKeyword(), protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, nil, protoDollar[6].b, protoDollar[7].msgElements, protoDollar[8].b) } - case 112: + case 124: protoDollar = protoS[protopt-9 : protopt+1] { protoVAL.grp = ast.NewGroupNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id.ToKeyword(), protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, protoDollar[6].cmpctOpts, protoDollar[7].b, protoDollar[8].msgElements, protoDollar[9].b) } - case 113: - protoDollar = protoS[protopt-5 : protopt+1] + case 125: + protoDollar = protoS[protopt-9 : protopt+1] + { + protoVAL.msgGrp = newNodeWithEmptyDecls(ast.NewGroupNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id.ToKeyword(), protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, nil, protoDollar[6].b, protoDollar[7].msgElements, protoDollar[8].b), protoDollar[9].bs) + } + case 126: + protoDollar = protoS[protopt-10 : protopt+1] { - protoVAL.oo = ast.NewOneofNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].ooElements, protoDollar[5].b) + protoVAL.msgGrp = newNodeWithEmptyDecls(ast.NewGroupNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id.ToKeyword(), protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, protoDollar[6].cmpctOpts, protoDollar[7].b, protoDollar[8].msgElements, protoDollar[9].b), protoDollar[10].bs) } - case 114: + case 127: + protoDollar = protoS[protopt-6 : protopt+1] + { + protoVAL.oo = newNodeWithEmptyDecls(ast.NewOneofNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].ooElements, protoDollar[5].b), protoDollar[6].bs) + } + case 128: protoDollar = protoS[protopt-0 : protopt+1] { protoVAL.ooElements = nil } - case 116: + case 130: protoDollar = protoS[protopt-2 : protopt+1] { if protoDollar[2].ooElement != nil { @@ -1731,7 +1855,7 @@ protodefault: protoVAL.ooElements = protoDollar[1].ooElements } } - case 117: + case 131: protoDollar = protoS[protopt-1 : protopt+1] { if protoDollar[1].ooElement != nil { @@ -1740,349 +1864,367 @@ protodefault: protoVAL.ooElements = nil } } - case 118: + case 132: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.ooElement = protoDollar[1].opt + protoVAL.ooElement = protoDollar[1].optRaw } - case 119: + case 133: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.ooElement = protoDollar[1].fld } - case 120: + case 134: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.ooElement = protoDollar[1].grp } - case 121: + case 135: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.ooElement = nil } - case 122: + case 136: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.ooElement = nil } - case 123: + case 137: protoDollar = protoS[protopt-5 : protopt+1] { protoVAL.fld = ast.NewFieldNode(nil, protoDollar[1].tid, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, nil, protoDollar[5].b) } - case 124: + case 138: protoDollar = protoS[protopt-6 : protopt+1] { protoVAL.fld = ast.NewFieldNode(nil, protoDollar[1].tid, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, protoDollar[5].cmpctOpts, protoDollar[6].b) } - case 125: + case 139: protoDollar = protoS[protopt-7 : protopt+1] { protoVAL.grp = ast.NewGroupNode(nil, protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, nil, protoDollar[5].b, protoDollar[6].msgElements, protoDollar[7].b) } - case 126: + case 140: protoDollar = protoS[protopt-8 : protopt+1] { protoVAL.grp = ast.NewGroupNode(nil, protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, protoDollar[5].cmpctOpts, protoDollar[6].b, protoDollar[7].msgElements, protoDollar[8].b) } - case 127: + case 141: protoDollar = protoS[protopt-5 : protopt+1] { - protoVAL.mapFld = ast.NewMapFieldNode(protoDollar[1].mapType, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, nil, protoDollar[5].b) + semi, extra := protolex.(*protoLex).requireSemicolon(protoDollar[5].bs) + protoVAL.mapFld = newNodeWithEmptyDecls(ast.NewMapFieldNode(protoDollar[1].mapType, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, nil, semi), extra) } - case 128: + case 142: protoDollar = protoS[protopt-6 : protopt+1] { - protoVAL.mapFld = ast.NewMapFieldNode(protoDollar[1].mapType, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, protoDollar[5].cmpctOpts, protoDollar[6].b) + semi, extra := protolex.(*protoLex).requireSemicolon(protoDollar[6].bs) + protoVAL.mapFld = newNodeWithEmptyDecls(ast.NewMapFieldNode(protoDollar[1].mapType, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, protoDollar[5].cmpctOpts, semi), extra) } - case 129: + case 143: protoDollar = protoS[protopt-6 : protopt+1] { protoVAL.mapType = ast.NewMapTypeNode(protoDollar[1].id.ToKeyword(), protoDollar[2].b, protoDollar[3].id, protoDollar[4].b, protoDollar[5].tid, protoDollar[6].b) } - case 142: - protoDollar = protoS[protopt-3 : protopt+1] + case 156: + protoDollar = protoS[protopt-4 : protopt+1] { - protoVAL.ext = ast.NewExtensionRangeNode(protoDollar[1].id.ToKeyword(), protoDollar[2].rngs.ranges, protoDollar[2].rngs.commas, nil, protoDollar[3].b) + // TODO: Tolerate a missing semicolon here. This currnelty creates a shift/reduce conflict + // between `extensions 1 to 10` and `extensions 1` followed by `to = 10`. + protoVAL.ext = newNodeWithEmptyDecls(ast.NewExtensionRangeNode(protoDollar[1].id.ToKeyword(), protoDollar[2].rngs.ranges, protoDollar[2].rngs.commas, nil, protoDollar[3].b), protoDollar[4].bs) } - case 143: + case 157: protoDollar = protoS[protopt-4 : protopt+1] { - protoVAL.ext = ast.NewExtensionRangeNode(protoDollar[1].id.ToKeyword(), protoDollar[2].rngs.ranges, protoDollar[2].rngs.commas, protoDollar[3].cmpctOpts, protoDollar[4].b) + semi, extra := protolex.(*protoLex).requireSemicolon(protoDollar[4].bs) + protoVAL.ext = newNodeWithEmptyDecls(ast.NewExtensionRangeNode(protoDollar[1].id.ToKeyword(), protoDollar[2].rngs.ranges, protoDollar[2].rngs.commas, protoDollar[3].cmpctOpts, semi), extra) } - case 144: + case 158: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.rngs = &rangeSlices{ranges: []*ast.RangeNode{protoDollar[1].rng}} } - case 145: + case 159: protoDollar = protoS[protopt-3 : protopt+1] { protoDollar[1].rngs.ranges = append(protoDollar[1].rngs.ranges, protoDollar[3].rng) protoDollar[1].rngs.commas = append(protoDollar[1].rngs.commas, protoDollar[2].b) protoVAL.rngs = protoDollar[1].rngs } - case 146: + case 160: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.rng = ast.NewRangeNode(protoDollar[1].i, nil, nil, nil) } - case 147: + case 161: protoDollar = protoS[protopt-3 : protopt+1] { protoVAL.rng = ast.NewRangeNode(protoDollar[1].i, protoDollar[2].id.ToKeyword(), protoDollar[3].i, nil) } - case 148: + case 162: protoDollar = protoS[protopt-3 : protopt+1] { protoVAL.rng = ast.NewRangeNode(protoDollar[1].i, protoDollar[2].id.ToKeyword(), nil, protoDollar[3].id.ToKeyword()) } - case 149: + case 163: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.rngs = &rangeSlices{ranges: []*ast.RangeNode{protoDollar[1].rng}} } - case 150: + case 164: protoDollar = protoS[protopt-3 : protopt+1] { protoDollar[1].rngs.ranges = append(protoDollar[1].rngs.ranges, protoDollar[3].rng) protoDollar[1].rngs.commas = append(protoDollar[1].rngs.commas, protoDollar[2].b) protoVAL.rngs = protoDollar[1].rngs } - case 151: + case 165: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.rng = ast.NewRangeNode(protoDollar[1].il, nil, nil, nil) } - case 152: + case 166: protoDollar = protoS[protopt-3 : protopt+1] { protoVAL.rng = ast.NewRangeNode(protoDollar[1].il, protoDollar[2].id.ToKeyword(), protoDollar[3].il, nil) } - case 153: + case 167: protoDollar = protoS[protopt-3 : protopt+1] { protoVAL.rng = ast.NewRangeNode(protoDollar[1].il, protoDollar[2].id.ToKeyword(), nil, protoDollar[3].id.ToKeyword()) } - case 154: + case 168: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.il = protoDollar[1].i } - case 155: + case 169: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.il = ast.NewNegativeIntLiteralNode(protoDollar[1].b, protoDollar[2].i) } - case 156: - protoDollar = protoS[protopt-3 : protopt+1] + case 170: + protoDollar = protoS[protopt-4 : protopt+1] { - protoVAL.resvd = ast.NewReservedRangesNode(protoDollar[1].id.ToKeyword(), protoDollar[2].rngs.ranges, protoDollar[2].rngs.commas, protoDollar[3].b) + // TODO: Tolerate a missing semicolon here. This currnelty creates a shift/reduce conflict + // between `reserved 1 to 10` and `reserved 1` followed by `to = 10`. + protoVAL.resvd = newNodeWithEmptyDecls(ast.NewReservedRangesNode(protoDollar[1].id.ToKeyword(), protoDollar[2].rngs.ranges, protoDollar[2].rngs.commas, protoDollar[3].b), protoDollar[4].bs) } - case 158: + case 172: + protoDollar = protoS[protopt-4 : protopt+1] + { + // TODO: Tolerate a missing semicolon here. This currnelty creates a shift/reduce conflict + // between `reserved 1 to 10` and `reserved 1` followed by `to = 10`. + protoVAL.resvd = newNodeWithEmptyDecls(ast.NewReservedRangesNode(protoDollar[1].id.ToKeyword(), protoDollar[2].rngs.ranges, protoDollar[2].rngs.commas, protoDollar[3].b), protoDollar[4].bs) + } + case 174: protoDollar = protoS[protopt-3 : protopt+1] { - protoVAL.resvd = ast.NewReservedRangesNode(protoDollar[1].id.ToKeyword(), protoDollar[2].rngs.ranges, protoDollar[2].rngs.commas, protoDollar[3].b) + semi, extra := protolex.(*protoLex).requireSemicolon(protoDollar[3].bs) + protoVAL.resvd = newNodeWithEmptyDecls(ast.NewReservedNamesNode(protoDollar[1].id.ToKeyword(), protoDollar[2].names.names, protoDollar[2].names.commas, semi), extra) } - case 160: + case 175: protoDollar = protoS[protopt-3 : protopt+1] { - protoVAL.resvd = ast.NewReservedNamesNode(protoDollar[1].id.ToKeyword(), protoDollar[2].names.names, protoDollar[2].names.commas, protoDollar[3].b) + semi, extra := protolex.(*protoLex).requireSemicolon(protoDollar[3].bs) + protoVAL.resvd = newNodeWithEmptyDecls(ast.NewReservedIdentifiersNode(protoDollar[1].id.ToKeyword(), protoDollar[2].names.idents, protoDollar[2].names.commas, semi), extra) } - case 161: + case 176: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.names = &nameSlices{names: []ast.StringValueNode{toStringValueNode(protoDollar[1].str)}} } - case 162: + case 177: protoDollar = protoS[protopt-3 : protopt+1] { protoDollar[1].names.names = append(protoDollar[1].names.names, toStringValueNode(protoDollar[3].str)) protoDollar[1].names.commas = append(protoDollar[1].names.commas, protoDollar[2].b) protoVAL.names = protoDollar[1].names } - case 163: - protoDollar = protoS[protopt-5 : protopt+1] + case 178: + protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.en = ast.NewEnumNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].enElements, protoDollar[5].b) + protoVAL.names = &nameSlices{idents: []*ast.IdentNode{protoDollar[1].id}} } - case 164: - protoDollar = protoS[protopt-0 : protopt+1] + case 179: + protoDollar = protoS[protopt-3 : protopt+1] { - protoVAL.enElements = nil + protoDollar[1].names.idents = append(protoDollar[1].names.idents, protoDollar[3].id) + protoDollar[1].names.commas = append(protoDollar[1].names.commas, protoDollar[2].b) + protoVAL.names = protoDollar[1].names } - case 166: - protoDollar = protoS[protopt-2 : protopt+1] + case 180: + protoDollar = protoS[protopt-6 : protopt+1] { - if protoDollar[2].enElement != nil { - protoVAL.enElements = append(protoDollar[1].enElements, protoDollar[2].enElement) - } else { - protoVAL.enElements = protoDollar[1].enElements - } + protoVAL.en = newNodeWithEmptyDecls(ast.NewEnumNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].enElements, protoDollar[5].b), protoDollar[6].bs) } - case 167: + case 181: protoDollar = protoS[protopt-1 : protopt+1] { - if protoDollar[1].enElement != nil { - protoVAL.enElements = []ast.EnumElement{protoDollar[1].enElement} - } else { - protoVAL.enElements = nil - } + protoVAL.enElements = newEnumElements(protoDollar[1].bs, nil) } - case 168: + case 182: + protoDollar = protoS[protopt-2 : protopt+1] + { + protoVAL.enElements = newEnumElements(protoDollar[1].bs, protoDollar[2].enElements) + } + case 183: + protoDollar = protoS[protopt-2 : protopt+1] + { + protoVAL.enElements = append(protoDollar[1].enElements, protoDollar[2].enElements...) + } + case 184: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.enElement = protoDollar[1].opt + protoVAL.enElements = protoDollar[1].enElements } - case 169: + case 185: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.enElement = protoDollar[1].env + protoVAL.enElements = toEnumElements(protoDollar[1].opt) } - case 170: + case 186: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.enElement = protoDollar[1].resvd + protoVAL.enElements = toEnumElements(protoDollar[1].env) } - case 171: + case 187: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.enElement = ast.NewEmptyDeclNode(protoDollar[1].b) + protoVAL.enElements = toEnumElements(protoDollar[1].resvd) } - case 172: + case 188: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.enElement = nil + protoVAL.enElements = nil } - case 173: + case 189: protoDollar = protoS[protopt-4 : protopt+1] { - protoVAL.env = ast.NewEnumValueNode(protoDollar[1].id, protoDollar[2].b, protoDollar[3].il, nil, protoDollar[4].b) + semi, extra := protolex.(*protoLex).requireSemicolon(protoDollar[4].bs) + protoVAL.env = newNodeWithEmptyDecls(ast.NewEnumValueNode(protoDollar[1].id, protoDollar[2].b, protoDollar[3].il, nil, semi), extra) } - case 174: + case 190: protoDollar = protoS[protopt-5 : protopt+1] { - protoVAL.env = ast.NewEnumValueNode(protoDollar[1].id, protoDollar[2].b, protoDollar[3].il, protoDollar[4].cmpctOpts, protoDollar[5].b) + semi, extra := protolex.(*protoLex).requireSemicolon(protoDollar[5].bs) + protoVAL.env = newNodeWithEmptyDecls(ast.NewEnumValueNode(protoDollar[1].id, protoDollar[2].b, protoDollar[3].il, protoDollar[4].cmpctOpts, semi), extra) } - case 175: - protoDollar = protoS[protopt-5 : protopt+1] + case 191: + protoDollar = protoS[protopt-6 : protopt+1] { - protoVAL.msg = ast.NewMessageNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].msgElements, protoDollar[5].b) + protoVAL.msg = newNodeWithEmptyDecls(ast.NewMessageNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].msgElements, protoDollar[5].b), protoDollar[6].bs) } - case 176: - protoDollar = protoS[protopt-0 : protopt+1] + case 192: + protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.msgElements = nil + protoVAL.msgElements = newMessageElements(protoDollar[1].bs, nil) } - case 178: + case 193: protoDollar = protoS[protopt-2 : protopt+1] { - if protoDollar[2].msgElement != nil { - protoVAL.msgElements = append(protoDollar[1].msgElements, protoDollar[2].msgElement) - } else { - protoVAL.msgElements = protoDollar[1].msgElements - } + protoVAL.msgElements = newMessageElements(protoDollar[1].bs, protoDollar[2].msgElements) } - case 179: - protoDollar = protoS[protopt-1 : protopt+1] + case 194: + protoDollar = protoS[protopt-2 : protopt+1] { - if protoDollar[1].msgElement != nil { - protoVAL.msgElements = []ast.MessageElement{protoDollar[1].msgElement} - } else { - protoVAL.msgElements = nil - } + protoVAL.msgElements = append(protoDollar[1].msgElements, protoDollar[2].msgElements...) } - case 180: + case 195: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.msgElement = protoDollar[1].fld + protoVAL.msgElements = protoDollar[1].msgElements } - case 181: + case 196: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.msgElement = protoDollar[1].en + protoVAL.msgElements = toMessageElements(protoDollar[1].msgFld) } - case 182: + case 197: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.msgElement = protoDollar[1].msg + protoVAL.msgElements = toMessageElements(protoDollar[1].en) } - case 183: + case 198: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.msgElement = protoDollar[1].extend + protoVAL.msgElements = toMessageElements(protoDollar[1].msg) } - case 184: + case 199: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.msgElement = protoDollar[1].ext + protoVAL.msgElements = toMessageElements(protoDollar[1].extend) } - case 185: + case 200: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.msgElement = protoDollar[1].grp + protoVAL.msgElements = toMessageElements(protoDollar[1].ext) } - case 186: + case 201: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.msgElement = protoDollar[1].opt + protoVAL.msgElements = toMessageElements(protoDollar[1].msgGrp) } - case 187: + case 202: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.msgElement = protoDollar[1].oo + protoVAL.msgElements = toMessageElements(protoDollar[1].opt) } - case 188: + case 203: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.msgElement = protoDollar[1].mapFld + protoVAL.msgElements = toMessageElements(protoDollar[1].oo) } - case 189: + case 204: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.msgElement = protoDollar[1].resvd + protoVAL.msgElements = toMessageElements(protoDollar[1].mapFld) } - case 190: + case 205: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.msgElement = ast.NewEmptyDeclNode(protoDollar[1].b) + protoVAL.msgElements = toMessageElements(protoDollar[1].resvd) } - case 191: + case 206: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.msgElement = nil + protoVAL.msgElements = nil } - case 192: + case 207: protoDollar = protoS[protopt-6 : protopt+1] { - protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, nil, protoDollar[6].b) + semis, extra := protolex.(*protoLex).requireSemicolon(protoDollar[6].bs) + protoVAL.msgFld = newNodeWithEmptyDecls(ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, nil, semis), extra) } - case 193: + case 208: protoDollar = protoS[protopt-7 : protopt+1] { - protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, protoDollar[6].cmpctOpts, protoDollar[7].b) + semis, extra := protolex.(*protoLex).requireSemicolon(protoDollar[7].bs) + protoVAL.msgFld = newNodeWithEmptyDecls(ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, protoDollar[6].cmpctOpts, semis), extra) } - case 194: + case 209: protoDollar = protoS[protopt-5 : protopt+1] { - protoVAL.fld = ast.NewFieldNode(nil, protoDollar[1].tid, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, nil, protoDollar[5].b) + semis, extra := protolex.(*protoLex).requireSemicolon(protoDollar[5].bs) + protoVAL.msgFld = newNodeWithEmptyDecls(ast.NewFieldNode(nil, protoDollar[1].tid, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, nil, semis), extra) } - case 195: + case 210: protoDollar = protoS[protopt-6 : protopt+1] { - protoVAL.fld = ast.NewFieldNode(nil, protoDollar[1].tid, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, protoDollar[5].cmpctOpts, protoDollar[6].b) + semis, extra := protolex.(*protoLex).requireSemicolon(protoDollar[6].bs) + protoVAL.msgFld = newNodeWithEmptyDecls(ast.NewFieldNode(nil, protoDollar[1].tid, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, protoDollar[5].cmpctOpts, semis), extra) } - case 196: - protoDollar = protoS[protopt-5 : protopt+1] + case 211: + protoDollar = protoS[protopt-6 : protopt+1] { - protoVAL.extend = ast.NewExtendNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].b, protoDollar[4].extElements, protoDollar[5].b) + protoVAL.extend = newNodeWithEmptyDecls(ast.NewExtendNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].b, protoDollar[4].extElements, protoDollar[5].b), protoDollar[6].bs) } - case 197: + case 212: protoDollar = protoS[protopt-0 : protopt+1] { protoVAL.extElements = nil } - case 199: + case 214: protoDollar = protoS[protopt-2 : protopt+1] { if protoDollar[2].extElement != nil { @@ -2091,7 +2233,7 @@ protodefault: protoVAL.extElements = protoDollar[1].extElements } } - case 200: + case 215: protoDollar = protoS[protopt-1 : protopt+1] { if protoDollar[1].extElement != nil { @@ -2100,151 +2242,136 @@ protodefault: protoVAL.extElements = nil } } - case 201: + case 216: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.extElement = protoDollar[1].fld } - case 202: + case 217: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.extElement = protoDollar[1].grp } - case 203: + case 218: protoDollar = protoS[protopt-2 : protopt+1] { protoVAL.extElement = nil } - case 204: + case 219: protoDollar = protoS[protopt-1 : protopt+1] { protoVAL.extElement = nil } - case 205: + case 220: protoDollar = protoS[protopt-6 : protopt+1] { protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, nil, protoDollar[6].b) } - case 206: + case 221: protoDollar = protoS[protopt-7 : protopt+1] { protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, protoDollar[6].cmpctOpts, protoDollar[7].b) } - case 207: + case 222: protoDollar = protoS[protopt-5 : protopt+1] { protoVAL.fld = ast.NewFieldNode(nil, protoDollar[1].tid, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, nil, protoDollar[5].b) } - case 208: + case 223: protoDollar = protoS[protopt-6 : protopt+1] { protoVAL.fld = ast.NewFieldNode(nil, protoDollar[1].tid, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, protoDollar[5].cmpctOpts, protoDollar[6].b) } - case 209: - protoDollar = protoS[protopt-5 : protopt+1] + case 224: + protoDollar = protoS[protopt-6 : protopt+1] { - protoVAL.svc = ast.NewServiceNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].svcElements, protoDollar[5].b) + protoVAL.svc = newNodeWithEmptyDecls(ast.NewServiceNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].svcElements, protoDollar[5].b), protoDollar[6].bs) } - case 210: - protoDollar = protoS[protopt-0 : protopt+1] + case 225: + protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.svcElements = nil + protoVAL.svcElements = newServiceElements(protoDollar[1].bs, nil) } - case 212: + case 226: protoDollar = protoS[protopt-2 : protopt+1] { - if protoDollar[2].svcElement != nil { - protoVAL.svcElements = append(protoDollar[1].svcElements, protoDollar[2].svcElement) - } else { - protoVAL.svcElements = protoDollar[1].svcElements - } + protoVAL.svcElements = newServiceElements(protoDollar[1].bs, protoDollar[2].svcElements) } - case 213: - protoDollar = protoS[protopt-1 : protopt+1] + case 227: + protoDollar = protoS[protopt-2 : protopt+1] { - if protoDollar[1].svcElement != nil { - protoVAL.svcElements = []ast.ServiceElement{protoDollar[1].svcElement} - } else { - protoVAL.svcElements = nil - } + protoVAL.svcElements = append(protoDollar[1].svcElements, protoDollar[2].svcElements...) } - case 214: + case 228: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.svcElement = protoDollar[1].opt + protoVAL.svcElements = protoDollar[1].svcElements } - case 215: + case 229: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.svcElement = protoDollar[1].mtd + protoVAL.svcElements = toServiceElements(protoDollar[1].opt) } - case 216: + case 230: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.svcElement = ast.NewEmptyDeclNode(protoDollar[1].b) + protoVAL.svcElements = toServiceElements(protoDollar[1].mtd) } - case 217: + case 231: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.svcElement = nil + protoVAL.svcElements = nil } - case 218: + case 232: protoDollar = protoS[protopt-6 : protopt+1] { - protoVAL.mtd = ast.NewRPCNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].mtdMsgType, protoDollar[4].id.ToKeyword(), protoDollar[5].mtdMsgType, protoDollar[6].b) + semi, extra := protolex.(*protoLex).requireSemicolon(protoDollar[6].bs) + protoVAL.mtd = newNodeWithEmptyDecls(ast.NewRPCNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].mtdMsgType, protoDollar[4].id.ToKeyword(), protoDollar[5].mtdMsgType, semi), extra) } - case 219: - protoDollar = protoS[protopt-8 : protopt+1] + case 233: + protoDollar = protoS[protopt-9 : protopt+1] { - protoVAL.mtd = ast.NewRPCNodeWithBody(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].mtdMsgType, protoDollar[4].id.ToKeyword(), protoDollar[5].mtdMsgType, protoDollar[6].b, protoDollar[7].mtdElements, protoDollar[8].b) + protoVAL.mtd = newNodeWithEmptyDecls(ast.NewRPCNodeWithBody(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].mtdMsgType, protoDollar[4].id.ToKeyword(), protoDollar[5].mtdMsgType, protoDollar[6].b, protoDollar[7].mtdElements, protoDollar[8].b), protoDollar[9].bs) } - case 220: + case 234: protoDollar = protoS[protopt-4 : protopt+1] { protoVAL.mtdMsgType = ast.NewRPCTypeNode(protoDollar[1].b, protoDollar[2].id.ToKeyword(), protoDollar[3].tid, protoDollar[4].b) } - case 221: + case 235: protoDollar = protoS[protopt-3 : protopt+1] { protoVAL.mtdMsgType = ast.NewRPCTypeNode(protoDollar[1].b, nil, protoDollar[2].tid, protoDollar[3].b) } - case 222: - protoDollar = protoS[protopt-0 : protopt+1] + case 236: + protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.mtdElements = nil + protoVAL.mtdElements = newMethodElements(protoDollar[1].bs, nil) } - case 224: + case 237: protoDollar = protoS[protopt-2 : protopt+1] { - if protoDollar[2].mtdElement != nil { - protoVAL.mtdElements = append(protoDollar[1].mtdElements, protoDollar[2].mtdElement) - } else { - protoVAL.mtdElements = protoDollar[1].mtdElements - } + protoVAL.mtdElements = newMethodElements(protoDollar[1].bs, protoDollar[2].mtdElements) } - case 225: - protoDollar = protoS[protopt-1 : protopt+1] + case 238: + protoDollar = protoS[protopt-2 : protopt+1] { - if protoDollar[1].mtdElement != nil { - protoVAL.mtdElements = []ast.RPCElement{protoDollar[1].mtdElement} - } else { - protoVAL.mtdElements = nil - } + protoVAL.mtdElements = append(protoDollar[1].mtdElements, protoDollar[2].mtdElements...) } - case 226: + case 239: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.mtdElement = protoDollar[1].opt + protoVAL.mtdElements = protoDollar[1].mtdElements } - case 227: + case 240: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.mtdElement = ast.NewEmptyDeclNode(protoDollar[1].b) + protoVAL.mtdElements = toMethodElements(protoDollar[1].opt) } - case 228: + case 241: protoDollar = protoS[protopt-1 : protopt+1] { - protoVAL.mtdElement = nil + protoVAL.mtdElements = nil } } goto protostack /* stack new state and value */ diff --git a/vendor/github.com/bufbuild/protocompile/parser/result.go b/vendor/github.com/bufbuild/protocompile/parser/result.go index 211e12138c0f..3916a88518e8 100644 --- a/vendor/github.com/bufbuild/protocompile/parser/result.go +++ b/vendor/github.com/bufbuild/protocompile/parser/result.go @@ -16,7 +16,9 @@ package parser import ( "bytes" + "fmt" "math" + "sort" "strings" "unicode" @@ -28,6 +30,32 @@ import ( "github.com/bufbuild/protocompile/reporter" ) +var supportedEditions = map[string]descriptorpb.Edition{ + "2023": descriptorpb.Edition_EDITION_2023, +} + +// NB: protoreflect.Syntax doesn't yet know about editions, so we have to use our own type. +type syntaxType int + +const ( + syntaxProto2 = syntaxType(iota) + syntaxProto3 + syntaxEditions +) + +func (s syntaxType) String() string { + switch s { + case syntaxProto2: + return "proto2" + case syntaxProto3: + return "proto3" + case syntaxEditions: + return "editions" + default: + return fmt.Sprintf("unknown(%d)", s) + } +} + type result struct { file *ast.FileNode proto *descriptorpb.FileDescriptorProto @@ -84,24 +112,52 @@ func (r *result) createFileDescriptor(filename string, file *ast.FileNode, handl r.putFileNode(fd, file) - isProto3 := false - if file.Syntax != nil { - if file.Syntax.Syntax.AsString() == "proto3" { - isProto3 = true - } else if file.Syntax.Syntax.AsString() != "proto2" { + var syntax syntaxType + switch { + case file.Syntax != nil: + switch file.Syntax.Syntax.AsString() { + case "proto3": + syntax = syntaxProto3 + case "proto2": + syntax = syntaxProto2 + default: nodeInfo := file.NodeInfo(file.Syntax.Syntax) - if handler.HandleErrorf(nodeInfo.Start(), `syntax value must be "proto2" or "proto3"`) != nil { + if handler.HandleErrorf(nodeInfo, `syntax value must be "proto2" or "proto3"`) != nil { return } } - // proto2 is the default, so no need to set unless proto3 - if isProto3 { + // proto2 is the default, so no need to set for that value + if syntax != syntaxProto2 { fd.Syntax = proto.String(file.Syntax.Syntax.AsString()) } - } else { + case file.Edition != nil: + if !internal.AllowEditions { + nodeInfo := file.NodeInfo(file.Edition.Edition) + if handler.HandleErrorf(nodeInfo, `editions are not yet supported; use syntax proto2 or proto3 instead`) != nil { + return + } + } + edition := file.Edition.Edition.AsString() + syntax = syntaxEditions + + fd.Syntax = proto.String("editions") + editionEnum, ok := supportedEditions[edition] + if !ok { + nodeInfo := file.NodeInfo(file.Edition.Edition) + editionStrs := make([]string, 0, len(supportedEditions)) + for supportedEdition := range supportedEditions { + editionStrs = append(editionStrs, fmt.Sprintf("%q", supportedEdition)) + } + sort.Strings(editionStrs) + if handler.HandleErrorf(nodeInfo, `edition value %q not recognized; should be one of [%s]`, edition, strings.Join(editionStrs, ",")) != nil { + return + } + } + fd.Edition = editionEnum.Enum() + default: nodeInfo := file.NodeInfo(file) - handler.HandleWarningWithPos(nodeInfo.Start(), ErrNoSyntax) + handler.HandleWarningWithPos(nodeInfo, ErrNoSyntax) } for _, decl := range file.Decls { @@ -110,9 +166,9 @@ func (r *result) createFileDescriptor(filename string, file *ast.FileNode, handl } switch decl := decl.(type) { case *ast.EnumNode: - fd.EnumType = append(fd.EnumType, r.asEnumDescriptor(decl, handler)) + fd.EnumType = append(fd.EnumType, r.asEnumDescriptor(decl, syntax, handler)) case *ast.ExtendNode: - r.addExtensions(decl, &fd.Extension, &fd.MessageType, isProto3, handler, 0) + r.addExtensions(decl, &fd.Extension, &fd.MessageType, syntax, handler, 0) case *ast.ImportNode: index := len(fd.Dependency) fd.Dependency = append(fd.Dependency, decl.Name.AsString()) @@ -122,7 +178,7 @@ func (r *result) createFileDescriptor(filename string, file *ast.FileNode, handl fd.WeakDependency = append(fd.WeakDependency, int32(index)) } case *ast.MessageNode: - fd.MessageType = append(fd.MessageType, r.asMessageDescriptor(decl, isProto3, handler, 1)) + fd.MessageType = append(fd.MessageType, r.asMessageDescriptor(decl, syntax, handler, 1)) case *ast.OptionNode: if fd.Options == nil { fd.Options = &descriptorpb.FileOptions{} @@ -133,20 +189,20 @@ func (r *result) createFileDescriptor(filename string, file *ast.FileNode, handl case *ast.PackageNode: if fd.Package != nil { nodeInfo := file.NodeInfo(decl) - if handler.HandleErrorf(nodeInfo.Start(), "files should have only one package declaration") != nil { + if handler.HandleErrorf(nodeInfo, "files should have only one package declaration") != nil { return } } pkgName := string(decl.Name.AsIdentifier()) if len(pkgName) >= 512 { nodeInfo := file.NodeInfo(decl.Name) - if handler.HandleErrorf(nodeInfo.Start(), "package name (with whitespace removed) must be less than 512 characters long") != nil { + if handler.HandleErrorf(nodeInfo, "package name (with whitespace removed) must be less than 512 characters long") != nil { return } } if strings.Count(pkgName, ".") > 100 { nodeInfo := file.NodeInfo(decl.Name) - if handler.HandleErrorf(nodeInfo.Start(), "package name may not contain more than 100 periods") != nil { + if handler.HandleErrorf(nodeInfo, "package name may not contain more than 100 periods") != nil { return } } @@ -235,7 +291,7 @@ func (r *result) asUninterpretedOptionName(parts []*ast.FieldReferenceNode) []*d return ret } -func (r *result) addExtensions(ext *ast.ExtendNode, flds *[]*descriptorpb.FieldDescriptorProto, msgs *[]*descriptorpb.DescriptorProto, isProto3 bool, handler *reporter.Handler, depth int) { +func (r *result) addExtensions(ext *ast.ExtendNode, flds *[]*descriptorpb.FieldDescriptorProto, msgs *[]*descriptorpb.DescriptorProto, syntax syntaxType, handler *reporter.Handler, depth int) { extendee := string(ext.Extendee.AsIdentifier()) count := 0 for _, decl := range ext.Decls { @@ -243,13 +299,13 @@ func (r *result) addExtensions(ext *ast.ExtendNode, flds *[]*descriptorpb.FieldD case *ast.FieldNode: count++ // use higher limit since we don't know yet whether extendee is messageset wire format - fd := r.asFieldDescriptor(decl, internal.MaxTag, isProto3, handler) + fd := r.asFieldDescriptor(decl, internal.MaxTag, syntax, handler) fd.Extendee = proto.String(extendee) *flds = append(*flds, fd) case *ast.GroupNode: count++ // ditto: use higher limit right now - fd, md := r.asGroupDescriptors(decl, isProto3, internal.MaxTag, handler, depth+1) + fd, md := r.asGroupDescriptors(decl, syntax, internal.MaxTag, handler, depth+1) fd.Extendee = proto.String(extendee) *flds = append(*flds, fd) *msgs = append(*msgs, md) @@ -257,7 +313,7 @@ func (r *result) addExtensions(ext *ast.ExtendNode, flds *[]*descriptorpb.FieldD } if count == 0 { nodeInfo := r.file.NodeInfo(ext) - _ = handler.HandleErrorf(nodeInfo.Start(), "extend sections must define at least one extension") + _ = handler.HandleErrorf(nodeInfo, "extend sections must define at least one extension") } } @@ -275,7 +331,7 @@ func asLabel(lbl *ast.FieldLabel) *descriptorpb.FieldDescriptorProto_Label { } } -func (r *result) asFieldDescriptor(node *ast.FieldNode, maxTag int32, isProto3 bool, handler *reporter.Handler) *descriptorpb.FieldDescriptorProto { +func (r *result) asFieldDescriptor(node *ast.FieldNode, maxTag int32, syntax syntaxType, handler *reporter.Handler) *descriptorpb.FieldDescriptorProto { tag := node.Tag.Val if err := r.checkTag(node.Tag, tag, maxTag); err != nil { _ = handler.HandleError(err) @@ -285,7 +341,7 @@ func (r *result) asFieldDescriptor(node *ast.FieldNode, maxTag int32, isProto3 b if opts := node.Options.GetElements(); len(opts) > 0 { fd.Options = &descriptorpb.FieldOptions{UninterpretedOption: r.asUninterpretedOptions(opts)} } - if isProto3 && fd.Label != nil && fd.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL { + if syntax == syntaxProto3 && fd.Label != nil && fd.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL { fd.Proto3Optional = proto.Bool(true) } return fd @@ -328,14 +384,14 @@ func newFieldDescriptor(name string, fieldType string, tag int32, lbl *descripto return fd } -func (r *result) asGroupDescriptors(group *ast.GroupNode, isProto3 bool, maxTag int32, handler *reporter.Handler, depth int) (*descriptorpb.FieldDescriptorProto, *descriptorpb.DescriptorProto) { +func (r *result) asGroupDescriptors(group *ast.GroupNode, syntax syntaxType, maxTag int32, handler *reporter.Handler, depth int) (*descriptorpb.FieldDescriptorProto, *descriptorpb.DescriptorProto) { tag := group.Tag.Val if err := r.checkTag(group.Tag, tag, maxTag); err != nil { _ = handler.HandleError(err) } if !unicode.IsUpper(rune(group.Name.Val[0])) { nameNodeInfo := r.file.NodeInfo(group.Name) - _ = handler.HandleErrorf(nameNodeInfo.Start(), "group %s should have a name that starts with a capital letter", group.Name.Val) + _ = handler.HandleErrorf(nameNodeInfo, "group %s should have a name that starts with a capital letter", group.Name.Val) } fieldName := strings.ToLower(group.Name.Val) fd := &descriptorpb.FieldDescriptorProto{ @@ -354,19 +410,19 @@ func (r *result) asGroupDescriptors(group *ast.GroupNode, isProto3 bool, maxTag r.putMessageNode(md, group) // don't bother processing body if we've exceeded depth if r.checkDepth(depth, group, handler) { - r.addMessageBody(md, &group.MessageBody, isProto3, handler, depth) + r.addMessageBody(md, &group.MessageBody, syntax, handler, depth) } return fd, md } -func (r *result) asMapDescriptors(mapField *ast.MapFieldNode, isProto3 bool, maxTag int32, handler *reporter.Handler, depth int) (*descriptorpb.FieldDescriptorProto, *descriptorpb.DescriptorProto) { +func (r *result) asMapDescriptors(mapField *ast.MapFieldNode, syntax syntaxType, maxTag int32, handler *reporter.Handler, depth int) (*descriptorpb.FieldDescriptorProto, *descriptorpb.DescriptorProto) { tag := mapField.Tag.Val if err := r.checkTag(mapField.Tag, tag, maxTag); err != nil { _ = handler.HandleError(err) } r.checkDepth(depth, mapField, handler) var lbl *descriptorpb.FieldDescriptorProto_Label - if !isProto3 { + if syntax == syntaxProto2 { lbl = descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum() } keyFd := newFieldDescriptor("key", mapField.MapType.KeyType.Val, 1, lbl) @@ -410,7 +466,7 @@ func (r *result) asEnumValue(ev *ast.EnumValueNode, handler *reporter.Handler) * num, ok := ast.AsInt32(ev.Number, math.MinInt32, math.MaxInt32) if !ok { numberNodeInfo := r.file.NodeInfo(ev.Number) - _ = handler.HandleErrorf(numberNodeInfo.Start(), "value %d is out of range: should be between %d and %d", ev.Number.Value(), math.MinInt32, math.MaxInt32) + _ = handler.HandleErrorf(numberNodeInfo, "value %d is out of range: should be between %d and %d", ev.Number.Value(), math.MinInt32, math.MaxInt32) } evd := &descriptorpb.EnumValueDescriptorProto{Name: proto.String(ev.Name.Val), Number: proto.Int32(num)} r.putEnumValueNode(evd, ev) @@ -447,9 +503,10 @@ func (r *result) asMethodDescriptor(node *ast.RPCNode) *descriptorpb.MethodDescr return md } -func (r *result) asEnumDescriptor(en *ast.EnumNode, handler *reporter.Handler) *descriptorpb.EnumDescriptorProto { +func (r *result) asEnumDescriptor(en *ast.EnumNode, syntax syntaxType, handler *reporter.Handler) *descriptorpb.EnumDescriptorProto { ed := &descriptorpb.EnumDescriptorProto{Name: proto.String(en.Name.Val)} r.putEnumNode(ed, en) + rsvdNames := map[string]ast.SourcePos{} for _, decl := range en.Decls { switch decl := decl.(type) { case *ast.OptionNode: @@ -460,9 +517,7 @@ func (r *result) asEnumDescriptor(en *ast.EnumNode, handler *reporter.Handler) * case *ast.EnumValueNode: ed.Value = append(ed.Value, r.asEnumValue(decl, handler)) case *ast.ReservedNode: - for _, n := range decl.Names { - ed.ReservedName = append(ed.ReservedName, n.AsString()) - } + r.addReservedNames(&ed.ReservedName, decl, syntax, handler, rsvdNames) for _, rng := range decl.Ranges { ed.ReservedRange = append(ed.ReservedRange, r.asEnumReservedRange(rng, handler)) } @@ -481,16 +536,51 @@ func (r *result) asEnumReservedRange(rng *ast.RangeNode, handler *reporter.Handl return rr } -func (r *result) asMessageDescriptor(node *ast.MessageNode, isProto3 bool, handler *reporter.Handler, depth int) *descriptorpb.DescriptorProto { +func (r *result) asMessageDescriptor(node *ast.MessageNode, syntax syntaxType, handler *reporter.Handler, depth int) *descriptorpb.DescriptorProto { msgd := &descriptorpb.DescriptorProto{Name: proto.String(node.Name.Val)} r.putMessageNode(msgd, node) // don't bother processing body if we've exceeded depth if r.checkDepth(depth, node, handler) { - r.addMessageBody(msgd, &node.MessageBody, isProto3, handler, depth) + r.addMessageBody(msgd, &node.MessageBody, syntax, handler, depth) } return msgd } +func (r *result) addReservedNames(names *[]string, node *ast.ReservedNode, syntax syntaxType, handler *reporter.Handler, alreadyReserved map[string]ast.SourcePos) { + if syntax == syntaxEditions { + if len(node.Names) > 0 { + nameNodeInfo := r.file.NodeInfo(node.Names[0]) + _ = handler.HandleErrorf(nameNodeInfo, `must use identifiers, not string literals, to reserved names with editions`) + } + for _, n := range node.Identifiers { + name := string(n.AsIdentifier()) + nameNodeInfo := r.file.NodeInfo(n) + if existing, ok := alreadyReserved[name]; ok { + _ = handler.HandleErrorf(nameNodeInfo, "name %q is already reserved at %s", name, existing) + continue + } + alreadyReserved[name] = nameNodeInfo.Start() + *names = append(*names, name) + } + return + } + + if len(node.Identifiers) > 0 { + nameNodeInfo := r.file.NodeInfo(node.Identifiers[0]) + _ = handler.HandleErrorf(nameNodeInfo, `must use string literals, not identifiers, to reserved names with proto2 and proto3`) + } + for _, n := range node.Names { + name := n.AsString() + nameNodeInfo := r.file.NodeInfo(n) + if existing, ok := alreadyReserved[name]; ok { + _ = handler.HandleErrorf(nameNodeInfo, "name %q is already reserved at %s", name, existing) + continue + } + alreadyReserved[name] = nameNodeInfo.Start() + *names = append(*names, name) + } +} + func (r *result) checkDepth(depth int, node ast.MessageDeclNode, handler *reporter.Handler) bool { if depth < 32 { return true @@ -500,11 +590,11 @@ func (r *result) checkDepth(depth int, node ast.MessageDeclNode, handler *report // pinpoint the group keyword if the source is a group n = grp.Keyword } - _ = handler.HandleErrorf(r.file.NodeInfo(n).Start(), "message nesting depth must be less than 32") + _ = handler.HandleErrorf(r.file.NodeInfo(n), "message nesting depth must be less than 32") return false } -func (r *result) addMessageBody(msgd *descriptorpb.DescriptorProto, body *ast.MessageBody, isProto3 bool, handler *reporter.Handler, depth int) { +func (r *result) addMessageBody(msgd *descriptorpb.DescriptorProto, body *ast.MessageBody, syntax syntaxType, handler *reporter.Handler, depth int) { // first process any options for _, decl := range body.Decls { if opt, ok := decl.(*ast.OptionNode); ok { @@ -522,34 +612,34 @@ func (r *result) addMessageBody(msgd *descriptorpb.DescriptorProto, body *ast.Me if err != nil { return } else if messageSetOpt != nil { - if isProto3 { + if syntax == syntaxProto3 { node := r.OptionNode(messageSetOpt) nodeInfo := r.file.NodeInfo(node) - _ = handler.HandleErrorf(nodeInfo.Start(), "messages with message-set wire format are not allowed with proto3 syntax") + _ = handler.HandleErrorf(nodeInfo, "messages with message-set wire format are not allowed with proto3 syntax") } maxTag = internal.MaxTag // higher limit for messageset wire format } - rsvdNames := map[string]int{} + rsvdNames := map[string]ast.SourcePos{} // now we can process the rest for _, decl := range body.Decls { switch decl := decl.(type) { case *ast.EnumNode: - msgd.EnumType = append(msgd.EnumType, r.asEnumDescriptor(decl, handler)) + msgd.EnumType = append(msgd.EnumType, r.asEnumDescriptor(decl, syntax, handler)) case *ast.ExtendNode: - r.addExtensions(decl, &msgd.Extension, &msgd.NestedType, isProto3, handler, depth) + r.addExtensions(decl, &msgd.Extension, &msgd.NestedType, syntax, handler, depth) case *ast.ExtensionRangeNode: msgd.ExtensionRange = append(msgd.ExtensionRange, r.asExtensionRanges(decl, maxTag, handler)...) case *ast.FieldNode: - fd := r.asFieldDescriptor(decl, maxTag, isProto3, handler) + fd := r.asFieldDescriptor(decl, maxTag, syntax, handler) msgd.Field = append(msgd.Field, fd) case *ast.MapFieldNode: - fd, md := r.asMapDescriptors(decl, isProto3, maxTag, handler, depth+1) + fd, md := r.asMapDescriptors(decl, syntax, maxTag, handler, depth+1) msgd.Field = append(msgd.Field, fd) msgd.NestedType = append(msgd.NestedType, md) case *ast.GroupNode: - fd, md := r.asGroupDescriptors(decl, isProto3, maxTag, handler, depth+1) + fd, md := r.asGroupDescriptors(decl, syntax, maxTag, handler, depth+1) msgd.Field = append(msgd.Field, fd) msgd.NestedType = append(msgd.NestedType, md) case *ast.OneofNode: @@ -566,12 +656,12 @@ func (r *result) addMessageBody(msgd *descriptorpb.DescriptorProto, body *ast.Me } ood.Options.UninterpretedOption = append(ood.Options.UninterpretedOption, r.asUninterpretedOption(oodecl)) case *ast.FieldNode: - fd := r.asFieldDescriptor(oodecl, maxTag, isProto3, handler) + fd := r.asFieldDescriptor(oodecl, maxTag, syntax, handler) fd.OneofIndex = proto.Int32(int32(oodIndex)) msgd.Field = append(msgd.Field, fd) ooFields++ case *ast.GroupNode: - fd, md := r.asGroupDescriptors(oodecl, isProto3, maxTag, handler, depth+1) + fd, md := r.asGroupDescriptors(oodecl, syntax, maxTag, handler, depth+1) fd.OneofIndex = proto.Int32(int32(oodIndex)) msgd.Field = append(msgd.Field, fd) msgd.NestedType = append(msgd.NestedType, md) @@ -580,20 +670,12 @@ func (r *result) addMessageBody(msgd *descriptorpb.DescriptorProto, body *ast.Me } if ooFields == 0 { declNodeInfo := r.file.NodeInfo(decl) - _ = handler.HandleErrorf(declNodeInfo.Start(), "oneof must contain at least one field") + _ = handler.HandleErrorf(declNodeInfo, "oneof must contain at least one field") } case *ast.MessageNode: - msgd.NestedType = append(msgd.NestedType, r.asMessageDescriptor(decl, isProto3, handler, depth+1)) + msgd.NestedType = append(msgd.NestedType, r.asMessageDescriptor(decl, syntax, handler, depth+1)) case *ast.ReservedNode: - for _, n := range decl.Names { - count := rsvdNames[n.AsString()] - if count == 1 { // already seen - nameNodeInfo := r.file.NodeInfo(n) - _ = handler.HandleErrorf(nameNodeInfo.Start(), "name %q is reserved multiple times", n.AsString()) - } - rsvdNames[n.AsString()] = count + 1 - msgd.ReservedName = append(msgd.ReservedName, n.AsString()) - } + r.addReservedNames(&msgd.ReservedName, decl, syntax, handler, rsvdNames) for _, rng := range decl.Ranges { msgd.ReservedRange = append(msgd.ReservedRange, r.asMessageReservedRange(rng, maxTag, handler)) } @@ -604,17 +686,17 @@ func (r *result) addMessageBody(msgd *descriptorpb.DescriptorProto, body *ast.Me if len(msgd.Field) > 0 { node := r.FieldNode(msgd.Field[0]) nodeInfo := r.file.NodeInfo(node) - _ = handler.HandleErrorf(nodeInfo.Start(), "messages with message-set wire format cannot contain non-extension fields") + _ = handler.HandleErrorf(nodeInfo, "messages with message-set wire format cannot contain non-extension fields") } if len(msgd.ExtensionRange) == 0 { node := r.OptionNode(messageSetOpt) nodeInfo := r.file.NodeInfo(node) - _ = handler.HandleErrorf(nodeInfo.Start(), "messages with message-set wire format must contain at least one extension range") + _ = handler.HandleErrorf(nodeInfo, "messages with message-set wire format must contain at least one extension range") } } // process any proto3_optional fields - if isProto3 { + if syntax == syntaxProto3 { r.processProto3OptionalFields(msgd) } } @@ -640,7 +722,7 @@ func (r *result) isMessageSetWireFormat(scope string, md *descriptorpb.Descripto default: optNode := r.OptionNode(opt) optNodeInfo := r.file.NodeInfo(optNode.GetValue()) - return nil, handler.HandleErrorf(optNodeInfo.Start(), "%s: expecting bool value for message_set_wire_format option", scope) + return nil, handler.HandleErrorf(optNodeInfo, "%s: expecting bool value for message_set_wire_format option", scope) } } @@ -660,7 +742,7 @@ func (r *result) getRangeBounds(rng *ast.RangeNode, minVal, maxVal int32, handle if !ok { checkOrder = false startValNodeInfo := r.file.NodeInfo(rng.StartVal) - _ = handler.HandleErrorf(startValNodeInfo.Start(), "range start %d is out of range: should be between %d and %d", rng.StartValue(), minVal, maxVal) + _ = handler.HandleErrorf(startValNodeInfo, "range start %d is out of range: should be between %d and %d", rng.StartValue(), minVal, maxVal) } end, ok := rng.EndValueAsInt32(minVal, maxVal) @@ -668,13 +750,13 @@ func (r *result) getRangeBounds(rng *ast.RangeNode, minVal, maxVal int32, handle checkOrder = false if rng.EndVal != nil { endValNodeInfo := r.file.NodeInfo(rng.EndVal) - _ = handler.HandleErrorf(endValNodeInfo.Start(), "range end %d is out of range: should be between %d and %d", rng.EndValue(), minVal, maxVal) + _ = handler.HandleErrorf(endValNodeInfo, "range end %d is out of range: should be between %d and %d", rng.EndValue(), minVal, maxVal) } } if checkOrder && start > end { rangeStartNodeInfo := r.file.NodeInfo(rng.RangeStart()) - _ = handler.HandleErrorf(rangeStartNodeInfo.Start(), "range, %d to %d, is invalid: start must be <= end", start, end) + _ = handler.HandleErrorf(rangeStartNodeInfo, "range, %d to %d, is invalid: start must be <= end", start, end) } return start, end @@ -700,11 +782,11 @@ func (r *result) asServiceDescriptor(svc *ast.ServiceNode) *descriptorpb.Service func (r *result) checkTag(n ast.Node, v uint64, maxTag int32) error { switch { case v < 1: - return reporter.Errorf(r.file.NodeInfo(n).Start(), "tag number %d must be greater than zero", v) + return reporter.Errorf(r.file.NodeInfo(n), "tag number %d must be greater than zero", v) case v > uint64(maxTag): - return reporter.Errorf(r.file.NodeInfo(n).Start(), "tag number %d is higher than max allowed tag number (%d)", v, maxTag) + return reporter.Errorf(r.file.NodeInfo(n), "tag number %d is higher than max allowed tag number (%d)", v, maxTag) case v >= internal.SpecialReservedStart && v <= internal.SpecialReservedEnd: - return reporter.Errorf(r.file.NodeInfo(n).Start(), "tag number %d is in disallowed reserved range %d-%d", v, internal.SpecialReservedStart, internal.SpecialReservedEnd) + return reporter.Errorf(r.file.NodeInfo(n), "tag number %d is in disallowed reserved range %d-%d", v, internal.SpecialReservedStart, internal.SpecialReservedEnd) default: return nil } diff --git a/vendor/github.com/bufbuild/protocompile/parser/validate.go b/vendor/github.com/bufbuild/protocompile/parser/validate.go index c0f1223c28d0..769928d2fbc0 100644 --- a/vendor/github.com/bufbuild/protocompile/parser/validate.go +++ b/vendor/github.com/bufbuild/protocompile/parser/validate.go @@ -30,26 +30,55 @@ import ( func validateBasic(res *result, handler *reporter.Handler) { fd := res.proto - isProto3 := fd.GetSyntax() == "proto3" + var syntax syntaxType + switch fd.GetSyntax() { + case "", "proto2": + syntax = syntaxProto2 + case "proto3": + syntax = syntaxProto3 + case "editions": + syntax = syntaxEditions + // TODO: default: error? + } if err := validateImports(res, handler); err != nil { return } + if err := validateNoFeatures(res, syntax, "file options", fd.Options.GetUninterpretedOption(), handler); err != nil { + return + } + _ = walk.DescriptorProtos(fd, func(name protoreflect.FullName, d proto.Message) error { switch d := d.(type) { case *descriptorpb.DescriptorProto: - if err := validateMessage(res, isProto3, name, d, handler); err != nil { + if err := validateMessage(res, syntax, name, d, handler); err != nil { // exit func is not called when enter returns error return err } + case *descriptorpb.FieldDescriptorProto: + if err := validateField(res, syntax, name, d, handler); err != nil { + return err + } + case *descriptorpb.OneofDescriptorProto: + if err := validateNoFeatures(res, syntax, fmt.Sprintf("oneof %s", name), d.Options.GetUninterpretedOption(), handler); err != nil { + return err + } case *descriptorpb.EnumDescriptorProto: - if err := validateEnum(res, isProto3, name, d, handler); err != nil { + if err := validateEnum(res, syntax, name, d, handler); err != nil { return err } - case *descriptorpb.FieldDescriptorProto: - if err := validateField(res, isProto3, name, d, handler); err != nil { + case *descriptorpb.EnumValueDescriptorProto: + if err := validateNoFeatures(res, syntax, fmt.Sprintf("enum value %s", name), d.Options.GetUninterpretedOption(), handler); err != nil { + return err + } + case *descriptorpb.ServiceDescriptorProto: + if err := validateNoFeatures(res, syntax, fmt.Sprintf("service %s", name), d.Options.GetUninterpretedOption(), handler); err != nil { + return err + } + case *descriptorpb.MethodDescriptorProto: + if err := validateNoFeatures(res, syntax, fmt.Sprintf("method %s", name), d.Options.GetUninterpretedOption(), handler); err != nil { return err } } @@ -68,23 +97,40 @@ func validateImports(res *result, handler *reporter.Handler) error { if !ok { continue } - startPos := fileNode.NodeInfo(decl).Start() + info := fileNode.NodeInfo(decl) name := imp.Name.AsString() if prev, ok := imports[name]; ok { - return handler.HandleErrorf(startPos, "%q was already imported at %v", name, prev) + return handler.HandleErrorf(info, "%q was already imported at %v", name, prev) } - imports[name] = startPos + imports[name] = info.Start() } return nil } -func validateMessage(res *result, isProto3 bool, name protoreflect.FullName, md *descriptorpb.DescriptorProto, handler *reporter.Handler) error { +func validateNoFeatures(res *result, syntax syntaxType, scope string, opts []*descriptorpb.UninterpretedOption, handler *reporter.Handler) error { + if syntax == syntaxEditions { + // Editions is allowed to use features + return nil + } + if index, err := internal.FindFirstOption(res, handler, scope, opts, "features"); err != nil { + return err + } else if index >= 0 { + optNode := res.OptionNode(opts[index]) + optNameNodeInfo := res.file.NodeInfo(optNode.GetName()) + if err := handler.HandleErrorf(optNameNodeInfo, "%s: option 'features' may only be used with editions but file uses %s syntax", scope, syntax); err != nil { + return err + } + } + return nil +} + +func validateMessage(res *result, syntax syntaxType, name protoreflect.FullName, md *descriptorpb.DescriptorProto, handler *reporter.Handler) error { scope := fmt.Sprintf("message %s", name) - if isProto3 && len(md.ExtensionRange) > 0 { + if syntax == syntaxProto3 && len(md.ExtensionRange) > 0 { n := res.ExtensionRangeNode(md.ExtensionRange[0]) nInfo := res.file.NodeInfo(n) - if err := handler.HandleErrorf(nInfo.Start(), "%s: extension ranges are not allowed in proto3", scope); err != nil { + if err := handler.HandleErrorf(nInfo, "%s: extension ranges are not allowed in proto3", scope); err != nil { return err } } @@ -92,30 +138,17 @@ func validateMessage(res *result, isProto3 bool, name protoreflect.FullName, md if index, err := internal.FindOption(res, handler, scope, md.Options.GetUninterpretedOption(), "map_entry"); err != nil { return err } else if index >= 0 { - opt := md.Options.UninterpretedOption[index] - optn := res.OptionNode(opt) - md.Options.UninterpretedOption = internal.RemoveOption(md.Options.UninterpretedOption, index) - valid := false - if opt.IdentifierValue != nil { - if opt.GetIdentifierValue() == "true" { - valid = true - optionNodeInfo := res.file.NodeInfo(optn.GetValue()) - if err := handler.HandleErrorf(optionNodeInfo.Start(), "%s: map_entry option should not be set explicitly; use map type instead", scope); err != nil { - return err - } - } else if opt.GetIdentifierValue() == "false" { - valid = true - md.Options.MapEntry = proto.Bool(false) - } - } - if !valid { - optionNodeInfo := res.file.NodeInfo(optn.GetValue()) - if err := handler.HandleErrorf(optionNodeInfo.Start(), "%s: expecting bool value for map_entry option", scope); err != nil { - return err - } + optNode := res.OptionNode(md.Options.GetUninterpretedOption()[index]) + optNameNodeInfo := res.file.NodeInfo(optNode.GetName()) + if err := handler.HandleErrorf(optNameNodeInfo, "%s: map_entry option should not be set explicitly; use map type instead", scope); err != nil { + return err } } + if err := validateNoFeatures(res, syntax, scope, md.Options.GetUninterpretedOption(), handler); err != nil { + return err + } + // reserved ranges should not overlap rsvd := make(tagRanges, len(md.ReservedRange)) for i, r := range md.ReservedRange { @@ -126,7 +159,7 @@ func validateMessage(res *result, isProto3 bool, name protoreflect.FullName, md for i := 1; i < len(rsvd); i++ { if rsvd[i].start < rsvd[i-1].end { rangeNodeInfo := res.file.NodeInfo(rsvd[i].node) - if err := handler.HandleErrorf(rangeNodeInfo.Start(), "%s: reserved ranges overlap: %d to %d and %d to %d", scope, rsvd[i-1].start, rsvd[i-1].end-1, rsvd[i].start, rsvd[i].end-1); err != nil { + if err := handler.HandleErrorf(rangeNodeInfo, "%s: reserved ranges overlap: %d to %d and %d to %d", scope, rsvd[i-1].start, rsvd[i-1].end-1, rsvd[i].start, rsvd[i].end-1); err != nil { return err } } @@ -135,6 +168,9 @@ func validateMessage(res *result, isProto3 bool, name protoreflect.FullName, md // extensions ranges should not overlap exts := make(tagRanges, len(md.ExtensionRange)) for i, r := range md.ExtensionRange { + if err := validateNoFeatures(res, syntax, scope, r.Options.GetUninterpretedOption(), handler); err != nil { + return err + } n := res.ExtensionRangeNode(r) exts[i] = tagRange{start: r.GetStart(), end: r.GetEnd(), node: n} } @@ -142,7 +178,7 @@ func validateMessage(res *result, isProto3 bool, name protoreflect.FullName, md for i := 1; i < len(exts); i++ { if exts[i].start < exts[i-1].end { rangeNodeInfo := res.file.NodeInfo(exts[i].node) - if err := handler.HandleErrorf(rangeNodeInfo.Start(), "%s: extension ranges overlap: %d to %d and %d to %d", scope, exts[i-1].start, exts[i-1].end-1, exts[i].start, exts[i].end-1); err != nil { + if err := handler.HandleErrorf(rangeNodeInfo, "%s: extension ranges overlap: %d to %d and %d to %d", scope, exts[i-1].start, exts[i-1].end-1, exts[i].start, exts[i].end-1); err != nil { return err } } @@ -153,16 +189,16 @@ func validateMessage(res *result, isProto3 bool, name protoreflect.FullName, md for i < len(rsvd) && j < len(exts) { if rsvd[i].start >= exts[j].start && rsvd[i].start < exts[j].end || exts[j].start >= rsvd[i].start && exts[j].start < rsvd[i].end { - var pos ast.SourcePos + var span ast.SourceSpan if rsvd[i].start >= exts[j].start && rsvd[i].start < exts[j].end { rangeNodeInfo := res.file.NodeInfo(rsvd[i].node) - pos = rangeNodeInfo.Start() + span = rangeNodeInfo } else { rangeNodeInfo := res.file.NodeInfo(exts[j].node) - pos = rangeNodeInfo.Start() + span = rangeNodeInfo } // ranges overlap - if err := handler.HandleErrorf(pos, "%s: extension range %d to %d overlaps reserved range %d to %d", scope, exts[j].start, exts[j].end-1, rsvd[i].start, rsvd[i].end-1); err != nil { + if err := handler.HandleErrorf(span, "%s: extension range %d to %d overlaps reserved range %d to %d", scope, exts[j].start, exts[j].end-1, rsvd[i].start, rsvd[i].end-1); err != nil { return err } } @@ -181,7 +217,7 @@ func validateMessage(res *result, isProto3 bool, name protoreflect.FullName, md if !isIdentifier(n) { node := findMessageReservedNameNode(res.MessageNode(md), n) nodeInfo := res.file.NodeInfo(node) - if err := handler.HandleErrorf(nodeInfo.Start(), "%s: reserved name %q is not a valid identifier", scope, n); err != nil { + if err := handler.HandleErrorf(nodeInfo, "%s: reserved name %q is not a valid identifier", scope, n); err != nil { return err } } @@ -192,13 +228,13 @@ func validateMessage(res *result, isProto3 bool, name protoreflect.FullName, md fn := res.FieldNode(fld) if _, ok := rsvdNames[fld.GetName()]; ok { fieldNameNodeInfo := res.file.NodeInfo(fn.FieldName()) - if err := handler.HandleErrorf(fieldNameNodeInfo.Start(), "%s: field %s is using a reserved name", scope, fld.GetName()); err != nil { + if err := handler.HandleErrorf(fieldNameNodeInfo, "%s: field %s is using a reserved name", scope, fld.GetName()); err != nil { return err } } if existing := fieldTags[fld.GetNumber()]; existing != "" { fieldTagNodeInfo := res.file.NodeInfo(fn.FieldTag()) - if err := handler.HandleErrorf(fieldTagNodeInfo.Start(), "%s: fields %s and %s both have the same tag %d", scope, existing, fld.GetName(), fld.GetNumber()); err != nil { + if err := handler.HandleErrorf(fieldTagNodeInfo, "%s: fields %s and %s both have the same tag %d", scope, existing, fld.GetName(), fld.GetNumber()); err != nil { return err } } @@ -207,7 +243,7 @@ func validateMessage(res *result, isProto3 bool, name protoreflect.FullName, md r := sort.Search(len(rsvd), func(index int) bool { return rsvd[index].end > fld.GetNumber() }) if r < len(rsvd) && rsvd[r].start <= fld.GetNumber() { fieldTagNodeInfo := res.file.NodeInfo(fn.FieldTag()) - if err := handler.HandleErrorf(fieldTagNodeInfo.Start(), "%s: field %s is using tag %d which is in reserved range %d to %d", scope, fld.GetName(), fld.GetNumber(), rsvd[r].start, rsvd[r].end-1); err != nil { + if err := handler.HandleErrorf(fieldTagNodeInfo, "%s: field %s is using tag %d which is in reserved range %d to %d", scope, fld.GetName(), fld.GetNumber(), rsvd[r].start, rsvd[r].end-1); err != nil { return err } } @@ -215,7 +251,7 @@ func validateMessage(res *result, isProto3 bool, name protoreflect.FullName, md e := sort.Search(len(exts), func(index int) bool { return exts[index].end > fld.GetNumber() }) if e < len(exts) && exts[e].start <= fld.GetNumber() { fieldTagNodeInfo := res.file.NodeInfo(fn.FieldTag()) - if err := handler.HandleErrorf(fieldTagNodeInfo.Start(), "%s: field %s is using tag %d which is in extension range %d to %d", scope, fld.GetName(), fld.GetNumber(), exts[e].start, exts[e].end-1); err != nil { + if err := handler.HandleErrorf(fieldTagNodeInfo, "%s: field %s is using tag %d which is in extension range %d to %d", scope, fld.GetName(), fld.GetNumber(), exts[e].start, exts[e].end-1); err != nil { return err } } @@ -278,17 +314,21 @@ func findReservedNameNode[T ast.Node](parent ast.Node, decls []T, name string) a return parent } -func validateEnum(res *result, isProto3 bool, name protoreflect.FullName, ed *descriptorpb.EnumDescriptorProto, handler *reporter.Handler) error { +func validateEnum(res *result, syntax syntaxType, name protoreflect.FullName, ed *descriptorpb.EnumDescriptorProto, handler *reporter.Handler) error { scope := fmt.Sprintf("enum %s", name) if len(ed.Value) == 0 { enNode := res.EnumNode(ed) enNodeInfo := res.file.NodeInfo(enNode) - if err := handler.HandleErrorf(enNodeInfo.Start(), "%s: enums must define at least one value", scope); err != nil { + if err := handler.HandleErrorf(enNodeInfo, "%s: enums must define at least one value", scope); err != nil { return err } } + if err := validateNoFeatures(res, syntax, scope, ed.Options.GetUninterpretedOption(), handler); err != nil { + return err + } + allowAlias := false var allowAliasOpt *descriptorpb.UninterpretedOption if index, err := internal.FindOption(res, handler, scope, ed.Options.GetUninterpretedOption(), "allow_alias"); err != nil { @@ -307,16 +347,16 @@ func validateEnum(res *result, isProto3 bool, name protoreflect.FullName, ed *de if !valid { optNode := res.OptionNode(allowAliasOpt) optNodeInfo := res.file.NodeInfo(optNode.GetValue()) - if err := handler.HandleErrorf(optNodeInfo.Start(), "%s: expecting bool value for allow_alias option", scope); err != nil { + if err := handler.HandleErrorf(optNodeInfo, "%s: expecting bool value for allow_alias option", scope); err != nil { return err } } } - if isProto3 && len(ed.Value) > 0 && ed.Value[0].GetNumber() != 0 { + if syntax == syntaxProto3 && len(ed.Value) > 0 && ed.Value[0].GetNumber() != 0 { evNode := res.EnumValueNode(ed.Value[0]) evNodeInfo := res.file.NodeInfo(evNode.GetNumber()) - if err := handler.HandleErrorf(evNodeInfo.Start(), "%s: proto3 requires that first value in enum have numeric value of 0", scope); err != nil { + if err := handler.HandleErrorf(evNodeInfo, "%s: proto3 requires that first value in enum have numeric value of 0", scope); err != nil { return err } } @@ -332,7 +372,7 @@ func validateEnum(res *result, isProto3 bool, name protoreflect.FullName, ed *de } else { evNode := res.EnumValueNode(evd) evNodeInfo := res.file.NodeInfo(evNode.GetNumber()) - if err := handler.HandleErrorf(evNodeInfo.Start(), "%s: values %s and %s both have the same numeric value %d; use allow_alias option if intentional", scope, existing, evd.GetName(), evd.GetNumber()); err != nil { + if err := handler.HandleErrorf(evNodeInfo, "%s: values %s and %s both have the same numeric value %d; use allow_alias option if intentional", scope, existing, evd.GetName(), evd.GetNumber()); err != nil { return err } } @@ -342,7 +382,7 @@ func validateEnum(res *result, isProto3 bool, name protoreflect.FullName, ed *de if allowAlias && !hasAlias { optNode := res.OptionNode(allowAliasOpt) optNodeInfo := res.file.NodeInfo(optNode.GetValue()) - if err := handler.HandleErrorf(optNodeInfo.Start(), "%s: allow_alias is true but no values are aliases", scope); err != nil { + if err := handler.HandleErrorf(optNodeInfo, "%s: allow_alias is true but no values are aliases", scope); err != nil { return err } } @@ -357,7 +397,7 @@ func validateEnum(res *result, isProto3 bool, name protoreflect.FullName, ed *de for i := 1; i < len(rsvd); i++ { if rsvd[i].start <= rsvd[i-1].end { rangeNodeInfo := res.file.NodeInfo(rsvd[i].node) - if err := handler.HandleErrorf(rangeNodeInfo.Start(), "%s: reserved ranges overlap: %d to %d and %d to %d", scope, rsvd[i-1].start, rsvd[i-1].end, rsvd[i].start, rsvd[i].end); err != nil { + if err := handler.HandleErrorf(rangeNodeInfo, "%s: reserved ranges overlap: %d to %d and %d to %d", scope, rsvd[i-1].start, rsvd[i-1].end, rsvd[i].start, rsvd[i].end); err != nil { return err } } @@ -371,7 +411,7 @@ func validateEnum(res *result, isProto3 bool, name protoreflect.FullName, ed *de if !isIdentifier(n) { node := findEnumReservedNameNode(res.EnumNode(ed), n) nodeInfo := res.file.NodeInfo(node) - if err := handler.HandleErrorf(nodeInfo.Start(), "%s: reserved name %q is not a valid identifier", scope, n); err != nil { + if err := handler.HandleErrorf(nodeInfo, "%s: reserved name %q is not a valid identifier", scope, n); err != nil { return err } } @@ -381,7 +421,7 @@ func validateEnum(res *result, isProto3 bool, name protoreflect.FullName, ed *de evn := res.EnumValueNode(ev) if _, ok := rsvdNames[ev.GetName()]; ok { enumValNodeInfo := res.file.NodeInfo(evn.GetName()) - if err := handler.HandleErrorf(enumValNodeInfo.Start(), "%s: value %s is using a reserved name", scope, ev.GetName()); err != nil { + if err := handler.HandleErrorf(enumValNodeInfo, "%s: value %s is using a reserved name", scope, ev.GetName()); err != nil { return err } } @@ -389,7 +429,7 @@ func validateEnum(res *result, isProto3 bool, name protoreflect.FullName, ed *de r := sort.Search(len(rsvd), func(index int) bool { return rsvd[index].end >= ev.GetNumber() }) if r < len(rsvd) && rsvd[r].start <= ev.GetNumber() { enumValNodeInfo := res.file.NodeInfo(evn.GetNumber()) - if err := handler.HandleErrorf(enumValNodeInfo.Start(), "%s: value %s is using number %d which is in reserved range %d to %d", scope, ev.GetName(), ev.GetNumber(), rsvd[r].start, rsvd[r].end); err != nil { + if err := handler.HandleErrorf(enumValNodeInfo, "%s: value %s is using number %d which is in reserved range %d to %d", scope, ev.GetName(), ev.GetNumber(), rsvd[r].start, rsvd[r].end); err != nil { return err } } @@ -407,47 +447,70 @@ func findEnumReservedNameNode(enumNode ast.Node, name string) ast.Node { return findReservedNameNode(enumNode, decls, name) } -func validateField(res *result, isProto3 bool, name protoreflect.FullName, fld *descriptorpb.FieldDescriptorProto, handler *reporter.Handler) error { - scope := fmt.Sprintf("field %s", name) +func validateField(res *result, syntax syntaxType, name protoreflect.FullName, fld *descriptorpb.FieldDescriptorProto, handler *reporter.Handler) error { + var scope string + if fld.Extendee != nil { + scope = fmt.Sprintf("extension %s", name) + } else { + scope = fmt.Sprintf("field %s", name) + } node := res.FieldNode(fld) - if isProto3 { + if syntax != syntaxProto2 { if fld.GetType() == descriptorpb.FieldDescriptorProto_TYPE_GROUP { groupNodeInfo := res.file.NodeInfo(node.GetGroupKeyword()) - if err := handler.HandleErrorf(groupNodeInfo.Start(), "%s: groups are not allowed in proto3", scope); err != nil { + if err := handler.HandleErrorf(groupNodeInfo, "%s: groups are not allowed in proto3 or editions", scope); err != nil { return err } } else if fld.Label != nil && fld.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_REQUIRED { fieldLabelNodeInfo := res.file.NodeInfo(node.FieldLabel()) - if err := handler.HandleErrorf(fieldLabelNodeInfo.Start(), "%s: label 'required' is not allowed in proto3", scope); err != nil { + if err := handler.HandleErrorf(fieldLabelNodeInfo, "%s: label 'required' is not allowed in proto3 or editions", scope); err != nil { return err } } - if index, err := internal.FindOption(res, handler, scope, fld.Options.GetUninterpretedOption(), "default"); err != nil { - return err - } else if index >= 0 { - optNode := res.OptionNode(fld.Options.GetUninterpretedOption()[index]) - optNameNodeInfo := res.file.NodeInfo(optNode.GetName()) - if err := handler.HandleErrorf(optNameNodeInfo.Start(), "%s: default values are not allowed in proto3", scope); err != nil { + if syntax == syntaxEditions { + if fld.Label != nil && fld.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL { + fieldLabelNodeInfo := res.file.NodeInfo(node.FieldLabel()) + if err := handler.HandleErrorf(fieldLabelNodeInfo, "%s: label 'optional' is not allowed in editions; use option features.field_presence instead", scope); err != nil { + return err + } + } + if index, err := internal.FindOption(res, handler, scope, fld.Options.GetUninterpretedOption(), "packed"); err != nil { return err + } else if index >= 0 { + optNode := res.OptionNode(fld.Options.GetUninterpretedOption()[index]) + optNameNodeInfo := res.file.NodeInfo(optNode.GetName()) + if err := handler.HandleErrorf(optNameNodeInfo, "%s: packed option is not allowed in editions; use option features.repeated_field_encoding instead", scope); err != nil { + return err + } + } + } else if syntax == syntaxProto3 { + if index, err := internal.FindOption(res, handler, scope, fld.Options.GetUninterpretedOption(), "default"); err != nil { + return err + } else if index >= 0 { + optNode := res.OptionNode(fld.Options.GetUninterpretedOption()[index]) + optNameNodeInfo := res.file.NodeInfo(optNode.GetName()) + if err := handler.HandleErrorf(optNameNodeInfo, "%s: default values are not allowed in proto3", scope); err != nil { + return err + } } } } else { if fld.Label == nil && fld.OneofIndex == nil { fieldNameNodeInfo := res.file.NodeInfo(node.FieldName()) - if err := handler.HandleErrorf(fieldNameNodeInfo.Start(), "%s: field has no label; proto2 requires explicit 'optional' label", scope); err != nil { + if err := handler.HandleErrorf(fieldNameNodeInfo, "%s: field has no label; proto2 requires explicit 'optional' label", scope); err != nil { return err } } if fld.GetExtendee() != "" && fld.Label != nil && fld.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_REQUIRED { fieldLabelNodeInfo := res.file.NodeInfo(node.FieldLabel()) - if err := handler.HandleErrorf(fieldLabelNodeInfo.Start(), "%s: extension fields cannot be 'required'", scope); err != nil { + if err := handler.HandleErrorf(fieldLabelNodeInfo, "%s: extension fields cannot be 'required'", scope); err != nil { return err } } } - return nil + return validateNoFeatures(res, syntax, scope, fld.Options.GetUninterpretedOption(), handler) } type tagRange struct { diff --git a/vendor/github.com/bufbuild/protocompile/reporter/errors.go b/vendor/github.com/bufbuild/protocompile/reporter/errors.go index b324afc380b3..50519996d9b4 100644 --- a/vendor/github.com/bufbuild/protocompile/reporter/errors.go +++ b/vendor/github.com/bufbuild/protocompile/reporter/errors.go @@ -30,39 +30,40 @@ var ErrInvalidSource = errors.New("parse failed: invalid proto source") // about the location in the file that caused the error. type ErrorWithPos interface { error - // GetPosition returns the source position that caused the underlying error. + ast.SourceSpan + // GetPosition returns the start source position that caused the underlying error. GetPosition() ast.SourcePos // Unwrap returns the underlying error. Unwrap() error } // Error creates a new ErrorWithPos from the given error and source position. -func Error(pos ast.SourcePos, err error) ErrorWithPos { - return errorWithSourcePos{pos: pos, underlying: err} +func Error(span ast.SourceSpan, err error) ErrorWithPos { + return errorWithSpan{SourceSpan: span, underlying: err} } // Errorf creates a new ErrorWithPos whose underlying error is created using the // given message format and arguments (via fmt.Errorf). -func Errorf(pos ast.SourcePos, format string, args ...interface{}) ErrorWithPos { - return errorWithSourcePos{pos: pos, underlying: fmt.Errorf(format, args...)} +func Errorf(span ast.SourceSpan, format string, args ...interface{}) ErrorWithPos { + return errorWithSpan{SourceSpan: span, underlying: fmt.Errorf(format, args...)} } -type errorWithSourcePos struct { +type errorWithSpan struct { + ast.SourceSpan underlying error - pos ast.SourcePos } -func (e errorWithSourcePos) Error() string { +func (e errorWithSpan) Error() string { sourcePos := e.GetPosition() return fmt.Sprintf("%s: %v", sourcePos, e.underlying) } -func (e errorWithSourcePos) GetPosition() ast.SourcePos { - return e.pos +func (e errorWithSpan) GetPosition() ast.SourcePos { + return e.Start() } -func (e errorWithSourcePos) Unwrap() error { +func (e errorWithSpan) Unwrap() error { return e.underlying } -var _ ErrorWithPos = errorWithSourcePos{} +var _ ErrorWithPos = errorWithSpan{} diff --git a/vendor/github.com/bufbuild/protocompile/reporter/reporter.go b/vendor/github.com/bufbuild/protocompile/reporter/reporter.go index 17f09fe0b87a..ba6c0386fdcc 100644 --- a/vendor/github.com/bufbuild/protocompile/reporter/reporter.go +++ b/vendor/github.com/bufbuild/protocompile/reporter/reporter.go @@ -152,12 +152,12 @@ func (h *Handler) HandleError(err error) error { // If the handler has already aborted (by returning a non-nil error from a prior // call to HandleError or HandleErrorf), that same error is returned and the // given error is not reported. -func (h *Handler) HandleErrorWithPos(pos ast.SourcePos, err error) error { +func (h *Handler) HandleErrorWithPos(span ast.SourceSpan, err error) error { if ewp, ok := err.(ErrorWithPos); ok { // replace existing position with given one - err = errorWithSourcePos{pos: pos, underlying: ewp.Unwrap()} + err = errorWithSpan{SourceSpan: span, underlying: ewp.Unwrap()} } else { - err = errorWithSourcePos{pos: pos, underlying: err} + err = errorWithSpan{SourceSpan: span, underlying: err} } return h.HandleError(err) } @@ -168,8 +168,8 @@ func (h *Handler) HandleErrorWithPos(pos ast.SourcePos, err error) error { // If the handler has already aborted (by returning a non-nil error from a call // to HandleError or HandleErrorf), that same error is returned and the given // error is not reported. -func (h *Handler) HandleErrorf(pos ast.SourcePos, format string, args ...interface{}) error { - return h.HandleError(Errorf(pos, format, args...)) +func (h *Handler) HandleErrorf(span ast.SourceSpan, format string, args ...interface{}) error { + return h.HandleError(Errorf(span, format, args...)) } // HandleWarning handles the given warning. This will delegate to the handler's @@ -190,21 +190,21 @@ func (h *Handler) HandleWarning(err ErrorWithPos) { // HandleWarningWithPos handles a warning with the given source position. This will // delegate to the handler's configured reporter. -func (h *Handler) HandleWarningWithPos(pos ast.SourcePos, err error) { +func (h *Handler) HandleWarningWithPos(span ast.SourceSpan, err error) { ewp, ok := err.(ErrorWithPos) if ok { // replace existing position with given one - ewp = errorWithSourcePos{pos: pos, underlying: ewp.Unwrap()} + ewp = errorWithSpan{SourceSpan: span, underlying: ewp.Unwrap()} } else { - ewp = errorWithSourcePos{pos: pos, underlying: err} + ewp = errorWithSpan{SourceSpan: span, underlying: err} } h.HandleWarning(ewp) } // HandleWarningf handles a warning with the given source position, creating the // actual error value using the given message format and arguments. -func (h *Handler) HandleWarningf(pos ast.SourcePos, format string, args ...interface{}) { - h.HandleWarning(Errorf(pos, format, args...)) +func (h *Handler) HandleWarningf(span ast.SourceSpan, format string, args ...interface{}) { + h.HandleWarning(Errorf(span, format, args...)) } // Error returns the handler result. If any errors have been reported then this diff --git a/vendor/github.com/bufbuild/protocompile/sourceinfo/source_code_info.go b/vendor/github.com/bufbuild/protocompile/sourceinfo/source_code_info.go index b5415bfc0f0b..908fb170997e 100644 --- a/vendor/github.com/bufbuild/protocompile/sourceinfo/source_code_info.go +++ b/vendor/github.com/bufbuild/protocompile/sourceinfo/source_code_info.go @@ -139,6 +139,9 @@ func generateSourceInfoForFile(opts OptionIndex, sci *sourceCodeInfo, file *ast. if file.Syntax != nil { sci.newLocWithComments(file.Syntax, append(path, internal.FileSyntaxTag)) } + if file.Edition != nil { + sci.newLocWithComments(file.Edition, append(path, internal.FileEditionTag)) + } var depIndex, pubDepIndex, weakDepIndex, optIndex, msgIndex, enumIndex, extendIndex, svcIndex int32 diff --git a/vendor/github.com/jhump/protoreflect/desc/protoparse/errors.go b/vendor/github.com/jhump/protoreflect/desc/protoparse/errors.go index c71d651d70c3..0ec70bd752f2 100644 --- a/vendor/github.com/jhump/protoreflect/desc/protoparse/errors.go +++ b/vendor/github.com/jhump/protoreflect/desc/protoparse/errors.go @@ -62,8 +62,12 @@ type ErrorWithPos = reporter.ErrorWithPos // // SourcePos should always be set and never nil. type ErrorWithSourcePos struct { + // These fields are present and exported for backwards-compatibility + // with v1.4 and earlier. Underlying error Pos *SourcePos + + reporter.ErrorWithPos } // Error implements the error interface @@ -92,8 +96,9 @@ var _ ErrorWithPos = ErrorWithSourcePos{} func toErrorWithSourcePos(err ErrorWithPos) ErrorWithPos { pos := err.GetPosition() return ErrorWithSourcePos{ - Underlying: err.Unwrap(), - Pos: &pos, + ErrorWithPos: err, + Underlying: err.Unwrap(), + Pos: &pos, } } diff --git a/vendor/github.com/jhump/protoreflect/desc/protoparse/parser.go b/vendor/github.com/jhump/protoreflect/desc/protoparse/parser.go index 6f35316a1113..6a02bf15a4f5 100644 --- a/vendor/github.com/jhump/protoreflect/desc/protoparse/parser.go +++ b/vendor/github.com/jhump/protoreflect/desc/protoparse/parser.go @@ -147,11 +147,11 @@ func (p Parser) ParseFiles(filenames ...string) ([]*desc.FileDescriptor, error) srcInfoMode = protocompile.SourceInfoExtraComments } rep := newReporter(p.ErrorReporter, p.WarningReporter) - res, srcPosAddr := p.getResolver(filenames) + res, srcSpanAddr := p.getResolver(filenames) if p.InferImportPaths { // we must first compile everything to protos - results, err := parseToProtosRecursive(res, filenames, reporter.NewHandler(rep), srcPosAddr) + results, err := parseToProtosRecursive(res, filenames, reporter.NewHandler(rep), srcSpanAddr) if err != nil { return nil, err } @@ -375,17 +375,17 @@ func parseToProtos(res protocompile.Resolver, filenames []string, rep *reporter. return results, nil } -func parseToProtosRecursive(res protocompile.Resolver, filenames []string, rep *reporter.Handler, srcPosAddr *SourcePos) (map[string]parser.Result, error) { +func parseToProtosRecursive(res protocompile.Resolver, filenames []string, rep *reporter.Handler, srcSpanAddr *ast2.SourceSpan) (map[string]parser.Result, error) { results := make(map[string]parser.Result, len(filenames)) for _, filename := range filenames { - if err := parseToProtoRecursive(res, filename, rep, srcPosAddr, results); err != nil { + if err := parseToProtoRecursive(res, filename, rep, srcSpanAddr, results); err != nil { return results, err } } return results, rep.Error() } -func parseToProtoRecursive(res protocompile.Resolver, filename string, rep *reporter.Handler, srcPosAddr *SourcePos, results map[string]parser.Result) error { +func parseToProtoRecursive(res protocompile.Resolver, filename string, rep *reporter.Handler, srcSpanAddr *ast2.SourceSpan, results map[string]parser.Result) error { if _, ok := results[filename]; ok { // already processed this one return nil @@ -412,13 +412,13 @@ func parseToProtoRecursive(res protocompile.Resolver, filename string, rep *repo continue } err := func() error { - orig := *srcPosAddr - *srcPosAddr = astRoot.NodeInfo(imp.Name).Start() + orig := *srcSpanAddr + *srcSpanAddr = astRoot.NodeInfo(imp.Name) defer func() { - *srcPosAddr = orig + *srcSpanAddr = orig }() - return parseToProtoRecursive(res, imp.Name.AsString(), rep, srcPosAddr, results) + return parseToProtoRecursive(res, imp.Name.AsString(), rep, srcSpanAddr, results) }() if err != nil { return err @@ -433,27 +433,42 @@ func parseToProtoRecursive(res protocompile.Resolver, filename string, rep *repo for i, dep := range fd.Dependency { path := []int32{internal.File_dependencyTag, int32(i)} err := func() error { - orig := *srcPosAddr + orig := *srcSpanAddr found := false for _, loc := range fd.GetSourceCodeInfo().GetLocation() { if pathsEqual(loc.Path, path) { - *srcPosAddr = SourcePos{ + start := SourcePos{ Filename: dep, Line: int(loc.Span[0]), Col: int(loc.Span[1]), } + var end SourcePos + if len(loc.Span) > 3 { + end = SourcePos{ + Filename: dep, + Line: int(loc.Span[2]), + Col: int(loc.Span[3]), + } + } else { + end = SourcePos{ + Filename: dep, + Line: int(loc.Span[0]), + Col: int(loc.Span[2]), + } + } + *srcSpanAddr = ast2.NewSourceSpan(start, end) found = true break } } if !found { - *srcPosAddr = *ast.UnknownPos(dep) + *srcSpanAddr = ast2.UnknownSpan(dep) } defer func() { - *srcPosAddr = orig + *srcSpanAddr = orig }() - return parseToProtoRecursive(res, dep, rep, srcPosAddr, results) + return parseToProtoRecursive(res, dep, rep, srcSpanAddr, results) }() if err != nil { return err @@ -496,8 +511,8 @@ func newReporter(errRep ErrorReporter, warnRep WarningReporter) reporter.Reporte return reporter.NewReporter(errRep, warnRep) } -func (p Parser) getResolver(filenames []string) (protocompile.Resolver, *SourcePos) { - var srcPos SourcePos +func (p Parser) getResolver(filenames []string) (protocompile.Resolver, *ast2.SourceSpan) { + var srcSpan ast2.SourceSpan accessor := p.Accessor if accessor == nil { accessor = func(name string) (io.ReadCloser, error) { @@ -512,8 +527,8 @@ func (p Parser) getResolver(filenames []string) (protocompile.Resolver, *SourceP // errors that don't include the filename that failed are no bueno err = errorWithFilename{filename: filename, underlying: err} } - if srcPos.Filename != "" { - err = reporter.Error(srcPos, err) + if srcSpan != nil { + err = reporter.Error(srcSpan, err) } } return in, err @@ -552,7 +567,7 @@ func (p Parser) getResolver(filenames []string) (protocompile.Resolver, *SourceP } return backupResolver.FindFileByPath(path) }), - }, &srcPos + }, &srcSpan } func fixupFilenames(protos map[string]parser.Result) (revisedProtos map[string]parser.Result, rewrittenPaths map[string]string) { diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go index 5f28148d805b..5033906276e3 100644 --- a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go +++ b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go @@ -23,7 +23,7 @@ import ( "google.golang.org/protobuf/reflect/protoregistry" ) -// Unmarshal reads the given []byte into the given proto.Message. +// Unmarshal reads the given []byte into the given [proto.Message]. // The provided message must be mutable (e.g., a non-nil pointer to a message). func Unmarshal(b []byte, m proto.Message) error { return UnmarshalOptions{}.Unmarshal(b, m) @@ -37,7 +37,7 @@ type UnmarshalOptions struct { // required fields will not return an error. AllowPartial bool - // If DiscardUnknown is set, unknown fields are ignored. + // If DiscardUnknown is set, unknown fields and enum name values are ignored. DiscardUnknown bool // Resolver is used for looking up types when unmarshaling @@ -49,7 +49,7 @@ type UnmarshalOptions struct { } } -// Unmarshal reads the given []byte and populates the given proto.Message +// Unmarshal reads the given []byte and populates the given [proto.Message] // using options in the UnmarshalOptions object. // It will clear the message first before setting the fields. // If it returns an error, the given message may be partially set. @@ -266,7 +266,9 @@ func (d decoder) unmarshalSingular(m protoreflect.Message, fd protoreflect.Field if err != nil { return err } - m.Set(fd, val) + if val.IsValid() { + m.Set(fd, val) + } return nil } @@ -329,7 +331,7 @@ func (d decoder) unmarshalScalar(fd protoreflect.FieldDescriptor) (protoreflect. } case protoreflect.EnumKind: - if v, ok := unmarshalEnum(tok, fd); ok { + if v, ok := unmarshalEnum(tok, fd, d.opts.DiscardUnknown); ok { return v, nil } @@ -474,7 +476,7 @@ func unmarshalBytes(tok json.Token) (protoreflect.Value, bool) { return protoreflect.ValueOfBytes(b), true } -func unmarshalEnum(tok json.Token, fd protoreflect.FieldDescriptor) (protoreflect.Value, bool) { +func unmarshalEnum(tok json.Token, fd protoreflect.FieldDescriptor, discardUnknown bool) (protoreflect.Value, bool) { switch tok.Kind() { case json.String: // Lookup EnumNumber based on name. @@ -482,6 +484,9 @@ func unmarshalEnum(tok json.Token, fd protoreflect.FieldDescriptor) (protoreflec if enumVal := fd.Enum().Values().ByName(protoreflect.Name(s)); enumVal != nil { return protoreflect.ValueOfEnum(enumVal.Number()), true } + if discardUnknown { + return protoreflect.Value{}, true + } case json.Number: if n, ok := tok.Int(32); ok { @@ -542,7 +547,9 @@ func (d decoder) unmarshalList(list protoreflect.List, fd protoreflect.FieldDesc if err != nil { return err } - list.Append(val) + if val.IsValid() { + list.Append(val) + } } } @@ -609,8 +616,9 @@ Loop: if err != nil { return err } - - mmap.Set(pkey, pval) + if pval.IsValid() { + mmap.Set(pkey, pval) + } } return nil diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/doc.go b/vendor/google.golang.org/protobuf/encoding/protojson/doc.go index 21d5d2cb18e1..ae71007c18b9 100644 --- a/vendor/google.golang.org/protobuf/encoding/protojson/doc.go +++ b/vendor/google.golang.org/protobuf/encoding/protojson/doc.go @@ -6,6 +6,6 @@ // format. It follows the guide at // https://protobuf.dev/programming-guides/proto3#json. // -// This package produces a different output than the standard "encoding/json" +// This package produces a different output than the standard [encoding/json] // package, which does not operate correctly on protocol buffer messages. package protojson diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/encode.go b/vendor/google.golang.org/protobuf/encoding/protojson/encode.go index 66b95870e977..3f75098b6fb8 100644 --- a/vendor/google.golang.org/protobuf/encoding/protojson/encode.go +++ b/vendor/google.golang.org/protobuf/encoding/protojson/encode.go @@ -31,7 +31,7 @@ func Format(m proto.Message) string { return MarshalOptions{Multiline: true}.Format(m) } -// Marshal writes the given proto.Message in JSON format using default options. +// Marshal writes the given [proto.Message] in JSON format using default options. // Do not depend on the output being stable. It may change over time across // different versions of the program. func Marshal(m proto.Message) ([]byte, error) { @@ -81,6 +81,25 @@ type MarshalOptions struct { // ╚═══════╧════════════════════════════╝ EmitUnpopulated bool + // EmitDefaultValues specifies whether to emit default-valued primitive fields, + // empty lists, and empty maps. The fields affected are as follows: + // ╔═══════╤════════════════════════════════════════╗ + // ║ JSON │ Protobuf field ║ + // ╠═══════╪════════════════════════════════════════╣ + // ║ false │ non-optional scalar boolean fields ║ + // ║ 0 │ non-optional scalar numeric fields ║ + // ║ "" │ non-optional scalar string/byte fields ║ + // ║ [] │ empty repeated fields ║ + // ║ {} │ empty map fields ║ + // ╚═══════╧════════════════════════════════════════╝ + // + // Behaves similarly to EmitUnpopulated, but does not emit "null"-value fields, + // i.e. presence-sensing fields that are omitted will remain omitted to preserve + // presence-sensing. + // EmitUnpopulated takes precedence over EmitDefaultValues since the former generates + // a strict superset of the latter. + EmitDefaultValues bool + // Resolver is used for looking up types when expanding google.protobuf.Any // messages. If nil, this defaults to using protoregistry.GlobalTypes. Resolver interface { @@ -102,7 +121,7 @@ func (o MarshalOptions) Format(m proto.Message) string { return string(b) } -// Marshal marshals the given proto.Message in the JSON format using options in +// Marshal marshals the given [proto.Message] in the JSON format using options in // 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) { @@ -178,7 +197,11 @@ func (m typeURLFieldRanger) Range(f func(protoreflect.FieldDescriptor, protorefl // unpopulatedFieldRanger wraps a protoreflect.Message and modifies its Range // method to additionally iterate over unpopulated fields. -type unpopulatedFieldRanger struct{ protoreflect.Message } +type unpopulatedFieldRanger struct { + protoreflect.Message + + skipNull bool +} func (m unpopulatedFieldRanger) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { fds := m.Descriptor().Fields() @@ -192,6 +215,9 @@ func (m unpopulatedFieldRanger) Range(f func(protoreflect.FieldDescriptor, proto isProto2Scalar := fd.Syntax() == protoreflect.Proto2 && fd.Default().IsValid() isSingularMessage := fd.Cardinality() != protoreflect.Repeated && fd.Message() != nil if isProto2Scalar || isSingularMessage { + if m.skipNull { + continue + } v = protoreflect.Value{} // use invalid value to emit null } if !f(fd, v) { @@ -217,8 +243,11 @@ func (e encoder) marshalMessage(m protoreflect.Message, typeURL string) error { defer e.EndObject() var fields order.FieldRanger = m - if e.opts.EmitUnpopulated { - fields = unpopulatedFieldRanger{m} + switch { + case e.opts.EmitUnpopulated: + fields = unpopulatedFieldRanger{Message: m, skipNull: false} + case e.opts.EmitDefaultValues: + fields = unpopulatedFieldRanger{Message: m, skipNull: true} } if typeURL != "" { fields = typeURLFieldRanger{fields, typeURL} diff --git a/vendor/google.golang.org/protobuf/encoding/prototext/decode.go b/vendor/google.golang.org/protobuf/encoding/prototext/decode.go index 4921b2d4a76f..a45f112bce30 100644 --- a/vendor/google.golang.org/protobuf/encoding/prototext/decode.go +++ b/vendor/google.golang.org/protobuf/encoding/prototext/decode.go @@ -21,7 +21,7 @@ import ( "google.golang.org/protobuf/reflect/protoregistry" ) -// Unmarshal reads the given []byte into the given proto.Message. +// Unmarshal reads the given []byte into the given [proto.Message]. // The provided message must be mutable (e.g., a non-nil pointer to a message). func Unmarshal(b []byte, m proto.Message) error { return UnmarshalOptions{}.Unmarshal(b, m) @@ -51,7 +51,7 @@ type UnmarshalOptions struct { } } -// Unmarshal reads the given []byte and populates the given proto.Message +// Unmarshal reads the given []byte and populates the given [proto.Message] // using options in the UnmarshalOptions object. // The provided message must be mutable (e.g., a non-nil pointer to a message). func (o UnmarshalOptions) Unmarshal(b []byte, m proto.Message) error { @@ -739,7 +739,9 @@ func (d decoder) skipValue() error { case text.ListClose: return nil case text.MessageOpen: - return d.skipMessageValue() + if err := d.skipMessageValue(); err != nil { + return err + } default: // Skip items. This will not validate whether skipped values are // of the same type or not, same behavior as C++ diff --git a/vendor/google.golang.org/protobuf/encoding/prototext/encode.go b/vendor/google.golang.org/protobuf/encoding/prototext/encode.go index 722a7b41df36..95967e8112a7 100644 --- a/vendor/google.golang.org/protobuf/encoding/prototext/encode.go +++ b/vendor/google.golang.org/protobuf/encoding/prototext/encode.go @@ -33,7 +33,7 @@ func Format(m proto.Message) string { return MarshalOptions{Multiline: true}.Format(m) } -// Marshal writes the given proto.Message in textproto format using default +// Marshal writes the given [proto.Message] in textproto format using default // options. Do not depend on the output being stable. It may change over time // across different versions of the program. func Marshal(m proto.Message) ([]byte, error) { @@ -97,7 +97,7 @@ func (o MarshalOptions) Format(m proto.Message) string { return string(b) } -// Marshal writes the given proto.Message in textproto format using options in +// Marshal writes the given [proto.Message] in textproto format using options in // MarshalOptions object. Do not depend on the output being stable. It may // change over time across different versions of the program. func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) { diff --git a/vendor/google.golang.org/protobuf/encoding/protowire/wire.go b/vendor/google.golang.org/protobuf/encoding/protowire/wire.go index f4b4686cf9de..e942bc983eed 100644 --- a/vendor/google.golang.org/protobuf/encoding/protowire/wire.go +++ b/vendor/google.golang.org/protobuf/encoding/protowire/wire.go @@ -6,7 +6,7 @@ // See https://protobuf.dev/programming-guides/encoding. // // For marshaling and unmarshaling entire protobuf messages, -// use the "google.golang.org/protobuf/proto" package instead. +// use the [google.golang.org/protobuf/proto] package instead. package protowire import ( @@ -87,7 +87,7 @@ func ParseError(n int) error { // ConsumeField parses an entire field record (both tag and value) and returns // the field number, the wire type, and the total length. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). // // The total length includes the tag header and the end group marker (if the // field is a group). @@ -104,8 +104,8 @@ func ConsumeField(b []byte) (Number, Type, int) { } // ConsumeFieldValue parses a field value and returns its length. -// This assumes that the field Number and wire Type have already been parsed. -// This returns a negative length upon an error (see ParseError). +// This assumes that the field [Number] and wire [Type] have already been parsed. +// This returns a negative length upon an error (see [ParseError]). // // When parsing a group, the length includes the end group marker and // the end group is verified to match the starting field number. @@ -164,7 +164,7 @@ func AppendTag(b []byte, num Number, typ Type) []byte { } // ConsumeTag parses b as a varint-encoded tag, reporting its length. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). func ConsumeTag(b []byte) (Number, Type, int) { v, n := ConsumeVarint(b) if n < 0 { @@ -263,7 +263,7 @@ func AppendVarint(b []byte, v uint64) []byte { } // ConsumeVarint parses b as a varint-encoded uint64, reporting its length. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). func ConsumeVarint(b []byte) (v uint64, n int) { var y uint64 if len(b) <= 0 { @@ -384,7 +384,7 @@ func AppendFixed32(b []byte, v uint32) []byte { } // ConsumeFixed32 parses b as a little-endian uint32, reporting its length. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). func ConsumeFixed32(b []byte) (v uint32, n int) { if len(b) < 4 { return 0, errCodeTruncated @@ -412,7 +412,7 @@ func AppendFixed64(b []byte, v uint64) []byte { } // ConsumeFixed64 parses b as a little-endian uint64, reporting its length. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). func ConsumeFixed64(b []byte) (v uint64, n int) { if len(b) < 8 { return 0, errCodeTruncated @@ -432,7 +432,7 @@ func AppendBytes(b []byte, v []byte) []byte { } // ConsumeBytes parses b as a length-prefixed bytes value, reporting its length. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). func ConsumeBytes(b []byte) (v []byte, n int) { m, n := ConsumeVarint(b) if n < 0 { @@ -456,7 +456,7 @@ func AppendString(b []byte, v string) []byte { } // ConsumeString parses b as a length-prefixed bytes value, reporting its length. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). func ConsumeString(b []byte) (v string, n int) { bb, n := ConsumeBytes(b) return string(bb), n @@ -471,7 +471,7 @@ func AppendGroup(b []byte, num Number, v []byte) []byte { // ConsumeGroup parses b as a group value until the trailing end group marker, // and verifies that the end marker matches the provided num. The value v // does not contain the end marker, while the length does contain the end marker. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). func ConsumeGroup(num Number, b []byte) (v []byte, n int) { n = ConsumeFieldValue(num, StartGroupType, b) if n < 0 { @@ -495,8 +495,8 @@ func SizeGroup(num Number, n int) int { return n + SizeTag(num) } -// DecodeTag decodes the field Number and wire Type from its unified form. -// The Number is -1 if the decoded field number overflows int32. +// DecodeTag decodes the field [Number] and wire [Type] from its unified form. +// The [Number] is -1 if the decoded field number overflows int32. // Other than overflow, this does not check for field number validity. func DecodeTag(x uint64) (Number, Type) { // NOTE: MessageSet allows for larger field numbers than normal. @@ -506,7 +506,7 @@ func DecodeTag(x uint64) (Number, Type) { return Number(x >> 3), Type(x & 7) } -// EncodeTag encodes the field Number and wire Type into its unified form. +// EncodeTag encodes the field [Number] and wire [Type] into its unified form. func EncodeTag(num Number, typ Type) uint64 { return uint64(num)<<3 | uint64(typ&7) } diff --git a/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go b/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go index db5248e1b512..a45625c8d1f4 100644 --- a/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go +++ b/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go @@ -83,7 +83,13 @@ func formatListOpt(vs list, isRoot, allowMulti bool) string { case protoreflect.FileImports: for i := 0; i < vs.Len(); i++ { var rs records - rs.Append(reflect.ValueOf(vs.Get(i)), "Path", "Package", "IsPublic", "IsWeak") + rv := reflect.ValueOf(vs.Get(i)) + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Path"), "Path"}, + {rv.MethodByName("Package"), "Package"}, + {rv.MethodByName("IsPublic"), "IsPublic"}, + {rv.MethodByName("IsWeak"), "IsWeak"}, + }...) ss = append(ss, "{"+rs.Join()+"}") } return start + joinStrings(ss, allowMulti) + end @@ -92,34 +98,26 @@ func formatListOpt(vs list, isRoot, allowMulti bool) string { for i := 0; i < vs.Len(); i++ { m := reflect.ValueOf(vs).MethodByName("Get") v := m.Call([]reflect.Value{reflect.ValueOf(i)})[0].Interface() - ss = append(ss, formatDescOpt(v.(protoreflect.Descriptor), false, allowMulti && !isEnumValue)) + ss = append(ss, formatDescOpt(v.(protoreflect.Descriptor), false, allowMulti && !isEnumValue, nil)) } return start + joinStrings(ss, allowMulti && isEnumValue) + end } } -// descriptorAccessors is a list of accessors to print for each descriptor. -// -// Do not print all accessors since some contain redundant information, -// while others are pointers that we do not want to follow since the descriptor -// is actually a cyclic graph. -// -// Using a list allows us to print the accessors in a sensible order. -var descriptorAccessors = map[reflect.Type][]string{ - reflect.TypeOf((*protoreflect.FileDescriptor)(nil)).Elem(): {"Path", "Package", "Imports", "Messages", "Enums", "Extensions", "Services"}, - reflect.TypeOf((*protoreflect.MessageDescriptor)(nil)).Elem(): {"IsMapEntry", "Fields", "Oneofs", "ReservedNames", "ReservedRanges", "RequiredNumbers", "ExtensionRanges", "Messages", "Enums", "Extensions"}, - reflect.TypeOf((*protoreflect.FieldDescriptor)(nil)).Elem(): {"Number", "Cardinality", "Kind", "HasJSONName", "JSONName", "HasPresence", "IsExtension", "IsPacked", "IsWeak", "IsList", "IsMap", "MapKey", "MapValue", "HasDefault", "Default", "ContainingOneof", "ContainingMessage", "Message", "Enum"}, - reflect.TypeOf((*protoreflect.OneofDescriptor)(nil)).Elem(): {"Fields"}, // not directly used; must keep in sync with formatDescOpt - reflect.TypeOf((*protoreflect.EnumDescriptor)(nil)).Elem(): {"Values", "ReservedNames", "ReservedRanges"}, - reflect.TypeOf((*protoreflect.EnumValueDescriptor)(nil)).Elem(): {"Number"}, - reflect.TypeOf((*protoreflect.ServiceDescriptor)(nil)).Elem(): {"Methods"}, - reflect.TypeOf((*protoreflect.MethodDescriptor)(nil)).Elem(): {"Input", "Output", "IsStreamingClient", "IsStreamingServer"}, +type methodAndName struct { + method reflect.Value + name string } func FormatDesc(s fmt.State, r rune, t protoreflect.Descriptor) { - io.WriteString(s, formatDescOpt(t, true, r == 'v' && (s.Flag('+') || s.Flag('#')))) + io.WriteString(s, formatDescOpt(t, true, r == 'v' && (s.Flag('+') || s.Flag('#')), nil)) } -func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool) string { + +func InternalFormatDescOptForTesting(t protoreflect.Descriptor, isRoot, allowMulti bool, record func(string)) string { + return formatDescOpt(t, isRoot, allowMulti, record) +} + +func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool, record func(string)) string { rv := reflect.ValueOf(t) rt := rv.MethodByName("ProtoType").Type().In(0) @@ -129,26 +127,60 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool) string { } _, isFile := t.(protoreflect.FileDescriptor) - rs := records{allowMulti: allowMulti} + rs := records{ + allowMulti: allowMulti, + record: record, + } if t.IsPlaceholder() { if isFile { - rs.Append(rv, "Path", "Package", "IsPlaceholder") + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Path"), "Path"}, + {rv.MethodByName("Package"), "Package"}, + {rv.MethodByName("IsPlaceholder"), "IsPlaceholder"}, + }...) } else { - rs.Append(rv, "FullName", "IsPlaceholder") + rs.Append(rv, []methodAndName{ + {rv.MethodByName("FullName"), "FullName"}, + {rv.MethodByName("IsPlaceholder"), "IsPlaceholder"}, + }...) } } else { switch { case isFile: - rs.Append(rv, "Syntax") + rs.Append(rv, methodAndName{rv.MethodByName("Syntax"), "Syntax"}) case isRoot: - rs.Append(rv, "Syntax", "FullName") + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Syntax"), "Syntax"}, + {rv.MethodByName("FullName"), "FullName"}, + }...) default: - rs.Append(rv, "Name") + rs.Append(rv, methodAndName{rv.MethodByName("Name"), "Name"}) } switch t := t.(type) { case protoreflect.FieldDescriptor: - for _, s := range descriptorAccessors[rt] { - switch s { + accessors := []methodAndName{ + {rv.MethodByName("Number"), "Number"}, + {rv.MethodByName("Cardinality"), "Cardinality"}, + {rv.MethodByName("Kind"), "Kind"}, + {rv.MethodByName("HasJSONName"), "HasJSONName"}, + {rv.MethodByName("JSONName"), "JSONName"}, + {rv.MethodByName("HasPresence"), "HasPresence"}, + {rv.MethodByName("IsExtension"), "IsExtension"}, + {rv.MethodByName("IsPacked"), "IsPacked"}, + {rv.MethodByName("IsWeak"), "IsWeak"}, + {rv.MethodByName("IsList"), "IsList"}, + {rv.MethodByName("IsMap"), "IsMap"}, + {rv.MethodByName("MapKey"), "MapKey"}, + {rv.MethodByName("MapValue"), "MapValue"}, + {rv.MethodByName("HasDefault"), "HasDefault"}, + {rv.MethodByName("Default"), "Default"}, + {rv.MethodByName("ContainingOneof"), "ContainingOneof"}, + {rv.MethodByName("ContainingMessage"), "ContainingMessage"}, + {rv.MethodByName("Message"), "Message"}, + {rv.MethodByName("Enum"), "Enum"}, + } + for _, s := range accessors { + switch s.name { case "MapKey": if k := t.MapKey(); k != nil { rs.recs = append(rs.recs, [2]string{"MapKey", k.Kind().String()}) @@ -157,20 +189,20 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool) string { if v := t.MapValue(); v != nil { switch v.Kind() { case protoreflect.EnumKind: - rs.recs = append(rs.recs, [2]string{"MapValue", string(v.Enum().FullName())}) + rs.AppendRecs("MapValue", [2]string{"MapValue", string(v.Enum().FullName())}) case protoreflect.MessageKind, protoreflect.GroupKind: - rs.recs = append(rs.recs, [2]string{"MapValue", string(v.Message().FullName())}) + rs.AppendRecs("MapValue", [2]string{"MapValue", string(v.Message().FullName())}) default: - rs.recs = append(rs.recs, [2]string{"MapValue", v.Kind().String()}) + rs.AppendRecs("MapValue", [2]string{"MapValue", v.Kind().String()}) } } case "ContainingOneof": if od := t.ContainingOneof(); od != nil { - rs.recs = append(rs.recs, [2]string{"Oneof", string(od.Name())}) + rs.AppendRecs("ContainingOneof", [2]string{"Oneof", string(od.Name())}) } case "ContainingMessage": if t.IsExtension() { - rs.recs = append(rs.recs, [2]string{"Extendee", string(t.ContainingMessage().FullName())}) + rs.AppendRecs("ContainingMessage", [2]string{"Extendee", string(t.ContainingMessage().FullName())}) } case "Message": if !t.IsMap() { @@ -187,13 +219,61 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool) string { ss = append(ss, string(fs.Get(i).Name())) } if len(ss) > 0 { - rs.recs = append(rs.recs, [2]string{"Fields", "[" + joinStrings(ss, false) + "]"}) + rs.AppendRecs("Fields", [2]string{"Fields", "[" + joinStrings(ss, false) + "]"}) } - default: - rs.Append(rv, descriptorAccessors[rt]...) + + case protoreflect.FileDescriptor: + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Path"), "Path"}, + {rv.MethodByName("Package"), "Package"}, + {rv.MethodByName("Imports"), "Imports"}, + {rv.MethodByName("Messages"), "Messages"}, + {rv.MethodByName("Enums"), "Enums"}, + {rv.MethodByName("Extensions"), "Extensions"}, + {rv.MethodByName("Services"), "Services"}, + }...) + + case protoreflect.MessageDescriptor: + rs.Append(rv, []methodAndName{ + {rv.MethodByName("IsMapEntry"), "IsMapEntry"}, + {rv.MethodByName("Fields"), "Fields"}, + {rv.MethodByName("Oneofs"), "Oneofs"}, + {rv.MethodByName("ReservedNames"), "ReservedNames"}, + {rv.MethodByName("ReservedRanges"), "ReservedRanges"}, + {rv.MethodByName("RequiredNumbers"), "RequiredNumbers"}, + {rv.MethodByName("ExtensionRanges"), "ExtensionRanges"}, + {rv.MethodByName("Messages"), "Messages"}, + {rv.MethodByName("Enums"), "Enums"}, + {rv.MethodByName("Extensions"), "Extensions"}, + }...) + + case protoreflect.EnumDescriptor: + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Values"), "Values"}, + {rv.MethodByName("ReservedNames"), "ReservedNames"}, + {rv.MethodByName("ReservedRanges"), "ReservedRanges"}, + }...) + + case protoreflect.EnumValueDescriptor: + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Number"), "Number"}, + }...) + + case protoreflect.ServiceDescriptor: + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Methods"), "Methods"}, + }...) + + case protoreflect.MethodDescriptor: + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Input"), "Input"}, + {rv.MethodByName("Output"), "Output"}, + {rv.MethodByName("IsStreamingClient"), "IsStreamingClient"}, + {rv.MethodByName("IsStreamingServer"), "IsStreamingServer"}, + }...) } - if rv.MethodByName("GoType").IsValid() { - rs.Append(rv, "GoType") + if m := rv.MethodByName("GoType"); m.IsValid() { + rs.Append(rv, methodAndName{m, "GoType"}) } } return start + rs.Join() + end @@ -202,19 +282,34 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool) string { type records struct { recs [][2]string allowMulti bool + + // record is a function that will be called for every Append() or + // AppendRecs() call, to be used for testing with the + // InternalFormatDescOptForTesting function. + record func(string) } -func (rs *records) Append(v reflect.Value, accessors ...string) { +func (rs *records) AppendRecs(fieldName string, newRecs [2]string) { + if rs.record != nil { + rs.record(fieldName) + } + rs.recs = append(rs.recs, newRecs) +} + +func (rs *records) Append(v reflect.Value, accessors ...methodAndName) { for _, a := range accessors { + if rs.record != nil { + rs.record(a.name) + } var rv reflect.Value - if m := v.MethodByName(a); m.IsValid() { - rv = m.Call(nil)[0] + if a.method.IsValid() { + rv = a.method.Call(nil)[0] } if v.Kind() == reflect.Struct && !rv.IsValid() { - rv = v.FieldByName(a) + rv = v.FieldByName(a.name) } if !rv.IsValid() { - panic(fmt.Sprintf("unknown accessor: %v.%s", v.Type(), a)) + panic(fmt.Sprintf("unknown accessor: %v.%s", v.Type(), a.name)) } if _, ok := rv.Interface().(protoreflect.Value); ok { rv = rv.MethodByName("Interface").Call(nil)[0] @@ -261,7 +356,7 @@ func (rs *records) Append(v reflect.Value, accessors ...string) { default: s = fmt.Sprint(v) } - rs.recs = append(rs.recs, [2]string{a, s}) + rs.recs = append(rs.recs, [2]string{a.name, s}) } } diff --git a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go index 136f1b215733..8f94230ea1c8 100644 --- a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +++ b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go @@ -12,6 +12,12 @@ import ( const File_google_protobuf_descriptor_proto = "google/protobuf/descriptor.proto" +// Full and short names for google.protobuf.Edition. +const ( + Edition_enum_fullname = "google.protobuf.Edition" + Edition_enum_name = "Edition" +) + // Names for google.protobuf.FileDescriptorSet. const ( FileDescriptorSet_message_name protoreflect.Name = "FileDescriptorSet" @@ -81,7 +87,7 @@ const ( FileDescriptorProto_Options_field_number protoreflect.FieldNumber = 8 FileDescriptorProto_SourceCodeInfo_field_number protoreflect.FieldNumber = 9 FileDescriptorProto_Syntax_field_number protoreflect.FieldNumber = 12 - FileDescriptorProto_Edition_field_number protoreflect.FieldNumber = 13 + FileDescriptorProto_Edition_field_number protoreflect.FieldNumber = 14 ) // Names for google.protobuf.DescriptorProto. @@ -184,10 +190,12 @@ const ( const ( ExtensionRangeOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" ExtensionRangeOptions_Declaration_field_name protoreflect.Name = "declaration" + ExtensionRangeOptions_Features_field_name protoreflect.Name = "features" ExtensionRangeOptions_Verification_field_name protoreflect.Name = "verification" ExtensionRangeOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.uninterpreted_option" ExtensionRangeOptions_Declaration_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.declaration" + ExtensionRangeOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.features" ExtensionRangeOptions_Verification_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.verification" ) @@ -195,6 +203,7 @@ const ( const ( ExtensionRangeOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ExtensionRangeOptions_Declaration_field_number protoreflect.FieldNumber = 2 + ExtensionRangeOptions_Features_field_number protoreflect.FieldNumber = 50 ExtensionRangeOptions_Verification_field_number protoreflect.FieldNumber = 3 ) @@ -212,29 +221,26 @@ const ( // Field names for google.protobuf.ExtensionRangeOptions.Declaration. const ( - ExtensionRangeOptions_Declaration_Number_field_name protoreflect.Name = "number" - ExtensionRangeOptions_Declaration_FullName_field_name protoreflect.Name = "full_name" - ExtensionRangeOptions_Declaration_Type_field_name protoreflect.Name = "type" - ExtensionRangeOptions_Declaration_IsRepeated_field_name protoreflect.Name = "is_repeated" - ExtensionRangeOptions_Declaration_Reserved_field_name protoreflect.Name = "reserved" - ExtensionRangeOptions_Declaration_Repeated_field_name protoreflect.Name = "repeated" + ExtensionRangeOptions_Declaration_Number_field_name protoreflect.Name = "number" + ExtensionRangeOptions_Declaration_FullName_field_name protoreflect.Name = "full_name" + ExtensionRangeOptions_Declaration_Type_field_name protoreflect.Name = "type" + ExtensionRangeOptions_Declaration_Reserved_field_name protoreflect.Name = "reserved" + ExtensionRangeOptions_Declaration_Repeated_field_name protoreflect.Name = "repeated" - ExtensionRangeOptions_Declaration_Number_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.number" - ExtensionRangeOptions_Declaration_FullName_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.full_name" - ExtensionRangeOptions_Declaration_Type_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.type" - ExtensionRangeOptions_Declaration_IsRepeated_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.is_repeated" - ExtensionRangeOptions_Declaration_Reserved_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.reserved" - ExtensionRangeOptions_Declaration_Repeated_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.repeated" + ExtensionRangeOptions_Declaration_Number_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.number" + ExtensionRangeOptions_Declaration_FullName_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.full_name" + ExtensionRangeOptions_Declaration_Type_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.type" + ExtensionRangeOptions_Declaration_Reserved_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.reserved" + ExtensionRangeOptions_Declaration_Repeated_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.repeated" ) // Field numbers for google.protobuf.ExtensionRangeOptions.Declaration. const ( - ExtensionRangeOptions_Declaration_Number_field_number protoreflect.FieldNumber = 1 - ExtensionRangeOptions_Declaration_FullName_field_number protoreflect.FieldNumber = 2 - ExtensionRangeOptions_Declaration_Type_field_number protoreflect.FieldNumber = 3 - ExtensionRangeOptions_Declaration_IsRepeated_field_number protoreflect.FieldNumber = 4 - ExtensionRangeOptions_Declaration_Reserved_field_number protoreflect.FieldNumber = 5 - ExtensionRangeOptions_Declaration_Repeated_field_number protoreflect.FieldNumber = 6 + ExtensionRangeOptions_Declaration_Number_field_number protoreflect.FieldNumber = 1 + ExtensionRangeOptions_Declaration_FullName_field_number protoreflect.FieldNumber = 2 + ExtensionRangeOptions_Declaration_Type_field_number protoreflect.FieldNumber = 3 + ExtensionRangeOptions_Declaration_Reserved_field_number protoreflect.FieldNumber = 5 + ExtensionRangeOptions_Declaration_Repeated_field_number protoreflect.FieldNumber = 6 ) // Names for google.protobuf.FieldDescriptorProto. @@ -478,6 +484,7 @@ const ( FileOptions_PhpNamespace_field_name protoreflect.Name = "php_namespace" FileOptions_PhpMetadataNamespace_field_name protoreflect.Name = "php_metadata_namespace" FileOptions_RubyPackage_field_name protoreflect.Name = "ruby_package" + FileOptions_Features_field_name protoreflect.Name = "features" FileOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" FileOptions_JavaPackage_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.java_package" @@ -500,6 +507,7 @@ const ( FileOptions_PhpNamespace_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.php_namespace" FileOptions_PhpMetadataNamespace_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.php_metadata_namespace" FileOptions_RubyPackage_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.ruby_package" + FileOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.features" FileOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.uninterpreted_option" ) @@ -525,6 +533,7 @@ const ( FileOptions_PhpNamespace_field_number protoreflect.FieldNumber = 41 FileOptions_PhpMetadataNamespace_field_number protoreflect.FieldNumber = 44 FileOptions_RubyPackage_field_number protoreflect.FieldNumber = 45 + FileOptions_Features_field_number protoreflect.FieldNumber = 50 FileOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -547,6 +556,7 @@ const ( MessageOptions_Deprecated_field_name protoreflect.Name = "deprecated" MessageOptions_MapEntry_field_name protoreflect.Name = "map_entry" MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_name protoreflect.Name = "deprecated_legacy_json_field_conflicts" + MessageOptions_Features_field_name protoreflect.Name = "features" MessageOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" MessageOptions_MessageSetWireFormat_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.message_set_wire_format" @@ -554,6 +564,7 @@ const ( MessageOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.deprecated" MessageOptions_MapEntry_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.map_entry" MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.deprecated_legacy_json_field_conflicts" + MessageOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.features" MessageOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.uninterpreted_option" ) @@ -564,6 +575,7 @@ const ( MessageOptions_Deprecated_field_number protoreflect.FieldNumber = 3 MessageOptions_MapEntry_field_number protoreflect.FieldNumber = 7 MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_number protoreflect.FieldNumber = 11 + MessageOptions_Features_field_number protoreflect.FieldNumber = 12 MessageOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -584,8 +596,9 @@ const ( FieldOptions_Weak_field_name protoreflect.Name = "weak" FieldOptions_DebugRedact_field_name protoreflect.Name = "debug_redact" FieldOptions_Retention_field_name protoreflect.Name = "retention" - FieldOptions_Target_field_name protoreflect.Name = "target" FieldOptions_Targets_field_name protoreflect.Name = "targets" + FieldOptions_EditionDefaults_field_name protoreflect.Name = "edition_defaults" + FieldOptions_Features_field_name protoreflect.Name = "features" FieldOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" FieldOptions_Ctype_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.ctype" @@ -597,8 +610,9 @@ const ( FieldOptions_Weak_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.weak" FieldOptions_DebugRedact_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.debug_redact" FieldOptions_Retention_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.retention" - FieldOptions_Target_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.target" FieldOptions_Targets_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.targets" + FieldOptions_EditionDefaults_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.edition_defaults" + FieldOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.features" FieldOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.uninterpreted_option" ) @@ -613,8 +627,9 @@ const ( FieldOptions_Weak_field_number protoreflect.FieldNumber = 10 FieldOptions_DebugRedact_field_number protoreflect.FieldNumber = 16 FieldOptions_Retention_field_number protoreflect.FieldNumber = 17 - FieldOptions_Target_field_number protoreflect.FieldNumber = 18 FieldOptions_Targets_field_number protoreflect.FieldNumber = 19 + FieldOptions_EditionDefaults_field_number protoreflect.FieldNumber = 20 + FieldOptions_Features_field_number protoreflect.FieldNumber = 21 FieldOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -642,6 +657,27 @@ const ( FieldOptions_OptionTargetType_enum_name = "OptionTargetType" ) +// Names for google.protobuf.FieldOptions.EditionDefault. +const ( + FieldOptions_EditionDefault_message_name protoreflect.Name = "EditionDefault" + FieldOptions_EditionDefault_message_fullname protoreflect.FullName = "google.protobuf.FieldOptions.EditionDefault" +) + +// Field names for google.protobuf.FieldOptions.EditionDefault. +const ( + FieldOptions_EditionDefault_Edition_field_name protoreflect.Name = "edition" + FieldOptions_EditionDefault_Value_field_name protoreflect.Name = "value" + + FieldOptions_EditionDefault_Edition_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.EditionDefault.edition" + FieldOptions_EditionDefault_Value_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.EditionDefault.value" +) + +// Field numbers for google.protobuf.FieldOptions.EditionDefault. +const ( + FieldOptions_EditionDefault_Edition_field_number protoreflect.FieldNumber = 3 + FieldOptions_EditionDefault_Value_field_number protoreflect.FieldNumber = 2 +) + // Names for google.protobuf.OneofOptions. const ( OneofOptions_message_name protoreflect.Name = "OneofOptions" @@ -650,13 +686,16 @@ const ( // Field names for google.protobuf.OneofOptions. const ( + OneofOptions_Features_field_name protoreflect.Name = "features" OneofOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" + OneofOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.OneofOptions.features" OneofOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.OneofOptions.uninterpreted_option" ) // Field numbers for google.protobuf.OneofOptions. const ( + OneofOptions_Features_field_number protoreflect.FieldNumber = 1 OneofOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -671,11 +710,13 @@ const ( EnumOptions_AllowAlias_field_name protoreflect.Name = "allow_alias" EnumOptions_Deprecated_field_name protoreflect.Name = "deprecated" EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_name protoreflect.Name = "deprecated_legacy_json_field_conflicts" + EnumOptions_Features_field_name protoreflect.Name = "features" EnumOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" EnumOptions_AllowAlias_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.allow_alias" EnumOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.deprecated" EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.deprecated_legacy_json_field_conflicts" + EnumOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.features" EnumOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.uninterpreted_option" ) @@ -684,6 +725,7 @@ const ( EnumOptions_AllowAlias_field_number protoreflect.FieldNumber = 2 EnumOptions_Deprecated_field_number protoreflect.FieldNumber = 3 EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_number protoreflect.FieldNumber = 6 + EnumOptions_Features_field_number protoreflect.FieldNumber = 7 EnumOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -696,15 +738,21 @@ const ( // Field names for google.protobuf.EnumValueOptions. const ( EnumValueOptions_Deprecated_field_name protoreflect.Name = "deprecated" + EnumValueOptions_Features_field_name protoreflect.Name = "features" + EnumValueOptions_DebugRedact_field_name protoreflect.Name = "debug_redact" EnumValueOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" EnumValueOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.deprecated" + EnumValueOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.features" + EnumValueOptions_DebugRedact_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.debug_redact" EnumValueOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.uninterpreted_option" ) // Field numbers for google.protobuf.EnumValueOptions. const ( EnumValueOptions_Deprecated_field_number protoreflect.FieldNumber = 1 + EnumValueOptions_Features_field_number protoreflect.FieldNumber = 2 + EnumValueOptions_DebugRedact_field_number protoreflect.FieldNumber = 3 EnumValueOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -716,15 +764,18 @@ const ( // Field names for google.protobuf.ServiceOptions. const ( + ServiceOptions_Features_field_name protoreflect.Name = "features" ServiceOptions_Deprecated_field_name protoreflect.Name = "deprecated" ServiceOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" + ServiceOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.ServiceOptions.features" ServiceOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.ServiceOptions.deprecated" ServiceOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.ServiceOptions.uninterpreted_option" ) // Field numbers for google.protobuf.ServiceOptions. const ( + ServiceOptions_Features_field_number protoreflect.FieldNumber = 34 ServiceOptions_Deprecated_field_number protoreflect.FieldNumber = 33 ServiceOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -739,10 +790,12 @@ const ( const ( MethodOptions_Deprecated_field_name protoreflect.Name = "deprecated" MethodOptions_IdempotencyLevel_field_name protoreflect.Name = "idempotency_level" + MethodOptions_Features_field_name protoreflect.Name = "features" MethodOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" MethodOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.deprecated" MethodOptions_IdempotencyLevel_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.idempotency_level" + MethodOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.features" MethodOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.uninterpreted_option" ) @@ -750,6 +803,7 @@ const ( const ( MethodOptions_Deprecated_field_number protoreflect.FieldNumber = 33 MethodOptions_IdempotencyLevel_field_number protoreflect.FieldNumber = 34 + MethodOptions_Features_field_number protoreflect.FieldNumber = 35 MethodOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -816,6 +870,120 @@ const ( UninterpretedOption_NamePart_IsExtension_field_number protoreflect.FieldNumber = 2 ) +// Names for google.protobuf.FeatureSet. +const ( + FeatureSet_message_name protoreflect.Name = "FeatureSet" + FeatureSet_message_fullname protoreflect.FullName = "google.protobuf.FeatureSet" +) + +// Field names for google.protobuf.FeatureSet. +const ( + FeatureSet_FieldPresence_field_name protoreflect.Name = "field_presence" + FeatureSet_EnumType_field_name protoreflect.Name = "enum_type" + FeatureSet_RepeatedFieldEncoding_field_name protoreflect.Name = "repeated_field_encoding" + FeatureSet_Utf8Validation_field_name protoreflect.Name = "utf8_validation" + FeatureSet_MessageEncoding_field_name protoreflect.Name = "message_encoding" + FeatureSet_JsonFormat_field_name protoreflect.Name = "json_format" + + FeatureSet_FieldPresence_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.field_presence" + FeatureSet_EnumType_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.enum_type" + FeatureSet_RepeatedFieldEncoding_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.repeated_field_encoding" + FeatureSet_Utf8Validation_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.utf8_validation" + FeatureSet_MessageEncoding_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.message_encoding" + FeatureSet_JsonFormat_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.json_format" +) + +// Field numbers for google.protobuf.FeatureSet. +const ( + FeatureSet_FieldPresence_field_number protoreflect.FieldNumber = 1 + FeatureSet_EnumType_field_number protoreflect.FieldNumber = 2 + FeatureSet_RepeatedFieldEncoding_field_number protoreflect.FieldNumber = 3 + FeatureSet_Utf8Validation_field_number protoreflect.FieldNumber = 4 + FeatureSet_MessageEncoding_field_number protoreflect.FieldNumber = 5 + FeatureSet_JsonFormat_field_number protoreflect.FieldNumber = 6 +) + +// Full and short names for google.protobuf.FeatureSet.FieldPresence. +const ( + FeatureSet_FieldPresence_enum_fullname = "google.protobuf.FeatureSet.FieldPresence" + FeatureSet_FieldPresence_enum_name = "FieldPresence" +) + +// Full and short names for google.protobuf.FeatureSet.EnumType. +const ( + FeatureSet_EnumType_enum_fullname = "google.protobuf.FeatureSet.EnumType" + FeatureSet_EnumType_enum_name = "EnumType" +) + +// Full and short names for google.protobuf.FeatureSet.RepeatedFieldEncoding. +const ( + FeatureSet_RepeatedFieldEncoding_enum_fullname = "google.protobuf.FeatureSet.RepeatedFieldEncoding" + FeatureSet_RepeatedFieldEncoding_enum_name = "RepeatedFieldEncoding" +) + +// Full and short names for google.protobuf.FeatureSet.Utf8Validation. +const ( + FeatureSet_Utf8Validation_enum_fullname = "google.protobuf.FeatureSet.Utf8Validation" + FeatureSet_Utf8Validation_enum_name = "Utf8Validation" +) + +// Full and short names for google.protobuf.FeatureSet.MessageEncoding. +const ( + FeatureSet_MessageEncoding_enum_fullname = "google.protobuf.FeatureSet.MessageEncoding" + FeatureSet_MessageEncoding_enum_name = "MessageEncoding" +) + +// Full and short names for google.protobuf.FeatureSet.JsonFormat. +const ( + FeatureSet_JsonFormat_enum_fullname = "google.protobuf.FeatureSet.JsonFormat" + FeatureSet_JsonFormat_enum_name = "JsonFormat" +) + +// Names for google.protobuf.FeatureSetDefaults. +const ( + FeatureSetDefaults_message_name protoreflect.Name = "FeatureSetDefaults" + FeatureSetDefaults_message_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults" +) + +// Field names for google.protobuf.FeatureSetDefaults. +const ( + FeatureSetDefaults_Defaults_field_name protoreflect.Name = "defaults" + FeatureSetDefaults_MinimumEdition_field_name protoreflect.Name = "minimum_edition" + FeatureSetDefaults_MaximumEdition_field_name protoreflect.Name = "maximum_edition" + + FeatureSetDefaults_Defaults_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.defaults" + FeatureSetDefaults_MinimumEdition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.minimum_edition" + FeatureSetDefaults_MaximumEdition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.maximum_edition" +) + +// Field numbers for google.protobuf.FeatureSetDefaults. +const ( + FeatureSetDefaults_Defaults_field_number protoreflect.FieldNumber = 1 + FeatureSetDefaults_MinimumEdition_field_number protoreflect.FieldNumber = 4 + FeatureSetDefaults_MaximumEdition_field_number protoreflect.FieldNumber = 5 +) + +// Names for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. +const ( + FeatureSetDefaults_FeatureSetEditionDefault_message_name protoreflect.Name = "FeatureSetEditionDefault" + FeatureSetDefaults_FeatureSetEditionDefault_message_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault" +) + +// Field names for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. +const ( + FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_name protoreflect.Name = "edition" + FeatureSetDefaults_FeatureSetEditionDefault_Features_field_name protoreflect.Name = "features" + + FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition" + FeatureSetDefaults_FeatureSetEditionDefault_Features_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features" +) + +// Field numbers for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. +const ( + FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_number protoreflect.FieldNumber = 3 + FeatureSetDefaults_FeatureSetEditionDefault_Features_field_number protoreflect.FieldNumber = 2 +) + // Names for google.protobuf.SourceCodeInfo. const ( SourceCodeInfo_message_name protoreflect.Name = "SourceCodeInfo" diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go b/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go index 1a509b63ebc1..f55dc01e3a92 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go @@ -162,11 +162,20 @@ func appendBoolSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions func consumeBoolSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.BoolSlice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := 0 + for _, v := range b { + if v < 0x80 { + count++ + } + } + if count > 0 { + p.growBoolSlice(count) + } + s := *sp for len(b) > 0 { var v uint64 var n int @@ -732,11 +741,20 @@ func appendInt32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOption func consumeInt32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int32Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := 0 + for _, v := range b { + if v < 0x80 { + count++ + } + } + if count > 0 { + p.growInt32Slice(count) + } + s := *sp for len(b) > 0 { var v uint64 var n int @@ -1138,11 +1156,20 @@ func appendSint32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio func consumeSint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int32Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := 0 + for _, v := range b { + if v < 0x80 { + count++ + } + } + if count > 0 { + p.growInt32Slice(count) + } + s := *sp for len(b) > 0 { var v uint64 var n int @@ -1544,11 +1571,20 @@ func appendUint32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio func consumeUint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Uint32Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := 0 + for _, v := range b { + if v < 0x80 { + count++ + } + } + if count > 0 { + p.growUint32Slice(count) + } + s := *sp for len(b) > 0 { var v uint64 var n int @@ -1950,11 +1986,20 @@ func appendInt64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOption func consumeInt64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int64Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := 0 + for _, v := range b { + if v < 0x80 { + count++ + } + } + if count > 0 { + p.growInt64Slice(count) + } + s := *sp for len(b) > 0 { var v uint64 var n int @@ -2356,11 +2401,20 @@ func appendSint64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio func consumeSint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int64Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := 0 + for _, v := range b { + if v < 0x80 { + count++ + } + } + if count > 0 { + p.growInt64Slice(count) + } + s := *sp for len(b) > 0 { var v uint64 var n int @@ -2762,11 +2816,20 @@ func appendUint64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio func consumeUint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Uint64Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := 0 + for _, v := range b { + if v < 0x80 { + count++ + } + } + if count > 0 { + p.growUint64Slice(count) + } + s := *sp for len(b) > 0 { var v uint64 var n int @@ -3145,11 +3208,15 @@ func appendSfixed32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOpt func consumeSfixed32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int32Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := len(b) / protowire.SizeFixed32() + if count > 0 { + p.growInt32Slice(count) + } + s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed32(b) if n < 0 { @@ -3461,11 +3528,15 @@ func appendFixed32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOpti func consumeFixed32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Uint32Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := len(b) / protowire.SizeFixed32() + if count > 0 { + p.growUint32Slice(count) + } + s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed32(b) if n < 0 { @@ -3777,11 +3848,15 @@ func appendFloatSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOption func consumeFloatSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Float32Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := len(b) / protowire.SizeFixed32() + if count > 0 { + p.growFloat32Slice(count) + } + s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed32(b) if n < 0 { @@ -4093,11 +4168,15 @@ func appendSfixed64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOpt func consumeSfixed64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int64Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := len(b) / protowire.SizeFixed64() + if count > 0 { + p.growInt64Slice(count) + } + s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed64(b) if n < 0 { @@ -4409,11 +4488,15 @@ func appendFixed64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOpti func consumeFixed64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Uint64Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := len(b) / protowire.SizeFixed64() + if count > 0 { + p.growUint64Slice(count) + } + s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed64(b) if n < 0 { @@ -4725,11 +4808,15 @@ func appendDoubleSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio func consumeDoubleSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Float64Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := len(b) / protowire.SizeFixed64() + if count > 0 { + p.growFloat64Slice(count) + } + s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed64(b) if n < 0 { diff --git a/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go b/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go index 61c483fac06e..2ab2c629784c 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go +++ b/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go @@ -206,13 +206,18 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName // Obtain a list of oneof wrapper types. var oneofWrappers []reflect.Type - for _, method := range []string{"XXX_OneofFuncs", "XXX_OneofWrappers"} { - if fn, ok := t.MethodByName(method); ok { - for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { - if vs, ok := v.Interface().([]interface{}); ok { - for _, v := range vs { - oneofWrappers = append(oneofWrappers, reflect.TypeOf(v)) - } + methods := make([]reflect.Method, 0, 2) + if m, ok := t.MethodByName("XXX_OneofFuncs"); ok { + methods = append(methods, m) + } + if m, ok := t.MethodByName("XXX_OneofWrappers"); ok { + methods = append(methods, m) + } + for _, fn := range methods { + for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { + if vs, ok := v.Interface().([]interface{}); ok { + for _, v := range vs { + oneofWrappers = append(oneofWrappers, reflect.TypeOf(v)) } } } diff --git a/vendor/google.golang.org/protobuf/internal/impl/message.go b/vendor/google.golang.org/protobuf/internal/impl/message.go index 4f5fb67a0ddb..629bacdcedd3 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/message.go +++ b/vendor/google.golang.org/protobuf/internal/impl/message.go @@ -192,12 +192,17 @@ fieldLoop: // Derive a mapping of oneof wrappers to fields. oneofWrappers := mi.OneofWrappers - for _, method := range []string{"XXX_OneofFuncs", "XXX_OneofWrappers"} { - if fn, ok := reflect.PtrTo(t).MethodByName(method); ok { - for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { - if vs, ok := v.Interface().([]interface{}); ok { - oneofWrappers = vs - } + methods := make([]reflect.Method, 0, 2) + if m, ok := reflect.PtrTo(t).MethodByName("XXX_OneofFuncs"); ok { + methods = append(methods, m) + } + if m, ok := reflect.PtrTo(t).MethodByName("XXX_OneofWrappers"); ok { + methods = append(methods, m) + } + for _, fn := range methods { + for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { + if vs, ok := v.Interface().([]interface{}); ok { + oneofWrappers = vs } } } diff --git a/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go b/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go index 4c491bdf4825..517e94434c73 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go +++ b/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go @@ -159,6 +159,42 @@ func (p pointer) SetPointer(v pointer) { p.v.Elem().Set(v.v) } +func growSlice(p pointer, addCap int) { + // TODO: Once we only support Go 1.20 and newer, use reflect.Grow. + in := p.v.Elem() + out := reflect.MakeSlice(in.Type(), in.Len(), in.Len()+addCap) + reflect.Copy(out, in) + p.v.Elem().Set(out) +} + +func (p pointer) growBoolSlice(addCap int) { + growSlice(p, addCap) +} + +func (p pointer) growInt32Slice(addCap int) { + growSlice(p, addCap) +} + +func (p pointer) growUint32Slice(addCap int) { + growSlice(p, addCap) +} + +func (p pointer) growInt64Slice(addCap int) { + growSlice(p, addCap) +} + +func (p pointer) growUint64Slice(addCap int) { + growSlice(p, addCap) +} + +func (p pointer) growFloat64Slice(addCap int) { + growSlice(p, addCap) +} + +func (p pointer) growFloat32Slice(addCap int) { + growSlice(p, addCap) +} + func (Export) MessageStateOf(p Pointer) *messageState { panic("not supported") } func (ms *messageState) pointer() pointer { panic("not supported") } func (ms *messageState) messageInfo() *MessageInfo { panic("not supported") } diff --git a/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go b/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go index ee0e0573e395..4b020e311644 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go +++ b/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go @@ -138,6 +138,46 @@ func (p pointer) SetPointer(v pointer) { *(*unsafe.Pointer)(p.p) = (unsafe.Pointer)(v.p) } +func (p pointer) growBoolSlice(addCap int) { + sp := p.BoolSlice() + s := make([]bool, 0, addCap+len(*sp)) + s = s[:len(*sp)] + copy(s, *sp) + *sp = s +} + +func (p pointer) growInt32Slice(addCap int) { + sp := p.Int32Slice() + s := make([]int32, 0, addCap+len(*sp)) + s = s[:len(*sp)] + copy(s, *sp) + *sp = s +} + +func (p pointer) growUint32Slice(addCap int) { + p.growInt32Slice(addCap) +} + +func (p pointer) growFloat32Slice(addCap int) { + p.growInt32Slice(addCap) +} + +func (p pointer) growInt64Slice(addCap int) { + sp := p.Int64Slice() + s := make([]int64, 0, addCap+len(*sp)) + s = s[:len(*sp)] + copy(s, *sp) + *sp = s +} + +func (p pointer) growUint64Slice(addCap int) { + p.growInt64Slice(addCap) +} + +func (p pointer) growFloat64Slice(addCap int) { + p.growInt64Slice(addCap) +} + // Static check that MessageState does not exceed the size of a pointer. const _ = uint(unsafe.Sizeof(unsafe.Pointer(nil)) - unsafe.Sizeof(MessageState{})) diff --git a/vendor/google.golang.org/protobuf/internal/version/version.go b/vendor/google.golang.org/protobuf/internal/version/version.go index 0999f29d501e..3763d76945f6 100644 --- a/vendor/google.golang.org/protobuf/internal/version/version.go +++ b/vendor/google.golang.org/protobuf/internal/version/version.go @@ -53,7 +53,7 @@ const ( Major = 1 Minor = 31 Patch = 0 - PreRelease = "" + PreRelease = "devel" ) // String formats the version string for this module in semver format. diff --git a/vendor/google.golang.org/protobuf/proto/decode.go b/vendor/google.golang.org/protobuf/proto/decode.go index 48d47946bb1a..e5b03b567719 100644 --- a/vendor/google.golang.org/protobuf/proto/decode.go +++ b/vendor/google.golang.org/protobuf/proto/decode.go @@ -69,7 +69,7 @@ func (o UnmarshalOptions) Unmarshal(b []byte, m Message) error { // UnmarshalState parses a wire-format message and places the result in m. // // This method permits fine-grained control over the unmarshaler. -// Most users should use Unmarshal instead. +// Most users should use [Unmarshal] instead. func (o UnmarshalOptions) UnmarshalState(in protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { if o.RecursionLimit == 0 { o.RecursionLimit = protowire.DefaultRecursionLimit diff --git a/vendor/google.golang.org/protobuf/proto/doc.go b/vendor/google.golang.org/protobuf/proto/doc.go index ec71e717fe7d..80ed16a0c295 100644 --- a/vendor/google.golang.org/protobuf/proto/doc.go +++ b/vendor/google.golang.org/protobuf/proto/doc.go @@ -18,27 +18,27 @@ // This package contains functions to convert to and from the wire format, // an efficient binary serialization of protocol buffers. // -// • Size reports the size of a message in the wire format. +// - [Size] reports the size of a message in the wire format. // -// • Marshal converts a message to the wire format. -// The MarshalOptions type provides more control over wire marshaling. +// - [Marshal] converts a message to the wire format. +// The [MarshalOptions] type provides more control over wire marshaling. // -// • Unmarshal converts a message from the wire format. -// The UnmarshalOptions type provides more control over wire unmarshaling. +// - [Unmarshal] converts a message from the wire format. +// The [UnmarshalOptions] type provides more control over wire unmarshaling. // // # Basic message operations // -// • Clone makes a deep copy of a message. +// - [Clone] makes a deep copy of a message. // -// • Merge merges the content of a message into another. +// - [Merge] merges the content of a message into another. // -// • Equal compares two messages. For more control over comparisons -// and detailed reporting of differences, see package -// "google.golang.org/protobuf/testing/protocmp". +// - [Equal] compares two messages. For more control over comparisons +// and detailed reporting of differences, see package +// [google.golang.org/protobuf/testing/protocmp]. // -// • Reset clears the content of a message. +// - [Reset] clears the content of a message. // -// • CheckInitialized reports whether all required fields in a message are set. +// - [CheckInitialized] reports whether all required fields in a message are set. // // # Optional scalar constructors // @@ -46,9 +46,9 @@ // as pointers to a value. For example, an optional string field has the // Go type *string. // -// • Bool, Int32, Int64, Uint32, Uint64, Float32, Float64, and String -// take a value and return a pointer to a new instance of it, -// to simplify construction of optional field values. +// - [Bool], [Int32], [Int64], [Uint32], [Uint64], [Float32], [Float64], and [String] +// take a value and return a pointer to a new instance of it, +// to simplify construction of optional field values. // // Generated enum types usually have an Enum method which performs the // same operation. @@ -57,29 +57,29 @@ // // # Extension accessors // -// • HasExtension, GetExtension, SetExtension, and ClearExtension -// access extension field values in a protocol buffer message. +// - [HasExtension], [GetExtension], [SetExtension], and [ClearExtension] +// access extension field values in a protocol buffer message. // // Extension fields are only supported in proto2. // // # Related packages // -// • Package "google.golang.org/protobuf/encoding/protojson" converts messages to -// and from JSON. +// - Package [google.golang.org/protobuf/encoding/protojson] converts messages to +// and from JSON. // -// • Package "google.golang.org/protobuf/encoding/prototext" converts messages to -// and from the text format. +// - Package [google.golang.org/protobuf/encoding/prototext] converts messages to +// and from the text format. // -// • Package "google.golang.org/protobuf/reflect/protoreflect" provides a -// reflection interface for protocol buffer data types. +// - Package [google.golang.org/protobuf/reflect/protoreflect] provides a +// reflection interface for protocol buffer data types. // -// • Package "google.golang.org/protobuf/testing/protocmp" provides features -// to compare protocol buffer messages with the "github.com/google/go-cmp/cmp" -// package. +// - Package [google.golang.org/protobuf/testing/protocmp] provides features +// to compare protocol buffer messages with the [github.com/google/go-cmp/cmp] +// package. // -// • Package "google.golang.org/protobuf/types/dynamicpb" provides a dynamic -// message type, suitable for working with messages where the protocol buffer -// type is only known at runtime. +// - Package [google.golang.org/protobuf/types/dynamicpb] provides a dynamic +// message type, suitable for working with messages where the protocol buffer +// type is only known at runtime. // // This module contains additional packages for more specialized use cases. // Consult the individual package documentation for details. diff --git a/vendor/google.golang.org/protobuf/proto/encode.go b/vendor/google.golang.org/protobuf/proto/encode.go index bf7f816d0e86..4fed202f9fc4 100644 --- a/vendor/google.golang.org/protobuf/proto/encode.go +++ b/vendor/google.golang.org/protobuf/proto/encode.go @@ -129,7 +129,7 @@ func (o MarshalOptions) MarshalAppend(b []byte, m Message) ([]byte, error) { // MarshalState returns the wire-format encoding of a message. // // This method permits fine-grained control over the marshaler. -// Most users should use Marshal instead. +// Most users should use [Marshal] instead. func (o MarshalOptions) MarshalState(in protoiface.MarshalInput) (protoiface.MarshalOutput, error) { return o.marshal(in.Buf, in.Message) } diff --git a/vendor/google.golang.org/protobuf/proto/extension.go b/vendor/google.golang.org/protobuf/proto/extension.go index 5f293cda8699..17899a3a767f 100644 --- a/vendor/google.golang.org/protobuf/proto/extension.go +++ b/vendor/google.golang.org/protobuf/proto/extension.go @@ -26,7 +26,7 @@ func HasExtension(m Message, xt protoreflect.ExtensionType) bool { } // ClearExtension clears an extension field such that subsequent -// HasExtension calls return false. +// [HasExtension] calls return false. // It panics if m is invalid or if xt does not extend m. func ClearExtension(m Message, xt protoreflect.ExtensionType) { m.ProtoReflect().Clear(xt.TypeDescriptor()) diff --git a/vendor/google.golang.org/protobuf/proto/merge.go b/vendor/google.golang.org/protobuf/proto/merge.go index d761ab331d1c..3c6fe57807bf 100644 --- a/vendor/google.golang.org/protobuf/proto/merge.go +++ b/vendor/google.golang.org/protobuf/proto/merge.go @@ -21,7 +21,7 @@ import ( // The unknown fields of src are appended to the unknown fields of dst. // // It is semantically equivalent to unmarshaling the encoded form of src -// into dst with the UnmarshalOptions.Merge option specified. +// into dst with the [UnmarshalOptions.Merge] option specified. func Merge(dst, src Message) { // TODO: Should nil src be treated as semantically equivalent to a // untyped, read-only, empty message? What about a nil dst? diff --git a/vendor/google.golang.org/protobuf/proto/proto.go b/vendor/google.golang.org/protobuf/proto/proto.go index 1f0d183b102d..7543ee6b255d 100644 --- a/vendor/google.golang.org/protobuf/proto/proto.go +++ b/vendor/google.golang.org/protobuf/proto/proto.go @@ -15,18 +15,20 @@ import ( // protobuf module that accept a Message, except where otherwise specified. // // This is the v2 interface definition for protobuf messages. -// The v1 interface definition is "github.com/golang/protobuf/proto".Message. +// The v1 interface definition is [github.com/golang/protobuf/proto.Message]. // -// To convert a v1 message to a v2 message, -// use "github.com/golang/protobuf/proto".MessageV2. -// To convert a v2 message to a v1 message, -// use "github.com/golang/protobuf/proto".MessageV1. +// - To convert a v1 message to a v2 message, +// use [google.golang.org/protobuf/protoadapt.MessageV2Of]. +// - To convert a v2 message to a v1 message, +// use [google.golang.org/protobuf/protoadapt.MessageV1Of]. type Message = protoreflect.ProtoMessage -// Error matches all errors produced by packages in the protobuf module. +// Error matches all errors produced by packages in the protobuf module +// according to [errors.Is]. // -// That is, errors.Is(err, Error) reports whether an error is produced -// by this module. +// Example usage: +// +// if errors.Is(err, proto.Error) { ... } var Error error func init() { diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go index e4dfb1205063..0f2908ed7010 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go @@ -3,11 +3,11 @@ // license that can be found in the LICENSE file. // Package protodesc provides functionality for converting -// FileDescriptorProto messages to/from protoreflect.FileDescriptor values. +// FileDescriptorProto messages to/from [protoreflect.FileDescriptor] values. // // The google.protobuf.FileDescriptorProto is a protobuf message that describes // the type information for a .proto file in a form that is easily serializable. -// The protoreflect.FileDescriptor is a more structured representation of +// The [protoreflect.FileDescriptor] is a more structured representation of // the FileDescriptorProto message where references and remote dependencies // can be directly followed. package protodesc @@ -24,11 +24,11 @@ import ( "google.golang.org/protobuf/types/descriptorpb" ) -// Resolver is the resolver used by NewFile to resolve dependencies. +// Resolver is the resolver used by [NewFile] to resolve dependencies. // The enums and messages provided must belong to some parent file, // which is also registered. // -// It is implemented by protoregistry.Files. +// It is implemented by [protoregistry.Files]. type Resolver interface { FindFileByPath(string) (protoreflect.FileDescriptor, error) FindDescriptorByName(protoreflect.FullName) (protoreflect.Descriptor, error) @@ -61,19 +61,19 @@ type FileOptions struct { AllowUnresolvable bool } -// NewFile creates a new protoreflect.FileDescriptor from the provided -// file descriptor message. See FileOptions.New for more information. +// NewFile creates a new [protoreflect.FileDescriptor] from the provided +// file descriptor message. See [FileOptions.New] for more information. func NewFile(fd *descriptorpb.FileDescriptorProto, r Resolver) (protoreflect.FileDescriptor, error) { return FileOptions{}.New(fd, r) } -// NewFiles creates a new protoregistry.Files from the provided -// FileDescriptorSet message. See FileOptions.NewFiles for more information. +// NewFiles creates a new [protoregistry.Files] from the provided +// FileDescriptorSet message. See [FileOptions.NewFiles] for more information. func NewFiles(fd *descriptorpb.FileDescriptorSet) (*protoregistry.Files, error) { return FileOptions{}.NewFiles(fd) } -// New creates a new protoreflect.FileDescriptor from the provided +// New creates a new [protoreflect.FileDescriptor] from the provided // file descriptor message. The file must represent a valid proto file according // to protobuf semantics. The returned descriptor is a deep copy of the input. // @@ -231,7 +231,7 @@ func (is importSet) importPublic(imps protoreflect.FileImports) { } } -// NewFiles creates a new protoregistry.Files from the provided +// NewFiles creates a new [protoregistry.Files] from the provided // FileDescriptorSet message. The descriptor set must include only // valid files according to protobuf semantics. The returned descriptors // are a deep copy of the input. diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go b/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go index a7c5ceffc9b1..c5151490c84e 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go @@ -16,7 +16,7 @@ import ( "google.golang.org/protobuf/types/descriptorpb" ) -// ToFileDescriptorProto copies a protoreflect.FileDescriptor into a +// ToFileDescriptorProto copies a [protoreflect.FileDescriptor] into a // google.protobuf.FileDescriptorProto message. func ToFileDescriptorProto(file protoreflect.FileDescriptor) *descriptorpb.FileDescriptorProto { p := &descriptorpb.FileDescriptorProto{ @@ -76,7 +76,7 @@ func ToFileDescriptorProto(file protoreflect.FileDescriptor) *descriptorpb.FileD return p } -// ToDescriptorProto copies a protoreflect.MessageDescriptor into a +// ToDescriptorProto copies a [protoreflect.MessageDescriptor] into a // google.protobuf.DescriptorProto message. func ToDescriptorProto(message protoreflect.MessageDescriptor) *descriptorpb.DescriptorProto { p := &descriptorpb.DescriptorProto{ @@ -119,7 +119,7 @@ func ToDescriptorProto(message protoreflect.MessageDescriptor) *descriptorpb.Des return p } -// ToFieldDescriptorProto copies a protoreflect.FieldDescriptor into a +// ToFieldDescriptorProto copies a [protoreflect.FieldDescriptor] into a // google.protobuf.FieldDescriptorProto message. func ToFieldDescriptorProto(field protoreflect.FieldDescriptor) *descriptorpb.FieldDescriptorProto { p := &descriptorpb.FieldDescriptorProto{ @@ -168,7 +168,7 @@ func ToFieldDescriptorProto(field protoreflect.FieldDescriptor) *descriptorpb.Fi return p } -// ToOneofDescriptorProto copies a protoreflect.OneofDescriptor into a +// ToOneofDescriptorProto copies a [protoreflect.OneofDescriptor] into a // google.protobuf.OneofDescriptorProto message. func ToOneofDescriptorProto(oneof protoreflect.OneofDescriptor) *descriptorpb.OneofDescriptorProto { return &descriptorpb.OneofDescriptorProto{ @@ -177,7 +177,7 @@ func ToOneofDescriptorProto(oneof protoreflect.OneofDescriptor) *descriptorpb.On } } -// ToEnumDescriptorProto copies a protoreflect.EnumDescriptor into a +// ToEnumDescriptorProto copies a [protoreflect.EnumDescriptor] into a // google.protobuf.EnumDescriptorProto message. func ToEnumDescriptorProto(enum protoreflect.EnumDescriptor) *descriptorpb.EnumDescriptorProto { p := &descriptorpb.EnumDescriptorProto{ @@ -200,7 +200,7 @@ func ToEnumDescriptorProto(enum protoreflect.EnumDescriptor) *descriptorpb.EnumD return p } -// ToEnumValueDescriptorProto copies a protoreflect.EnumValueDescriptor into a +// ToEnumValueDescriptorProto copies a [protoreflect.EnumValueDescriptor] into a // google.protobuf.EnumValueDescriptorProto message. func ToEnumValueDescriptorProto(value protoreflect.EnumValueDescriptor) *descriptorpb.EnumValueDescriptorProto { return &descriptorpb.EnumValueDescriptorProto{ @@ -210,7 +210,7 @@ func ToEnumValueDescriptorProto(value protoreflect.EnumValueDescriptor) *descrip } } -// ToServiceDescriptorProto copies a protoreflect.ServiceDescriptor into a +// ToServiceDescriptorProto copies a [protoreflect.ServiceDescriptor] into a // google.protobuf.ServiceDescriptorProto message. func ToServiceDescriptorProto(service protoreflect.ServiceDescriptor) *descriptorpb.ServiceDescriptorProto { p := &descriptorpb.ServiceDescriptorProto{ @@ -223,7 +223,7 @@ func ToServiceDescriptorProto(service protoreflect.ServiceDescriptor) *descripto return p } -// ToMethodDescriptorProto copies a protoreflect.MethodDescriptor into a +// ToMethodDescriptorProto copies a [protoreflect.MethodDescriptor] into a // google.protobuf.MethodDescriptorProto message. func ToMethodDescriptorProto(method protoreflect.MethodDescriptor) *descriptorpb.MethodDescriptorProto { p := &descriptorpb.MethodDescriptorProto{ diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go index 55aa14922b01..7bb1042e858a 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go @@ -10,46 +10,46 @@ // // # Protocol Buffer Descriptors // -// Protobuf descriptors (e.g., EnumDescriptor or MessageDescriptor) +// Protobuf descriptors (e.g., [EnumDescriptor] or [MessageDescriptor]) // are immutable objects that represent protobuf type information. // They are wrappers around the messages declared in descriptor.proto. // Protobuf descriptors alone lack any information regarding Go types. // -// Enums and messages generated by this module implement Enum and ProtoMessage, +// Enums and messages generated by this module implement [Enum] and [ProtoMessage], // where the Descriptor and ProtoReflect.Descriptor accessors respectively // return the protobuf descriptor for the values. // // The protobuf descriptor interfaces are not meant to be implemented by // user code since they might need to be extended in the future to support // additions to the protobuf language. -// The "google.golang.org/protobuf/reflect/protodesc" package converts between +// The [google.golang.org/protobuf/reflect/protodesc] package converts between // google.protobuf.DescriptorProto messages and protobuf descriptors. // // # Go Type Descriptors // -// A type descriptor (e.g., EnumType or MessageType) is a constructor for +// A type descriptor (e.g., [EnumType] or [MessageType]) is a constructor for // a concrete Go type that represents the associated protobuf descriptor. // There is commonly a one-to-one relationship between protobuf descriptors and // Go type descriptors, but it can potentially be a one-to-many relationship. // -// Enums and messages generated by this module implement Enum and ProtoMessage, +// Enums and messages generated by this module implement [Enum] and [ProtoMessage], // where the Type and ProtoReflect.Type accessors respectively // return the protobuf descriptor for the values. // -// The "google.golang.org/protobuf/types/dynamicpb" package can be used to +// The [google.golang.org/protobuf/types/dynamicpb] package can be used to // create Go type descriptors from protobuf descriptors. // // # Value Interfaces // -// The Enum and Message interfaces provide a reflective view over an +// The [Enum] and [Message] interfaces provide a reflective view over an // enum or message instance. For enums, it provides the ability to retrieve // the enum value number for any concrete enum type. For messages, it provides // the ability to access or manipulate fields of the message. // -// To convert a proto.Message to a protoreflect.Message, use the +// To convert a [google.golang.org/protobuf/proto.Message] to a [protoreflect.Message], use the // former's ProtoReflect method. Since the ProtoReflect method is new to the // v2 message interface, it may not be present on older message implementations. -// The "github.com/golang/protobuf/proto".MessageReflect function can be used +// The [github.com/golang/protobuf/proto.MessageReflect] function can be used // to obtain a reflective view on older messages. // // # Relationships @@ -71,12 +71,12 @@ // │ │ // └────────────────── Type() ───────┘ // -// • An EnumType describes a concrete Go enum type. +// • An [EnumType] describes a concrete Go enum type. // It has an EnumDescriptor and can construct an Enum instance. // -// • An EnumDescriptor describes an abstract protobuf enum type. +// • An [EnumDescriptor] describes an abstract protobuf enum type. // -// • An Enum is a concrete enum instance. Generated enums implement Enum. +// • An [Enum] is a concrete enum instance. Generated enums implement Enum. // // ┌──────────────── New() ─────────────────┐ // │ │ @@ -90,24 +90,26 @@ // │ │ // └─────────────────── Type() ─────────┘ // -// • A MessageType describes a concrete Go message type. -// It has a MessageDescriptor and can construct a Message instance. -// Just as how Go's reflect.Type is a reflective description of a Go type, -// a MessageType is a reflective description of a Go type for a protobuf message. +// • A [MessageType] describes a concrete Go message type. +// It has a [MessageDescriptor] and can construct a [Message] instance. +// Just as how Go's [reflect.Type] is a reflective description of a Go type, +// a [MessageType] is a reflective description of a Go type for a protobuf message. // -// • A MessageDescriptor describes an abstract protobuf message type. -// It has no understanding of Go types. In order to construct a MessageType -// from just a MessageDescriptor, you can consider looking up the message type -// in the global registry using protoregistry.GlobalTypes.FindMessageByName -// or constructing a dynamic MessageType using dynamicpb.NewMessageType. +// • A [MessageDescriptor] describes an abstract protobuf message type. +// It has no understanding of Go types. In order to construct a [MessageType] +// from just a [MessageDescriptor], you can consider looking up the message type +// in the global registry using the FindMessageByName method on +// [google.golang.org/protobuf/reflect/protoregistry.GlobalTypes] +// or constructing a dynamic [MessageType] using +// [google.golang.org/protobuf/types/dynamicpb.NewMessageType]. // -// • A Message is a reflective view over a concrete message instance. -// Generated messages implement ProtoMessage, which can convert to a Message. -// Just as how Go's reflect.Value is a reflective view over a Go value, -// a Message is a reflective view over a concrete protobuf message instance. -// Using Go reflection as an analogy, the ProtoReflect method is similar to -// calling reflect.ValueOf, and the Message.Interface method is similar to -// calling reflect.Value.Interface. +// • A [Message] is a reflective view over a concrete message instance. +// Generated messages implement [ProtoMessage], which can convert to a [Message]. +// Just as how Go's [reflect.Value] is a reflective view over a Go value, +// a [Message] is a reflective view over a concrete protobuf message instance. +// Using Go reflection as an analogy, the [ProtoMessage.ProtoReflect] method is similar to +// calling [reflect.ValueOf], and the [Message.Interface] method is similar to +// calling [reflect.Value.Interface]. // // ┌── TypeDescriptor() ──┐ ┌───── Descriptor() ─────┐ // │ V │ V @@ -119,15 +121,15 @@ // │ │ // └────── implements ────────┘ // -// • An ExtensionType describes a concrete Go implementation of an extension. -// It has an ExtensionTypeDescriptor and can convert to/from -// abstract Values and Go values. +// • An [ExtensionType] describes a concrete Go implementation of an extension. +// It has an [ExtensionTypeDescriptor] and can convert to/from +// an abstract [Value] and a Go value. // -// • An ExtensionTypeDescriptor is an ExtensionDescriptor -// which also has an ExtensionType. +// • An [ExtensionTypeDescriptor] is an [ExtensionDescriptor] +// which also has an [ExtensionType]. // -// • An ExtensionDescriptor describes an abstract protobuf extension field and -// may not always be an ExtensionTypeDescriptor. +// • An [ExtensionDescriptor] describes an abstract protobuf extension field and +// may not always be an [ExtensionTypeDescriptor]. package protoreflect import ( @@ -142,7 +144,7 @@ type doNotImplement pragma.DoNotImplement // ProtoMessage is the top-level interface that all proto messages implement. // This is declared in the protoreflect package to avoid a cyclic dependency; -// use the proto.Message type instead, which aliases this type. +// use the [google.golang.org/protobuf/proto.Message] type instead, which aliases this type. type ProtoMessage interface{ ProtoReflect() Message } // Syntax is the language version of the proto file. @@ -436,7 +438,7 @@ type Names interface { // FullName is a qualified name that uniquely identifies a proto declaration. // A qualified name is the concatenation of the proto package along with the // fully-declared name (i.e., name of parent preceding the name of the child), -// with a '.' delimiter placed between each Name. +// with a '.' delimiter placed between each [Name]. // // This should not have any leading or trailing dots. type FullName string // e.g., "google.protobuf.Field.Kind" @@ -480,7 +482,7 @@ func isLetterDigit(c byte) bool { } // Name returns the short name, which is the last identifier segment. -// A single segment FullName is the Name itself. +// A single segment FullName is the [Name] itself. func (n FullName) Name() Name { if i := strings.LastIndexByte(string(n), '.'); i >= 0 { return Name(n[i+1:]) diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go index 717b106f3da9..0c045db6ab6a 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go @@ -35,7 +35,7 @@ func (p *SourcePath) appendFileDescriptorProto(b []byte) []byte { b = p.appendSingularField(b, "source_code_info", (*SourcePath).appendSourceCodeInfo) case 12: b = p.appendSingularField(b, "syntax", nil) - case 13: + case 14: b = p.appendSingularField(b, "edition", nil) } return b @@ -180,6 +180,8 @@ func (p *SourcePath) appendFileOptions(b []byte) []byte { b = p.appendSingularField(b, "php_metadata_namespace", nil) case 45: b = p.appendSingularField(b, "ruby_package", nil) + case 50: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } @@ -240,6 +242,8 @@ func (p *SourcePath) appendMessageOptions(b []byte) []byte { b = p.appendSingularField(b, "map_entry", nil) case 11: b = p.appendSingularField(b, "deprecated_legacy_json_field_conflicts", nil) + case 12: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } @@ -285,6 +289,8 @@ func (p *SourcePath) appendEnumOptions(b []byte) []byte { b = p.appendSingularField(b, "deprecated", nil) case 6: b = p.appendSingularField(b, "deprecated_legacy_json_field_conflicts", nil) + case 7: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } @@ -330,6 +336,8 @@ func (p *SourcePath) appendServiceOptions(b []byte) []byte { return b } switch (*p)[0] { + case 34: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 33: b = p.appendSingularField(b, "deprecated", nil) case 999: @@ -361,16 +369,39 @@ func (p *SourcePath) appendFieldOptions(b []byte) []byte { b = p.appendSingularField(b, "debug_redact", nil) case 17: b = p.appendSingularField(b, "retention", nil) - case 18: - b = p.appendSingularField(b, "target", nil) case 19: b = p.appendRepeatedField(b, "targets", nil) + case 20: + b = p.appendRepeatedField(b, "edition_defaults", (*SourcePath).appendFieldOptions_EditionDefault) + case 21: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } return b } +func (p *SourcePath) appendFeatureSet(b []byte) []byte { + if len(*p) == 0 { + return b + } + switch (*p)[0] { + case 1: + b = p.appendSingularField(b, "field_presence", nil) + case 2: + b = p.appendSingularField(b, "enum_type", nil) + case 3: + b = p.appendSingularField(b, "repeated_field_encoding", nil) + case 4: + b = p.appendSingularField(b, "utf8_validation", nil) + case 5: + b = p.appendSingularField(b, "message_encoding", nil) + case 6: + b = p.appendSingularField(b, "json_format", nil) + } + return b +} + func (p *SourcePath) appendUninterpretedOption(b []byte) []byte { if len(*p) == 0 { return b @@ -422,6 +453,8 @@ func (p *SourcePath) appendExtensionRangeOptions(b []byte) []byte { b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) case 2: b = p.appendRepeatedField(b, "declaration", (*SourcePath).appendExtensionRangeOptions_Declaration) + case 50: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 3: b = p.appendSingularField(b, "verification", nil) } @@ -433,6 +466,8 @@ func (p *SourcePath) appendOneofOptions(b []byte) []byte { return b } switch (*p)[0] { + case 1: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } @@ -446,6 +481,10 @@ func (p *SourcePath) appendEnumValueOptions(b []byte) []byte { switch (*p)[0] { case 1: b = p.appendSingularField(b, "deprecated", nil) + case 2: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) + case 3: + b = p.appendSingularField(b, "debug_redact", nil) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } @@ -461,12 +500,27 @@ func (p *SourcePath) appendMethodOptions(b []byte) []byte { b = p.appendSingularField(b, "deprecated", nil) case 34: b = p.appendSingularField(b, "idempotency_level", nil) + case 35: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } return b } +func (p *SourcePath) appendFieldOptions_EditionDefault(b []byte) []byte { + if len(*p) == 0 { + return b + } + switch (*p)[0] { + case 3: + b = p.appendSingularField(b, "edition", nil) + case 2: + b = p.appendSingularField(b, "value", nil) + } + return b +} + func (p *SourcePath) appendUninterpretedOption_NamePart(b []byte) []byte { if len(*p) == 0 { return b @@ -491,8 +545,6 @@ func (p *SourcePath) appendExtensionRangeOptions_Declaration(b []byte) []byte { b = p.appendSingularField(b, "full_name", nil) case 3: b = p.appendSingularField(b, "type", nil) - case 4: - b = p.appendSingularField(b, "is_repeated", nil) case 5: b = p.appendSingularField(b, "reserved", nil) case 6: diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go index 3867470d30ac..60ff62b4c852 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go @@ -12,7 +12,7 @@ package protoreflect // exactly identical. However, it is possible for the same semantically // identical proto type to be represented by multiple type descriptors. // -// For example, suppose we have t1 and t2 which are both MessageDescriptors. +// For example, suppose we have t1 and t2 which are both an [MessageDescriptor]. // If t1 == t2, then the types are definitely equal and all accessors return // the same information. However, if t1 != t2, then it is still possible that // they still represent the same proto type (e.g., t1.FullName == t2.FullName). @@ -115,7 +115,7 @@ type Descriptor interface { // corresponds with the google.protobuf.FileDescriptorProto message. // // Top-level declarations: -// EnumDescriptor, MessageDescriptor, FieldDescriptor, and/or ServiceDescriptor. +// [EnumDescriptor], [MessageDescriptor], [FieldDescriptor], and/or [ServiceDescriptor]. type FileDescriptor interface { Descriptor // Descriptor.FullName is identical to Package @@ -180,8 +180,8 @@ type FileImport struct { // corresponds with the google.protobuf.DescriptorProto message. // // Nested declarations: -// FieldDescriptor, OneofDescriptor, FieldDescriptor, EnumDescriptor, -// and/or MessageDescriptor. +// [FieldDescriptor], [OneofDescriptor], [FieldDescriptor], [EnumDescriptor], +// and/or [MessageDescriptor]. type MessageDescriptor interface { Descriptor @@ -214,7 +214,7 @@ type MessageDescriptor interface { ExtensionRanges() FieldRanges // ExtensionRangeOptions returns the ith extension range options. // - // To avoid a dependency cycle, this method returns a proto.Message value, + // To avoid a dependency cycle, this method returns a proto.Message] value, // which always contains a google.protobuf.ExtensionRangeOptions message. // This method returns a typed nil-pointer if no options are present. // The caller must import the descriptorpb package to use this. @@ -231,9 +231,9 @@ type MessageDescriptor interface { } type isMessageDescriptor interface{ ProtoType(MessageDescriptor) } -// MessageType encapsulates a MessageDescriptor with a concrete Go implementation. +// MessageType encapsulates a [MessageDescriptor] with a concrete Go implementation. // It is recommended that implementations of this interface also implement the -// MessageFieldTypes interface. +// [MessageFieldTypes] interface. type MessageType interface { // New returns a newly allocated empty message. // It may return nil for synthetic messages representing a map entry. @@ -249,19 +249,19 @@ type MessageType interface { Descriptor() MessageDescriptor } -// MessageFieldTypes extends a MessageType by providing type information +// MessageFieldTypes extends a [MessageType] by providing type information // regarding enums and messages referenced by the message fields. type MessageFieldTypes interface { MessageType - // Enum returns the EnumType for the ith field in Descriptor.Fields. + // Enum returns the EnumType for the ith field in MessageDescriptor.Fields. // It returns nil if the ith field is not an enum kind. // It panics if out of bounds. // // Invariant: mt.Enum(i).Descriptor() == mt.Descriptor().Fields(i).Enum() Enum(i int) EnumType - // Message returns the MessageType for the ith field in Descriptor.Fields. + // Message returns the MessageType for the ith field in MessageDescriptor.Fields. // It returns nil if the ith field is not a message or group kind. // It panics if out of bounds. // @@ -286,8 +286,8 @@ type MessageDescriptors interface { // corresponds with the google.protobuf.FieldDescriptorProto message. // // It is used for both normal fields defined within the parent message -// (e.g., MessageDescriptor.Fields) and fields that extend some remote message -// (e.g., FileDescriptor.Extensions or MessageDescriptor.Extensions). +// (e.g., [MessageDescriptor.Fields]) and fields that extend some remote message +// (e.g., [FileDescriptor.Extensions] or [MessageDescriptor.Extensions]). type FieldDescriptor interface { Descriptor @@ -344,7 +344,7 @@ type FieldDescriptor interface { // IsMap reports whether this field represents a map, // where the value type for the associated field is a Map. // It is equivalent to checking whether Cardinality is Repeated, - // that the Kind is MessageKind, and that Message.IsMapEntry reports true. + // that the Kind is MessageKind, and that MessageDescriptor.IsMapEntry reports true. IsMap() bool // MapKey returns the field descriptor for the key in the map entry. @@ -419,7 +419,7 @@ type OneofDescriptor interface { // IsSynthetic reports whether this is a synthetic oneof created to support // proto3 optional semantics. If true, Fields contains exactly one field - // with HasOptionalKeyword specified. + // with FieldDescriptor.HasOptionalKeyword specified. IsSynthetic() bool // Fields is a list of fields belonging to this oneof. @@ -442,10 +442,10 @@ type OneofDescriptors interface { doNotImplement } -// ExtensionDescriptor is an alias of FieldDescriptor for documentation. +// ExtensionDescriptor is an alias of [FieldDescriptor] for documentation. type ExtensionDescriptor = FieldDescriptor -// ExtensionTypeDescriptor is an ExtensionDescriptor with an associated ExtensionType. +// ExtensionTypeDescriptor is an [ExtensionDescriptor] with an associated [ExtensionType]. type ExtensionTypeDescriptor interface { ExtensionDescriptor @@ -470,12 +470,12 @@ type ExtensionDescriptors interface { doNotImplement } -// ExtensionType encapsulates an ExtensionDescriptor with a concrete +// ExtensionType encapsulates an [ExtensionDescriptor] with a concrete // Go implementation. The nested field descriptor must be for a extension field. // // While a normal field is a member of the parent message that it is declared -// within (see Descriptor.Parent), an extension field is a member of some other -// target message (see ExtensionDescriptor.Extendee) and may have no +// within (see [Descriptor.Parent]), an extension field is a member of some other +// target message (see [FieldDescriptor.ContainingMessage]) and may have no // relationship with the parent. However, the full name of an extension field is // relative to the parent that it is declared within. // @@ -532,7 +532,7 @@ type ExtensionType interface { // corresponds with the google.protobuf.EnumDescriptorProto message. // // Nested declarations: -// EnumValueDescriptor. +// [EnumValueDescriptor]. type EnumDescriptor interface { Descriptor @@ -548,7 +548,7 @@ type EnumDescriptor interface { } type isEnumDescriptor interface{ ProtoType(EnumDescriptor) } -// EnumType encapsulates an EnumDescriptor with a concrete Go implementation. +// EnumType encapsulates an [EnumDescriptor] with a concrete Go implementation. type EnumType interface { // New returns an instance of this enum type with its value set to n. New(n EnumNumber) Enum @@ -610,7 +610,7 @@ type EnumValueDescriptors interface { // ServiceDescriptor describes a service and // corresponds with the google.protobuf.ServiceDescriptorProto message. // -// Nested declarations: MethodDescriptor. +// Nested declarations: [MethodDescriptor]. type ServiceDescriptor interface { Descriptor diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go index 37601b781997..a7b0d06ff328 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go @@ -27,16 +27,16 @@ type Enum interface { // Message is a reflective interface for a concrete message value, // encapsulating both type and value information for the message. // -// Accessor/mutators for individual fields are keyed by FieldDescriptor. +// Accessor/mutators for individual fields are keyed by [FieldDescriptor]. // For non-extension fields, the descriptor must exactly match the // field known by the parent message. -// For extension fields, the descriptor must implement ExtensionTypeDescriptor, -// extend the parent message (i.e., have the same message FullName), and +// For extension fields, the descriptor must implement [ExtensionTypeDescriptor], +// extend the parent message (i.e., have the same message [FullName]), and // be within the parent's extension range. // -// Each field Value can be a scalar or a composite type (Message, List, or Map). -// See Value for the Go types associated with a FieldDescriptor. -// Providing a Value that is invalid or of an incorrect type panics. +// Each field [Value] can be a scalar or a composite type ([Message], [List], or [Map]). +// See [Value] for the Go types associated with a [FieldDescriptor]. +// Providing a [Value] that is invalid or of an incorrect type panics. type Message interface { // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. @@ -152,7 +152,7 @@ type Message interface { // This method may return nil. // // The returned methods type is identical to - // "google.golang.org/protobuf/runtime/protoiface".Methods. + // google.golang.org/protobuf/runtime/protoiface.Methods. // Consult the protoiface package documentation for details. ProtoMethods() *methods } @@ -175,8 +175,8 @@ func (b RawFields) IsValid() bool { } // List is a zero-indexed, ordered list. -// The element Value type is determined by FieldDescriptor.Kind. -// Providing a Value that is invalid or of an incorrect type panics. +// The element [Value] type is determined by [FieldDescriptor.Kind]. +// Providing a [Value] that is invalid or of an incorrect type panics. type List interface { // Len reports the number of entries in the List. // Get, Set, and Truncate panic with out of bound indexes. @@ -226,9 +226,9 @@ type List interface { } // Map is an unordered, associative map. -// The entry MapKey type is determined by FieldDescriptor.MapKey.Kind. -// The entry Value type is determined by FieldDescriptor.MapValue.Kind. -// Providing a MapKey or Value that is invalid or of an incorrect type panics. +// The entry [MapKey] type is determined by [FieldDescriptor.MapKey].Kind. +// The entry [Value] type is determined by [FieldDescriptor.MapValue].Kind. +// Providing a [MapKey] or [Value] that is invalid or of an incorrect type panics. type Map interface { // Len reports the number of elements in the map. Len() int diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go index 591652541f28..654599d4493e 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go @@ -24,19 +24,19 @@ import ( // Unlike the == operator, a NaN is equal to another NaN. // // - Enums are equal if they contain the same number. -// Since Value does not contain an enum descriptor, +// Since [Value] does not contain an enum descriptor, // enum values do not consider the type of the enum. // // - Other scalar values are equal if they contain the same value. // -// - Message values are equal if they belong to the same message descriptor, +// - [Message] values are equal if they belong to the same message descriptor, // have the same set of populated known and extension field values, // and the same set of unknown fields values. // -// - Lists are equal if they are the same length and +// - [List] values are equal if they are the same length and // each corresponding element is equal. // -// - Maps are equal if they have the same set of keys and +// - [Map] values are equal if they have the same set of keys and // the corresponding value for each key is equal. func (v1 Value) Equal(v2 Value) bool { return equalValue(v1, v2) diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go index 08e5ef73fc0e..1603097311e9 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go @@ -11,7 +11,7 @@ import ( // Value is a union where only one Go type may be set at a time. // The Value is used to represent all possible values a field may take. -// The following shows which Go type is used to represent each proto Kind: +// The following shows which Go type is used to represent each proto [Kind]: // // ╔════════════╤═════════════════════════════════════╗ // ║ Go type │ Protobuf kind ║ @@ -31,22 +31,22 @@ import ( // // Multiple protobuf Kinds may be represented by a single Go type if the type // can losslessly represent the information for the proto kind. For example, -// Int64Kind, Sint64Kind, and Sfixed64Kind are all represented by int64, +// [Int64Kind], [Sint64Kind], and [Sfixed64Kind] are all represented by int64, // but use different integer encoding methods. // -// The List or Map types are used if the field cardinality is repeated. -// A field is a List if FieldDescriptor.IsList reports true. -// A field is a Map if FieldDescriptor.IsMap reports true. +// The [List] or [Map] types are used if the field cardinality is repeated. +// A field is a [List] if [FieldDescriptor.IsList] reports true. +// A field is a [Map] if [FieldDescriptor.IsMap] reports true. // // Converting to/from a Value and a concrete Go value panics on type mismatch. -// For example, ValueOf("hello").Int() panics because this attempts to +// For example, [ValueOf]("hello").Int() panics because this attempts to // retrieve an int64 from a string. // -// List, Map, and Message Values are called "composite" values. +// [List], [Map], and [Message] Values are called "composite" values. // // A composite Value may alias (reference) memory at some location, // such that changes to the Value updates the that location. -// A composite value acquired with a Mutable method, such as Message.Mutable, +// A composite value acquired with a Mutable method, such as [Message.Mutable], // always references the source object. // // For example: @@ -65,7 +65,7 @@ import ( // // appending to the List here may or may not modify the message. // list.Append(protoreflect.ValueOfInt32(0)) // -// Some operations, such as Message.Get, may return an "empty, read-only" +// Some operations, such as [Message.Get], may return an "empty, read-only" // composite Value. Modifying an empty, read-only value panics. type Value value @@ -306,7 +306,7 @@ func (v Value) Float() float64 { } } -// String returns v as a string. Since this method implements fmt.Stringer, +// String returns v as a string. Since this method implements [fmt.Stringer], // this returns the formatted string value for any non-string type. func (v Value) String() string { switch v.typ { @@ -327,7 +327,7 @@ func (v Value) Bytes() []byte { } } -// Enum returns v as a EnumNumber and panics if the type is not a EnumNumber. +// Enum returns v as a [EnumNumber] and panics if the type is not a [EnumNumber]. func (v Value) Enum() EnumNumber { switch v.typ { case enumType: @@ -337,7 +337,7 @@ func (v Value) Enum() EnumNumber { } } -// Message returns v as a Message and panics if the type is not a Message. +// Message returns v as a [Message] and panics if the type is not a [Message]. func (v Value) Message() Message { switch vi := v.getIface().(type) { case Message: @@ -347,7 +347,7 @@ func (v Value) Message() Message { } } -// List returns v as a List and panics if the type is not a List. +// List returns v as a [List] and panics if the type is not a [List]. func (v Value) List() List { switch vi := v.getIface().(type) { case List: @@ -357,7 +357,7 @@ func (v Value) List() List { } } -// Map returns v as a Map and panics if the type is not a Map. +// Map returns v as a [Map] and panics if the type is not a [Map]. func (v Value) Map() Map { switch vi := v.getIface().(type) { case Map: @@ -367,7 +367,7 @@ func (v Value) Map() Map { } } -// MapKey returns v as a MapKey and panics for invalid MapKey types. +// MapKey returns v as a [MapKey] and panics for invalid [MapKey] types. func (v Value) MapKey() MapKey { switch v.typ { case boolType, int32Type, int64Type, uint32Type, uint64Type, stringType: @@ -378,8 +378,8 @@ func (v Value) MapKey() MapKey { } // MapKey is used to index maps, where the Go type of the MapKey must match -// the specified key Kind (see MessageDescriptor.IsMapEntry). -// The following shows what Go type is used to represent each proto Kind: +// the specified key [Kind] (see [MessageDescriptor.IsMapEntry]). +// The following shows what Go type is used to represent each proto [Kind]: // // ╔═════════╤═════════════════════════════════════╗ // ║ Go type │ Protobuf kind ║ @@ -392,13 +392,13 @@ func (v Value) MapKey() MapKey { // ║ string │ StringKind ║ // ╚═════════╧═════════════════════════════════════╝ // -// A MapKey is constructed and accessed through a Value: +// A MapKey is constructed and accessed through a [Value]: // // k := ValueOf("hash").MapKey() // convert string to MapKey // s := k.String() // convert MapKey to string // -// The MapKey is a strict subset of valid types used in Value; -// converting a Value to a MapKey with an invalid type panics. +// The MapKey is a strict subset of valid types used in [Value]; +// converting a [Value] to a MapKey with an invalid type panics. type MapKey value // IsValid reports whether k is populated with a value. @@ -426,13 +426,13 @@ func (k MapKey) Uint() uint64 { return Value(k).Uint() } -// String returns k as a string. Since this method implements fmt.Stringer, +// String returns k as a string. Since this method implements [fmt.Stringer], // this returns the formatted string value for any non-string type. func (k MapKey) String() string { return Value(k).String() } -// Value returns k as a Value. +// Value returns k as a [Value]. func (k MapKey) Value() Value { return Value(k) } diff --git a/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go b/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go index aeb559774469..6267dc52a67a 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go +++ b/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go @@ -5,12 +5,12 @@ // Package protoregistry provides data structures to register and lookup // protobuf descriptor types. // -// The Files registry contains file descriptors and provides the ability +// The [Files] registry contains file descriptors and provides the ability // to iterate over the files or lookup a specific descriptor within the files. -// Files only contains protobuf descriptors and has no understanding of Go +// [Files] only contains protobuf descriptors and has no understanding of Go // type information that may be associated with each descriptor. // -// The Types registry contains descriptor types for which there is a known +// The [Types] registry contains descriptor types for which there is a known // Go type associated with that descriptor. It provides the ability to iterate // over the registered types or lookup a type by name. package protoregistry @@ -218,7 +218,7 @@ func (r *Files) checkGenProtoConflict(path string) { // FindDescriptorByName looks up a descriptor by the full name. // -// This returns (nil, NotFound) if not found. +// This returns (nil, [NotFound]) if not found. func (r *Files) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) { if r == nil { return nil, NotFound @@ -310,7 +310,7 @@ func (s *nameSuffix) Pop() (name protoreflect.Name) { // FindFileByPath looks up a file by the path. // -// This returns (nil, NotFound) if not found. +// This returns (nil, [NotFound]) if not found. // This returns an error if multiple files have the same path. func (r *Files) FindFileByPath(path string) (protoreflect.FileDescriptor, error) { if r == nil { @@ -431,7 +431,7 @@ func rangeTopLevelDescriptors(fd protoreflect.FileDescriptor, f func(protoreflec // A compliant implementation must deterministically return the same type // if no error is encountered. // -// The Types type implements this interface. +// The [Types] type implements this interface. type MessageTypeResolver interface { // FindMessageByName looks up a message by its full name. // E.g., "google.protobuf.Any" @@ -451,7 +451,7 @@ type MessageTypeResolver interface { // A compliant implementation must deterministically return the same type // if no error is encountered. // -// The Types type implements this interface. +// The [Types] type implements this interface. type ExtensionTypeResolver interface { // FindExtensionByName looks up a extension field by the field's full name. // Note that this is the full name of the field as determined by @@ -590,7 +590,7 @@ func (r *Types) register(kind string, desc protoreflect.Descriptor, typ interfac // FindEnumByName looks up an enum by its full name. // E.g., "google.protobuf.Field.Kind". // -// This returns (nil, NotFound) if not found. +// This returns (nil, [NotFound]) if not found. func (r *Types) FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumType, error) { if r == nil { return nil, NotFound @@ -611,7 +611,7 @@ func (r *Types) FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumTyp // FindMessageByName looks up a message by its full name, // e.g. "google.protobuf.Any". // -// This returns (nil, NotFound) if not found. +// This returns (nil, [NotFound]) if not found. func (r *Types) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) { if r == nil { return nil, NotFound @@ -632,7 +632,7 @@ func (r *Types) FindMessageByName(message protoreflect.FullName) (protoreflect.M // FindMessageByURL looks up a message by a URL identifier. // See documentation on google.protobuf.Any.type_url for the URL format. // -// This returns (nil, NotFound) if not found. +// This returns (nil, [NotFound]) if not found. func (r *Types) FindMessageByURL(url string) (protoreflect.MessageType, error) { // This function is similar to FindMessageByName but // truncates anything before and including '/' in the URL. @@ -662,7 +662,7 @@ func (r *Types) FindMessageByURL(url string) (protoreflect.MessageType, error) { // where the extension is declared and is unrelated to the full name of the // message being extended. // -// This returns (nil, NotFound) if not found. +// This returns (nil, [NotFound]) if not found. func (r *Types) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { if r == nil { return nil, NotFound @@ -703,7 +703,7 @@ func (r *Types) FindExtensionByName(field protoreflect.FullName) (protoreflect.E // FindExtensionByNumber looks up a extension field by the field number // within some parent message, identified by full name. // -// This returns (nil, NotFound) if not found. +// This returns (nil, [NotFound]) if not found. func (r *Types) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { if r == nil { return nil, NotFound diff --git a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go index 04c00f737c1e..38daa858d07e 100644 --- a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go +++ b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go @@ -48,6 +48,94 @@ import ( sync "sync" ) +// The full set of known editions. +type Edition int32 + +const ( + // A placeholder for an unknown edition value. + Edition_EDITION_UNKNOWN Edition = 0 + // Legacy syntax "editions". These pre-date editions, but behave much like + // distinct editions. These can't be used to specify the edition of proto + // files, but feature definitions must supply proto2/proto3 defaults for + // backwards compatibility. + Edition_EDITION_PROTO2 Edition = 998 + Edition_EDITION_PROTO3 Edition = 999 + // Editions that have been released. The specific values are arbitrary and + // should not be depended on, but they will always be time-ordered for easy + // comparison. + Edition_EDITION_2023 Edition = 1000 + // Placeholder editions for testing feature resolution. These should not be + // used or relyed on outside of tests. + Edition_EDITION_1_TEST_ONLY Edition = 1 + Edition_EDITION_2_TEST_ONLY Edition = 2 + Edition_EDITION_99997_TEST_ONLY Edition = 99997 + Edition_EDITION_99998_TEST_ONLY Edition = 99998 + Edition_EDITION_99999_TEST_ONLY Edition = 99999 +) + +// Enum value maps for Edition. +var ( + Edition_name = map[int32]string{ + 0: "EDITION_UNKNOWN", + 998: "EDITION_PROTO2", + 999: "EDITION_PROTO3", + 1000: "EDITION_2023", + 1: "EDITION_1_TEST_ONLY", + 2: "EDITION_2_TEST_ONLY", + 99997: "EDITION_99997_TEST_ONLY", + 99998: "EDITION_99998_TEST_ONLY", + 99999: "EDITION_99999_TEST_ONLY", + } + Edition_value = map[string]int32{ + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + } +) + +func (x Edition) Enum() *Edition { + p := new(Edition) + *p = x + return p +} + +func (x Edition) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Edition) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[0].Descriptor() +} + +func (Edition) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[0] +} + +func (x Edition) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *Edition) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = Edition(num) + return nil +} + +// Deprecated: Use Edition.Descriptor instead. +func (Edition) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{0} +} + // The verification state of the extension range. type ExtensionRangeOptions_VerificationState int32 @@ -80,11 +168,11 @@ func (x ExtensionRangeOptions_VerificationState) String() string { } func (ExtensionRangeOptions_VerificationState) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[0].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[1].Descriptor() } func (ExtensionRangeOptions_VerificationState) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[0] + return &file_google_protobuf_descriptor_proto_enumTypes[1] } func (x ExtensionRangeOptions_VerificationState) Number() protoreflect.EnumNumber { @@ -125,9 +213,10 @@ const ( FieldDescriptorProto_TYPE_BOOL FieldDescriptorProto_Type = 8 FieldDescriptorProto_TYPE_STRING FieldDescriptorProto_Type = 9 // Tag-delimited aggregate. - // Group type is deprecated and not supported in proto3. However, Proto3 + // Group type is deprecated and not supported after google.protobuf. However, Proto3 // implementations should still be able to parse the group wire format and - // treat group fields as unknown fields. + // treat group fields as unknown fields. In Editions, the group wire format + // can be enabled via the `message_encoding` feature. FieldDescriptorProto_TYPE_GROUP FieldDescriptorProto_Type = 10 FieldDescriptorProto_TYPE_MESSAGE FieldDescriptorProto_Type = 11 // Length-delimited aggregate. // New in version 2. @@ -195,11 +284,11 @@ func (x FieldDescriptorProto_Type) String() string { } func (FieldDescriptorProto_Type) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[1].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[2].Descriptor() } func (FieldDescriptorProto_Type) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[1] + return &file_google_protobuf_descriptor_proto_enumTypes[2] } func (x FieldDescriptorProto_Type) Number() protoreflect.EnumNumber { @@ -226,21 +315,24 @@ type FieldDescriptorProto_Label int32 const ( // 0 is reserved for errors FieldDescriptorProto_LABEL_OPTIONAL FieldDescriptorProto_Label = 1 - FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2 FieldDescriptorProto_LABEL_REPEATED FieldDescriptorProto_Label = 3 + // The required label is only allowed in google.protobuf. In proto3 and Editions + // it's explicitly prohibited. In Editions, the `field_presence` feature + // can be used to get this behavior. + FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2 ) // Enum value maps for FieldDescriptorProto_Label. var ( FieldDescriptorProto_Label_name = map[int32]string{ 1: "LABEL_OPTIONAL", - 2: "LABEL_REQUIRED", 3: "LABEL_REPEATED", + 2: "LABEL_REQUIRED", } FieldDescriptorProto_Label_value = map[string]int32{ "LABEL_OPTIONAL": 1, - "LABEL_REQUIRED": 2, "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2, } ) @@ -255,11 +347,11 @@ func (x FieldDescriptorProto_Label) String() string { } func (FieldDescriptorProto_Label) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[2].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[3].Descriptor() } func (FieldDescriptorProto_Label) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[2] + return &file_google_protobuf_descriptor_proto_enumTypes[3] } func (x FieldDescriptorProto_Label) Number() protoreflect.EnumNumber { @@ -316,11 +408,11 @@ func (x FileOptions_OptimizeMode) String() string { } func (FileOptions_OptimizeMode) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[3].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[4].Descriptor() } func (FileOptions_OptimizeMode) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[3] + return &file_google_protobuf_descriptor_proto_enumTypes[4] } func (x FileOptions_OptimizeMode) Number() protoreflect.EnumNumber { @@ -382,11 +474,11 @@ func (x FieldOptions_CType) String() string { } func (FieldOptions_CType) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[4].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[5].Descriptor() } func (FieldOptions_CType) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[4] + return &file_google_protobuf_descriptor_proto_enumTypes[5] } func (x FieldOptions_CType) Number() protoreflect.EnumNumber { @@ -444,11 +536,11 @@ func (x FieldOptions_JSType) String() string { } func (FieldOptions_JSType) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[5].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[6].Descriptor() } func (FieldOptions_JSType) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[5] + return &file_google_protobuf_descriptor_proto_enumTypes[6] } func (x FieldOptions_JSType) Number() protoreflect.EnumNumber { @@ -506,11 +598,11 @@ func (x FieldOptions_OptionRetention) String() string { } func (FieldOptions_OptionRetention) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[6].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[7].Descriptor() } func (FieldOptions_OptionRetention) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[6] + return &file_google_protobuf_descriptor_proto_enumTypes[7] } func (x FieldOptions_OptionRetention) Number() protoreflect.EnumNumber { @@ -590,11 +682,11 @@ func (x FieldOptions_OptionTargetType) String() string { } func (FieldOptions_OptionTargetType) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[7].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[8].Descriptor() } func (FieldOptions_OptionTargetType) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[7] + return &file_google_protobuf_descriptor_proto_enumTypes[8] } func (x FieldOptions_OptionTargetType) Number() protoreflect.EnumNumber { @@ -652,11 +744,11 @@ func (x MethodOptions_IdempotencyLevel) String() string { } func (MethodOptions_IdempotencyLevel) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[8].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[9].Descriptor() } func (MethodOptions_IdempotencyLevel) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[8] + return &file_google_protobuf_descriptor_proto_enumTypes[9] } func (x MethodOptions_IdempotencyLevel) Number() protoreflect.EnumNumber { @@ -678,6 +770,363 @@ func (MethodOptions_IdempotencyLevel) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{17, 0} } +type FeatureSet_FieldPresence int32 + +const ( + FeatureSet_FIELD_PRESENCE_UNKNOWN FeatureSet_FieldPresence = 0 + FeatureSet_EXPLICIT FeatureSet_FieldPresence = 1 + FeatureSet_IMPLICIT FeatureSet_FieldPresence = 2 + FeatureSet_LEGACY_REQUIRED FeatureSet_FieldPresence = 3 +) + +// Enum value maps for FeatureSet_FieldPresence. +var ( + FeatureSet_FieldPresence_name = map[int32]string{ + 0: "FIELD_PRESENCE_UNKNOWN", + 1: "EXPLICIT", + 2: "IMPLICIT", + 3: "LEGACY_REQUIRED", + } + FeatureSet_FieldPresence_value = map[string]int32{ + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3, + } +) + +func (x FeatureSet_FieldPresence) Enum() *FeatureSet_FieldPresence { + p := new(FeatureSet_FieldPresence) + *p = x + return p +} + +func (x FeatureSet_FieldPresence) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FeatureSet_FieldPresence) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[10].Descriptor() +} + +func (FeatureSet_FieldPresence) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[10] +} + +func (x FeatureSet_FieldPresence) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *FeatureSet_FieldPresence) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = FeatureSet_FieldPresence(num) + return nil +} + +// Deprecated: Use FeatureSet_FieldPresence.Descriptor instead. +func (FeatureSet_FieldPresence) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 0} +} + +type FeatureSet_EnumType int32 + +const ( + FeatureSet_ENUM_TYPE_UNKNOWN FeatureSet_EnumType = 0 + FeatureSet_OPEN FeatureSet_EnumType = 1 + FeatureSet_CLOSED FeatureSet_EnumType = 2 +) + +// Enum value maps for FeatureSet_EnumType. +var ( + FeatureSet_EnumType_name = map[int32]string{ + 0: "ENUM_TYPE_UNKNOWN", + 1: "OPEN", + 2: "CLOSED", + } + FeatureSet_EnumType_value = map[string]int32{ + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2, + } +) + +func (x FeatureSet_EnumType) Enum() *FeatureSet_EnumType { + p := new(FeatureSet_EnumType) + *p = x + return p +} + +func (x FeatureSet_EnumType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FeatureSet_EnumType) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[11].Descriptor() +} + +func (FeatureSet_EnumType) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[11] +} + +func (x FeatureSet_EnumType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *FeatureSet_EnumType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = FeatureSet_EnumType(num) + return nil +} + +// Deprecated: Use FeatureSet_EnumType.Descriptor instead. +func (FeatureSet_EnumType) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 1} +} + +type FeatureSet_RepeatedFieldEncoding int32 + +const ( + FeatureSet_REPEATED_FIELD_ENCODING_UNKNOWN FeatureSet_RepeatedFieldEncoding = 0 + FeatureSet_PACKED FeatureSet_RepeatedFieldEncoding = 1 + FeatureSet_EXPANDED FeatureSet_RepeatedFieldEncoding = 2 +) + +// Enum value maps for FeatureSet_RepeatedFieldEncoding. +var ( + FeatureSet_RepeatedFieldEncoding_name = map[int32]string{ + 0: "REPEATED_FIELD_ENCODING_UNKNOWN", + 1: "PACKED", + 2: "EXPANDED", + } + FeatureSet_RepeatedFieldEncoding_value = map[string]int32{ + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2, + } +) + +func (x FeatureSet_RepeatedFieldEncoding) Enum() *FeatureSet_RepeatedFieldEncoding { + p := new(FeatureSet_RepeatedFieldEncoding) + *p = x + return p +} + +func (x FeatureSet_RepeatedFieldEncoding) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FeatureSet_RepeatedFieldEncoding) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[12].Descriptor() +} + +func (FeatureSet_RepeatedFieldEncoding) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[12] +} + +func (x FeatureSet_RepeatedFieldEncoding) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *FeatureSet_RepeatedFieldEncoding) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = FeatureSet_RepeatedFieldEncoding(num) + return nil +} + +// Deprecated: Use FeatureSet_RepeatedFieldEncoding.Descriptor instead. +func (FeatureSet_RepeatedFieldEncoding) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 2} +} + +type FeatureSet_Utf8Validation int32 + +const ( + FeatureSet_UTF8_VALIDATION_UNKNOWN FeatureSet_Utf8Validation = 0 + FeatureSet_NONE FeatureSet_Utf8Validation = 1 + FeatureSet_VERIFY FeatureSet_Utf8Validation = 2 +) + +// Enum value maps for FeatureSet_Utf8Validation. +var ( + FeatureSet_Utf8Validation_name = map[int32]string{ + 0: "UTF8_VALIDATION_UNKNOWN", + 1: "NONE", + 2: "VERIFY", + } + FeatureSet_Utf8Validation_value = map[string]int32{ + "UTF8_VALIDATION_UNKNOWN": 0, + "NONE": 1, + "VERIFY": 2, + } +) + +func (x FeatureSet_Utf8Validation) Enum() *FeatureSet_Utf8Validation { + p := new(FeatureSet_Utf8Validation) + *p = x + return p +} + +func (x FeatureSet_Utf8Validation) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FeatureSet_Utf8Validation) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[13].Descriptor() +} + +func (FeatureSet_Utf8Validation) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[13] +} + +func (x FeatureSet_Utf8Validation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *FeatureSet_Utf8Validation) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = FeatureSet_Utf8Validation(num) + return nil +} + +// Deprecated: Use FeatureSet_Utf8Validation.Descriptor instead. +func (FeatureSet_Utf8Validation) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 3} +} + +type FeatureSet_MessageEncoding int32 + +const ( + FeatureSet_MESSAGE_ENCODING_UNKNOWN FeatureSet_MessageEncoding = 0 + FeatureSet_LENGTH_PREFIXED FeatureSet_MessageEncoding = 1 + FeatureSet_DELIMITED FeatureSet_MessageEncoding = 2 +) + +// Enum value maps for FeatureSet_MessageEncoding. +var ( + FeatureSet_MessageEncoding_name = map[int32]string{ + 0: "MESSAGE_ENCODING_UNKNOWN", + 1: "LENGTH_PREFIXED", + 2: "DELIMITED", + } + FeatureSet_MessageEncoding_value = map[string]int32{ + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2, + } +) + +func (x FeatureSet_MessageEncoding) Enum() *FeatureSet_MessageEncoding { + p := new(FeatureSet_MessageEncoding) + *p = x + return p +} + +func (x FeatureSet_MessageEncoding) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FeatureSet_MessageEncoding) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[14].Descriptor() +} + +func (FeatureSet_MessageEncoding) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[14] +} + +func (x FeatureSet_MessageEncoding) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *FeatureSet_MessageEncoding) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = FeatureSet_MessageEncoding(num) + return nil +} + +// Deprecated: Use FeatureSet_MessageEncoding.Descriptor instead. +func (FeatureSet_MessageEncoding) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 4} +} + +type FeatureSet_JsonFormat int32 + +const ( + FeatureSet_JSON_FORMAT_UNKNOWN FeatureSet_JsonFormat = 0 + FeatureSet_ALLOW FeatureSet_JsonFormat = 1 + FeatureSet_LEGACY_BEST_EFFORT FeatureSet_JsonFormat = 2 +) + +// Enum value maps for FeatureSet_JsonFormat. +var ( + FeatureSet_JsonFormat_name = map[int32]string{ + 0: "JSON_FORMAT_UNKNOWN", + 1: "ALLOW", + 2: "LEGACY_BEST_EFFORT", + } + FeatureSet_JsonFormat_value = map[string]int32{ + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2, + } +) + +func (x FeatureSet_JsonFormat) Enum() *FeatureSet_JsonFormat { + p := new(FeatureSet_JsonFormat) + *p = x + return p +} + +func (x FeatureSet_JsonFormat) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FeatureSet_JsonFormat) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[15].Descriptor() +} + +func (FeatureSet_JsonFormat) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[15] +} + +func (x FeatureSet_JsonFormat) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *FeatureSet_JsonFormat) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = FeatureSet_JsonFormat(num) + return nil +} + +// Deprecated: Use FeatureSet_JsonFormat.Descriptor instead. +func (FeatureSet_JsonFormat) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 5} +} + // Represents the identified object's effect on the element in the original // .proto file. type GeneratedCodeInfo_Annotation_Semantic int32 @@ -716,11 +1165,11 @@ func (x GeneratedCodeInfo_Annotation_Semantic) String() string { } func (GeneratedCodeInfo_Annotation_Semantic) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[9].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[16].Descriptor() } func (GeneratedCodeInfo_Annotation_Semantic) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[9] + return &file_google_protobuf_descriptor_proto_enumTypes[16] } func (x GeneratedCodeInfo_Annotation_Semantic) Number() protoreflect.EnumNumber { @@ -739,7 +1188,7 @@ func (x *GeneratedCodeInfo_Annotation_Semantic) UnmarshalJSON(b []byte) error { // Deprecated: Use GeneratedCodeInfo_Annotation_Semantic.Descriptor instead. func (GeneratedCodeInfo_Annotation_Semantic) EnumDescriptor() ([]byte, []int) { - return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{20, 0, 0} + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{22, 0, 0} } // The protocol compiler can output a FileDescriptorSet containing the .proto @@ -822,8 +1271,8 @@ type FileDescriptorProto struct { // // If `edition` is present, this value must be "editions". Syntax *string `protobuf:"bytes,12,opt,name=syntax" json:"syntax,omitempty"` - // The edition of the proto file, which is an opaque string. - Edition *string `protobuf:"bytes,13,opt,name=edition" json:"edition,omitempty"` + // The edition of the proto file. + Edition *Edition `protobuf:"varint,14,opt,name=edition,enum=google.protobuf.Edition" json:"edition,omitempty"` } func (x *FileDescriptorProto) Reset() { @@ -942,11 +1391,11 @@ func (x *FileDescriptorProto) GetSyntax() string { return "" } -func (x *FileDescriptorProto) GetEdition() string { +func (x *FileDescriptorProto) GetEdition() Edition { if x != nil && x.Edition != nil { return *x.Edition } - return "" + return Edition_EDITION_UNKNOWN } // Describes a message type. @@ -1079,13 +1528,14 @@ type ExtensionRangeOptions struct { // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - // go/protobuf-stripping-extension-declarations - // Like Metadata, but we use a repeated field to hold all extension - // declarations. This should avoid the size increases of transforming a large - // extension range into small ranges in generated binaries. + // For external users: DO NOT USE. We are in the process of open sourcing + // extension declaration and executing internal cleanups before it can be + // used externally. Declaration []*ExtensionRangeOptions_Declaration `protobuf:"bytes,2,rep,name=declaration" json:"declaration,omitempty"` + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,50,opt,name=features" json:"features,omitempty"` // The verification state of the range. - // TODO(b/278783756): flip the default to DECLARATION once all empty ranges + // TODO: flip the default to DECLARATION once all empty ranges // are marked as UNVERIFIED. Verification *ExtensionRangeOptions_VerificationState `protobuf:"varint,3,opt,name=verification,enum=google.protobuf.ExtensionRangeOptions_VerificationState,def=1" json:"verification,omitempty"` } @@ -1141,6 +1591,13 @@ func (x *ExtensionRangeOptions) GetDeclaration() []*ExtensionRangeOptions_Declar return nil } +func (x *ExtensionRangeOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *ExtensionRangeOptions) GetVerification() ExtensionRangeOptions_VerificationState { if x != nil && x.Verification != nil { return *x.Verification @@ -1772,6 +2229,8 @@ type FileOptions struct { // is empty. When this option is not set, the package name will be used for // determining the ruby package. RubyPackage *string `protobuf:"bytes,45,opt,name=ruby_package,json=rubyPackage" json:"ruby_package,omitempty"` + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,50,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. // See the documentation for the "Options" section above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` @@ -1963,6 +2422,13 @@ func (x *FileOptions) GetRubyPackage() string { return "" } +func (x *FileOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *FileOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -2039,11 +2505,13 @@ type MessageOptions struct { // This should only be used as a temporary measure against broken builds due // to the change in behavior for JSON field name conflicts. // - // TODO(b/261750190) This is legacy behavior we plan to remove once downstream + // TODO This is legacy behavior we plan to remove once downstream // teams have had time to migrate. // // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. DeprecatedLegacyJsonFieldConflicts *bool `protobuf:"varint,11,opt,name=deprecated_legacy_json_field_conflicts,json=deprecatedLegacyJsonFieldConflicts" json:"deprecated_legacy_json_field_conflicts,omitempty"` + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,12,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } @@ -2123,6 +2591,13 @@ func (x *MessageOptions) GetDeprecatedLegacyJsonFieldConflicts() bool { return false } +func (x *MessageOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *MessageOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -2147,7 +2622,9 @@ type FieldOptions struct { // a more efficient representation on the wire. Rather than repeatedly // writing the tag and type for each element, the entire array is encoded as // a single length-delimited blob. In proto3, only explicit setting it to - // false will avoid using packed encoding. + // false will avoid using packed encoding. This option is prohibited in + // Editions, but the `repeated_field_encoding` feature can be used to control + // the behavior. Packed *bool `protobuf:"varint,2,opt,name=packed" json:"packed,omitempty"` // The jstype option determines the JavaScript type used for values of the // field. The option is permitted only for 64 bit integral and fixed types @@ -2205,11 +2682,12 @@ type FieldOptions struct { Weak *bool `protobuf:"varint,10,opt,name=weak,def=0" json:"weak,omitempty"` // Indicate that the field value should not be printed out when using debug // formats, e.g. when the field contains sensitive credentials. - DebugRedact *bool `protobuf:"varint,16,opt,name=debug_redact,json=debugRedact,def=0" json:"debug_redact,omitempty"` - Retention *FieldOptions_OptionRetention `protobuf:"varint,17,opt,name=retention,enum=google.protobuf.FieldOptions_OptionRetention" json:"retention,omitempty"` - // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. - Target *FieldOptions_OptionTargetType `protobuf:"varint,18,opt,name=target,enum=google.protobuf.FieldOptions_OptionTargetType" json:"target,omitempty"` - Targets []FieldOptions_OptionTargetType `protobuf:"varint,19,rep,name=targets,enum=google.protobuf.FieldOptions_OptionTargetType" json:"targets,omitempty"` + DebugRedact *bool `protobuf:"varint,16,opt,name=debug_redact,json=debugRedact,def=0" json:"debug_redact,omitempty"` + Retention *FieldOptions_OptionRetention `protobuf:"varint,17,opt,name=retention,enum=google.protobuf.FieldOptions_OptionRetention" json:"retention,omitempty"` + Targets []FieldOptions_OptionTargetType `protobuf:"varint,19,rep,name=targets,enum=google.protobuf.FieldOptions_OptionTargetType" json:"targets,omitempty"` + EditionDefaults []*FieldOptions_EditionDefault `protobuf:"bytes,20,rep,name=edition_defaults,json=editionDefaults" json:"edition_defaults,omitempty"` + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,21,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } @@ -2320,17 +2798,23 @@ func (x *FieldOptions) GetRetention() FieldOptions_OptionRetention { return FieldOptions_RETENTION_UNKNOWN } -// Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. -func (x *FieldOptions) GetTarget() FieldOptions_OptionTargetType { - if x != nil && x.Target != nil { - return *x.Target +func (x *FieldOptions) GetTargets() []FieldOptions_OptionTargetType { + if x != nil { + return x.Targets } - return FieldOptions_TARGET_TYPE_UNKNOWN + return nil } -func (x *FieldOptions) GetTargets() []FieldOptions_OptionTargetType { +func (x *FieldOptions) GetEditionDefaults() []*FieldOptions_EditionDefault { if x != nil { - return x.Targets + return x.EditionDefaults + } + return nil +} + +func (x *FieldOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features } return nil } @@ -2348,6 +2832,8 @@ type OneofOptions struct { unknownFields protoimpl.UnknownFields extensionFields protoimpl.ExtensionFields + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,1,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } @@ -2384,6 +2870,13 @@ func (*OneofOptions) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{13} } +func (x *OneofOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *OneofOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -2409,11 +2902,13 @@ type EnumOptions struct { // and strips underscored from the fields before comparison in proto3 only. // The new behavior takes `json_name` into account and applies to proto2 as // well. - // TODO(b/261750190) Remove this legacy behavior once downstream teams have + // TODO Remove this legacy behavior once downstream teams have // had time to migrate. // // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. DeprecatedLegacyJsonFieldConflicts *bool `protobuf:"varint,6,opt,name=deprecated_legacy_json_field_conflicts,json=deprecatedLegacyJsonFieldConflicts" json:"deprecated_legacy_json_field_conflicts,omitempty"` + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,7,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } @@ -2477,6 +2972,13 @@ func (x *EnumOptions) GetDeprecatedLegacyJsonFieldConflicts() bool { return false } +func (x *EnumOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *EnumOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -2495,13 +2997,20 @@ type EnumValueOptions struct { // for the enum value, or it will be completely ignored; in the very least, // this is a formalization for deprecating enum values. Deprecated *bool `protobuf:"varint,1,opt,name=deprecated,def=0" json:"deprecated,omitempty"` + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,2,opt,name=features" json:"features,omitempty"` + // Indicate that fields annotated with this enum value should not be printed + // out when using debug formats, e.g. when the field contains sensitive + // credentials. + DebugRedact *bool `protobuf:"varint,3,opt,name=debug_redact,json=debugRedact,def=0" json:"debug_redact,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } // Default values for EnumValueOptions fields. const ( - Default_EnumValueOptions_Deprecated = bool(false) + Default_EnumValueOptions_Deprecated = bool(false) + Default_EnumValueOptions_DebugRedact = bool(false) ) func (x *EnumValueOptions) Reset() { @@ -2543,6 +3052,20 @@ func (x *EnumValueOptions) GetDeprecated() bool { return Default_EnumValueOptions_Deprecated } +func (x *EnumValueOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + +func (x *EnumValueOptions) GetDebugRedact() bool { + if x != nil && x.DebugRedact != nil { + return *x.DebugRedact + } + return Default_EnumValueOptions_DebugRedact +} + func (x *EnumValueOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -2556,6 +3079,8 @@ type ServiceOptions struct { unknownFields protoimpl.UnknownFields extensionFields protoimpl.ExtensionFields + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,34,opt,name=features" json:"features,omitempty"` // Is this service deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the service, or it will be completely ignored; in the very least, @@ -2602,6 +3127,13 @@ func (*ServiceOptions) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{16} } +func (x *ServiceOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *ServiceOptions) GetDeprecated() bool { if x != nil && x.Deprecated != nil { return *x.Deprecated @@ -2628,6 +3160,8 @@ type MethodOptions struct { // this is a formalization for deprecating methods. Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"` IdempotencyLevel *MethodOptions_IdempotencyLevel `protobuf:"varint,34,opt,name=idempotency_level,json=idempotencyLevel,enum=google.protobuf.MethodOptions_IdempotencyLevel,def=0" json:"idempotency_level,omitempty"` + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,35,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } @@ -2684,6 +3218,13 @@ func (x *MethodOptions) GetIdempotencyLevel() MethodOptions_IdempotencyLevel { return Default_MethodOptions_IdempotencyLevel } +func (x *MethodOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *MethodOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -2763,35 +3304,200 @@ func (x *UninterpretedOption) GetPositiveIntValue() uint64 { if x != nil && x.PositiveIntValue != nil { return *x.PositiveIntValue } - return 0 + return 0 +} + +func (x *UninterpretedOption) GetNegativeIntValue() int64 { + if x != nil && x.NegativeIntValue != nil { + return *x.NegativeIntValue + } + return 0 +} + +func (x *UninterpretedOption) GetDoubleValue() float64 { + if x != nil && x.DoubleValue != nil { + return *x.DoubleValue + } + return 0 +} + +func (x *UninterpretedOption) GetStringValue() []byte { + if x != nil { + return x.StringValue + } + return nil +} + +func (x *UninterpretedOption) GetAggregateValue() string { + if x != nil && x.AggregateValue != nil { + return *x.AggregateValue + } + return "" +} + +// TODO Enums in C++ gencode (and potentially other languages) are +// not well scoped. This means that each of the feature enums below can clash +// with each other. The short names we've chosen maximize call-site +// readability, but leave us very open to this scenario. A future feature will +// be designed and implemented to handle this, hopefully before we ever hit a +// conflict here. +type FeatureSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + extensionFields protoimpl.ExtensionFields + + FieldPresence *FeatureSet_FieldPresence `protobuf:"varint,1,opt,name=field_presence,json=fieldPresence,enum=google.protobuf.FeatureSet_FieldPresence" json:"field_presence,omitempty"` + EnumType *FeatureSet_EnumType `protobuf:"varint,2,opt,name=enum_type,json=enumType,enum=google.protobuf.FeatureSet_EnumType" json:"enum_type,omitempty"` + RepeatedFieldEncoding *FeatureSet_RepeatedFieldEncoding `protobuf:"varint,3,opt,name=repeated_field_encoding,json=repeatedFieldEncoding,enum=google.protobuf.FeatureSet_RepeatedFieldEncoding" json:"repeated_field_encoding,omitempty"` + Utf8Validation *FeatureSet_Utf8Validation `protobuf:"varint,4,opt,name=utf8_validation,json=utf8Validation,enum=google.protobuf.FeatureSet_Utf8Validation" json:"utf8_validation,omitempty"` + MessageEncoding *FeatureSet_MessageEncoding `protobuf:"varint,5,opt,name=message_encoding,json=messageEncoding,enum=google.protobuf.FeatureSet_MessageEncoding" json:"message_encoding,omitempty"` + JsonFormat *FeatureSet_JsonFormat `protobuf:"varint,6,opt,name=json_format,json=jsonFormat,enum=google.protobuf.FeatureSet_JsonFormat" json:"json_format,omitempty"` +} + +func (x *FeatureSet) Reset() { + *x = FeatureSet{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_descriptor_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeatureSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeatureSet) ProtoMessage() {} + +func (x *FeatureSet) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_descriptor_proto_msgTypes[19] + 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 FeatureSet.ProtoReflect.Descriptor instead. +func (*FeatureSet) Descriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19} +} + +func (x *FeatureSet) GetFieldPresence() FeatureSet_FieldPresence { + if x != nil && x.FieldPresence != nil { + return *x.FieldPresence + } + return FeatureSet_FIELD_PRESENCE_UNKNOWN +} + +func (x *FeatureSet) GetEnumType() FeatureSet_EnumType { + if x != nil && x.EnumType != nil { + return *x.EnumType + } + return FeatureSet_ENUM_TYPE_UNKNOWN +} + +func (x *FeatureSet) GetRepeatedFieldEncoding() FeatureSet_RepeatedFieldEncoding { + if x != nil && x.RepeatedFieldEncoding != nil { + return *x.RepeatedFieldEncoding + } + return FeatureSet_REPEATED_FIELD_ENCODING_UNKNOWN +} + +func (x *FeatureSet) GetUtf8Validation() FeatureSet_Utf8Validation { + if x != nil && x.Utf8Validation != nil { + return *x.Utf8Validation + } + return FeatureSet_UTF8_VALIDATION_UNKNOWN +} + +func (x *FeatureSet) GetMessageEncoding() FeatureSet_MessageEncoding { + if x != nil && x.MessageEncoding != nil { + return *x.MessageEncoding + } + return FeatureSet_MESSAGE_ENCODING_UNKNOWN +} + +func (x *FeatureSet) GetJsonFormat() FeatureSet_JsonFormat { + if x != nil && x.JsonFormat != nil { + return *x.JsonFormat + } + return FeatureSet_JSON_FORMAT_UNKNOWN +} + +// A compiled specification for the defaults of a set of features. These +// messages are generated from FeatureSet extensions and can be used to seed +// feature resolution. The resolution with this object becomes a simple search +// for the closest matching edition, followed by proto merges. +type FeatureSetDefaults struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Defaults []*FeatureSetDefaults_FeatureSetEditionDefault `protobuf:"bytes,1,rep,name=defaults" json:"defaults,omitempty"` + // The minimum supported edition (inclusive) when this was constructed. + // Editions before this will not have defaults. + MinimumEdition *Edition `protobuf:"varint,4,opt,name=minimum_edition,json=minimumEdition,enum=google.protobuf.Edition" json:"minimum_edition,omitempty"` + // The maximum known edition (inclusive) when this was constructed. Editions + // after this will not have reliable defaults. + MaximumEdition *Edition `protobuf:"varint,5,opt,name=maximum_edition,json=maximumEdition,enum=google.protobuf.Edition" json:"maximum_edition,omitempty"` +} + +func (x *FeatureSetDefaults) Reset() { + *x = FeatureSetDefaults{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_descriptor_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (x *UninterpretedOption) GetNegativeIntValue() int64 { - if x != nil && x.NegativeIntValue != nil { - return *x.NegativeIntValue - } - return 0 +func (x *FeatureSetDefaults) String() string { + return protoimpl.X.MessageStringOf(x) } -func (x *UninterpretedOption) GetDoubleValue() float64 { - if x != nil && x.DoubleValue != nil { - return *x.DoubleValue +func (*FeatureSetDefaults) ProtoMessage() {} + +func (x *FeatureSetDefaults) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_descriptor_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return 0 + return mi.MessageOf(x) } -func (x *UninterpretedOption) GetStringValue() []byte { +// Deprecated: Use FeatureSetDefaults.ProtoReflect.Descriptor instead. +func (*FeatureSetDefaults) Descriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{20} +} + +func (x *FeatureSetDefaults) GetDefaults() []*FeatureSetDefaults_FeatureSetEditionDefault { if x != nil { - return x.StringValue + return x.Defaults } return nil } -func (x *UninterpretedOption) GetAggregateValue() string { - if x != nil && x.AggregateValue != nil { - return *x.AggregateValue +func (x *FeatureSetDefaults) GetMinimumEdition() Edition { + if x != nil && x.MinimumEdition != nil { + return *x.MinimumEdition } - return "" + return Edition_EDITION_UNKNOWN +} + +func (x *FeatureSetDefaults) GetMaximumEdition() Edition { + if x != nil && x.MaximumEdition != nil { + return *x.MaximumEdition + } + return Edition_EDITION_UNKNOWN } // Encapsulates information about the original source file from which a @@ -2855,7 +3561,7 @@ type SourceCodeInfo struct { func (x *SourceCodeInfo) Reset() { *x = SourceCodeInfo{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[19] + mi := &file_google_protobuf_descriptor_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2868,7 +3574,7 @@ func (x *SourceCodeInfo) String() string { func (*SourceCodeInfo) ProtoMessage() {} func (x *SourceCodeInfo) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[19] + mi := &file_google_protobuf_descriptor_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2881,7 +3587,7 @@ func (x *SourceCodeInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use SourceCodeInfo.ProtoReflect.Descriptor instead. func (*SourceCodeInfo) Descriptor() ([]byte, []int) { - return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19} + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{21} } func (x *SourceCodeInfo) GetLocation() []*SourceCodeInfo_Location { @@ -2907,7 +3613,7 @@ type GeneratedCodeInfo struct { func (x *GeneratedCodeInfo) Reset() { *x = GeneratedCodeInfo{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[20] + mi := &file_google_protobuf_descriptor_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2920,7 +3626,7 @@ func (x *GeneratedCodeInfo) String() string { func (*GeneratedCodeInfo) ProtoMessage() {} func (x *GeneratedCodeInfo) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[20] + mi := &file_google_protobuf_descriptor_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2933,7 +3639,7 @@ func (x *GeneratedCodeInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use GeneratedCodeInfo.ProtoReflect.Descriptor instead. func (*GeneratedCodeInfo) Descriptor() ([]byte, []int) { - return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{20} + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{22} } func (x *GeneratedCodeInfo) GetAnnotation() []*GeneratedCodeInfo_Annotation { @@ -2956,7 +3662,7 @@ type DescriptorProto_ExtensionRange struct { func (x *DescriptorProto_ExtensionRange) Reset() { *x = DescriptorProto_ExtensionRange{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[21] + mi := &file_google_protobuf_descriptor_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2969,7 +3675,7 @@ func (x *DescriptorProto_ExtensionRange) String() string { func (*DescriptorProto_ExtensionRange) ProtoMessage() {} func (x *DescriptorProto_ExtensionRange) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[21] + mi := &file_google_protobuf_descriptor_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3021,7 +3727,7 @@ type DescriptorProto_ReservedRange struct { func (x *DescriptorProto_ReservedRange) Reset() { *x = DescriptorProto_ReservedRange{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[22] + mi := &file_google_protobuf_descriptor_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3034,7 +3740,7 @@ func (x *DescriptorProto_ReservedRange) String() string { func (*DescriptorProto_ReservedRange) ProtoMessage() {} func (x *DescriptorProto_ReservedRange) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[22] + mi := &file_google_protobuf_descriptor_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3078,10 +3784,6 @@ type ExtensionRangeOptions_Declaration struct { // Metadata.type, Declaration.type must have a leading dot for messages // and enums. Type *string `protobuf:"bytes,3,opt,name=type" json:"type,omitempty"` - // Deprecated. Please use "repeated". - // - // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. - IsRepeated *bool `protobuf:"varint,4,opt,name=is_repeated,json=isRepeated" json:"is_repeated,omitempty"` // If true, indicates that the number is reserved in the extension range, // and any extension field with the number will fail to compile. Set this // when a declared extension field is deleted. @@ -3094,7 +3796,7 @@ type ExtensionRangeOptions_Declaration struct { func (x *ExtensionRangeOptions_Declaration) Reset() { *x = ExtensionRangeOptions_Declaration{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[23] + mi := &file_google_protobuf_descriptor_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3107,7 +3809,7 @@ func (x *ExtensionRangeOptions_Declaration) String() string { func (*ExtensionRangeOptions_Declaration) ProtoMessage() {} func (x *ExtensionRangeOptions_Declaration) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[23] + mi := &file_google_protobuf_descriptor_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3144,14 +3846,6 @@ func (x *ExtensionRangeOptions_Declaration) GetType() string { return "" } -// Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. -func (x *ExtensionRangeOptions_Declaration) GetIsRepeated() bool { - if x != nil && x.IsRepeated != nil { - return *x.IsRepeated - } - return false -} - func (x *ExtensionRangeOptions_Declaration) GetReserved() bool { if x != nil && x.Reserved != nil { return *x.Reserved @@ -3184,7 +3878,7 @@ type EnumDescriptorProto_EnumReservedRange struct { func (x *EnumDescriptorProto_EnumReservedRange) Reset() { *x = EnumDescriptorProto_EnumReservedRange{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[24] + mi := &file_google_protobuf_descriptor_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3197,7 +3891,7 @@ func (x *EnumDescriptorProto_EnumReservedRange) String() string { func (*EnumDescriptorProto_EnumReservedRange) ProtoMessage() {} func (x *EnumDescriptorProto_EnumReservedRange) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[24] + mi := &file_google_protobuf_descriptor_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3227,6 +3921,61 @@ func (x *EnumDescriptorProto_EnumReservedRange) GetEnd() int32 { return 0 } +type FieldOptions_EditionDefault struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Edition *Edition `protobuf:"varint,3,opt,name=edition,enum=google.protobuf.Edition" json:"edition,omitempty"` + Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` // Textproto value. +} + +func (x *FieldOptions_EditionDefault) Reset() { + *x = FieldOptions_EditionDefault{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_descriptor_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FieldOptions_EditionDefault) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldOptions_EditionDefault) ProtoMessage() {} + +func (x *FieldOptions_EditionDefault) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_descriptor_proto_msgTypes[27] + 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 FieldOptions_EditionDefault.ProtoReflect.Descriptor instead. +func (*FieldOptions_EditionDefault) Descriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{12, 0} +} + +func (x *FieldOptions_EditionDefault) GetEdition() Edition { + if x != nil && x.Edition != nil { + return *x.Edition + } + return Edition_EDITION_UNKNOWN +} + +func (x *FieldOptions_EditionDefault) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). @@ -3244,7 +3993,7 @@ type UninterpretedOption_NamePart struct { func (x *UninterpretedOption_NamePart) Reset() { *x = UninterpretedOption_NamePart{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[25] + mi := &file_google_protobuf_descriptor_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3257,7 +4006,7 @@ func (x *UninterpretedOption_NamePart) String() string { func (*UninterpretedOption_NamePart) ProtoMessage() {} func (x *UninterpretedOption_NamePart) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[25] + mi := &file_google_protobuf_descriptor_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3287,6 +4036,65 @@ func (x *UninterpretedOption_NamePart) GetIsExtension() bool { return false } +// A map from every known edition with a unique set of defaults to its +// defaults. Not all editions may be contained here. For a given edition, +// the defaults at the closest matching edition ordered at or before it should +// be used. This field must be in strict ascending order by edition. +type FeatureSetDefaults_FeatureSetEditionDefault struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Edition *Edition `protobuf:"varint,3,opt,name=edition,enum=google.protobuf.Edition" json:"edition,omitempty"` + Features *FeatureSet `protobuf:"bytes,2,opt,name=features" json:"features,omitempty"` +} + +func (x *FeatureSetDefaults_FeatureSetEditionDefault) Reset() { + *x = FeatureSetDefaults_FeatureSetEditionDefault{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_descriptor_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeatureSetDefaults_FeatureSetEditionDefault) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeatureSetDefaults_FeatureSetEditionDefault) ProtoMessage() {} + +func (x *FeatureSetDefaults_FeatureSetEditionDefault) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_descriptor_proto_msgTypes[29] + 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 FeatureSetDefaults_FeatureSetEditionDefault.ProtoReflect.Descriptor instead. +func (*FeatureSetDefaults_FeatureSetEditionDefault) Descriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{20, 0} +} + +func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetEdition() Edition { + if x != nil && x.Edition != nil { + return *x.Edition + } + return Edition_EDITION_UNKNOWN +} + +func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + type SourceCodeInfo_Location struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3388,7 +4196,7 @@ type SourceCodeInfo_Location struct { func (x *SourceCodeInfo_Location) Reset() { *x = SourceCodeInfo_Location{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[26] + mi := &file_google_protobuf_descriptor_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3401,7 +4209,7 @@ func (x *SourceCodeInfo_Location) String() string { func (*SourceCodeInfo_Location) ProtoMessage() {} func (x *SourceCodeInfo_Location) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[26] + mi := &file_google_protobuf_descriptor_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3414,7 +4222,7 @@ func (x *SourceCodeInfo_Location) ProtoReflect() protoreflect.Message { // Deprecated: Use SourceCodeInfo_Location.ProtoReflect.Descriptor instead. func (*SourceCodeInfo_Location) Descriptor() ([]byte, []int) { - return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 0} + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{21, 0} } func (x *SourceCodeInfo_Location) GetPath() []int32 { @@ -3475,7 +4283,7 @@ type GeneratedCodeInfo_Annotation struct { func (x *GeneratedCodeInfo_Annotation) Reset() { *x = GeneratedCodeInfo_Annotation{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[27] + mi := &file_google_protobuf_descriptor_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3488,7 +4296,7 @@ func (x *GeneratedCodeInfo_Annotation) String() string { func (*GeneratedCodeInfo_Annotation) ProtoMessage() {} func (x *GeneratedCodeInfo_Annotation) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[27] + mi := &file_google_protobuf_descriptor_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3501,7 +4309,7 @@ func (x *GeneratedCodeInfo_Annotation) ProtoReflect() protoreflect.Message { // Deprecated: Use GeneratedCodeInfo_Annotation.ProtoReflect.Descriptor instead. func (*GeneratedCodeInfo_Annotation) Descriptor() ([]byte, []int) { - return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{20, 0} + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{22, 0} } func (x *GeneratedCodeInfo_Annotation) GetPath() []int32 { @@ -3550,7 +4358,7 @@ var file_google_protobuf_descriptor_proto_rawDesc = []byte{ 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x04, 0x66, 0x69, - 0x6c, 0x65, 0x22, 0xfe, 0x04, 0x0a, 0x13, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, + 0x6c, 0x65, 0x22, 0x98, 0x05, 0x0a, 0x13, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, @@ -3588,527 +4396,687 @@ var file_google_protobuf_descriptor_proto_rawDesc = []byte{ 0x75, 0x66, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0xb9, 0x06, 0x0a, 0x0f, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x43, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, - 0x0b, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x0a, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x41, 0x0a, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x58, 0x0a, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, + 0x09, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x12, 0x32, 0x0a, 0x07, 0x65, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb9, 0x06, + 0x0a, 0x0f, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x05, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x12, 0x43, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x09, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x0b, 0x6e, 0x65, 0x73, 0x74, 0x65, + 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0e, 0x65, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x44, 0x0a, - 0x0a, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x5f, 0x64, 0x65, 0x63, 0x6c, 0x18, 0x08, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x09, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x44, - 0x65, 0x63, 0x6c, 0x12, 0x39, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x55, - 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x0a, + 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x41, 0x0a, 0x09, 0x65, 0x6e, + 0x75, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x52, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x58, 0x0a, + 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x7a, 0x0a, 0x0e, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x03, 0x65, 0x6e, 0x64, 0x12, 0x40, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x37, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, - 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, - 0xad, 0x04, 0x0a, 0x15, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, - 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x59, 0x0a, 0x0b, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0x88, 0x01, - 0x02, 0x52, 0x0b, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x68, - 0x0a, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x56, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x0a, - 0x55, 0x4e, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x45, 0x44, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xb3, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x63, - 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x23, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x69, 0x73, 0x52, 0x65, - 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x22, 0x34, - 0x0a, 0x11, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x44, 0x45, 0x43, 0x4c, 0x41, 0x52, 0x41, 0x54, 0x49, - 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x01, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, - 0xc1, 0x06, 0x0a, 0x14, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x3e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x65, - 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x5f, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x6e, 0x65, 0x6f, - 0x66, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x27, 0x0a, 0x0f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, - 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x22, 0xb6, 0x02, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, - 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, - 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x02, 0x12, - 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x03, 0x12, - 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x04, - 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x05, - 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, - 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44, - 0x33, 0x32, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4f, 0x4f, - 0x4c, 0x10, 0x08, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, - 0x4e, 0x47, 0x10, 0x09, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x52, 0x4f, - 0x55, 0x50, 0x10, 0x0a, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, - 0x53, 0x41, 0x47, 0x45, 0x10, 0x0b, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, - 0x59, 0x54, 0x45, 0x53, 0x10, 0x0c, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, - 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x0d, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, - 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x10, 0x0f, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x10, 0x10, 0x12, 0x0f, 0x0a, 0x0b, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x11, 0x12, 0x0f, 0x0a, - 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x12, 0x22, 0x43, - 0x0a, 0x05, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x41, 0x42, 0x45, 0x4c, - 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4c, - 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x02, 0x12, - 0x12, 0x0a, 0x0e, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x52, 0x45, 0x50, 0x45, 0x41, 0x54, 0x45, - 0x44, 0x10, 0x03, 0x22, 0x63, 0x0a, 0x14, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x37, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xe3, 0x02, 0x0a, 0x13, 0x45, 0x6e, 0x75, - 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5d, 0x0a, - 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6e, 0x75, 0x6d, - 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0d, 0x72, - 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, - 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x4e, 0x61, 0x6d, - 0x65, 0x1a, 0x3b, 0x0a, 0x11, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, + 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x6f, 0x6e, 0x65, 0x6f, 0x66, + 0x5f, 0x64, 0x65, 0x63, 0x6c, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4f, 0x6e, + 0x65, 0x6f, 0x66, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x52, 0x09, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x44, 0x65, 0x63, 0x6c, 0x12, 0x39, 0x0a, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x55, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x52, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, + 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, + 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x7a, 0x0a, 0x0e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, - 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0x83, - 0x01, 0x0a, 0x18, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa7, 0x01, 0x0a, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x40, + 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x1a, 0x37, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0xc7, 0x04, 0x0a, 0x15, 0x45, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, + 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, + 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x59, 0x0a, + 0x0b, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, + 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0x88, 0x01, 0x02, 0x52, 0x0b, 0x64, 0x65, 0x63, + 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x18, 0x32, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x73, 0x12, 0x68, 0x0a, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x3a, 0x0a, 0x55, 0x4e, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x45, 0x44, 0x52, 0x0c, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x94, 0x01, 0x0a, 0x0b, + 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, + 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x04, + 0x10, 0x05, 0x22, 0x34, 0x0a, 0x11, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x44, 0x45, 0x43, 0x4c, 0x41, + 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x56, 0x45, + 0x52, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x01, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, + 0x80, 0x80, 0x02, 0x22, 0xc1, 0x06, 0x0a, 0x14, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x3e, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, + 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x74, 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x64, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x64, 0x65, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x6e, 0x65, + 0x6f, 0x66, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x73, + 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, + 0x73, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x22, 0xb6, 0x02, 0x0a, 0x04, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x55, 0x42, 0x4c, + 0x45, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4c, 0x4f, 0x41, + 0x54, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x36, + 0x34, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x49, 0x4e, 0x54, + 0x36, 0x34, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, + 0x33, 0x32, 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, + 0x45, 0x44, 0x36, 0x34, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, + 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x08, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x09, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x0a, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x0b, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x0c, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x55, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x0d, 0x12, 0x0d, 0x0a, 0x09, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x10, 0x0f, 0x12, 0x11, 0x0a, + 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x10, 0x10, + 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, + 0x11, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54, 0x36, 0x34, + 0x10, 0x12, 0x22, 0x43, 0x0a, 0x05, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x0e, 0x4c, + 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x10, 0x01, 0x12, + 0x12, 0x0a, 0x0e, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x52, 0x45, 0x50, 0x45, 0x41, 0x54, 0x45, + 0x44, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x52, 0x45, 0x51, + 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x02, 0x22, 0x63, 0x0a, 0x14, 0x4f, 0x6e, 0x65, 0x6f, 0x66, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xe3, 0x02, 0x0a, + 0x13, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, + 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x5d, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, + 0x65, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x3b, 0x0a, 0x11, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, + 0x6e, 0x64, 0x22, 0x83, 0x01, 0x0a, 0x18, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x06, 0x6d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x12, 0x39, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x89, - 0x02, 0x0a, 0x15, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, - 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x38, 0x0a, 0x07, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa7, 0x01, 0x0a, 0x16, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, + 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x39, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x22, 0x89, 0x02, 0x0a, 0x15, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x38, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x10, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0f, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x30, 0x0a, 0x10, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0f, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x22, 0xca, + 0x09, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, + 0x0a, 0x0c, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6a, 0x61, 0x76, 0x61, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x12, 0x30, 0x0a, 0x14, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, + 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x12, 0x6a, 0x61, 0x76, 0x61, 0x4f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x13, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74, + 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, + 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x11, 0x6a, 0x61, 0x76, 0x61, 0x4d, 0x75, 0x6c, + 0x74, 0x69, 0x70, 0x6c, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x1d, 0x6a, 0x61, + 0x76, 0x61, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x71, 0x75, 0x61, + 0x6c, 0x73, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x14, 0x20, 0x01, 0x28, + 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x19, 0x6a, 0x61, 0x76, 0x61, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x41, 0x6e, 0x64, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x3a, 0x0a, 0x16, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x75, 0x74, 0x66, 0x38, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x08, + 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x13, 0x6a, 0x61, 0x76, 0x61, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x74, 0x66, 0x38, 0x12, 0x53, 0x0a, 0x0c, + 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x3a, 0x05, 0x53, + 0x50, 0x45, 0x45, 0x44, 0x52, 0x0b, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x46, 0x6f, + 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x12, 0x35, 0x0a, 0x13, 0x63, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, + 0x61, 0x6c, 0x73, 0x65, 0x52, 0x11, 0x63, 0x63, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x15, 0x6a, 0x61, 0x76, 0x61, 0x5f, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x13, 0x6a, + 0x61, 0x76, 0x61, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x12, 0x35, 0x0a, 0x13, 0x70, 0x79, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x3a, + 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x11, 0x70, 0x79, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, + 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x14, 0x70, 0x68, 0x70, + 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x12, + 0x70, 0x68, 0x70, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, + 0x18, 0x17, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x10, 0x63, 0x63, 0x5f, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x72, 0x65, 0x6e, 0x61, 0x73, 0x18, 0x1f, 0x20, + 0x01, 0x28, 0x08, 0x3a, 0x04, 0x74, 0x72, 0x75, 0x65, 0x52, 0x0e, 0x63, 0x63, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x6f, 0x62, 0x6a, + 0x63, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x24, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x63, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x50, + 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x25, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x77, 0x69, 0x66, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, + 0x18, 0x27, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x77, 0x69, 0x66, 0x74, 0x50, 0x72, 0x65, + 0x66, 0x69, 0x78, 0x12, 0x28, 0x0a, 0x10, 0x70, 0x68, 0x70, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, + 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x28, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, + 0x68, 0x70, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x23, 0x0a, + 0x0d, 0x70, 0x68, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x29, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x68, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x70, 0x68, 0x70, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x2c, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x14, 0x70, 0x68, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x75, 0x62, 0x79, + 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x72, 0x75, 0x62, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x66, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x32, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x10, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, - 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x30, 0x0a, 0x10, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x22, 0x91, 0x09, 0x0a, 0x0b, 0x46, - 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6a, 0x61, - 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x6a, 0x61, 0x76, 0x61, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, - 0x14, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6a, 0x61, 0x76, - 0x61, 0x4f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x35, 0x0a, 0x13, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, - 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, - 0x6c, 0x73, 0x65, 0x52, 0x11, 0x6a, 0x61, 0x76, 0x61, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, - 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x1d, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x5f, 0x61, - 0x6e, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, - 0x01, 0x52, 0x19, 0x6a, 0x61, 0x76, 0x61, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x45, - 0x71, 0x75, 0x61, 0x6c, 0x73, 0x41, 0x6e, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x3a, 0x0a, 0x16, - 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x5f, 0x75, 0x74, 0x66, 0x38, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, - 0x6c, 0x73, 0x65, 0x52, 0x13, 0x6a, 0x61, 0x76, 0x61, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x55, 0x74, 0x66, 0x38, 0x12, 0x53, 0x0a, 0x0c, 0x6f, 0x70, 0x74, 0x69, - 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, - 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x3a, 0x05, 0x53, 0x50, 0x45, 0x45, 0x44, - 0x52, 0x0b, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x46, 0x6f, 0x72, 0x12, 0x1d, 0x0a, - 0x0a, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x67, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x35, 0x0a, 0x13, - 0x63, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, - 0x52, 0x11, 0x63, 0x63, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x15, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x11, 0x20, 0x01, - 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x13, 0x6a, 0x61, 0x76, 0x61, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x35, - 0x0a, 0x13, 0x70, 0x79, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, - 0x73, 0x65, 0x52, 0x11, 0x70, 0x79, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x14, 0x70, 0x68, 0x70, 0x5f, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x2a, 0x20, - 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x12, 0x70, 0x68, 0x70, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x25, - 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x17, 0x20, 0x01, - 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, - 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x10, 0x63, 0x63, 0x5f, 0x65, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x5f, 0x61, 0x72, 0x65, 0x6e, 0x61, 0x73, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x08, 0x3a, - 0x04, 0x74, 0x72, 0x75, 0x65, 0x52, 0x0e, 0x63, 0x63, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, - 0x72, 0x65, 0x6e, 0x61, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x6f, 0x62, 0x6a, 0x63, 0x5f, 0x63, 0x6c, - 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x24, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x63, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x50, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x25, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x73, 0x68, - 0x61, 0x72, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, - 0x73, 0x77, 0x69, 0x66, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x27, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x73, 0x77, 0x69, 0x66, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, - 0x28, 0x0a, 0x10, 0x70, 0x68, 0x70, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x18, 0x28, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x68, 0x70, 0x43, 0x6c, - 0x61, 0x73, 0x73, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x68, 0x70, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x29, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x70, 0x68, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x34, - 0x0a, 0x16, 0x70, 0x68, 0x70, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, - 0x70, 0x68, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x75, 0x62, 0x79, 0x5f, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x75, 0x62, 0x79, - 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x22, 0x3a, 0x0a, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x4d, 0x6f, 0x64, - 0x65, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x50, 0x45, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, - 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4c, - 0x49, 0x54, 0x45, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x03, 0x2a, 0x09, 0x08, - 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x26, 0x10, 0x27, 0x22, 0xbb, - 0x03, 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x3c, 0x0a, 0x17, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, - 0x5f, 0x77, 0x69, 0x72, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x14, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x53, 0x65, 0x74, 0x57, 0x69, 0x72, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, - 0x4c, 0x0a, 0x1f, 0x6e, 0x6f, 0x5f, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x5f, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, - 0x1c, 0x6e, 0x6f, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x12, 0x25, 0x0a, - 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x6e, 0x74, 0x72, - 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x56, 0x0a, 0x26, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x22, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, - 0x64, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x43, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, - 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, - 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, - 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x22, 0x85, 0x09, 0x0a, - 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x0a, - 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x54, 0x79, 0x70, - 0x65, 0x3a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x52, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x47, 0x0a, 0x06, 0x6a, 0x73, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x09, - 0x4a, 0x53, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x52, 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x19, 0x0a, 0x04, 0x6c, 0x61, 0x7a, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x3a, - 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x04, 0x6c, 0x61, 0x7a, 0x79, 0x12, 0x2e, 0x0a, 0x0f, - 0x75, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x6c, 0x61, 0x7a, 0x79, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0e, 0x75, 0x6e, - 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x4c, 0x61, 0x7a, 0x79, 0x12, 0x25, 0x0a, 0x0a, - 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x04, 0x77, 0x65, 0x61, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x04, 0x77, 0x65, 0x61, 0x6b, 0x12, 0x28, - 0x0a, 0x0c, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, 0x64, 0x61, 0x63, 0x74, 0x18, 0x10, - 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x62, - 0x75, 0x67, 0x52, 0x65, 0x64, 0x61, 0x63, 0x74, 0x12, 0x4b, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x65, - 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x74, 0x65, - 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, - 0x12, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x54, 0x79, 0x70, 0x65, 0x42, 0x02, 0x18, 0x01, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x12, 0x48, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x13, 0x20, 0x03, - 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, - 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2f, 0x0a, 0x05, 0x43, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, - 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, - 0x52, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x50, - 0x49, 0x45, 0x43, 0x45, 0x10, 0x02, 0x22, 0x35, 0x0a, 0x06, 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, - 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0d, - 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x02, 0x22, 0x55, 0x0a, - 0x0f, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, - 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x54, 0x45, 0x4e, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x14, - 0x0a, 0x10, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, - 0x43, 0x45, 0x10, 0x02, 0x22, 0x8c, 0x02, 0x0a, 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, - 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, - 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x54, 0x41, 0x52, 0x47, - 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f, - 0x4e, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, - 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, - 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x52, - 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x10, 0x05, - 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x06, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, - 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x54, - 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, - 0x44, 0x10, 0x09, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, - 0x08, 0x04, 0x10, 0x05, 0x22, 0x73, 0x0a, 0x0c, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, - 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x98, 0x02, 0x0a, 0x0b, 0x45, 0x6e, - 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, - 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, + 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3a, + 0x0a, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x09, + 0x0a, 0x05, 0x53, 0x50, 0x45, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x44, + 0x45, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4c, 0x49, 0x54, 0x45, + 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x03, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, + 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x26, 0x10, 0x27, 0x22, 0xf4, 0x03, 0x0a, 0x0e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3c, + 0x0a, 0x17, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x77, 0x69, + 0x72, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x3a, + 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x14, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, + 0x65, 0x74, 0x57, 0x69, 0x72, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x4c, 0x0a, 0x1f, + 0x6e, 0x6f, 0x5f, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x1c, 0x6e, 0x6f, + 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, - 0x64, 0x12, 0x56, 0x0a, 0x26, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x22, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, - 0x64, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x43, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, - 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, - 0x08, 0x05, 0x10, 0x06, 0x22, 0x9e, 0x01, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, - 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, - 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, - 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, - 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, - 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, - 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x9c, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, - 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x56, + 0x0a, 0x26, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x63, + 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, + 0x18, 0x01, 0x52, 0x22, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x4c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x6f, 0x6e, + 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, - 0x80, 0x80, 0x80, 0x02, 0x22, 0xe0, 0x02, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, - 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x71, 0x0a, - 0x11, 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, - 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x3a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, - 0x4f, 0x54, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x52, 0x10, - 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, - 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, - 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, - 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x50, 0x0a, 0x10, 0x49, 0x64, - 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x17, - 0x0a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x55, 0x4e, - 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4e, 0x4f, 0x5f, 0x53, 0x49, - 0x44, 0x45, 0x5f, 0x45, 0x46, 0x46, 0x45, 0x43, 0x54, 0x53, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, - 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x2a, 0x09, 0x08, 0xe8, - 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x9a, 0x03, 0x0a, 0x13, 0x55, 0x6e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x41, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, + 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x4a, 0x04, 0x08, 0x09, + 0x10, 0x0a, 0x22, 0xad, 0x0a, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x0a, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x43, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x52, + 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x47, + 0x0a, 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4a, 0x53, + 0x54, 0x79, 0x70, 0x65, 0x3a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x52, + 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x04, 0x6c, 0x61, 0x7a, 0x79, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x04, 0x6c, 0x61, + 0x7a, 0x79, 0x12, 0x2e, 0x0a, 0x0f, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x5f, 0x6c, 0x61, 0x7a, 0x79, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, + 0x73, 0x65, 0x52, 0x0e, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x4c, 0x61, + 0x7a, 0x79, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x04, 0x77, 0x65, 0x61, + 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x04, + 0x77, 0x65, 0x61, 0x6b, 0x12, 0x28, 0x0a, 0x0c, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, + 0x64, 0x61, 0x63, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, + 0x65, 0x52, 0x0b, 0x64, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x64, 0x61, 0x63, 0x74, 0x12, 0x4b, + 0x0a, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, 0x07, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x57, 0x0a, 0x10, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x45, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0f, 0x65, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x37, + 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x1a, 0x5a, 0x0a, 0x0e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, + 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2f, 0x0a, + 0x05, 0x43, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, + 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, + 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x49, 0x45, 0x43, 0x45, 0x10, 0x02, 0x22, 0x35, + 0x0a, 0x06, 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, + 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x53, 0x54, + 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, 0x55, 0x4d, + 0x42, 0x45, 0x52, 0x10, 0x02, 0x22, 0x55, 0x0a, 0x0f, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x54, 0x45, + 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, + 0x15, 0x0a, 0x11, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, + 0x54, 0x49, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x02, 0x22, 0x8c, 0x02, 0x0a, + 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, + 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x01, + 0x12, 0x1f, 0x0a, 0x1b, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x45, 0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, + 0x02, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, + 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x10, + 0x04, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x10, 0x05, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x52, 0x47, + 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x06, 0x12, 0x1a, + 0x0a, 0x16, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, + 0x55, 0x4d, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, + 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, + 0x45, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x10, 0x09, 0x2a, 0x09, 0x08, 0xe8, 0x07, + 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x12, + 0x10, 0x13, 0x22, 0xac, 0x01, 0x0a, 0x0c, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, + 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, + 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, + 0x02, 0x22, 0xd1, 0x02, 0x0a, 0x0b, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x6c, 0x69, + 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x56, 0x0a, 0x26, 0x64, 0x65, 0x70, + 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x6a, + 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, + 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x22, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x4a, + 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, + 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, + 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, + 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0x81, 0x02, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, + 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, + 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, + 0x64, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, + 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x0c, 0x64, 0x65, + 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, 0x64, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, + 0x64, 0x61, 0x63, 0x74, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, + 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, + 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0xd5, 0x01, 0x0a, 0x0e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x37, 0x0a, 0x08, + 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, + 0x74, 0x65, 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, + 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x58, 0x0a, 0x14, + 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, + 0x02, 0x22, 0x99, 0x03, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, + 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, + 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x71, 0x0a, 0x11, 0x69, 0x64, + 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, + 0x22, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, + 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x3a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, + 0x4e, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x52, 0x10, 0x69, 0x64, 0x65, + 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x37, 0x0a, + 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x23, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, + 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x50, 0x0a, 0x10, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, + 0x4e, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, + 0x0f, 0x4e, 0x4f, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x45, 0x46, 0x46, 0x45, 0x43, 0x54, 0x53, + 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, 0x4e, 0x54, + 0x10, 0x02, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x9a, 0x03, + 0x0a, 0x13, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, + 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, + 0x72, 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, + 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x10, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, + 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6e, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x21, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x4a, + 0x0a, 0x08, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, 0x08, 0x6e, + 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x02, 0x28, 0x08, 0x52, 0x0b, 0x69, + 0x73, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xfc, 0x09, 0x0a, 0x0a, 0x46, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x12, 0x8b, 0x01, 0x0a, 0x0e, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x39, 0x88, + 0x01, 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, 0x58, 0x50, + 0x4c, 0x49, 0x43, 0x49, 0x54, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x49, 0x4d, 0x50, + 0x4c, 0x49, 0x43, 0x49, 0x54, 0x18, 0xe7, 0x07, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, 0x58, 0x50, + 0x4c, 0x49, 0x43, 0x49, 0x54, 0x18, 0xe8, 0x07, 0x52, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x50, + 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x66, 0x0a, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, + 0x42, 0x23, 0x88, 0x01, 0x01, 0x98, 0x01, 0x06, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x0b, 0x12, 0x06, + 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x09, 0x12, 0x04, 0x4f, 0x50, + 0x45, 0x4e, 0x18, 0xe7, 0x07, 0x52, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x92, 0x01, 0x0a, 0x17, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x52, + 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x63, 0x6f, + 0x64, 0x69, 0x6e, 0x67, 0x42, 0x27, 0x88, 0x01, 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, + 0x01, 0x0d, 0x12, 0x08, 0x45, 0x58, 0x50, 0x41, 0x4e, 0x44, 0x45, 0x44, 0x18, 0xe6, 0x07, 0xa2, + 0x01, 0x0b, 0x12, 0x06, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x44, 0x18, 0xe7, 0x07, 0x52, 0x15, 0x72, + 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x63, 0x6f, + 0x64, 0x69, 0x6e, 0x67, 0x12, 0x78, 0x0a, 0x0f, 0x75, 0x74, 0x66, 0x38, 0x5f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x55, 0x74, 0x66, 0x38, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x23, 0x88, 0x01, 0x01, 0x98, 0x01, + 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x09, 0x12, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x18, 0xe6, 0x07, + 0xa2, 0x01, 0x0b, 0x12, 0x06, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x18, 0xe7, 0x07, 0x52, 0x0e, + 0x75, 0x74, 0x66, 0x38, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x78, + 0x0a, 0x10, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, + 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, + 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x20, 0x88, 0x01, 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, + 0xa2, 0x01, 0x14, 0x12, 0x0f, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x5f, 0x50, 0x52, 0x45, 0x46, + 0x49, 0x58, 0x45, 0x44, 0x18, 0xe6, 0x07, 0x52, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x7c, 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, + 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, - 0x12, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6e, - 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, - 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x6f, 0x75, - 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, - 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x27, 0x0a, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x4a, 0x0a, 0x08, 0x4e, 0x61, 0x6d, 0x65, - 0x50, 0x61, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x70, 0x61, 0x72, - 0x74, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, - 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x02, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa7, 0x02, 0x0a, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, - 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x44, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xce, 0x01, - 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x12, 0x16, 0x0a, 0x04, 0x73, 0x70, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, - 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x73, 0x70, 0x61, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x6c, 0x65, - 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, - 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x10, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, - 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x17, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, - 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xd0, - 0x02, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4d, 0x0a, 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x1a, 0xeb, 0x01, 0x0a, 0x0a, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, - 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, - 0x65, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x62, 0x65, 0x67, 0x69, - 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, - 0x65, 0x6e, 0x64, 0x12, 0x52, 0x0a, 0x08, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x08, 0x73, - 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x22, 0x28, 0x0a, 0x08, 0x53, 0x65, 0x6d, 0x61, 0x6e, - 0x74, 0x69, 0x63, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, - 0x03, 0x53, 0x45, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x49, 0x41, 0x53, 0x10, - 0x02, 0x42, 0x7e, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x10, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x48, 0x01, 0x5a, 0x2d, 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, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2, 0x02, - 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, + 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x46, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x42, 0x33, 0x88, 0x01, 0x01, 0x98, 0x01, 0x03, 0x98, 0x01, 0x06, + 0x98, 0x01, 0x01, 0xa2, 0x01, 0x17, 0x12, 0x12, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x42, + 0x45, 0x53, 0x54, 0x5f, 0x45, 0x46, 0x46, 0x4f, 0x52, 0x54, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x0a, + 0x12, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x18, 0xe7, 0x07, 0x52, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, + 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x5c, 0x0a, 0x0d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, + 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x46, 0x49, 0x45, 0x4c, 0x44, + 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x10, + 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x10, 0x02, 0x12, + 0x13, 0x0a, 0x0f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, + 0x45, 0x44, 0x10, 0x03, 0x22, 0x37, 0x0a, 0x08, 0x45, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x15, 0x0a, 0x11, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, + 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x50, 0x45, 0x4e, 0x10, + 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x10, 0x02, 0x22, 0x56, 0x0a, + 0x15, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, + 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x0a, 0x1f, 0x52, 0x45, 0x50, 0x45, 0x41, 0x54, + 0x45, 0x44, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, + 0x47, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x50, + 0x41, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, 0x41, 0x4e, + 0x44, 0x45, 0x44, 0x10, 0x02, 0x22, 0x43, 0x0a, 0x0e, 0x55, 0x74, 0x66, 0x38, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x55, 0x54, 0x46, 0x38, 0x5f, + 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, + 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0a, + 0x0a, 0x06, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x02, 0x22, 0x53, 0x0a, 0x0f, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, + 0x18, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, + 0x47, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4c, + 0x45, 0x4e, 0x47, 0x54, 0x48, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x45, 0x44, 0x10, 0x01, + 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x10, 0x02, 0x22, + 0x48, 0x0a, 0x0a, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x17, 0x0a, + 0x13, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x10, + 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x42, 0x45, 0x53, 0x54, + 0x5f, 0x45, 0x46, 0x46, 0x4f, 0x52, 0x54, 0x10, 0x02, 0x2a, 0x06, 0x08, 0xe8, 0x07, 0x10, 0xe9, + 0x07, 0x2a, 0x06, 0x08, 0xe9, 0x07, 0x10, 0xea, 0x07, 0x2a, 0x06, 0x08, 0x8b, 0x4e, 0x10, 0x90, + 0x4e, 0x4a, 0x06, 0x08, 0xe7, 0x07, 0x10, 0xe8, 0x07, 0x22, 0xfe, 0x02, 0x0a, 0x12, 0x46, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, + 0x12, 0x58, 0x0a, 0x08, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, + 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x52, 0x08, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x0f, 0x6d, 0x69, + 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x6d, + 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, + 0x0f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0x87, 0x01, 0x0a, 0x18, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x45, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x32, 0x0a, + 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, + 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0xa7, 0x02, 0x0a, 0x0e, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x44, 0x0a, + 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x1a, 0xce, 0x01, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x16, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x42, 0x02, + 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x04, 0x73, 0x70, 0x61, 0x6e, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x73, 0x70, 0x61, 0x6e, + 0x12, 0x29, 0x0a, 0x10, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x65, 0x61, 0x64, + 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x74, + 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x6c, 0x65, 0x61, 0x64, + 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x17, 0x6c, 0x65, 0x61, + 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x22, 0xd0, 0x02, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4d, 0x0a, 0x0a, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xeb, 0x01, 0x0a, 0x0a, 0x41, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x52, 0x0a, 0x08, 0x73, 0x65, 0x6d, + 0x61, 0x6e, 0x74, 0x69, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, + 0x74, 0x69, 0x63, 0x52, 0x08, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x22, 0x28, 0x0a, + 0x08, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, + 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x45, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, + 0x41, 0x4c, 0x49, 0x41, 0x53, 0x10, 0x02, 0x2a, 0xea, 0x01, 0x0a, 0x07, 0x45, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0e, 0x45, 0x44, 0x49, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x32, 0x10, 0xe6, 0x07, 0x12, 0x13, 0x0a, + 0x0e, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x10, + 0xe7, 0x07, 0x12, 0x11, 0x0a, 0x0c, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, + 0x32, 0x33, 0x10, 0xe8, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x31, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x12, 0x17, + 0x0a, 0x13, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x5f, 0x54, 0x45, 0x53, 0x54, + 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x17, 0x45, 0x44, 0x49, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x37, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, + 0x4c, 0x59, 0x10, 0x9d, 0x8d, 0x06, 0x12, 0x1d, 0x0a, 0x17, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x38, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, + 0x59, 0x10, 0x9e, 0x8d, 0x06, 0x12, 0x1d, 0x0a, 0x17, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x39, 0x39, 0x39, 0x39, 0x39, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, + 0x10, 0x9f, 0x8d, 0x06, 0x42, 0x7e, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x10, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x48, 0x01, 0x5a, + 0x2d, 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, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xf8, 0x01, + 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, } var ( @@ -4123,103 +5091,136 @@ func file_google_protobuf_descriptor_proto_rawDescGZIP() []byte { return file_google_protobuf_descriptor_proto_rawDescData } -var file_google_protobuf_descriptor_proto_enumTypes = make([]protoimpl.EnumInfo, 10) -var file_google_protobuf_descriptor_proto_msgTypes = make([]protoimpl.MessageInfo, 28) +var file_google_protobuf_descriptor_proto_enumTypes = make([]protoimpl.EnumInfo, 17) +var file_google_protobuf_descriptor_proto_msgTypes = make([]protoimpl.MessageInfo, 32) var file_google_protobuf_descriptor_proto_goTypes = []interface{}{ - (ExtensionRangeOptions_VerificationState)(0), // 0: google.protobuf.ExtensionRangeOptions.VerificationState - (FieldDescriptorProto_Type)(0), // 1: google.protobuf.FieldDescriptorProto.Type - (FieldDescriptorProto_Label)(0), // 2: google.protobuf.FieldDescriptorProto.Label - (FileOptions_OptimizeMode)(0), // 3: google.protobuf.FileOptions.OptimizeMode - (FieldOptions_CType)(0), // 4: google.protobuf.FieldOptions.CType - (FieldOptions_JSType)(0), // 5: google.protobuf.FieldOptions.JSType - (FieldOptions_OptionRetention)(0), // 6: google.protobuf.FieldOptions.OptionRetention - (FieldOptions_OptionTargetType)(0), // 7: google.protobuf.FieldOptions.OptionTargetType - (MethodOptions_IdempotencyLevel)(0), // 8: google.protobuf.MethodOptions.IdempotencyLevel - (GeneratedCodeInfo_Annotation_Semantic)(0), // 9: google.protobuf.GeneratedCodeInfo.Annotation.Semantic - (*FileDescriptorSet)(nil), // 10: google.protobuf.FileDescriptorSet - (*FileDescriptorProto)(nil), // 11: google.protobuf.FileDescriptorProto - (*DescriptorProto)(nil), // 12: google.protobuf.DescriptorProto - (*ExtensionRangeOptions)(nil), // 13: google.protobuf.ExtensionRangeOptions - (*FieldDescriptorProto)(nil), // 14: google.protobuf.FieldDescriptorProto - (*OneofDescriptorProto)(nil), // 15: google.protobuf.OneofDescriptorProto - (*EnumDescriptorProto)(nil), // 16: google.protobuf.EnumDescriptorProto - (*EnumValueDescriptorProto)(nil), // 17: google.protobuf.EnumValueDescriptorProto - (*ServiceDescriptorProto)(nil), // 18: google.protobuf.ServiceDescriptorProto - (*MethodDescriptorProto)(nil), // 19: google.protobuf.MethodDescriptorProto - (*FileOptions)(nil), // 20: google.protobuf.FileOptions - (*MessageOptions)(nil), // 21: google.protobuf.MessageOptions - (*FieldOptions)(nil), // 22: google.protobuf.FieldOptions - (*OneofOptions)(nil), // 23: google.protobuf.OneofOptions - (*EnumOptions)(nil), // 24: google.protobuf.EnumOptions - (*EnumValueOptions)(nil), // 25: google.protobuf.EnumValueOptions - (*ServiceOptions)(nil), // 26: google.protobuf.ServiceOptions - (*MethodOptions)(nil), // 27: google.protobuf.MethodOptions - (*UninterpretedOption)(nil), // 28: google.protobuf.UninterpretedOption - (*SourceCodeInfo)(nil), // 29: google.protobuf.SourceCodeInfo - (*GeneratedCodeInfo)(nil), // 30: google.protobuf.GeneratedCodeInfo - (*DescriptorProto_ExtensionRange)(nil), // 31: google.protobuf.DescriptorProto.ExtensionRange - (*DescriptorProto_ReservedRange)(nil), // 32: google.protobuf.DescriptorProto.ReservedRange - (*ExtensionRangeOptions_Declaration)(nil), // 33: google.protobuf.ExtensionRangeOptions.Declaration - (*EnumDescriptorProto_EnumReservedRange)(nil), // 34: google.protobuf.EnumDescriptorProto.EnumReservedRange - (*UninterpretedOption_NamePart)(nil), // 35: google.protobuf.UninterpretedOption.NamePart - (*SourceCodeInfo_Location)(nil), // 36: google.protobuf.SourceCodeInfo.Location - (*GeneratedCodeInfo_Annotation)(nil), // 37: google.protobuf.GeneratedCodeInfo.Annotation + (Edition)(0), // 0: google.protobuf.Edition + (ExtensionRangeOptions_VerificationState)(0), // 1: google.protobuf.ExtensionRangeOptions.VerificationState + (FieldDescriptorProto_Type)(0), // 2: google.protobuf.FieldDescriptorProto.Type + (FieldDescriptorProto_Label)(0), // 3: google.protobuf.FieldDescriptorProto.Label + (FileOptions_OptimizeMode)(0), // 4: google.protobuf.FileOptions.OptimizeMode + (FieldOptions_CType)(0), // 5: google.protobuf.FieldOptions.CType + (FieldOptions_JSType)(0), // 6: google.protobuf.FieldOptions.JSType + (FieldOptions_OptionRetention)(0), // 7: google.protobuf.FieldOptions.OptionRetention + (FieldOptions_OptionTargetType)(0), // 8: google.protobuf.FieldOptions.OptionTargetType + (MethodOptions_IdempotencyLevel)(0), // 9: google.protobuf.MethodOptions.IdempotencyLevel + (FeatureSet_FieldPresence)(0), // 10: google.protobuf.FeatureSet.FieldPresence + (FeatureSet_EnumType)(0), // 11: google.protobuf.FeatureSet.EnumType + (FeatureSet_RepeatedFieldEncoding)(0), // 12: google.protobuf.FeatureSet.RepeatedFieldEncoding + (FeatureSet_Utf8Validation)(0), // 13: google.protobuf.FeatureSet.Utf8Validation + (FeatureSet_MessageEncoding)(0), // 14: google.protobuf.FeatureSet.MessageEncoding + (FeatureSet_JsonFormat)(0), // 15: google.protobuf.FeatureSet.JsonFormat + (GeneratedCodeInfo_Annotation_Semantic)(0), // 16: google.protobuf.GeneratedCodeInfo.Annotation.Semantic + (*FileDescriptorSet)(nil), // 17: google.protobuf.FileDescriptorSet + (*FileDescriptorProto)(nil), // 18: google.protobuf.FileDescriptorProto + (*DescriptorProto)(nil), // 19: google.protobuf.DescriptorProto + (*ExtensionRangeOptions)(nil), // 20: google.protobuf.ExtensionRangeOptions + (*FieldDescriptorProto)(nil), // 21: google.protobuf.FieldDescriptorProto + (*OneofDescriptorProto)(nil), // 22: google.protobuf.OneofDescriptorProto + (*EnumDescriptorProto)(nil), // 23: google.protobuf.EnumDescriptorProto + (*EnumValueDescriptorProto)(nil), // 24: google.protobuf.EnumValueDescriptorProto + (*ServiceDescriptorProto)(nil), // 25: google.protobuf.ServiceDescriptorProto + (*MethodDescriptorProto)(nil), // 26: google.protobuf.MethodDescriptorProto + (*FileOptions)(nil), // 27: google.protobuf.FileOptions + (*MessageOptions)(nil), // 28: google.protobuf.MessageOptions + (*FieldOptions)(nil), // 29: google.protobuf.FieldOptions + (*OneofOptions)(nil), // 30: google.protobuf.OneofOptions + (*EnumOptions)(nil), // 31: google.protobuf.EnumOptions + (*EnumValueOptions)(nil), // 32: google.protobuf.EnumValueOptions + (*ServiceOptions)(nil), // 33: google.protobuf.ServiceOptions + (*MethodOptions)(nil), // 34: google.protobuf.MethodOptions + (*UninterpretedOption)(nil), // 35: google.protobuf.UninterpretedOption + (*FeatureSet)(nil), // 36: google.protobuf.FeatureSet + (*FeatureSetDefaults)(nil), // 37: google.protobuf.FeatureSetDefaults + (*SourceCodeInfo)(nil), // 38: google.protobuf.SourceCodeInfo + (*GeneratedCodeInfo)(nil), // 39: google.protobuf.GeneratedCodeInfo + (*DescriptorProto_ExtensionRange)(nil), // 40: google.protobuf.DescriptorProto.ExtensionRange + (*DescriptorProto_ReservedRange)(nil), // 41: google.protobuf.DescriptorProto.ReservedRange + (*ExtensionRangeOptions_Declaration)(nil), // 42: google.protobuf.ExtensionRangeOptions.Declaration + (*EnumDescriptorProto_EnumReservedRange)(nil), // 43: google.protobuf.EnumDescriptorProto.EnumReservedRange + (*FieldOptions_EditionDefault)(nil), // 44: google.protobuf.FieldOptions.EditionDefault + (*UninterpretedOption_NamePart)(nil), // 45: google.protobuf.UninterpretedOption.NamePart + (*FeatureSetDefaults_FeatureSetEditionDefault)(nil), // 46: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + (*SourceCodeInfo_Location)(nil), // 47: google.protobuf.SourceCodeInfo.Location + (*GeneratedCodeInfo_Annotation)(nil), // 48: google.protobuf.GeneratedCodeInfo.Annotation } var file_google_protobuf_descriptor_proto_depIdxs = []int32{ - 11, // 0: google.protobuf.FileDescriptorSet.file:type_name -> google.protobuf.FileDescriptorProto - 12, // 1: google.protobuf.FileDescriptorProto.message_type:type_name -> google.protobuf.DescriptorProto - 16, // 2: google.protobuf.FileDescriptorProto.enum_type:type_name -> google.protobuf.EnumDescriptorProto - 18, // 3: google.protobuf.FileDescriptorProto.service:type_name -> google.protobuf.ServiceDescriptorProto - 14, // 4: google.protobuf.FileDescriptorProto.extension:type_name -> google.protobuf.FieldDescriptorProto - 20, // 5: google.protobuf.FileDescriptorProto.options:type_name -> google.protobuf.FileOptions - 29, // 6: google.protobuf.FileDescriptorProto.source_code_info:type_name -> google.protobuf.SourceCodeInfo - 14, // 7: google.protobuf.DescriptorProto.field:type_name -> google.protobuf.FieldDescriptorProto - 14, // 8: google.protobuf.DescriptorProto.extension:type_name -> google.protobuf.FieldDescriptorProto - 12, // 9: google.protobuf.DescriptorProto.nested_type:type_name -> google.protobuf.DescriptorProto - 16, // 10: google.protobuf.DescriptorProto.enum_type:type_name -> google.protobuf.EnumDescriptorProto - 31, // 11: google.protobuf.DescriptorProto.extension_range:type_name -> google.protobuf.DescriptorProto.ExtensionRange - 15, // 12: google.protobuf.DescriptorProto.oneof_decl:type_name -> google.protobuf.OneofDescriptorProto - 21, // 13: google.protobuf.DescriptorProto.options:type_name -> google.protobuf.MessageOptions - 32, // 14: google.protobuf.DescriptorProto.reserved_range:type_name -> google.protobuf.DescriptorProto.ReservedRange - 28, // 15: google.protobuf.ExtensionRangeOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 33, // 16: google.protobuf.ExtensionRangeOptions.declaration:type_name -> google.protobuf.ExtensionRangeOptions.Declaration - 0, // 17: google.protobuf.ExtensionRangeOptions.verification:type_name -> google.protobuf.ExtensionRangeOptions.VerificationState - 2, // 18: google.protobuf.FieldDescriptorProto.label:type_name -> google.protobuf.FieldDescriptorProto.Label - 1, // 19: google.protobuf.FieldDescriptorProto.type:type_name -> google.protobuf.FieldDescriptorProto.Type - 22, // 20: google.protobuf.FieldDescriptorProto.options:type_name -> google.protobuf.FieldOptions - 23, // 21: google.protobuf.OneofDescriptorProto.options:type_name -> google.protobuf.OneofOptions - 17, // 22: google.protobuf.EnumDescriptorProto.value:type_name -> google.protobuf.EnumValueDescriptorProto - 24, // 23: google.protobuf.EnumDescriptorProto.options:type_name -> google.protobuf.EnumOptions - 34, // 24: google.protobuf.EnumDescriptorProto.reserved_range:type_name -> google.protobuf.EnumDescriptorProto.EnumReservedRange - 25, // 25: google.protobuf.EnumValueDescriptorProto.options:type_name -> google.protobuf.EnumValueOptions - 19, // 26: google.protobuf.ServiceDescriptorProto.method:type_name -> google.protobuf.MethodDescriptorProto - 26, // 27: google.protobuf.ServiceDescriptorProto.options:type_name -> google.protobuf.ServiceOptions - 27, // 28: google.protobuf.MethodDescriptorProto.options:type_name -> google.protobuf.MethodOptions - 3, // 29: google.protobuf.FileOptions.optimize_for:type_name -> google.protobuf.FileOptions.OptimizeMode - 28, // 30: google.protobuf.FileOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 28, // 31: google.protobuf.MessageOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 4, // 32: google.protobuf.FieldOptions.ctype:type_name -> google.protobuf.FieldOptions.CType - 5, // 33: google.protobuf.FieldOptions.jstype:type_name -> google.protobuf.FieldOptions.JSType - 6, // 34: google.protobuf.FieldOptions.retention:type_name -> google.protobuf.FieldOptions.OptionRetention - 7, // 35: google.protobuf.FieldOptions.target:type_name -> google.protobuf.FieldOptions.OptionTargetType - 7, // 36: google.protobuf.FieldOptions.targets:type_name -> google.protobuf.FieldOptions.OptionTargetType - 28, // 37: google.protobuf.FieldOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 28, // 38: google.protobuf.OneofOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 28, // 39: google.protobuf.EnumOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 28, // 40: google.protobuf.EnumValueOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 28, // 41: google.protobuf.ServiceOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 8, // 42: google.protobuf.MethodOptions.idempotency_level:type_name -> google.protobuf.MethodOptions.IdempotencyLevel - 28, // 43: google.protobuf.MethodOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 35, // 44: google.protobuf.UninterpretedOption.name:type_name -> google.protobuf.UninterpretedOption.NamePart - 36, // 45: google.protobuf.SourceCodeInfo.location:type_name -> google.protobuf.SourceCodeInfo.Location - 37, // 46: google.protobuf.GeneratedCodeInfo.annotation:type_name -> google.protobuf.GeneratedCodeInfo.Annotation - 13, // 47: google.protobuf.DescriptorProto.ExtensionRange.options:type_name -> google.protobuf.ExtensionRangeOptions - 9, // 48: google.protobuf.GeneratedCodeInfo.Annotation.semantic:type_name -> google.protobuf.GeneratedCodeInfo.Annotation.Semantic - 49, // [49:49] is the sub-list for method output_type - 49, // [49:49] is the sub-list for method input_type - 49, // [49:49] is the sub-list for extension type_name - 49, // [49:49] is the sub-list for extension extendee - 0, // [0:49] is the sub-list for field type_name + 18, // 0: google.protobuf.FileDescriptorSet.file:type_name -> google.protobuf.FileDescriptorProto + 19, // 1: google.protobuf.FileDescriptorProto.message_type:type_name -> google.protobuf.DescriptorProto + 23, // 2: google.protobuf.FileDescriptorProto.enum_type:type_name -> google.protobuf.EnumDescriptorProto + 25, // 3: google.protobuf.FileDescriptorProto.service:type_name -> google.protobuf.ServiceDescriptorProto + 21, // 4: google.protobuf.FileDescriptorProto.extension:type_name -> google.protobuf.FieldDescriptorProto + 27, // 5: google.protobuf.FileDescriptorProto.options:type_name -> google.protobuf.FileOptions + 38, // 6: google.protobuf.FileDescriptorProto.source_code_info:type_name -> google.protobuf.SourceCodeInfo + 0, // 7: google.protobuf.FileDescriptorProto.edition:type_name -> google.protobuf.Edition + 21, // 8: google.protobuf.DescriptorProto.field:type_name -> google.protobuf.FieldDescriptorProto + 21, // 9: google.protobuf.DescriptorProto.extension:type_name -> google.protobuf.FieldDescriptorProto + 19, // 10: google.protobuf.DescriptorProto.nested_type:type_name -> google.protobuf.DescriptorProto + 23, // 11: google.protobuf.DescriptorProto.enum_type:type_name -> google.protobuf.EnumDescriptorProto + 40, // 12: google.protobuf.DescriptorProto.extension_range:type_name -> google.protobuf.DescriptorProto.ExtensionRange + 22, // 13: google.protobuf.DescriptorProto.oneof_decl:type_name -> google.protobuf.OneofDescriptorProto + 28, // 14: google.protobuf.DescriptorProto.options:type_name -> google.protobuf.MessageOptions + 41, // 15: google.protobuf.DescriptorProto.reserved_range:type_name -> google.protobuf.DescriptorProto.ReservedRange + 35, // 16: google.protobuf.ExtensionRangeOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 42, // 17: google.protobuf.ExtensionRangeOptions.declaration:type_name -> google.protobuf.ExtensionRangeOptions.Declaration + 36, // 18: google.protobuf.ExtensionRangeOptions.features:type_name -> google.protobuf.FeatureSet + 1, // 19: google.protobuf.ExtensionRangeOptions.verification:type_name -> google.protobuf.ExtensionRangeOptions.VerificationState + 3, // 20: google.protobuf.FieldDescriptorProto.label:type_name -> google.protobuf.FieldDescriptorProto.Label + 2, // 21: google.protobuf.FieldDescriptorProto.type:type_name -> google.protobuf.FieldDescriptorProto.Type + 29, // 22: google.protobuf.FieldDescriptorProto.options:type_name -> google.protobuf.FieldOptions + 30, // 23: google.protobuf.OneofDescriptorProto.options:type_name -> google.protobuf.OneofOptions + 24, // 24: google.protobuf.EnumDescriptorProto.value:type_name -> google.protobuf.EnumValueDescriptorProto + 31, // 25: google.protobuf.EnumDescriptorProto.options:type_name -> google.protobuf.EnumOptions + 43, // 26: google.protobuf.EnumDescriptorProto.reserved_range:type_name -> google.protobuf.EnumDescriptorProto.EnumReservedRange + 32, // 27: google.protobuf.EnumValueDescriptorProto.options:type_name -> google.protobuf.EnumValueOptions + 26, // 28: google.protobuf.ServiceDescriptorProto.method:type_name -> google.protobuf.MethodDescriptorProto + 33, // 29: google.protobuf.ServiceDescriptorProto.options:type_name -> google.protobuf.ServiceOptions + 34, // 30: google.protobuf.MethodDescriptorProto.options:type_name -> google.protobuf.MethodOptions + 4, // 31: google.protobuf.FileOptions.optimize_for:type_name -> google.protobuf.FileOptions.OptimizeMode + 36, // 32: google.protobuf.FileOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 33: google.protobuf.FileOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 34: google.protobuf.MessageOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 35: google.protobuf.MessageOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 5, // 36: google.protobuf.FieldOptions.ctype:type_name -> google.protobuf.FieldOptions.CType + 6, // 37: google.protobuf.FieldOptions.jstype:type_name -> google.protobuf.FieldOptions.JSType + 7, // 38: google.protobuf.FieldOptions.retention:type_name -> google.protobuf.FieldOptions.OptionRetention + 8, // 39: google.protobuf.FieldOptions.targets:type_name -> google.protobuf.FieldOptions.OptionTargetType + 44, // 40: google.protobuf.FieldOptions.edition_defaults:type_name -> google.protobuf.FieldOptions.EditionDefault + 36, // 41: google.protobuf.FieldOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 42: google.protobuf.FieldOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 43: google.protobuf.OneofOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 44: google.protobuf.OneofOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 45: google.protobuf.EnumOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 46: google.protobuf.EnumOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 47: google.protobuf.EnumValueOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 48: google.protobuf.EnumValueOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 49: google.protobuf.ServiceOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 50: google.protobuf.ServiceOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 9, // 51: google.protobuf.MethodOptions.idempotency_level:type_name -> google.protobuf.MethodOptions.IdempotencyLevel + 36, // 52: google.protobuf.MethodOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 53: google.protobuf.MethodOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 45, // 54: google.protobuf.UninterpretedOption.name:type_name -> google.protobuf.UninterpretedOption.NamePart + 10, // 55: google.protobuf.FeatureSet.field_presence:type_name -> google.protobuf.FeatureSet.FieldPresence + 11, // 56: google.protobuf.FeatureSet.enum_type:type_name -> google.protobuf.FeatureSet.EnumType + 12, // 57: google.protobuf.FeatureSet.repeated_field_encoding:type_name -> google.protobuf.FeatureSet.RepeatedFieldEncoding + 13, // 58: google.protobuf.FeatureSet.utf8_validation:type_name -> google.protobuf.FeatureSet.Utf8Validation + 14, // 59: google.protobuf.FeatureSet.message_encoding:type_name -> google.protobuf.FeatureSet.MessageEncoding + 15, // 60: google.protobuf.FeatureSet.json_format:type_name -> google.protobuf.FeatureSet.JsonFormat + 46, // 61: google.protobuf.FeatureSetDefaults.defaults:type_name -> google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + 0, // 62: google.protobuf.FeatureSetDefaults.minimum_edition:type_name -> google.protobuf.Edition + 0, // 63: google.protobuf.FeatureSetDefaults.maximum_edition:type_name -> google.protobuf.Edition + 47, // 64: google.protobuf.SourceCodeInfo.location:type_name -> google.protobuf.SourceCodeInfo.Location + 48, // 65: google.protobuf.GeneratedCodeInfo.annotation:type_name -> google.protobuf.GeneratedCodeInfo.Annotation + 20, // 66: google.protobuf.DescriptorProto.ExtensionRange.options:type_name -> google.protobuf.ExtensionRangeOptions + 0, // 67: google.protobuf.FieldOptions.EditionDefault.edition:type_name -> google.protobuf.Edition + 0, // 68: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition:type_name -> google.protobuf.Edition + 36, // 69: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features:type_name -> google.protobuf.FeatureSet + 16, // 70: google.protobuf.GeneratedCodeInfo.Annotation.semantic:type_name -> google.protobuf.GeneratedCodeInfo.Annotation.Semantic + 71, // [71:71] is the sub-list for method output_type + 71, // [71:71] is the sub-list for method input_type + 71, // [71:71] is the sub-list for extension type_name + 71, // [71:71] is the sub-list for extension extendee + 0, // [0:71] is the sub-list for field type_name } func init() { file_google_protobuf_descriptor_proto_init() } @@ -4475,19 +5476,21 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SourceCodeInfo); i { + switch v := v.(*FeatureSet); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields + case 3: + return &v.extensionFields default: return nil } } file_google_protobuf_descriptor_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GeneratedCodeInfo); i { + switch v := v.(*FeatureSetDefaults); i { case 0: return &v.state case 1: @@ -4499,7 +5502,7 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DescriptorProto_ExtensionRange); i { + switch v := v.(*SourceCodeInfo); i { case 0: return &v.state case 1: @@ -4511,7 +5514,7 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DescriptorProto_ReservedRange); i { + switch v := v.(*GeneratedCodeInfo); i { case 0: return &v.state case 1: @@ -4523,7 +5526,7 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExtensionRangeOptions_Declaration); i { + switch v := v.(*DescriptorProto_ExtensionRange); i { case 0: return &v.state case 1: @@ -4535,7 +5538,7 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EnumDescriptorProto_EnumReservedRange); i { + switch v := v.(*DescriptorProto_ReservedRange); i { case 0: return &v.state case 1: @@ -4547,7 +5550,7 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UninterpretedOption_NamePart); i { + switch v := v.(*ExtensionRangeOptions_Declaration); i { case 0: return &v.state case 1: @@ -4559,7 +5562,7 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SourceCodeInfo_Location); i { + switch v := v.(*EnumDescriptorProto_EnumReservedRange); i { case 0: return &v.state case 1: @@ -4571,6 +5574,54 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FieldOptions_EditionDefault); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_descriptor_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UninterpretedOption_NamePart); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_descriptor_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FeatureSetDefaults_FeatureSetEditionDefault); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_descriptor_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SourceCodeInfo_Location); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_descriptor_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GeneratedCodeInfo_Annotation); i { case 0: return &v.state @@ -4588,8 +5639,8 @@ func file_google_protobuf_descriptor_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_protobuf_descriptor_proto_rawDesc, - NumEnums: 10, - NumMessages: 28, + NumEnums: 17, + NumMessages: 32, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/google.golang.org/protobuf/types/dynamicpb/dynamic.go b/vendor/google.golang.org/protobuf/types/dynamicpb/dynamic.go index f77ef0de153e..54ae1ab87d85 100644 --- a/vendor/google.golang.org/protobuf/types/dynamicpb/dynamic.go +++ b/vendor/google.golang.org/protobuf/types/dynamicpb/dynamic.go @@ -49,12 +49,13 @@ type extensionType struct { // A Message is a dynamically constructed protocol buffer message. // -// Message implements the proto.Message interface, and may be used with all -// standard proto package functions such as Marshal, Unmarshal, and so forth. +// Message implements the [google.golang.org/protobuf/proto.Message] interface, +// and may be used with all standard proto package functions +// such as Marshal, Unmarshal, and so forth. // -// Message also implements the protoreflect.Message interface. See the protoreflect -// package documentation for that interface for how to get and set fields and -// otherwise interact with the contents of a Message. +// Message also implements the [protoreflect.Message] interface. +// See the [protoreflect] package documentation for that interface for how to +// get and set fields and otherwise interact with the contents of a Message. // // Reflection API functions which construct messages, such as NewField, // return new dynamic messages of the appropriate type. Functions which take @@ -87,7 +88,7 @@ func NewMessage(desc protoreflect.MessageDescriptor) *Message { // ProtoMessage implements the legacy message interface. func (m *Message) ProtoMessage() {} -// ProtoReflect implements the protoreflect.ProtoMessage interface. +// ProtoReflect implements the [protoreflect.ProtoMessage] interface. func (m *Message) ProtoReflect() protoreflect.Message { return m } @@ -115,25 +116,25 @@ func (m *Message) Type() protoreflect.MessageType { } // New returns a newly allocated empty message with the same descriptor. -// See protoreflect.Message for details. +// See [protoreflect.Message] for details. func (m *Message) New() protoreflect.Message { return m.Type().New() } // Interface returns the message. -// See protoreflect.Message for details. +// See [protoreflect.Message] for details. func (m *Message) Interface() protoreflect.ProtoMessage { return m } -// ProtoMethods is an internal detail of the protoreflect.Message interface. +// ProtoMethods is an internal detail of the [protoreflect.Message] interface. // Users should never call this directly. func (m *Message) ProtoMethods() *protoiface.Methods { return nil } // Range visits every populated field in undefined order. -// See protoreflect.Message for details. +// See [protoreflect.Message] for details. func (m *Message) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { for num, v := range m.known { fd := m.ext[num] @@ -150,7 +151,7 @@ func (m *Message) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) } // Has reports whether a field is populated. -// See protoreflect.Message for details. +// See [protoreflect.Message] for details. func (m *Message) Has(fd protoreflect.FieldDescriptor) bool { m.checkField(fd) if fd.IsExtension() && m.ext[fd.Number()] != fd { @@ -164,7 +165,7 @@ func (m *Message) Has(fd protoreflect.FieldDescriptor) bool { } // Clear clears a field. -// See protoreflect.Message for details. +// See [protoreflect.Message] for details. func (m *Message) Clear(fd protoreflect.FieldDescriptor) { m.checkField(fd) num := fd.Number() @@ -173,7 +174,7 @@ func (m *Message) Clear(fd protoreflect.FieldDescriptor) { } // Get returns the value of a field. -// See protoreflect.Message for details. +// See [protoreflect.Message] for details. func (m *Message) Get(fd protoreflect.FieldDescriptor) protoreflect.Value { m.checkField(fd) num := fd.Number() @@ -212,7 +213,7 @@ func (m *Message) Get(fd protoreflect.FieldDescriptor) protoreflect.Value { } // Mutable returns a mutable reference to a repeated, map, or message field. -// See protoreflect.Message for details. +// See [protoreflect.Message] for details. func (m *Message) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { m.checkField(fd) if !fd.IsMap() && !fd.IsList() && fd.Message() == nil { @@ -241,7 +242,7 @@ func (m *Message) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { } // Set stores a value in a field. -// See protoreflect.Message for details. +// See [protoreflect.Message] for details. func (m *Message) Set(fd protoreflect.FieldDescriptor, v protoreflect.Value) { m.checkField(fd) if m.known == nil { @@ -284,7 +285,7 @@ func (m *Message) clearOtherOneofFields(fd protoreflect.FieldDescriptor) { } // NewField returns a new value for assignable to the field of a given descriptor. -// See protoreflect.Message for details. +// See [protoreflect.Message] for details. func (m *Message) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { m.checkField(fd) switch { @@ -305,7 +306,7 @@ func (m *Message) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { } // WhichOneof reports which field in a oneof is populated, returning nil if none are populated. -// See protoreflect.Message for details. +// See [protoreflect.Message] for details. func (m *Message) WhichOneof(od protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { for i := 0; i < od.Fields().Len(); i++ { fd := od.Fields().Get(i) @@ -317,13 +318,13 @@ func (m *Message) WhichOneof(od protoreflect.OneofDescriptor) protoreflect.Field } // GetUnknown returns the raw unknown fields. -// See protoreflect.Message for details. +// See [protoreflect.Message] for details. func (m *Message) GetUnknown() protoreflect.RawFields { return m.unknown } // SetUnknown sets the raw unknown fields. -// See protoreflect.Message for details. +// See [protoreflect.Message] for details. func (m *Message) SetUnknown(r protoreflect.RawFields) { if m.known == nil { panic(errors.New("%v: modification of read-only message", m.typ.desc.FullName())) @@ -332,7 +333,7 @@ func (m *Message) SetUnknown(r protoreflect.RawFields) { } // IsValid reports whether the message is valid. -// See protoreflect.Message for details. +// See [protoreflect.Message] for details. func (m *Message) IsValid() bool { return m.known != nil } diff --git a/vendor/google.golang.org/protobuf/types/dynamicpb/types.go b/vendor/google.golang.org/protobuf/types/dynamicpb/types.go index 5a8010f18faf..c432817bb9c7 100644 --- a/vendor/google.golang.org/protobuf/types/dynamicpb/types.go +++ b/vendor/google.golang.org/protobuf/types/dynamicpb/types.go @@ -23,13 +23,20 @@ type extField struct { // A Types is a collection of dynamically constructed descriptors. // Its methods are safe for concurrent use. // -// Types implements protoregistry.MessageTypeResolver and protoregistry.ExtensionTypeResolver. -// A Types may be used as a proto.UnmarshalOptions.Resolver. +// Types implements [protoregistry.MessageTypeResolver] and [protoregistry.ExtensionTypeResolver]. +// A Types may be used as a [google.golang.org/protobuf/proto.UnmarshalOptions.Resolver]. type Types struct { + // atomicExtFiles is used with sync/atomic and hence must be the first word + // of the struct to guarantee 64-bit alignment. + // + // TODO(stapelberg): once we only support Go 1.19 and newer, switch this + // field to be of type atomic.Uint64 to guarantee alignment on + // stack-allocated values, too. + atomicExtFiles uint64 + extMu sync.Mutex + files *protoregistry.Files - extMu sync.Mutex - atomicExtFiles uint64 extensionsByMessage map[extField]protoreflect.ExtensionDescriptor } @@ -45,7 +52,7 @@ func NewTypes(f *protoregistry.Files) *Types { // FindEnumByName looks up an enum by its full name; // e.g., "google.protobuf.Field.Kind". // -// This returns (nil, protoregistry.NotFound) if not found. +// This returns (nil, [protoregistry.NotFound]) if not found. func (t *Types) FindEnumByName(name protoreflect.FullName) (protoreflect.EnumType, error) { d, err := t.files.FindDescriptorByName(name) if err != nil { @@ -63,7 +70,7 @@ func (t *Types) FindEnumByName(name protoreflect.FullName) (protoreflect.EnumTyp // where the extension is declared and is unrelated to the full name of the // message being extended. // -// This returns (nil, protoregistry.NotFound) if not found. +// This returns (nil, [protoregistry.NotFound]) if not found. func (t *Types) FindExtensionByName(name protoreflect.FullName) (protoreflect.ExtensionType, error) { d, err := t.files.FindDescriptorByName(name) if err != nil { @@ -79,7 +86,7 @@ func (t *Types) FindExtensionByName(name protoreflect.FullName) (protoreflect.Ex // FindExtensionByNumber looks up an extension field by the field number // within some parent message, identified by full name. // -// This returns (nil, protoregistry.NotFound) if not found. +// This returns (nil, [protoregistry.NotFound]) if not found. func (t *Types) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { // Construct the extension number map lazily, since not every user will need it. // Update the map if new files are added to the registry. @@ -96,7 +103,7 @@ func (t *Types) FindExtensionByNumber(message protoreflect.FullName, field proto // FindMessageByName looks up a message by its full name; // e.g. "google.protobuf.Any". // -// This returns (nil, protoregistry.NotFound) if not found. +// This returns (nil, [protoregistry.NotFound]) if not found. func (t *Types) FindMessageByName(name protoreflect.FullName) (protoreflect.MessageType, error) { d, err := t.files.FindDescriptorByName(name) if err != nil { @@ -112,7 +119,7 @@ func (t *Types) FindMessageByName(name protoreflect.FullName) (protoreflect.Mess // FindMessageByURL looks up a message by a URL identifier. // See documentation on google.protobuf.Any.type_url for the URL format. // -// This returns (nil, protoregistry.NotFound) if not found. +// This returns (nil, [protoregistry.NotFound]) if not found. func (t *Types) FindMessageByURL(url string) (protoreflect.MessageType, error) { // This function is similar to FindMessageByName but // truncates anything before and including '/' in the URL. diff --git a/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go b/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go index 580b232f477a..9de51be54032 100644 --- a/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go @@ -237,7 +237,8 @@ type Any struct { // // Note: this functionality is not currently available in the official // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. + // type.googleapis.com. As of May 2023, there are no widely used type server + // implementations and no plans to implement one. // // Schemes other than `http`, `https` (or the empty scheme) might be // used with implementation specific semantics. diff --git a/vendor/google.golang.org/protobuf/types/pluginpb/plugin.pb.go b/vendor/google.golang.org/protobuf/types/pluginpb/plugin.pb.go index d0bb96a9d218..69892f41bd19 100644 --- a/vendor/google.golang.org/protobuf/types/pluginpb/plugin.pb.go +++ b/vendor/google.golang.org/protobuf/types/pluginpb/plugin.pb.go @@ -1,32 +1,9 @@ // 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. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd // Author: kenton@google.com (Kenton Varda) // @@ -58,8 +35,9 @@ import ( type CodeGeneratorResponse_Feature int32 const ( - CodeGeneratorResponse_FEATURE_NONE CodeGeneratorResponse_Feature = 0 - CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL CodeGeneratorResponse_Feature = 1 + CodeGeneratorResponse_FEATURE_NONE CodeGeneratorResponse_Feature = 0 + CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL CodeGeneratorResponse_Feature = 1 + CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS CodeGeneratorResponse_Feature = 2 ) // Enum value maps for CodeGeneratorResponse_Feature. @@ -67,10 +45,12 @@ var ( CodeGeneratorResponse_Feature_name = map[int32]string{ 0: "FEATURE_NONE", 1: "FEATURE_PROTO3_OPTIONAL", + 2: "FEATURE_SUPPORTS_EDITIONS", } CodeGeneratorResponse_Feature_value = map[string]int32{ - "FEATURE_NONE": 0, - "FEATURE_PROTO3_OPTIONAL": 1, + "FEATURE_NONE": 0, + "FEATURE_PROTO3_OPTIONAL": 1, + "FEATURE_SUPPORTS_EDITIONS": 2, } ) @@ -201,6 +181,11 @@ type CodeGeneratorRequest struct { // they import. The files will appear in topological order, so each file // appears before any file that imports it. // + // Note: the files listed in files_to_generate will include runtime-retention + // options only, but all other files will include source-retention options. + // The source_file_descriptors field below is available in case you need + // source-retention options for files_to_generate. + // // protoc guarantees that all proto_files will be written after // the fields above, even though this is not technically guaranteed by the // protobuf wire format. This theoretically could allow a plugin to stream @@ -212,6 +197,10 @@ type CodeGeneratorRequest struct { // Type names of fields and extensions in the FileDescriptorProto are always // fully qualified. ProtoFile []*descriptorpb.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file,json=protoFile" json:"proto_file,omitempty"` + // File descriptors with all options, including source-retention options. + // These descriptors are only provided for the files listed in + // files_to_generate. + SourceFileDescriptors []*descriptorpb.FileDescriptorProto `protobuf:"bytes,17,rep,name=source_file_descriptors,json=sourceFileDescriptors" json:"source_file_descriptors,omitempty"` // The version number of protocol compiler. CompilerVersion *Version `protobuf:"bytes,3,opt,name=compiler_version,json=compilerVersion" json:"compiler_version,omitempty"` } @@ -269,6 +258,13 @@ func (x *CodeGeneratorRequest) GetProtoFile() []*descriptorpb.FileDescriptorProt return nil } +func (x *CodeGeneratorRequest) GetSourceFileDescriptors() []*descriptorpb.FileDescriptorProto { + if x != nil { + return x.SourceFileDescriptors + } + return nil +} + func (x *CodeGeneratorRequest) GetCompilerVersion() *Version { if x != nil { return x.CompilerVersion @@ -493,7 +489,7 @@ var file_google_protobuf_compiler_plugin_proto_rawDesc = []byte{ 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x22, 0xf1, 0x01, 0x0a, 0x14, 0x43, 0x6f, 0x64, + 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x22, 0xcf, 0x02, 0x0a, 0x14, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x66, 0x69, 0x6c, @@ -503,45 +499,53 @@ var file_google_protobuf_compiler_plugin_proto_rawDesc = []byte{ 0x74, 0x6f, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x4c, - 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x69, - 0x6c, 0x65, 0x72, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x63, 0x6f, 0x6d, - 0x70, 0x69, 0x6c, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x94, 0x03, 0x0a, - 0x15, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2d, 0x0a, 0x12, - 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x64, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x04, 0x66, - 0x69, 0x6c, 0x65, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, - 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, - 0x04, 0x66, 0x69, 0x6c, 0x65, 0x1a, 0xb1, 0x01, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x73, - 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x52, 0x0a, 0x13, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x10, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, - 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x38, 0x0a, 0x07, 0x46, 0x65, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, - 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, - 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, - 0x4c, 0x10, 0x01, 0x42, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x69, - 0x6c, 0x65, 0x72, 0x42, 0x0c, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x73, 0x5a, 0x29, 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, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x70, 0x62, 0xaa, 0x02, 0x18, 0x47, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x43, - 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, + 0x6f, 0x74, 0x6f, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x5c, + 0x0a, 0x17, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x15, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, + 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x10, + 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, + 0x72, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x69, + 0x6c, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xb3, 0x03, 0x0a, 0x15, 0x43, + 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2d, 0x0a, 0x12, 0x73, 0x75, + 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, + 0x64, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x04, 0x66, 0x69, 0x6c, + 0x65, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, + 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x04, 0x66, + 0x69, 0x6c, 0x65, 0x1a, 0xb1, 0x01, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x6e, 0x73, 0x65, 0x72, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x12, 0x52, 0x0a, 0x13, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, + 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x57, 0x0a, 0x07, 0x46, 0x65, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x4e, 0x4f, + 0x4e, 0x45, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, + 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x10, + 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x53, 0x55, 0x50, + 0x50, 0x4f, 0x52, 0x54, 0x53, 0x5f, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x10, 0x02, + 0x42, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, + 0x42, 0x0c, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x5a, 0x29, + 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, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x70, 0x62, 0xaa, 0x02, 0x18, 0x47, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x43, 0x6f, 0x6d, 0x70, + 0x69, 0x6c, 0x65, 0x72, } var ( @@ -569,14 +573,15 @@ var file_google_protobuf_compiler_plugin_proto_goTypes = []interface{}{ } var file_google_protobuf_compiler_plugin_proto_depIdxs = []int32{ 5, // 0: google.protobuf.compiler.CodeGeneratorRequest.proto_file:type_name -> google.protobuf.FileDescriptorProto - 1, // 1: google.protobuf.compiler.CodeGeneratorRequest.compiler_version:type_name -> google.protobuf.compiler.Version - 4, // 2: google.protobuf.compiler.CodeGeneratorResponse.file:type_name -> google.protobuf.compiler.CodeGeneratorResponse.File - 6, // 3: google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info:type_name -> google.protobuf.GeneratedCodeInfo - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 5, // 1: google.protobuf.compiler.CodeGeneratorRequest.source_file_descriptors:type_name -> google.protobuf.FileDescriptorProto + 1, // 2: google.protobuf.compiler.CodeGeneratorRequest.compiler_version:type_name -> google.protobuf.compiler.Version + 4, // 3: google.protobuf.compiler.CodeGeneratorResponse.file:type_name -> google.protobuf.compiler.CodeGeneratorResponse.File + 6, // 4: google.protobuf.compiler.CodeGeneratorResponse.File.generated_code_info:type_name -> google.protobuf.GeneratedCodeInfo + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_google_protobuf_compiler_plugin_proto_init() } diff --git a/vendor/modules.txt b/vendor/modules.txt index 61df26d466db..982e4d96d0d4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -25,8 +25,8 @@ github.com/andybalholm/cascadia # github.com/beorn7/perks v1.0.1 ## explicit; go 1.11 github.com/beorn7/perks/quantile -# github.com/bufbuild/protocompile v0.6.0 -## explicit; go 1.18 +# github.com/bufbuild/protocompile v0.7.1 +## explicit; go 1.19 github.com/bufbuild/protocompile github.com/bufbuild/protocompile/ast github.com/bufbuild/protocompile/internal @@ -200,7 +200,7 @@ github.com/inconshreveable/mousetrap github.com/influxdata/influxdb1-client/models github.com/influxdata/influxdb1-client/pkg/escape github.com/influxdata/influxdb1-client/v2 -# github.com/jhump/protoreflect v1.15.3 +# github.com/jhump/protoreflect v1.15.4 ## explicit; go 1.18 github.com/jhump/protoreflect/desc github.com/jhump/protoreflect/desc/internal @@ -393,8 +393,8 @@ golang.org/x/net/internal/socks golang.org/x/net/internal/timeseries golang.org/x/net/proxy golang.org/x/net/trace -# golang.org/x/sync v0.4.0 -## explicit; go 1.17 +# golang.org/x/sync v0.5.0 +## explicit; go 1.18 golang.org/x/sync/semaphore # golang.org/x/sys v0.15.0 ## explicit; go 1.18 @@ -489,7 +489,7 @@ google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap google.golang.org/grpc/test/bufconn -# google.golang.org/protobuf v1.31.0 +# google.golang.org/protobuf v1.31.1-0.20231027082548-f4a6c1f6e5c1 ## explicit; go 1.11 google.golang.org/protobuf/encoding/protojson google.golang.org/protobuf/encoding/prototext