types: consistently name generated protos

Rename each generated protobuf package such that the base of the
Go package path is always equal to the Go package name to follow
proper Go package naming conventions.

The Go package name is derived from the .proto source file name by
replacing ".proto" with "pb" and stripping all underscores.

Change-Id: Iea05d1b5d94b1b2821ae10276ab771bb2df93c0e
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/177380
Reviewed-by: Damien Neil <dneil@google.com>
This commit is contained in:
Joe Tsai 2019-05-16 12:47:20 -07:00
parent 11caeff126
commit a95b29fbf6
41 changed files with 1152 additions and 931 deletions

View File

@ -12,7 +12,7 @@ import (
"google.golang.org/protobuf/compiler/protogen"
descriptorpb "google.golang.org/protobuf/types/descriptor"
"google.golang.org/protobuf/types/descriptorpb"
)
const (

View File

@ -13,7 +13,7 @@ import (
"google.golang.org/protobuf/internal/fieldnum"
"google.golang.org/protobuf/internal/scalar"
descriptorpb "google.golang.org/protobuf/types/descriptor"
"google.golang.org/protobuf/types/descriptorpb"
)
func TestAnnotations(t *testing.T) {

View File

@ -21,7 +21,7 @@ import (
"google.golang.org/protobuf/internal/fieldnum"
"google.golang.org/protobuf/reflect/protoreflect"
descriptorpb "google.golang.org/protobuf/types/descriptor"
"google.golang.org/protobuf/types/descriptorpb"
)
// minimumVersion is minimum version of the v2 proto package that is required.

View File

@ -14,7 +14,7 @@ import (
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
descriptorpb "google.golang.org/protobuf/types/descriptor"
"google.golang.org/protobuf/types/descriptorpb"
)
// TODO: Add support for proto options.

View File

@ -8,7 +8,7 @@ import (
protoregistry "google.golang.org/protobuf/reflect/protoregistry"
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
descriptor "google.golang.org/protobuf/types/descriptor"
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
sync "sync"
)
@ -83,7 +83,7 @@ func (*Message) Descriptor() ([]byte, []int) {
var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*bool)(nil),
Field: 1001,
Name: "goproto.protoc.extension.proto3.extension_bool",
@ -91,7 +91,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*Enum)(nil),
Field: 1002,
Name: "goproto.protoc.extension.proto3.extension_enum",
@ -99,7 +99,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*int32)(nil),
Field: 1003,
Name: "goproto.protoc.extension.proto3.extension_int32",
@ -107,7 +107,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*int32)(nil),
Field: 1004,
Name: "goproto.protoc.extension.proto3.extension_sint32",
@ -115,7 +115,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*uint32)(nil),
Field: 1005,
Name: "goproto.protoc.extension.proto3.extension_uint32",
@ -123,7 +123,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*int64)(nil),
Field: 1006,
Name: "goproto.protoc.extension.proto3.extension_int64",
@ -131,7 +131,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*int64)(nil),
Field: 1007,
Name: "goproto.protoc.extension.proto3.extension_sint64",
@ -139,7 +139,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*uint64)(nil),
Field: 1008,
Name: "goproto.protoc.extension.proto3.extension_uint64",
@ -147,7 +147,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*int32)(nil),
Field: 1009,
Name: "goproto.protoc.extension.proto3.extension_sfixed32",
@ -155,7 +155,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*uint32)(nil),
Field: 1010,
Name: "goproto.protoc.extension.proto3.extension_fixed32",
@ -163,7 +163,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*float32)(nil),
Field: 1011,
Name: "goproto.protoc.extension.proto3.extension_float",
@ -171,7 +171,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*int64)(nil),
Field: 1012,
Name: "goproto.protoc.extension.proto3.extension_sfixed64",
@ -179,7 +179,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*uint64)(nil),
Field: 1013,
Name: "goproto.protoc.extension.proto3.extension_fixed64",
@ -187,7 +187,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*float64)(nil),
Field: 1014,
Name: "goproto.protoc.extension.proto3.extension_double",
@ -195,7 +195,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*string)(nil),
Field: 1015,
Name: "goproto.protoc.extension.proto3.extension_string",
@ -203,7 +203,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]byte)(nil),
Field: 1016,
Name: "goproto.protoc.extension.proto3.extension_bytes",
@ -211,7 +211,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: (*Message)(nil),
Field: 1017,
Name: "goproto.protoc.extension.proto3.extension_Message",
@ -219,7 +219,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]bool)(nil),
Field: 2001,
Name: "goproto.protoc.extension.proto3.repeated_extension_bool",
@ -227,7 +227,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]Enum)(nil),
Field: 2002,
Name: "goproto.protoc.extension.proto3.repeated_extension_enum",
@ -235,7 +235,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]int32)(nil),
Field: 2003,
Name: "goproto.protoc.extension.proto3.repeated_extension_int32",
@ -243,7 +243,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]int32)(nil),
Field: 2004,
Name: "goproto.protoc.extension.proto3.repeated_extension_sint32",
@ -251,7 +251,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]uint32)(nil),
Field: 2005,
Name: "goproto.protoc.extension.proto3.repeated_extension_uint32",
@ -259,7 +259,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]int64)(nil),
Field: 2006,
Name: "goproto.protoc.extension.proto3.repeated_extension_int64",
@ -267,7 +267,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]int64)(nil),
Field: 2007,
Name: "goproto.protoc.extension.proto3.repeated_extension_sint64",
@ -275,7 +275,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]uint64)(nil),
Field: 2008,
Name: "goproto.protoc.extension.proto3.repeated_extension_uint64",
@ -283,7 +283,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]int32)(nil),
Field: 2009,
Name: "goproto.protoc.extension.proto3.repeated_extension_sfixed32",
@ -291,7 +291,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]uint32)(nil),
Field: 2010,
Name: "goproto.protoc.extension.proto3.repeated_extension_fixed32",
@ -299,7 +299,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]float32)(nil),
Field: 2011,
Name: "goproto.protoc.extension.proto3.repeated_extension_float",
@ -307,7 +307,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]int64)(nil),
Field: 2012,
Name: "goproto.protoc.extension.proto3.repeated_extension_sfixed64",
@ -315,7 +315,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]uint64)(nil),
Field: 2013,
Name: "goproto.protoc.extension.proto3.repeated_extension_fixed64",
@ -323,7 +323,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]float64)(nil),
Field: 2014,
Name: "goproto.protoc.extension.proto3.repeated_extension_double",
@ -331,7 +331,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]string)(nil),
Field: 2015,
Name: "goproto.protoc.extension.proto3.repeated_extension_string",
@ -339,7 +339,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([][]byte)(nil),
Field: 2016,
Name: "goproto.protoc.extension.proto3.repeated_extension_bytes",
@ -347,7 +347,7 @@ var file_extensions_proto3_ext3_proto_extDescs = []protoiface.ExtensionDescV1{
Filename: "extensions/proto3/ext3.proto",
},
{
ExtendedType: (*descriptor.MessageOptions)(nil),
ExtendedType: (*descriptorpb.MessageOptions)(nil),
ExtensionType: ([]*Message)(nil),
Field: 2017,
Name: "goproto.protoc.extension.proto3.repeated_extension_Message",
@ -683,9 +683,9 @@ func file_extensions_proto3_ext3_proto_rawDescGZIP() []byte {
var file_extensions_proto3_ext3_proto_enumTypes = make([]protoreflect.EnumType, 1)
var file_extensions_proto3_ext3_proto_msgTypes = make([]protoimpl.MessageType, 1)
var file_extensions_proto3_ext3_proto_goTypes = []interface{}{
(Enum)(0), // 0: goproto.protoc.extension.proto3.Enum
(*Message)(nil), // 1: goproto.protoc.extension.proto3.Message
(*descriptor.MessageOptions)(nil), // 2: google.protobuf.MessageOptions
(Enum)(0), // 0: goproto.protoc.extension.proto3.Enum
(*Message)(nil), // 1: goproto.protoc.extension.proto3.Message
(*descriptorpb.MessageOptions)(nil), // 2: google.protobuf.MessageOptions
}
var file_extensions_proto3_ext3_proto_depIdxs = []int32{
2, // goproto.protoc.extension.proto3.extension_bool:extendee -> google.protobuf.MessageOptions

View File

@ -36,8 +36,8 @@ import (
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/reflect/protoregistry"
descriptorpb "google.golang.org/protobuf/types/descriptor"
pluginpb "google.golang.org/protobuf/types/plugin"
"google.golang.org/protobuf/types/descriptorpb"
"google.golang.org/protobuf/types/pluginpb"
)
// Run executes a function as a protoc plugin.

View File

@ -13,8 +13,8 @@ import (
"google.golang.org/protobuf/internal/scalar"
"google.golang.org/protobuf/reflect/protoreflect"
descriptorpb "google.golang.org/protobuf/types/descriptor"
pluginpb "google.golang.org/protobuf/types/plugin"
"google.golang.org/protobuf/types/descriptorpb"
"google.golang.org/protobuf/types/pluginpb"
)
func TestPluginParameters(t *testing.T) {

View File

@ -8,14 +8,15 @@ import (
"testing"
"google.golang.org/protobuf/encoding/protojson"
knownpb "google.golang.org/protobuf/types/known"
"google.golang.org/protobuf/types/known/durationpb"
)
func BenchmarkUnmarshal_Duration(b *testing.B) {
input := []byte(`"-123456789.123456789s"`)
for i := 0; i < b.N; i++ {
err := protojson.Unmarshal(input, &knownpb.Duration{})
err := protojson.Unmarshal(input, &durationpb.Duration{})
if err != nil {
b.Fatal(err)
}

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,13 @@ import (
"google.golang.org/protobuf/encoding/testprotos/pb2"
"google.golang.org/protobuf/encoding/testprotos/pb3"
knownpb "google.golang.org/protobuf/types/known"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/emptypb"
"google.golang.org/protobuf/types/known/fieldmaskpb"
"google.golang.org/protobuf/types/known/structpb"
"google.golang.org/protobuf/types/known/timestamppb"
"google.golang.org/protobuf/types/known/wrapperspb"
)
// splitLines is a cmpopts.Option for comparing strings with line breaks.
@ -1105,125 +1111,125 @@ func TestMarshal(t *testing.T) {
}`,
}, {
desc: "BoolValue empty",
input: &knownpb.BoolValue{},
input: &wrapperspb.BoolValue{},
want: `false`,
}, {
desc: "BoolValue",
input: &knownpb.BoolValue{Value: true},
input: &wrapperspb.BoolValue{Value: true},
want: `true`,
}, {
desc: "Int32Value empty",
input: &knownpb.Int32Value{},
input: &wrapperspb.Int32Value{},
want: `0`,
}, {
desc: "Int32Value",
input: &knownpb.Int32Value{Value: 42},
input: &wrapperspb.Int32Value{Value: 42},
want: `42`,
}, {
desc: "Int64Value",
input: &knownpb.Int64Value{Value: 42},
input: &wrapperspb.Int64Value{Value: 42},
want: `"42"`,
}, {
desc: "UInt32Value",
input: &knownpb.UInt32Value{Value: 42},
input: &wrapperspb.UInt32Value{Value: 42},
want: `42`,
}, {
desc: "UInt64Value",
input: &knownpb.UInt64Value{Value: 42},
input: &wrapperspb.UInt64Value{Value: 42},
want: `"42"`,
}, {
desc: "FloatValue",
input: &knownpb.FloatValue{Value: 1.02},
input: &wrapperspb.FloatValue{Value: 1.02},
want: `1.02`,
}, {
desc: "FloatValue Infinity",
input: &knownpb.FloatValue{Value: float32(math.Inf(-1))},
input: &wrapperspb.FloatValue{Value: float32(math.Inf(-1))},
want: `"-Infinity"`,
}, {
desc: "DoubleValue",
input: &knownpb.DoubleValue{Value: 1.02},
input: &wrapperspb.DoubleValue{Value: 1.02},
want: `1.02`,
}, {
desc: "DoubleValue NaN",
input: &knownpb.DoubleValue{Value: math.NaN()},
input: &wrapperspb.DoubleValue{Value: math.NaN()},
want: `"NaN"`,
}, {
desc: "StringValue empty",
input: &knownpb.StringValue{},
input: &wrapperspb.StringValue{},
want: `""`,
}, {
desc: "StringValue",
input: &knownpb.StringValue{Value: "谷歌"},
input: &wrapperspb.StringValue{Value: "谷歌"},
want: `"谷歌"`,
}, {
desc: "StringValue with invalid UTF8 error",
input: &knownpb.StringValue{Value: "abc\xff"},
input: &wrapperspb.StringValue{Value: "abc\xff"},
want: "\"abc\xff\"",
wantErr: true,
}, {
desc: "StringValue field with invalid UTF8 error",
input: &pb2.KnownTypes{
OptString: &knownpb.StringValue{Value: "abc\xff"},
OptString: &wrapperspb.StringValue{Value: "abc\xff"},
},
want: "{\n \"optString\": \"abc\xff\"\n}",
wantErr: true,
}, {
desc: "BytesValue",
input: &knownpb.BytesValue{Value: []byte("hello")},
input: &wrapperspb.BytesValue{Value: []byte("hello")},
want: `"aGVsbG8="`,
}, {
desc: "Empty",
input: &knownpb.Empty{},
input: &emptypb.Empty{},
want: `{}`,
}, {
desc: "NullValue field",
input: &pb2.KnownTypes{OptNull: new(knownpb.NullValue)},
input: &pb2.KnownTypes{OptNull: new(structpb.NullValue)},
want: `{
"optNull": null
}`,
}, {
desc: "Value empty",
input: &knownpb.Value{},
input: &structpb.Value{},
wantErr: true,
}, {
desc: "Value empty field",
input: &pb2.KnownTypes{
OptValue: &knownpb.Value{},
OptValue: &structpb.Value{},
},
wantErr: true,
}, {
desc: "Value contains NullValue",
input: &knownpb.Value{Kind: &knownpb.Value_NullValue{}},
input: &structpb.Value{Kind: &structpb.Value_NullValue{}},
want: `null`,
}, {
desc: "Value contains BoolValue",
input: &knownpb.Value{Kind: &knownpb.Value_BoolValue{}},
input: &structpb.Value{Kind: &structpb.Value_BoolValue{}},
want: `false`,
}, {
desc: "Value contains NumberValue",
input: &knownpb.Value{Kind: &knownpb.Value_NumberValue{1.02}},
input: &structpb.Value{Kind: &structpb.Value_NumberValue{1.02}},
want: `1.02`,
}, {
desc: "Value contains StringValue",
input: &knownpb.Value{Kind: &knownpb.Value_StringValue{"hello"}},
input: &structpb.Value{Kind: &structpb.Value_StringValue{"hello"}},
want: `"hello"`,
}, {
desc: "Value contains StringValue with invalid UTF8",
input: &knownpb.Value{Kind: &knownpb.Value_StringValue{"\xff"}},
input: &structpb.Value{Kind: &structpb.Value_StringValue{"\xff"}},
want: "\"\xff\"",
wantErr: true,
}, {
desc: "Value contains Struct",
input: &knownpb.Value{
Kind: &knownpb.Value_StructValue{
&knownpb.Struct{
Fields: map[string]*knownpb.Value{
"null": {Kind: &knownpb.Value_NullValue{}},
"number": {Kind: &knownpb.Value_NumberValue{}},
"string": {Kind: &knownpb.Value_StringValue{}},
"struct": {Kind: &knownpb.Value_StructValue{}},
"list": {Kind: &knownpb.Value_ListValue{}},
"bool": {Kind: &knownpb.Value_BoolValue{}},
input: &structpb.Value{
Kind: &structpb.Value_StructValue{
&structpb.Struct{
Fields: map[string]*structpb.Value{
"null": {Kind: &structpb.Value_NullValue{}},
"number": {Kind: &structpb.Value_NumberValue{}},
"string": {Kind: &structpb.Value_StringValue{}},
"struct": {Kind: &structpb.Value_StructValue{}},
"list": {Kind: &structpb.Value_ListValue{}},
"bool": {Kind: &structpb.Value_BoolValue{}},
},
},
},
@ -1238,16 +1244,16 @@ func TestMarshal(t *testing.T) {
}`,
}, {
desc: "Value contains ListValue",
input: &knownpb.Value{
Kind: &knownpb.Value_ListValue{
&knownpb.ListValue{
Values: []*knownpb.Value{
{Kind: &knownpb.Value_BoolValue{}},
{Kind: &knownpb.Value_NullValue{}},
{Kind: &knownpb.Value_NumberValue{}},
{Kind: &knownpb.Value_StringValue{}},
{Kind: &knownpb.Value_StructValue{}},
{Kind: &knownpb.Value_ListValue{}},
input: &structpb.Value{
Kind: &structpb.Value_ListValue{
&structpb.ListValue{
Values: []*structpb.Value{
{Kind: &structpb.Value_BoolValue{}},
{Kind: &structpb.Value_NullValue{}},
{Kind: &structpb.Value_NumberValue{}},
{Kind: &structpb.Value_StringValue{}},
{Kind: &structpb.Value_StructValue{}},
{Kind: &structpb.Value_ListValue{}},
},
},
},
@ -1262,38 +1268,38 @@ func TestMarshal(t *testing.T) {
]`,
}, {
desc: "Struct with nil map",
input: &knownpb.Struct{},
input: &structpb.Struct{},
want: `{}`,
}, {
desc: "Struct with empty map",
input: &knownpb.Struct{
Fields: map[string]*knownpb.Value{},
input: &structpb.Struct{
Fields: map[string]*structpb.Value{},
},
want: `{}`,
}, {
desc: "Struct",
input: &knownpb.Struct{
Fields: map[string]*knownpb.Value{
"bool": {Kind: &knownpb.Value_BoolValue{true}},
"null": {Kind: &knownpb.Value_NullValue{}},
"number": {Kind: &knownpb.Value_NumberValue{3.1415}},
"string": {Kind: &knownpb.Value_StringValue{"hello"}},
input: &structpb.Struct{
Fields: map[string]*structpb.Value{
"bool": {Kind: &structpb.Value_BoolValue{true}},
"null": {Kind: &structpb.Value_NullValue{}},
"number": {Kind: &structpb.Value_NumberValue{3.1415}},
"string": {Kind: &structpb.Value_StringValue{"hello"}},
"struct": {
Kind: &knownpb.Value_StructValue{
&knownpb.Struct{
Fields: map[string]*knownpb.Value{
"string": {Kind: &knownpb.Value_StringValue{"world"}},
Kind: &structpb.Value_StructValue{
&structpb.Struct{
Fields: map[string]*structpb.Value{
"string": {Kind: &structpb.Value_StringValue{"world"}},
},
},
},
},
"list": {
Kind: &knownpb.Value_ListValue{
&knownpb.ListValue{
Values: []*knownpb.Value{
{Kind: &knownpb.Value_BoolValue{}},
{Kind: &knownpb.Value_NullValue{}},
{Kind: &knownpb.Value_NumberValue{}},
Kind: &structpb.Value_ListValue{
&structpb.ListValue{
Values: []*structpb.Value{
{Kind: &structpb.Value_BoolValue{}},
{Kind: &structpb.Value_NullValue{}},
{Kind: &structpb.Value_NumberValue{}},
},
},
},
@ -1316,47 +1322,47 @@ func TestMarshal(t *testing.T) {
}`,
}, {
desc: "Struct message with invalid UTF8 string",
input: &knownpb.Struct{
Fields: map[string]*knownpb.Value{
"string": {Kind: &knownpb.Value_StringValue{"\xff"}},
input: &structpb.Struct{
Fields: map[string]*structpb.Value{
"string": {Kind: &structpb.Value_StringValue{"\xff"}},
},
},
want: "{\n \"string\": \"\xff\"\n}",
wantErr: true,
}, {
desc: "ListValue with nil values",
input: &knownpb.ListValue{},
input: &structpb.ListValue{},
want: `[]`,
}, {
desc: "ListValue with empty values",
input: &knownpb.ListValue{
Values: []*knownpb.Value{},
input: &structpb.ListValue{
Values: []*structpb.Value{},
},
want: `[]`,
}, {
desc: "ListValue",
input: &knownpb.ListValue{
Values: []*knownpb.Value{
{Kind: &knownpb.Value_BoolValue{true}},
{Kind: &knownpb.Value_NullValue{}},
{Kind: &knownpb.Value_NumberValue{3.1415}},
{Kind: &knownpb.Value_StringValue{"hello"}},
input: &structpb.ListValue{
Values: []*structpb.Value{
{Kind: &structpb.Value_BoolValue{true}},
{Kind: &structpb.Value_NullValue{}},
{Kind: &structpb.Value_NumberValue{3.1415}},
{Kind: &structpb.Value_StringValue{"hello"}},
{
Kind: &knownpb.Value_ListValue{
&knownpb.ListValue{
Values: []*knownpb.Value{
{Kind: &knownpb.Value_BoolValue{}},
{Kind: &knownpb.Value_NullValue{}},
{Kind: &knownpb.Value_NumberValue{}},
Kind: &structpb.Value_ListValue{
&structpb.ListValue{
Values: []*structpb.Value{
{Kind: &structpb.Value_BoolValue{}},
{Kind: &structpb.Value_NullValue{}},
{Kind: &structpb.Value_NumberValue{}},
},
},
},
},
{
Kind: &knownpb.Value_StructValue{
&knownpb.Struct{
Fields: map[string]*knownpb.Value{
"string": {Kind: &knownpb.Value_StringValue{"world"}},
Kind: &structpb.Value_StructValue{
&structpb.Struct{
Fields: map[string]*structpb.Value{
"string": {Kind: &structpb.Value_StringValue{"world"}},
},
},
},
@ -1379,132 +1385,132 @@ func TestMarshal(t *testing.T) {
]`,
}, {
desc: "ListValue with invalid UTF8 string",
input: &knownpb.ListValue{
Values: []*knownpb.Value{
{Kind: &knownpb.Value_StringValue{"\xff"}},
input: &structpb.ListValue{
Values: []*structpb.Value{
{Kind: &structpb.Value_StringValue{"\xff"}},
},
},
want: "[\n \"\xff\"\n]",
wantErr: true,
}, {
desc: "Duration empty",
input: &knownpb.Duration{},
input: &durationpb.Duration{},
want: `"0s"`,
}, {
desc: "Duration with secs",
input: &knownpb.Duration{Seconds: 3},
input: &durationpb.Duration{Seconds: 3},
want: `"3s"`,
}, {
desc: "Duration with -secs",
input: &knownpb.Duration{Seconds: -3},
input: &durationpb.Duration{Seconds: -3},
want: `"-3s"`,
}, {
desc: "Duration with nanos",
input: &knownpb.Duration{Nanos: 1e6},
input: &durationpb.Duration{Nanos: 1e6},
want: `"0.001s"`,
}, {
desc: "Duration with -nanos",
input: &knownpb.Duration{Nanos: -1e6},
input: &durationpb.Duration{Nanos: -1e6},
want: `"-0.001s"`,
}, {
desc: "Duration with large secs",
input: &knownpb.Duration{Seconds: 1e10, Nanos: 1},
input: &durationpb.Duration{Seconds: 1e10, Nanos: 1},
want: `"10000000000.000000001s"`,
}, {
desc: "Duration with 6-digit nanos",
input: &knownpb.Duration{Nanos: 1e4},
input: &durationpb.Duration{Nanos: 1e4},
want: `"0.000010s"`,
}, {
desc: "Duration with 3-digit nanos",
input: &knownpb.Duration{Nanos: 1e6},
input: &durationpb.Duration{Nanos: 1e6},
want: `"0.001s"`,
}, {
desc: "Duration with -secs -nanos",
input: &knownpb.Duration{Seconds: -123, Nanos: -450},
input: &durationpb.Duration{Seconds: -123, Nanos: -450},
want: `"-123.000000450s"`,
}, {
desc: "Duration max value",
input: &knownpb.Duration{Seconds: 315576000000, Nanos: 999999999},
input: &durationpb.Duration{Seconds: 315576000000, Nanos: 999999999},
want: `"315576000000.999999999s"`,
}, {
desc: "Duration min value",
input: &knownpb.Duration{Seconds: -315576000000, Nanos: -999999999},
input: &durationpb.Duration{Seconds: -315576000000, Nanos: -999999999},
want: `"-315576000000.999999999s"`,
}, {
desc: "Duration with +secs -nanos",
input: &knownpb.Duration{Seconds: 1, Nanos: -1},
input: &durationpb.Duration{Seconds: 1, Nanos: -1},
wantErr: true,
}, {
desc: "Duration with -secs +nanos",
input: &knownpb.Duration{Seconds: -1, Nanos: 1},
input: &durationpb.Duration{Seconds: -1, Nanos: 1},
wantErr: true,
}, {
desc: "Duration with +secs out of range",
input: &knownpb.Duration{Seconds: 315576000001},
input: &durationpb.Duration{Seconds: 315576000001},
wantErr: true,
}, {
desc: "Duration with -secs out of range",
input: &knownpb.Duration{Seconds: -315576000001},
input: &durationpb.Duration{Seconds: -315576000001},
wantErr: true,
}, {
desc: "Duration with +nanos out of range",
input: &knownpb.Duration{Seconds: 0, Nanos: 1e9},
input: &durationpb.Duration{Seconds: 0, Nanos: 1e9},
wantErr: true,
}, {
desc: "Duration with -nanos out of range",
input: &knownpb.Duration{Seconds: 0, Nanos: -1e9},
input: &durationpb.Duration{Seconds: 0, Nanos: -1e9},
wantErr: true,
}, {
desc: "Timestamp zero",
input: &knownpb.Timestamp{},
input: &timestamppb.Timestamp{},
want: `"1970-01-01T00:00:00Z"`,
}, {
desc: "Timestamp",
input: &knownpb.Timestamp{Seconds: 1553036601},
input: &timestamppb.Timestamp{Seconds: 1553036601},
want: `"2019-03-19T23:03:21Z"`,
}, {
desc: "Timestamp with nanos",
input: &knownpb.Timestamp{Seconds: 1553036601, Nanos: 1},
input: &timestamppb.Timestamp{Seconds: 1553036601, Nanos: 1},
want: `"2019-03-19T23:03:21.000000001Z"`,
}, {
desc: "Timestamp with 6-digit nanos",
input: &knownpb.Timestamp{Nanos: 1e3},
input: &timestamppb.Timestamp{Nanos: 1e3},
want: `"1970-01-01T00:00:00.000001Z"`,
}, {
desc: "Timestamp with 3-digit nanos",
input: &knownpb.Timestamp{Nanos: 1e7},
input: &timestamppb.Timestamp{Nanos: 1e7},
want: `"1970-01-01T00:00:00.010Z"`,
}, {
desc: "Timestamp max value",
input: &knownpb.Timestamp{Seconds: 253402300799, Nanos: 999999999},
input: &timestamppb.Timestamp{Seconds: 253402300799, Nanos: 999999999},
want: `"9999-12-31T23:59:59.999999999Z"`,
}, {
desc: "Timestamp min value",
input: &knownpb.Timestamp{Seconds: -62135596800},
input: &timestamppb.Timestamp{Seconds: -62135596800},
want: `"0001-01-01T00:00:00Z"`,
}, {
desc: "Timestamp with +secs out of range",
input: &knownpb.Timestamp{Seconds: 253402300800},
input: &timestamppb.Timestamp{Seconds: 253402300800},
wantErr: true,
}, {
desc: "Timestamp with -secs out of range",
input: &knownpb.Timestamp{Seconds: -62135596801},
input: &timestamppb.Timestamp{Seconds: -62135596801},
wantErr: true,
}, {
desc: "Timestamp with -nanos",
input: &knownpb.Timestamp{Nanos: -1},
input: &timestamppb.Timestamp{Nanos: -1},
wantErr: true,
}, {
desc: "Timestamp with +nanos out of range",
input: &knownpb.Timestamp{Nanos: 1e9},
input: &timestamppb.Timestamp{Nanos: 1e9},
wantErr: true,
}, {
desc: "FieldMask empty",
input: &knownpb.FieldMask{},
input: &fieldmaskpb.FieldMask{},
want: `""`,
}, {
desc: "FieldMask",
input: &knownpb.FieldMask{
input: &fieldmaskpb.FieldMask{
Paths: []string{
"foo",
"foo_bar",
@ -1515,19 +1521,19 @@ func TestMarshal(t *testing.T) {
want: `"foo,fooBar,foo.barQux,Foo"`,
}, {
desc: "FieldMask error 1",
input: &knownpb.FieldMask{
input: &fieldmaskpb.FieldMask{
Paths: []string{"foo_"},
},
wantErr: true,
}, {
desc: "FieldMask error 2",
input: &knownpb.FieldMask{
input: &fieldmaskpb.FieldMask{
Paths: []string{"foo__bar"},
},
wantErr: true,
}, {
desc: "Any empty",
input: &knownpb.Any{},
input: &anypb.Any{},
want: `{}`,
}, {
desc: "Any with non-custom message",
@ -1545,7 +1551,7 @@ func TestMarshal(t *testing.T) {
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "foo/pb2.Nested",
Value: b,
}
@ -1562,14 +1568,14 @@ func TestMarshal(t *testing.T) {
mo: protojson.MarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&pb2.Nested{})),
},
input: &knownpb.Any{TypeUrl: "foo/pb2.Nested"},
input: &anypb.Any{TypeUrl: "foo/pb2.Nested"},
want: `{
"@type": "foo/pb2.Nested"
}`,
}, {
desc: "Any without registered type",
mo: protojson.MarshalOptions{Resolver: preg.NewTypes()},
input: &knownpb.Any{TypeUrl: "foo/pb2.Nested"},
input: &anypb.Any{TypeUrl: "foo/pb2.Nested"},
wantErr: true,
}, {
desc: "Any with missing required error",
@ -1587,7 +1593,7 @@ func TestMarshal(t *testing.T) {
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: string(m.ProtoReflect().Descriptor().FullName()),
Value: b,
}
@ -1614,7 +1620,7 @@ func TestMarshal(t *testing.T) {
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: string(m.ProtoReflect().Descriptor().FullName()),
Value: b,
}
@ -1636,7 +1642,7 @@ func TestMarshal(t *testing.T) {
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "foo/pb2.Nested",
Value: b,
}
@ -1651,7 +1657,7 @@ func TestMarshal(t *testing.T) {
mo: protojson.MarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&pb2.Nested{})),
},
input: &knownpb.Any{
input: &anypb.Any{
TypeUrl: "foo/pb2.Nested",
Value: dhex("80"),
},
@ -1659,15 +1665,15 @@ func TestMarshal(t *testing.T) {
}, {
desc: "Any with BoolValue",
mo: protojson.MarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&knownpb.BoolValue{})),
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&wrapperspb.BoolValue{})),
},
input: func() proto.Message {
m := &knownpb.BoolValue{Value: true}
m := &wrapperspb.BoolValue{Value: true}
b, err := proto.MarshalOptions{Deterministic: true}.Marshal(m)
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "type.googleapis.com/google.protobuf.BoolValue",
Value: b,
}
@ -1679,15 +1685,15 @@ func TestMarshal(t *testing.T) {
}, {
desc: "Any with Empty",
mo: protojson.MarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&knownpb.Empty{})),
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&emptypb.Empty{})),
},
input: func() proto.Message {
m := &knownpb.Empty{}
m := &emptypb.Empty{}
b, err := proto.MarshalOptions{Deterministic: true}.Marshal(m)
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "type.googleapis.com/google.protobuf.Empty",
Value: b,
}
@ -1699,15 +1705,15 @@ func TestMarshal(t *testing.T) {
}, {
desc: "Any with StringValue containing invalid UTF8",
mo: protojson.MarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&knownpb.StringValue{})),
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&wrapperspb.StringValue{})),
},
input: func() proto.Message {
m := &knownpb.StringValue{Value: "abcd"}
m := &wrapperspb.StringValue{Value: "abcd"}
b, err := proto.MarshalOptions{Deterministic: true}.Marshal(m)
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "google.protobuf.StringValue",
Value: bytes.Replace(b, []byte("abcd"), []byte("abc\xff"), -1),
}
@ -1720,15 +1726,15 @@ func TestMarshal(t *testing.T) {
}, {
desc: "Any with Int64Value",
mo: protojson.MarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&knownpb.Int64Value{})),
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&wrapperspb.Int64Value{})),
},
input: func() proto.Message {
m := &knownpb.Int64Value{Value: 42}
m := &wrapperspb.Int64Value{Value: 42}
b, err := proto.MarshalOptions{Deterministic: true}.Marshal(m)
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "google.protobuf.Int64Value",
Value: b,
}
@ -1740,15 +1746,15 @@ func TestMarshal(t *testing.T) {
}, {
desc: "Any with Duration",
mo: protojson.MarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&knownpb.Duration{})),
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&durationpb.Duration{})),
},
input: func() proto.Message {
m := &knownpb.Duration{}
m := &durationpb.Duration{}
b, err := proto.MarshalOptions{Deterministic: true}.Marshal(m)
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "type.googleapis.com/google.protobuf.Duration",
Value: b,
}
@ -1760,15 +1766,15 @@ func TestMarshal(t *testing.T) {
}, {
desc: "Any with empty Value",
mo: protojson.MarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&knownpb.Value{})),
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&structpb.Value{})),
},
input: func() proto.Message {
m := &knownpb.Value{}
m := &structpb.Value{}
b, err := proto.Marshal(m)
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "type.googleapis.com/google.protobuf.Value",
Value: b,
}
@ -1777,15 +1783,15 @@ func TestMarshal(t *testing.T) {
}, {
desc: "Any with Value of StringValue",
mo: protojson.MarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&knownpb.Value{})),
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&structpb.Value{})),
},
input: func() proto.Message {
m := &knownpb.Value{Kind: &knownpb.Value_StringValue{"abcd"}}
m := &structpb.Value{Kind: &structpb.Value_StringValue{"abcd"}}
b, err := proto.MarshalOptions{Deterministic: true}.Marshal(m)
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "type.googleapis.com/google.protobuf.Value",
Value: bytes.Replace(b, []byte("abcd"), []byte("abc\xff"), -1),
}
@ -1798,15 +1804,15 @@ func TestMarshal(t *testing.T) {
}, {
desc: "Any with Value of NullValue",
mo: protojson.MarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&knownpb.Value{})),
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&structpb.Value{})),
},
input: func() proto.Message {
m := &knownpb.Value{Kind: &knownpb.Value_NullValue{}}
m := &structpb.Value{Kind: &structpb.Value_NullValue{}}
b, err := proto.MarshalOptions{Deterministic: true}.Marshal(m)
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "type.googleapis.com/google.protobuf.Value",
Value: b,
}
@ -1819,24 +1825,24 @@ func TestMarshal(t *testing.T) {
desc: "Any with Struct",
mo: protojson.MarshalOptions{
Resolver: preg.NewTypes(
pimpl.Export{}.MessageTypeOf(&knownpb.Struct{}),
pimpl.Export{}.MessageTypeOf(&knownpb.Value{}),
pimpl.Export{}.MessageTypeOf(&knownpb.BoolValue{}),
pimpl.Export{}.EnumTypeOf(knownpb.NullValue_NULL_VALUE),
pimpl.Export{}.MessageTypeOf(&knownpb.StringValue{}),
pimpl.Export{}.MessageTypeOf(&structpb.Struct{}),
pimpl.Export{}.MessageTypeOf(&structpb.Value{}),
pimpl.Export{}.MessageTypeOf(&wrapperspb.BoolValue{}),
pimpl.Export{}.EnumTypeOf(structpb.NullValue_NULL_VALUE),
pimpl.Export{}.MessageTypeOf(&wrapperspb.StringValue{}),
),
},
input: func() proto.Message {
m := &knownpb.Struct{
Fields: map[string]*knownpb.Value{
"bool": {Kind: &knownpb.Value_BoolValue{true}},
"null": {Kind: &knownpb.Value_NullValue{}},
"string": {Kind: &knownpb.Value_StringValue{"hello"}},
m := &structpb.Struct{
Fields: map[string]*structpb.Value{
"bool": {Kind: &structpb.Value_BoolValue{true}},
"null": {Kind: &structpb.Value_NullValue{}},
"string": {Kind: &structpb.Value_StringValue{"hello"}},
"struct": {
Kind: &knownpb.Value_StructValue{
&knownpb.Struct{
Fields: map[string]*knownpb.Value{
"string": {Kind: &knownpb.Value_StringValue{"world"}},
Kind: &structpb.Value_StructValue{
&structpb.Struct{
Fields: map[string]*structpb.Value{
"string": {Kind: &structpb.Value_StringValue{"world"}},
},
},
},
@ -1847,7 +1853,7 @@ func TestMarshal(t *testing.T) {
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "google.protobuf.Struct",
Value: b,
}
@ -1866,15 +1872,15 @@ func TestMarshal(t *testing.T) {
}, {
desc: "Any with missing type_url",
mo: protojson.MarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&knownpb.BoolValue{})),
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&wrapperspb.BoolValue{})),
},
input: func() proto.Message {
m := &knownpb.BoolValue{Value: true}
m := &wrapperspb.BoolValue{Value: true}
b, err := proto.MarshalOptions{Deterministic: true}.Marshal(m)
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
Value: b,
}
}(),
@ -1882,41 +1888,41 @@ func TestMarshal(t *testing.T) {
}, {
desc: "well known types as field values",
mo: protojson.MarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&knownpb.Empty{})),
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&emptypb.Empty{})),
},
input: &pb2.KnownTypes{
OptBool: &knownpb.BoolValue{Value: false},
OptInt32: &knownpb.Int32Value{Value: 42},
OptInt64: &knownpb.Int64Value{Value: 42},
OptUint32: &knownpb.UInt32Value{Value: 42},
OptUint64: &knownpb.UInt64Value{Value: 42},
OptFloat: &knownpb.FloatValue{Value: 1.23},
OptDouble: &knownpb.DoubleValue{Value: 3.1415},
OptString: &knownpb.StringValue{Value: "hello"},
OptBytes: &knownpb.BytesValue{Value: []byte("hello")},
OptDuration: &knownpb.Duration{Seconds: 123},
OptTimestamp: &knownpb.Timestamp{Seconds: 1553036601},
OptStruct: &knownpb.Struct{
Fields: map[string]*knownpb.Value{
"string": {Kind: &knownpb.Value_StringValue{"hello"}},
OptBool: &wrapperspb.BoolValue{Value: false},
OptInt32: &wrapperspb.Int32Value{Value: 42},
OptInt64: &wrapperspb.Int64Value{Value: 42},
OptUint32: &wrapperspb.UInt32Value{Value: 42},
OptUint64: &wrapperspb.UInt64Value{Value: 42},
OptFloat: &wrapperspb.FloatValue{Value: 1.23},
OptDouble: &wrapperspb.DoubleValue{Value: 3.1415},
OptString: &wrapperspb.StringValue{Value: "hello"},
OptBytes: &wrapperspb.BytesValue{Value: []byte("hello")},
OptDuration: &durationpb.Duration{Seconds: 123},
OptTimestamp: &timestamppb.Timestamp{Seconds: 1553036601},
OptStruct: &structpb.Struct{
Fields: map[string]*structpb.Value{
"string": {Kind: &structpb.Value_StringValue{"hello"}},
},
},
OptList: &knownpb.ListValue{
Values: []*knownpb.Value{
{Kind: &knownpb.Value_NullValue{}},
{Kind: &knownpb.Value_StringValue{}},
{Kind: &knownpb.Value_StructValue{}},
{Kind: &knownpb.Value_ListValue{}},
OptList: &structpb.ListValue{
Values: []*structpb.Value{
{Kind: &structpb.Value_NullValue{}},
{Kind: &structpb.Value_StringValue{}},
{Kind: &structpb.Value_StructValue{}},
{Kind: &structpb.Value_ListValue{}},
},
},
OptValue: &knownpb.Value{
Kind: &knownpb.Value_StringValue{"world"},
OptValue: &structpb.Value{
Kind: &structpb.Value_StringValue{"world"},
},
OptEmpty: &knownpb.Empty{},
OptAny: &knownpb.Any{
OptEmpty: &emptypb.Empty{},
OptAny: &anypb.Any{
TypeUrl: "google.protobuf.Empty",
},
OptFieldmask: &knownpb.FieldMask{
OptFieldmask: &fieldmaskpb.FieldMask{
Paths: []string{"foo_bar", "bar_foo"},
},
},

View File

@ -18,7 +18,7 @@ import (
"google.golang.org/protobuf/encoding/testprotos/pb2"
"google.golang.org/protobuf/encoding/testprotos/pb3"
knownpb "google.golang.org/protobuf/types/known"
"google.golang.org/protobuf/types/known/anypb"
)
func TestUnmarshal(t *testing.T) {
@ -1365,27 +1365,27 @@ opt_int32: 42
}(),
}, {
desc: "Any not expanded",
inputMessage: &knownpb.Any{},
inputMessage: &anypb.Any{},
inputText: `
type_url: "pb2.Nested"
value: "some bytes"
`,
wantMessage: &knownpb.Any{
wantMessage: &anypb.Any{
TypeUrl: "pb2.Nested",
Value: []byte("some bytes"),
},
}, {
desc: "Any not expanded missing value",
inputMessage: &knownpb.Any{},
inputMessage: &anypb.Any{},
inputText: `type_url: "pb2.Nested"`,
wantMessage: &knownpb.Any{
wantMessage: &anypb.Any{
TypeUrl: "pb2.Nested",
},
}, {
desc: "Any not expanded missing type_url",
inputMessage: &knownpb.Any{},
inputMessage: &anypb.Any{},
inputText: `value: "some bytes"`,
wantMessage: &knownpb.Any{
wantMessage: &anypb.Any{
Value: []byte("some bytes"),
},
}, {
@ -1393,7 +1393,7 @@ value: "some bytes"
umo: prototext.UnmarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&pb2.Nested{})),
},
inputMessage: &knownpb.Any{},
inputMessage: &anypb.Any{},
inputText: `
[foobar/pb2.Nested]: {
opt_string: "embedded inside Any"
@ -1413,7 +1413,7 @@ value: "some bytes"
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "foobar/pb2.Nested",
Value: b,
}
@ -1423,9 +1423,9 @@ value: "some bytes"
umo: prototext.UnmarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&pb2.Nested{})),
},
inputMessage: &knownpb.Any{},
inputMessage: &anypb.Any{},
inputText: `[foo.com/pb2.Nested]: {}`,
wantMessage: &knownpb.Any{
wantMessage: &anypb.Any{
TypeUrl: "foo.com/pb2.Nested",
},
}, {
@ -1433,7 +1433,7 @@ value: "some bytes"
umo: prototext.UnmarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&pb2.PartialRequired{})),
},
inputMessage: &knownpb.Any{},
inputMessage: &anypb.Any{},
inputText: `
[pb2.PartialRequired]: {
opt_string: "embedded inside Any"
@ -1450,7 +1450,7 @@ value: "some bytes"
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "pb2.PartialRequired",
Value: b,
}
@ -1461,7 +1461,7 @@ value: "some bytes"
umo: prototext.UnmarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&pb3.Nested{})),
},
inputMessage: &knownpb.Any{},
inputMessage: &anypb.Any{},
inputText: `
[pb3.Nested]: {
s_string: "abc\xff"
@ -1476,7 +1476,7 @@ value: "some bytes"
if !nerr.Merge(err) {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: string(m.ProtoReflect().Descriptor().FullName()),
Value: b,
}
@ -1485,7 +1485,7 @@ value: "some bytes"
}, {
desc: "Any expanded with unregistered type",
umo: prototext.UnmarshalOptions{Resolver: preg.NewTypes()},
inputMessage: &knownpb.Any{},
inputMessage: &anypb.Any{},
inputText: `[SomeMessage]: {}`,
wantErr: true,
}, {
@ -1493,7 +1493,7 @@ value: "some bytes"
umo: prototext.UnmarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&pb2.Nested{})),
},
inputMessage: &knownpb.Any{},
inputMessage: &anypb.Any{},
inputText: `[pb2.Nested]: 123`,
wantErr: true,
}, {
@ -1501,7 +1501,7 @@ value: "some bytes"
umo: prototext.UnmarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&pb2.Nested{})),
},
inputMessage: &knownpb.Any{},
inputMessage: &anypb.Any{},
inputText: `
[pb2.Nested]: {}
unknown: ""
@ -1512,7 +1512,7 @@ unknown: ""
umo: prototext.UnmarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&pb2.Nested{})),
},
inputMessage: &knownpb.Any{},
inputMessage: &anypb.Any{},
inputText: `
[pb2.Nested]: {}
type_url: "pb2.Nested"

View File

@ -25,7 +25,7 @@ import (
"google.golang.org/protobuf/encoding/testprotos/pb2"
"google.golang.org/protobuf/encoding/testprotos/pb3"
knownpb "google.golang.org/protobuf/types/known"
"google.golang.org/protobuf/types/known/anypb"
)
func init() {
@ -1181,7 +1181,7 @@ opt_int32: 42
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "pb2.Nested",
Value: b,
}
@ -1205,7 +1205,7 @@ value: "\n\x13embedded inside Any\x12\x0b\n\tinception"
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: "foo/pb2.Nested",
Value: b,
}
@ -1233,7 +1233,7 @@ value: "\n\x13embedded inside Any\x12\x0b\n\tinception"
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: string(m.ProtoReflect().Descriptor().FullName()),
Value: b,
}
@ -1256,7 +1256,7 @@ value: "\n\x13embedded inside Any\x12\x0b\n\tinception"
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &knownpb.Any{
return &anypb.Any{
TypeUrl: string(m.ProtoReflect().Descriptor().FullName()),
Value: bytes.Replace(b, []byte("abcd"), []byte("abc\xff"), -1),
}
@ -1271,7 +1271,7 @@ value: "\n\x13embedded inside Any\x12\x0b\n\tinception"
mo: prototext.MarshalOptions{
Resolver: preg.NewTypes(pimpl.Export{}.MessageTypeOf(&pb2.Nested{})),
},
input: &knownpb.Any{
input: &anypb.Any{
TypeUrl: "foo/pb2.Nested",
Value: dhex("80"),
},

View File

@ -12,7 +12,12 @@ import (
preg "google.golang.org/protobuf/reflect/protoregistry"
"google.golang.org/protobuf/encoding/testprotos/pb2"
knownpb "google.golang.org/protobuf/types/known"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/emptypb"
"google.golang.org/protobuf/types/known/structpb"
"google.golang.org/protobuf/types/known/timestamppb"
"google.golang.org/protobuf/types/known/wrapperspb"
)
func TestRoundTrip(t *testing.T) {
@ -23,62 +28,62 @@ func TestRoundTrip(t *testing.T) {
}{{
desc: "well-known type fields set to empty messages",
message: &pb2.KnownTypes{
OptBool: &knownpb.BoolValue{},
OptInt32: &knownpb.Int32Value{},
OptInt64: &knownpb.Int64Value{},
OptUint32: &knownpb.UInt32Value{},
OptUint64: &knownpb.UInt64Value{},
OptFloat: &knownpb.FloatValue{},
OptDouble: &knownpb.DoubleValue{},
OptString: &knownpb.StringValue{},
OptBytes: &knownpb.BytesValue{},
OptDuration: &knownpb.Duration{},
OptTimestamp: &knownpb.Timestamp{},
OptStruct: &knownpb.Struct{},
OptList: &knownpb.ListValue{},
OptValue: &knownpb.Value{},
OptEmpty: &knownpb.Empty{},
OptAny: &knownpb.Any{},
OptBool: &wrapperspb.BoolValue{},
OptInt32: &wrapperspb.Int32Value{},
OptInt64: &wrapperspb.Int64Value{},
OptUint32: &wrapperspb.UInt32Value{},
OptUint64: &wrapperspb.UInt64Value{},
OptFloat: &wrapperspb.FloatValue{},
OptDouble: &wrapperspb.DoubleValue{},
OptString: &wrapperspb.StringValue{},
OptBytes: &wrapperspb.BytesValue{},
OptDuration: &durationpb.Duration{},
OptTimestamp: &timestamppb.Timestamp{},
OptStruct: &structpb.Struct{},
OptList: &structpb.ListValue{},
OptValue: &structpb.Value{},
OptEmpty: &emptypb.Empty{},
OptAny: &anypb.Any{},
},
}, {
desc: "well-known type scalar fields",
message: &pb2.KnownTypes{
OptBool: &knownpb.BoolValue{
OptBool: &wrapperspb.BoolValue{
Value: true,
},
OptInt32: &knownpb.Int32Value{
OptInt32: &wrapperspb.Int32Value{
Value: -42,
},
OptInt64: &knownpb.Int64Value{
OptInt64: &wrapperspb.Int64Value{
Value: -42,
},
OptUint32: &knownpb.UInt32Value{
OptUint32: &wrapperspb.UInt32Value{
Value: 0xff,
},
OptUint64: &knownpb.UInt64Value{
OptUint64: &wrapperspb.UInt64Value{
Value: 0xffff,
},
OptFloat: &knownpb.FloatValue{
OptFloat: &wrapperspb.FloatValue{
Value: 1.234,
},
OptDouble: &knownpb.DoubleValue{
OptDouble: &wrapperspb.DoubleValue{
Value: 1.23e308,
},
OptString: &knownpb.StringValue{
OptString: &wrapperspb.StringValue{
Value: "谷歌",
},
OptBytes: &knownpb.BytesValue{
OptBytes: &wrapperspb.BytesValue{
Value: []byte("\xe8\xb0\xb7\xe6\xad\x8c"),
},
},
}, {
desc: "well-known type time-related fields",
message: &pb2.KnownTypes{
OptDuration: &knownpb.Duration{
OptDuration: &durationpb.Duration{
Seconds: -3600,
Nanos: -123,
},
OptTimestamp: &knownpb.Timestamp{
OptTimestamp: &timestamppb.Timestamp{
Seconds: 1257894000,
Nanos: 123,
},
@ -86,34 +91,34 @@ func TestRoundTrip(t *testing.T) {
}, {
desc: "Struct field and different Value types",
message: &pb2.KnownTypes{
OptStruct: &knownpb.Struct{
Fields: map[string]*knownpb.Value{
"bool": &knownpb.Value{
Kind: &knownpb.Value_BoolValue{
OptStruct: &structpb.Struct{
Fields: map[string]*structpb.Value{
"bool": &structpb.Value{
Kind: &structpb.Value_BoolValue{
BoolValue: true,
},
},
"double": &knownpb.Value{
Kind: &knownpb.Value_NumberValue{
"double": &structpb.Value{
Kind: &structpb.Value_NumberValue{
NumberValue: 3.1415,
},
},
"null": &knownpb.Value{
Kind: &knownpb.Value_NullValue{
NullValue: knownpb.NullValue_NULL_VALUE,
"null": &structpb.Value{
Kind: &structpb.Value_NullValue{
NullValue: structpb.NullValue_NULL_VALUE,
},
},
"string": &knownpb.Value{
Kind: &knownpb.Value_StringValue{
"string": &structpb.Value{
Kind: &structpb.Value_StringValue{
StringValue: "string",
},
},
"struct": &knownpb.Value{
Kind: &knownpb.Value_StructValue{
StructValue: &knownpb.Struct{
Fields: map[string]*knownpb.Value{
"bool": &knownpb.Value{
Kind: &knownpb.Value_BoolValue{
"struct": &structpb.Value{
Kind: &structpb.Value_StructValue{
StructValue: &structpb.Struct{
Fields: map[string]*structpb.Value{
"bool": &structpb.Value{
Kind: &structpb.Value_BoolValue{
BoolValue: false,
},
},
@ -121,17 +126,17 @@ func TestRoundTrip(t *testing.T) {
},
},
},
"list": &knownpb.Value{
Kind: &knownpb.Value_ListValue{
ListValue: &knownpb.ListValue{
Values: []*knownpb.Value{
"list": &structpb.Value{
Kind: &structpb.Value_ListValue{
ListValue: &structpb.ListValue{
Values: []*structpb.Value{
{
Kind: &knownpb.Value_BoolValue{
Kind: &structpb.Value_BoolValue{
BoolValue: false,
},
},
{
Kind: &knownpb.Value_StringValue{
Kind: &structpb.Value_StringValue{
StringValue: "hello",
},
},
@ -157,7 +162,7 @@ func TestRoundTrip(t *testing.T) {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &pb2.KnownTypes{
OptAny: &knownpb.Any{
OptAny: &anypb.Any{
TypeUrl: string(m.ProtoReflect().Descriptor().FullName()),
Value: b,
},
@ -178,7 +183,7 @@ func TestRoundTrip(t *testing.T) {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &pb2.KnownTypes{
OptAny: &knownpb.Any{
OptAny: &anypb.Any{
TypeUrl: string(m.ProtoReflect().Descriptor().FullName()),
Value: b,
},
@ -188,7 +193,7 @@ func TestRoundTrip(t *testing.T) {
desc: "Any field containing Any message",
resolver: func() *preg.Types {
mt1 := impl.Export{}.MessageTypeOf(&pb2.Nested{})
mt2 := impl.Export{}.MessageTypeOf(&knownpb.Any{})
mt2 := impl.Export{}.MessageTypeOf(&anypb.Any{})
return preg.NewTypes(mt1, mt2)
}(),
message: func() *pb2.KnownTypes {
@ -199,7 +204,7 @@ func TestRoundTrip(t *testing.T) {
if err != nil {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
m2 := &knownpb.Any{
m2 := &anypb.Any{
TypeUrl: "pb2.Nested",
Value: b1,
}
@ -208,7 +213,7 @@ func TestRoundTrip(t *testing.T) {
t.Fatalf("error in binary marshaling message for Any.value: %v", err)
}
return &pb2.KnownTypes{
OptAny: &knownpb.Any{
OptAny: &anypb.Any{
TypeUrl: "google.protobuf.Any",
Value: b2,
},

View File

@ -8,7 +8,13 @@ import (
protoregistry "google.golang.org/protobuf/reflect/protoregistry"
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
known "google.golang.org/protobuf/types/known"
anypb "google.golang.org/protobuf/types/known/anypb"
durationpb "google.golang.org/protobuf/types/known/durationpb"
emptypb "google.golang.org/protobuf/types/known/emptypb"
fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
structpb "google.golang.org/protobuf/types/known/structpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
sync "sync"
)
@ -1050,24 +1056,24 @@ func (x *FakeMessageSetExtension) GetOptString() string {
// Message contains well-known type fields.
type KnownTypes struct {
OptBool *known.BoolValue `protobuf:"bytes,1,opt,name=opt_bool,json=optBool" json:"opt_bool,omitempty"`
OptInt32 *known.Int32Value `protobuf:"bytes,2,opt,name=opt_int32,json=optInt32" json:"opt_int32,omitempty"`
OptInt64 *known.Int64Value `protobuf:"bytes,3,opt,name=opt_int64,json=optInt64" json:"opt_int64,omitempty"`
OptUint32 *known.UInt32Value `protobuf:"bytes,4,opt,name=opt_uint32,json=optUint32" json:"opt_uint32,omitempty"`
OptUint64 *known.UInt64Value `protobuf:"bytes,5,opt,name=opt_uint64,json=optUint64" json:"opt_uint64,omitempty"`
OptFloat *known.FloatValue `protobuf:"bytes,6,opt,name=opt_float,json=optFloat" json:"opt_float,omitempty"`
OptDouble *known.DoubleValue `protobuf:"bytes,7,opt,name=opt_double,json=optDouble" json:"opt_double,omitempty"`
OptString *known.StringValue `protobuf:"bytes,8,opt,name=opt_string,json=optString" json:"opt_string,omitempty"`
OptBytes *known.BytesValue `protobuf:"bytes,9,opt,name=opt_bytes,json=optBytes" json:"opt_bytes,omitempty"`
OptDuration *known.Duration `protobuf:"bytes,20,opt,name=opt_duration,json=optDuration" json:"opt_duration,omitempty"`
OptTimestamp *known.Timestamp `protobuf:"bytes,21,opt,name=opt_timestamp,json=optTimestamp" json:"opt_timestamp,omitempty"`
OptStruct *known.Struct `protobuf:"bytes,25,opt,name=opt_struct,json=optStruct" json:"opt_struct,omitempty"`
OptList *known.ListValue `protobuf:"bytes,26,opt,name=opt_list,json=optList" json:"opt_list,omitempty"`
OptValue *known.Value `protobuf:"bytes,27,opt,name=opt_value,json=optValue" json:"opt_value,omitempty"`
OptNull *known.NullValue `protobuf:"varint,28,opt,name=opt_null,json=optNull,enum=google.protobuf.NullValue" json:"opt_null,omitempty"`
OptEmpty *known.Empty `protobuf:"bytes,30,opt,name=opt_empty,json=optEmpty" json:"opt_empty,omitempty"`
OptAny *known.Any `protobuf:"bytes,32,opt,name=opt_any,json=optAny" json:"opt_any,omitempty"`
OptFieldmask *known.FieldMask `protobuf:"bytes,40,opt,name=opt_fieldmask,json=optFieldmask" json:"opt_fieldmask,omitempty"`
OptBool *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=opt_bool,json=optBool" json:"opt_bool,omitempty"`
OptInt32 *wrapperspb.Int32Value `protobuf:"bytes,2,opt,name=opt_int32,json=optInt32" json:"opt_int32,omitempty"`
OptInt64 *wrapperspb.Int64Value `protobuf:"bytes,3,opt,name=opt_int64,json=optInt64" json:"opt_int64,omitempty"`
OptUint32 *wrapperspb.UInt32Value `protobuf:"bytes,4,opt,name=opt_uint32,json=optUint32" json:"opt_uint32,omitempty"`
OptUint64 *wrapperspb.UInt64Value `protobuf:"bytes,5,opt,name=opt_uint64,json=optUint64" json:"opt_uint64,omitempty"`
OptFloat *wrapperspb.FloatValue `protobuf:"bytes,6,opt,name=opt_float,json=optFloat" json:"opt_float,omitempty"`
OptDouble *wrapperspb.DoubleValue `protobuf:"bytes,7,opt,name=opt_double,json=optDouble" json:"opt_double,omitempty"`
OptString *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=opt_string,json=optString" json:"opt_string,omitempty"`
OptBytes *wrapperspb.BytesValue `protobuf:"bytes,9,opt,name=opt_bytes,json=optBytes" json:"opt_bytes,omitempty"`
OptDuration *durationpb.Duration `protobuf:"bytes,20,opt,name=opt_duration,json=optDuration" json:"opt_duration,omitempty"`
OptTimestamp *timestamppb.Timestamp `protobuf:"bytes,21,opt,name=opt_timestamp,json=optTimestamp" json:"opt_timestamp,omitempty"`
OptStruct *structpb.Struct `protobuf:"bytes,25,opt,name=opt_struct,json=optStruct" json:"opt_struct,omitempty"`
OptList *structpb.ListValue `protobuf:"bytes,26,opt,name=opt_list,json=optList" json:"opt_list,omitempty"`
OptValue *structpb.Value `protobuf:"bytes,27,opt,name=opt_value,json=optValue" json:"opt_value,omitempty"`
OptNull *structpb.NullValue `protobuf:"varint,28,opt,name=opt_null,json=optNull,enum=google.protobuf.NullValue" json:"opt_null,omitempty"`
OptEmpty *emptypb.Empty `protobuf:"bytes,30,opt,name=opt_empty,json=optEmpty" json:"opt_empty,omitempty"`
OptAny *anypb.Any `protobuf:"bytes,32,opt,name=opt_any,json=optAny" json:"opt_any,omitempty"`
OptFieldmask *fieldmaskpb.FieldMask `protobuf:"bytes,40,opt,name=opt_fieldmask,json=optFieldmask" json:"opt_fieldmask,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized protoimpl.UnknownFields `json:"-"`
XXX_sizecache protoimpl.SizeCache `json:"-"`
@ -1096,126 +1102,126 @@ func (*KnownTypes) Descriptor() ([]byte, []int) {
return file_pb2_test_proto_rawDescGZIP(), []int{15}
}
func (x *KnownTypes) GetOptBool() *known.BoolValue {
func (x *KnownTypes) GetOptBool() *wrapperspb.BoolValue {
if x != nil {
return x.OptBool
}
return nil
}
func (x *KnownTypes) GetOptInt32() *known.Int32Value {
func (x *KnownTypes) GetOptInt32() *wrapperspb.Int32Value {
if x != nil {
return x.OptInt32
}
return nil
}
func (x *KnownTypes) GetOptInt64() *known.Int64Value {
func (x *KnownTypes) GetOptInt64() *wrapperspb.Int64Value {
if x != nil {
return x.OptInt64
}
return nil
}
func (x *KnownTypes) GetOptUint32() *known.UInt32Value {
func (x *KnownTypes) GetOptUint32() *wrapperspb.UInt32Value {
if x != nil {
return x.OptUint32
}
return nil
}
func (x *KnownTypes) GetOptUint64() *known.UInt64Value {
func (x *KnownTypes) GetOptUint64() *wrapperspb.UInt64Value {
if x != nil {
return x.OptUint64
}
return nil
}
func (x *KnownTypes) GetOptFloat() *known.FloatValue {
func (x *KnownTypes) GetOptFloat() *wrapperspb.FloatValue {
if x != nil {
return x.OptFloat
}
return nil
}
func (x *KnownTypes) GetOptDouble() *known.DoubleValue {
func (x *KnownTypes) GetOptDouble() *wrapperspb.DoubleValue {
if x != nil {
return x.OptDouble
}
return nil
}
func (x *KnownTypes) GetOptString() *known.StringValue {
func (x *KnownTypes) GetOptString() *wrapperspb.StringValue {
if x != nil {
return x.OptString
}
return nil
}
func (x *KnownTypes) GetOptBytes() *known.BytesValue {
func (x *KnownTypes) GetOptBytes() *wrapperspb.BytesValue {
if x != nil {
return x.OptBytes
}
return nil
}
func (x *KnownTypes) GetOptDuration() *known.Duration {
func (x *KnownTypes) GetOptDuration() *durationpb.Duration {
if x != nil {
return x.OptDuration
}
return nil
}
func (x *KnownTypes) GetOptTimestamp() *known.Timestamp {
func (x *KnownTypes) GetOptTimestamp() *timestamppb.Timestamp {
if x != nil {
return x.OptTimestamp
}
return nil
}
func (x *KnownTypes) GetOptStruct() *known.Struct {
func (x *KnownTypes) GetOptStruct() *structpb.Struct {
if x != nil {
return x.OptStruct
}
return nil
}
func (x *KnownTypes) GetOptList() *known.ListValue {
func (x *KnownTypes) GetOptList() *structpb.ListValue {
if x != nil {
return x.OptList
}
return nil
}
func (x *KnownTypes) GetOptValue() *known.Value {
func (x *KnownTypes) GetOptValue() *structpb.Value {
if x != nil {
return x.OptValue
}
return nil
}
func (x *KnownTypes) GetOptNull() known.NullValue {
func (x *KnownTypes) GetOptNull() structpb.NullValue {
if x != nil && x.OptNull != nil {
return *x.OptNull
}
return known.NullValue_NULL_VALUE
return structpb.NullValue_NULL_VALUE
}
func (x *KnownTypes) GetOptEmpty() *known.Empty {
func (x *KnownTypes) GetOptEmpty() *emptypb.Empty {
if x != nil {
return x.OptEmpty
}
return nil
}
func (x *KnownTypes) GetOptAny() *known.Any {
func (x *KnownTypes) GetOptAny() *anypb.Any {
if x != nil {
return x.OptAny
}
return nil
}
func (x *KnownTypes) GetOptFieldmask() *known.FieldMask {
func (x *KnownTypes) GetOptFieldmask() *fieldmaskpb.FieldMask {
if x != nil {
return x.OptFieldmask
}
@ -1965,24 +1971,24 @@ var file_pb2_test_proto_goTypes = []interface{}{
(*Nests_RptGroup)(nil), // 19: pb2.Nests.RptGroup
(*Nests_OptGroup_OptNestedGroup)(nil), // 20: pb2.Nests.OptGroup.OptNestedGroup
nil, // 21: pb2.IndirectRequired.StrToNestedEntry
(*known.BoolValue)(nil), // 22: google.protobuf.BoolValue
(*known.Int32Value)(nil), // 23: google.protobuf.Int32Value
(*known.Int64Value)(nil), // 24: google.protobuf.Int64Value
(*known.UInt32Value)(nil), // 25: google.protobuf.UInt32Value
(*known.UInt64Value)(nil), // 26: google.protobuf.UInt64Value
(*known.FloatValue)(nil), // 27: google.protobuf.FloatValue
(*known.DoubleValue)(nil), // 28: google.protobuf.DoubleValue
(*known.StringValue)(nil), // 29: google.protobuf.StringValue
(*known.BytesValue)(nil), // 30: google.protobuf.BytesValue
(*known.Duration)(nil), // 31: google.protobuf.Duration
(*known.Timestamp)(nil), // 32: google.protobuf.Timestamp
(*known.Struct)(nil), // 33: google.protobuf.Struct
(*known.ListValue)(nil), // 34: google.protobuf.ListValue
(*known.Value)(nil), // 35: google.protobuf.Value
(known.NullValue)(0), // 36: google.protobuf.NullValue
(*known.Empty)(nil), // 37: google.protobuf.Empty
(*known.Any)(nil), // 38: google.protobuf.Any
(*known.FieldMask)(nil), // 39: google.protobuf.FieldMask
(*wrapperspb.BoolValue)(nil), // 22: google.protobuf.BoolValue
(*wrapperspb.Int32Value)(nil), // 23: google.protobuf.Int32Value
(*wrapperspb.Int64Value)(nil), // 24: google.protobuf.Int64Value
(*wrapperspb.UInt32Value)(nil), // 25: google.protobuf.UInt32Value
(*wrapperspb.UInt64Value)(nil), // 26: google.protobuf.UInt64Value
(*wrapperspb.FloatValue)(nil), // 27: google.protobuf.FloatValue
(*wrapperspb.DoubleValue)(nil), // 28: google.protobuf.DoubleValue
(*wrapperspb.StringValue)(nil), // 29: google.protobuf.StringValue
(*wrapperspb.BytesValue)(nil), // 30: google.protobuf.BytesValue
(*durationpb.Duration)(nil), // 31: google.protobuf.Duration
(*timestamppb.Timestamp)(nil), // 32: google.protobuf.Timestamp
(*structpb.Struct)(nil), // 33: google.protobuf.Struct
(*structpb.ListValue)(nil), // 34: google.protobuf.ListValue
(*structpb.Value)(nil), // 35: google.protobuf.Value
(structpb.NullValue)(0), // 36: google.protobuf.NullValue
(*emptypb.Empty)(nil), // 37: google.protobuf.Empty
(*anypb.Any)(nil), // 38: google.protobuf.Any
(*fieldmaskpb.FieldMask)(nil), // 39: google.protobuf.FieldMask
}
var file_pb2_test_proto_depIdxs = []int32{
11, // pb2.opt_ext_bool:extendee -> pb2.Extensions

View File

@ -290,21 +290,21 @@ func patchProtos(check func(error), repoRoot string) {
javaPackageRx := regexp.MustCompile(`^option\s+java_package\s*=\s*".*"\s*;\s*$`)
goPackageRx := regexp.MustCompile(`^option\s+go_package\s*=\s*".*"\s*;\s*$`)
files := map[string]string{
"src/google/protobuf/any.proto": "google.golang.org/protobuf/types/known;known_proto",
"src/google/protobuf/api.proto": "google.golang.org/protobuf/types/known;known_proto",
"src/google/protobuf/duration.proto": "google.golang.org/protobuf/types/known;known_proto",
"src/google/protobuf/empty.proto": "google.golang.org/protobuf/types/known;known_proto",
"src/google/protobuf/field_mask.proto": "google.golang.org/protobuf/types/known;known_proto",
"src/google/protobuf/source_context.proto": "google.golang.org/protobuf/types/known;known_proto",
"src/google/protobuf/struct.proto": "google.golang.org/protobuf/types/known;known_proto",
"src/google/protobuf/timestamp.proto": "google.golang.org/protobuf/types/known;known_proto",
"src/google/protobuf/type.proto": "google.golang.org/protobuf/types/known;known_proto",
"src/google/protobuf/wrappers.proto": "google.golang.org/protobuf/types/known;known_proto",
"src/google/protobuf/descriptor.proto": "google.golang.org/protobuf/types/descriptor;descriptor_proto",
"src/google/protobuf/compiler/plugin.proto": "google.golang.org/protobuf/types/plugin;plugin_proto",
"conformance/conformance.proto": "google.golang.org/protobuf/internal/testprotos/conformance;conformance",
"src/google/protobuf/test_messages_proto2.proto": "google.golang.org/protobuf/internal/testprotos/conformance;conformance",
"src/google/protobuf/test_messages_proto3.proto": "google.golang.org/protobuf/internal/testprotos/conformance;conformance",
"src/google/protobuf/any.proto": "google.golang.org/protobuf/types/known/anypb",
"src/google/protobuf/api.proto": "google.golang.org/protobuf/types/known/apipb",
"src/google/protobuf/duration.proto": "google.golang.org/protobuf/types/known/durationpb",
"src/google/protobuf/empty.proto": "google.golang.org/protobuf/types/known/emptypb",
"src/google/protobuf/field_mask.proto": "google.golang.org/protobuf/types/known/fieldmaskpb",
"src/google/protobuf/source_context.proto": "google.golang.org/protobuf/types/known/sourcecontextpb",
"src/google/protobuf/struct.proto": "google.golang.org/protobuf/types/known/structpb",
"src/google/protobuf/timestamp.proto": "google.golang.org/protobuf/types/known/timestamppb",
"src/google/protobuf/type.proto": "google.golang.org/protobuf/types/known/typepb",
"src/google/protobuf/wrappers.proto": "google.golang.org/protobuf/types/known/wrapperspb",
"src/google/protobuf/descriptor.proto": "google.golang.org/protobuf/types/descriptorpb",
"src/google/protobuf/compiler/plugin.proto": "google.golang.org/protobuf/types/pluginpb",
"conformance/conformance.proto": "google.golang.org/protobuf/internal/testprotos/conformance",
"src/google/protobuf/test_messages_proto2.proto": "google.golang.org/protobuf/internal/testprotos/conformance",
"src/google/protobuf/test_messages_proto3.proto": "google.golang.org/protobuf/internal/testprotos/conformance",
}
for pbpath, gopath := range files {
b, err := ioutil.ReadFile(filepath.Join(repoRoot, pbpath))

View File

@ -23,7 +23,7 @@ import (
"google.golang.org/protobuf/internal/scalar"
"google.golang.org/protobuf/reflect/protoreflect"
descriptorpb "google.golang.org/protobuf/types/descriptor"
"google.golang.org/protobuf/types/descriptorpb"
)
func main() {

View File

@ -7,10 +7,11 @@ import (
"testing"
proto "github.com/golang/protobuf/proto"
testpb "google.golang.org/protobuf/internal/testprotos/test"
"google.golang.org/protobuf/reflect/protodesc"
"google.golang.org/protobuf/reflect/protoreflect"
descriptorpb "google.golang.org/protobuf/types/descriptor"
testpb "google.golang.org/protobuf/internal/testprotos/test"
"google.golang.org/protobuf/types/descriptorpb"
)
func TestInit(t *testing.T) {

View File

@ -20,12 +20,8 @@ import (
pvalue "google.golang.org/protobuf/internal/value"
pref "google.golang.org/protobuf/reflect/protoreflect"
// The legacy package must be imported prior to use of any legacy messages.
// TODO: Remove this when protoV1 registers these hooks for you.
_ "google.golang.org/protobuf/internal/legacy"
proto2_20180125 "google.golang.org/protobuf/internal/testprotos/legacy/proto2.v1.0.0-20180125-92554152"
descriptorpb "google.golang.org/protobuf/types/descriptor"
"google.golang.org/protobuf/types/descriptorpb"
)
// List of test operations to perform on messages, lists, or maps.

View File

@ -17,7 +17,6 @@ import (
"google.golang.org/protobuf/proto"
pdesc "google.golang.org/protobuf/reflect/protodesc"
pref "google.golang.org/protobuf/reflect/protoreflect"
descriptorpb "google.golang.org/protobuf/types/descriptor"
proto2_20160225 "google.golang.org/protobuf/internal/testprotos/legacy/proto2.v0.0.0-20160225-2fc053c5"
proto2_20160519 "google.golang.org/protobuf/internal/testprotos/legacy/proto2.v0.0.0-20160519-a4ab9ec5"
@ -31,6 +30,7 @@ import (
proto3_20180430 "google.golang.org/protobuf/internal/testprotos/legacy/proto3.v1.1.0-20180430-b4deda09"
proto3_20180814 "google.golang.org/protobuf/internal/testprotos/legacy/proto3.v1.2.0-20180814-aa810b61"
proto3_20181126 "google.golang.org/protobuf/internal/testprotos/legacy/proto3.v1.2.1-20181126-8d0c54c1"
"google.golang.org/protobuf/types/descriptorpb"
)
func mustLoadFileDesc(b []byte, _ []int) pref.FileDescriptor {

View File

@ -20,7 +20,7 @@ import (
pdesc "google.golang.org/protobuf/reflect/protodesc"
pref "google.golang.org/protobuf/reflect/protoreflect"
descriptorpb "google.golang.org/protobuf/types/descriptor"
"google.golang.org/protobuf/types/descriptorpb"
)
func init() {

View File

@ -632,15 +632,14 @@ var file_conformance_conformance_proto_rawDesc = []byte{
0x52, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x50, 0x41, 0x52, 0x53, 0x49,
0x4e, 0x47, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x50,
0x42, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x45, 0x58, 0x54,
0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x10, 0x05, 0x42, 0x69,
0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x10, 0x05, 0x42, 0x5d,
0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63,
0x65, 0x5a, 0x46, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67,
0x65, 0x5a, 0x3a, 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, 0x69, 0x6e,
0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x3b, 0x63, 0x6f,
0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -1803,15 +1803,14 @@ var file_google_protobuf_test_messages_proto2_proto_rawDesc = []byte{
0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x32, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x73,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x18, 0x78, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x65, 0x78,
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x42, 0x77, 0x0a, 0x28,
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x42, 0x6b, 0x0a, 0x28,
0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x48, 0x01, 0x5a, 0x46, 0x67, 0x6f, 0x6f, 0x67,
0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x48, 0x01, 0x5a, 0x3a, 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, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f,
0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x6f,
0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e,
0x63, 0x65, 0xf8, 0x01, 0x01,
0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0xf8, 0x01, 0x01,
}
var (

View File

@ -8,7 +8,12 @@ import (
protoregistry "google.golang.org/protobuf/reflect/protoregistry"
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
known "google.golang.org/protobuf/types/known"
anypb "google.golang.org/protobuf/types/known/anypb"
durationpb "google.golang.org/protobuf/types/known/durationpb"
fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
structpb "google.golang.org/protobuf/types/known/structpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
sync "sync"
)
@ -244,37 +249,37 @@ type TestAllTypesProto3 struct {
// *TestAllTypesProto3_OneofEnum
OneofField isTestAllTypesProto3_OneofField `protobuf_oneof:"oneof_field"`
// Well-known types
OptionalBoolWrapper *known.BoolValue `protobuf:"bytes,201,opt,name=optional_bool_wrapper,json=optionalBoolWrapper,proto3" json:"optional_bool_wrapper,omitempty"`
OptionalInt32Wrapper *known.Int32Value `protobuf:"bytes,202,opt,name=optional_int32_wrapper,json=optionalInt32Wrapper,proto3" json:"optional_int32_wrapper,omitempty"`
OptionalInt64Wrapper *known.Int64Value `protobuf:"bytes,203,opt,name=optional_int64_wrapper,json=optionalInt64Wrapper,proto3" json:"optional_int64_wrapper,omitempty"`
OptionalUint32Wrapper *known.UInt32Value `protobuf:"bytes,204,opt,name=optional_uint32_wrapper,json=optionalUint32Wrapper,proto3" json:"optional_uint32_wrapper,omitempty"`
OptionalUint64Wrapper *known.UInt64Value `protobuf:"bytes,205,opt,name=optional_uint64_wrapper,json=optionalUint64Wrapper,proto3" json:"optional_uint64_wrapper,omitempty"`
OptionalFloatWrapper *known.FloatValue `protobuf:"bytes,206,opt,name=optional_float_wrapper,json=optionalFloatWrapper,proto3" json:"optional_float_wrapper,omitempty"`
OptionalDoubleWrapper *known.DoubleValue `protobuf:"bytes,207,opt,name=optional_double_wrapper,json=optionalDoubleWrapper,proto3" json:"optional_double_wrapper,omitempty"`
OptionalStringWrapper *known.StringValue `protobuf:"bytes,208,opt,name=optional_string_wrapper,json=optionalStringWrapper,proto3" json:"optional_string_wrapper,omitempty"`
OptionalBytesWrapper *known.BytesValue `protobuf:"bytes,209,opt,name=optional_bytes_wrapper,json=optionalBytesWrapper,proto3" json:"optional_bytes_wrapper,omitempty"`
RepeatedBoolWrapper []*known.BoolValue `protobuf:"bytes,211,rep,name=repeated_bool_wrapper,json=repeatedBoolWrapper,proto3" json:"repeated_bool_wrapper,omitempty"`
RepeatedInt32Wrapper []*known.Int32Value `protobuf:"bytes,212,rep,name=repeated_int32_wrapper,json=repeatedInt32Wrapper,proto3" json:"repeated_int32_wrapper,omitempty"`
RepeatedInt64Wrapper []*known.Int64Value `protobuf:"bytes,213,rep,name=repeated_int64_wrapper,json=repeatedInt64Wrapper,proto3" json:"repeated_int64_wrapper,omitempty"`
RepeatedUint32Wrapper []*known.UInt32Value `protobuf:"bytes,214,rep,name=repeated_uint32_wrapper,json=repeatedUint32Wrapper,proto3" json:"repeated_uint32_wrapper,omitempty"`
RepeatedUint64Wrapper []*known.UInt64Value `protobuf:"bytes,215,rep,name=repeated_uint64_wrapper,json=repeatedUint64Wrapper,proto3" json:"repeated_uint64_wrapper,omitempty"`
RepeatedFloatWrapper []*known.FloatValue `protobuf:"bytes,216,rep,name=repeated_float_wrapper,json=repeatedFloatWrapper,proto3" json:"repeated_float_wrapper,omitempty"`
RepeatedDoubleWrapper []*known.DoubleValue `protobuf:"bytes,217,rep,name=repeated_double_wrapper,json=repeatedDoubleWrapper,proto3" json:"repeated_double_wrapper,omitempty"`
RepeatedStringWrapper []*known.StringValue `protobuf:"bytes,218,rep,name=repeated_string_wrapper,json=repeatedStringWrapper,proto3" json:"repeated_string_wrapper,omitempty"`
RepeatedBytesWrapper []*known.BytesValue `protobuf:"bytes,219,rep,name=repeated_bytes_wrapper,json=repeatedBytesWrapper,proto3" json:"repeated_bytes_wrapper,omitempty"`
OptionalDuration *known.Duration `protobuf:"bytes,301,opt,name=optional_duration,json=optionalDuration,proto3" json:"optional_duration,omitempty"`
OptionalTimestamp *known.Timestamp `protobuf:"bytes,302,opt,name=optional_timestamp,json=optionalTimestamp,proto3" json:"optional_timestamp,omitempty"`
OptionalFieldMask *known.FieldMask `protobuf:"bytes,303,opt,name=optional_field_mask,json=optionalFieldMask,proto3" json:"optional_field_mask,omitempty"`
OptionalStruct *known.Struct `protobuf:"bytes,304,opt,name=optional_struct,json=optionalStruct,proto3" json:"optional_struct,omitempty"`
OptionalAny *known.Any `protobuf:"bytes,305,opt,name=optional_any,json=optionalAny,proto3" json:"optional_any,omitempty"`
OptionalValue *known.Value `protobuf:"bytes,306,opt,name=optional_value,json=optionalValue,proto3" json:"optional_value,omitempty"`
RepeatedDuration []*known.Duration `protobuf:"bytes,311,rep,name=repeated_duration,json=repeatedDuration,proto3" json:"repeated_duration,omitempty"`
RepeatedTimestamp []*known.Timestamp `protobuf:"bytes,312,rep,name=repeated_timestamp,json=repeatedTimestamp,proto3" json:"repeated_timestamp,omitempty"`
RepeatedFieldmask []*known.FieldMask `protobuf:"bytes,313,rep,name=repeated_fieldmask,json=repeatedFieldmask,proto3" json:"repeated_fieldmask,omitempty"`
RepeatedStruct []*known.Struct `protobuf:"bytes,324,rep,name=repeated_struct,json=repeatedStruct,proto3" json:"repeated_struct,omitempty"`
RepeatedAny []*known.Any `protobuf:"bytes,315,rep,name=repeated_any,json=repeatedAny,proto3" json:"repeated_any,omitempty"`
RepeatedValue []*known.Value `protobuf:"bytes,316,rep,name=repeated_value,json=repeatedValue,proto3" json:"repeated_value,omitempty"`
RepeatedListValue []*known.ListValue `protobuf:"bytes,317,rep,name=repeated_list_value,json=repeatedListValue,proto3" json:"repeated_list_value,omitempty"`
OptionalBoolWrapper *wrapperspb.BoolValue `protobuf:"bytes,201,opt,name=optional_bool_wrapper,json=optionalBoolWrapper,proto3" json:"optional_bool_wrapper,omitempty"`
OptionalInt32Wrapper *wrapperspb.Int32Value `protobuf:"bytes,202,opt,name=optional_int32_wrapper,json=optionalInt32Wrapper,proto3" json:"optional_int32_wrapper,omitempty"`
OptionalInt64Wrapper *wrapperspb.Int64Value `protobuf:"bytes,203,opt,name=optional_int64_wrapper,json=optionalInt64Wrapper,proto3" json:"optional_int64_wrapper,omitempty"`
OptionalUint32Wrapper *wrapperspb.UInt32Value `protobuf:"bytes,204,opt,name=optional_uint32_wrapper,json=optionalUint32Wrapper,proto3" json:"optional_uint32_wrapper,omitempty"`
OptionalUint64Wrapper *wrapperspb.UInt64Value `protobuf:"bytes,205,opt,name=optional_uint64_wrapper,json=optionalUint64Wrapper,proto3" json:"optional_uint64_wrapper,omitempty"`
OptionalFloatWrapper *wrapperspb.FloatValue `protobuf:"bytes,206,opt,name=optional_float_wrapper,json=optionalFloatWrapper,proto3" json:"optional_float_wrapper,omitempty"`
OptionalDoubleWrapper *wrapperspb.DoubleValue `protobuf:"bytes,207,opt,name=optional_double_wrapper,json=optionalDoubleWrapper,proto3" json:"optional_double_wrapper,omitempty"`
OptionalStringWrapper *wrapperspb.StringValue `protobuf:"bytes,208,opt,name=optional_string_wrapper,json=optionalStringWrapper,proto3" json:"optional_string_wrapper,omitempty"`
OptionalBytesWrapper *wrapperspb.BytesValue `protobuf:"bytes,209,opt,name=optional_bytes_wrapper,json=optionalBytesWrapper,proto3" json:"optional_bytes_wrapper,omitempty"`
RepeatedBoolWrapper []*wrapperspb.BoolValue `protobuf:"bytes,211,rep,name=repeated_bool_wrapper,json=repeatedBoolWrapper,proto3" json:"repeated_bool_wrapper,omitempty"`
RepeatedInt32Wrapper []*wrapperspb.Int32Value `protobuf:"bytes,212,rep,name=repeated_int32_wrapper,json=repeatedInt32Wrapper,proto3" json:"repeated_int32_wrapper,omitempty"`
RepeatedInt64Wrapper []*wrapperspb.Int64Value `protobuf:"bytes,213,rep,name=repeated_int64_wrapper,json=repeatedInt64Wrapper,proto3" json:"repeated_int64_wrapper,omitempty"`
RepeatedUint32Wrapper []*wrapperspb.UInt32Value `protobuf:"bytes,214,rep,name=repeated_uint32_wrapper,json=repeatedUint32Wrapper,proto3" json:"repeated_uint32_wrapper,omitempty"`
RepeatedUint64Wrapper []*wrapperspb.UInt64Value `protobuf:"bytes,215,rep,name=repeated_uint64_wrapper,json=repeatedUint64Wrapper,proto3" json:"repeated_uint64_wrapper,omitempty"`
RepeatedFloatWrapper []*wrapperspb.FloatValue `protobuf:"bytes,216,rep,name=repeated_float_wrapper,json=repeatedFloatWrapper,proto3" json:"repeated_float_wrapper,omitempty"`
RepeatedDoubleWrapper []*wrapperspb.DoubleValue `protobuf:"bytes,217,rep,name=repeated_double_wrapper,json=repeatedDoubleWrapper,proto3" json:"repeated_double_wrapper,omitempty"`
RepeatedStringWrapper []*wrapperspb.StringValue `protobuf:"bytes,218,rep,name=repeated_string_wrapper,json=repeatedStringWrapper,proto3" json:"repeated_string_wrapper,omitempty"`
RepeatedBytesWrapper []*wrapperspb.BytesValue `protobuf:"bytes,219,rep,name=repeated_bytes_wrapper,json=repeatedBytesWrapper,proto3" json:"repeated_bytes_wrapper,omitempty"`
OptionalDuration *durationpb.Duration `protobuf:"bytes,301,opt,name=optional_duration,json=optionalDuration,proto3" json:"optional_duration,omitempty"`
OptionalTimestamp *timestamppb.Timestamp `protobuf:"bytes,302,opt,name=optional_timestamp,json=optionalTimestamp,proto3" json:"optional_timestamp,omitempty"`
OptionalFieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,303,opt,name=optional_field_mask,json=optionalFieldMask,proto3" json:"optional_field_mask,omitempty"`
OptionalStruct *structpb.Struct `protobuf:"bytes,304,opt,name=optional_struct,json=optionalStruct,proto3" json:"optional_struct,omitempty"`
OptionalAny *anypb.Any `protobuf:"bytes,305,opt,name=optional_any,json=optionalAny,proto3" json:"optional_any,omitempty"`
OptionalValue *structpb.Value `protobuf:"bytes,306,opt,name=optional_value,json=optionalValue,proto3" json:"optional_value,omitempty"`
RepeatedDuration []*durationpb.Duration `protobuf:"bytes,311,rep,name=repeated_duration,json=repeatedDuration,proto3" json:"repeated_duration,omitempty"`
RepeatedTimestamp []*timestamppb.Timestamp `protobuf:"bytes,312,rep,name=repeated_timestamp,json=repeatedTimestamp,proto3" json:"repeated_timestamp,omitempty"`
RepeatedFieldmask []*fieldmaskpb.FieldMask `protobuf:"bytes,313,rep,name=repeated_fieldmask,json=repeatedFieldmask,proto3" json:"repeated_fieldmask,omitempty"`
RepeatedStruct []*structpb.Struct `protobuf:"bytes,324,rep,name=repeated_struct,json=repeatedStruct,proto3" json:"repeated_struct,omitempty"`
RepeatedAny []*anypb.Any `protobuf:"bytes,315,rep,name=repeated_any,json=repeatedAny,proto3" json:"repeated_any,omitempty"`
RepeatedValue []*structpb.Value `protobuf:"bytes,316,rep,name=repeated_value,json=repeatedValue,proto3" json:"repeated_value,omitempty"`
RepeatedListValue []*structpb.ListValue `protobuf:"bytes,317,rep,name=repeated_list_value,json=repeatedListValue,proto3" json:"repeated_list_value,omitempty"`
// Test field-name-to-JSON-name convention.
// (protobuf says names can be any valid C/C++ identifier.)
Fieldname1 int32 `protobuf:"varint,401,opt,name=fieldname1,proto3" json:"fieldname1,omitempty"`
@ -834,217 +839,217 @@ func (x *TestAllTypesProto3) GetOneofEnum() TestAllTypesProto3_NestedEnum {
return TestAllTypesProto3_FOO
}
func (x *TestAllTypesProto3) GetOptionalBoolWrapper() *known.BoolValue {
func (x *TestAllTypesProto3) GetOptionalBoolWrapper() *wrapperspb.BoolValue {
if x != nil {
return x.OptionalBoolWrapper
}
return nil
}
func (x *TestAllTypesProto3) GetOptionalInt32Wrapper() *known.Int32Value {
func (x *TestAllTypesProto3) GetOptionalInt32Wrapper() *wrapperspb.Int32Value {
if x != nil {
return x.OptionalInt32Wrapper
}
return nil
}
func (x *TestAllTypesProto3) GetOptionalInt64Wrapper() *known.Int64Value {
func (x *TestAllTypesProto3) GetOptionalInt64Wrapper() *wrapperspb.Int64Value {
if x != nil {
return x.OptionalInt64Wrapper
}
return nil
}
func (x *TestAllTypesProto3) GetOptionalUint32Wrapper() *known.UInt32Value {
func (x *TestAllTypesProto3) GetOptionalUint32Wrapper() *wrapperspb.UInt32Value {
if x != nil {
return x.OptionalUint32Wrapper
}
return nil
}
func (x *TestAllTypesProto3) GetOptionalUint64Wrapper() *known.UInt64Value {
func (x *TestAllTypesProto3) GetOptionalUint64Wrapper() *wrapperspb.UInt64Value {
if x != nil {
return x.OptionalUint64Wrapper
}
return nil
}
func (x *TestAllTypesProto3) GetOptionalFloatWrapper() *known.FloatValue {
func (x *TestAllTypesProto3) GetOptionalFloatWrapper() *wrapperspb.FloatValue {
if x != nil {
return x.OptionalFloatWrapper
}
return nil
}
func (x *TestAllTypesProto3) GetOptionalDoubleWrapper() *known.DoubleValue {
func (x *TestAllTypesProto3) GetOptionalDoubleWrapper() *wrapperspb.DoubleValue {
if x != nil {
return x.OptionalDoubleWrapper
}
return nil
}
func (x *TestAllTypesProto3) GetOptionalStringWrapper() *known.StringValue {
func (x *TestAllTypesProto3) GetOptionalStringWrapper() *wrapperspb.StringValue {
if x != nil {
return x.OptionalStringWrapper
}
return nil
}
func (x *TestAllTypesProto3) GetOptionalBytesWrapper() *known.BytesValue {
func (x *TestAllTypesProto3) GetOptionalBytesWrapper() *wrapperspb.BytesValue {
if x != nil {
return x.OptionalBytesWrapper
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedBoolWrapper() []*known.BoolValue {
func (x *TestAllTypesProto3) GetRepeatedBoolWrapper() []*wrapperspb.BoolValue {
if x != nil {
return x.RepeatedBoolWrapper
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedInt32Wrapper() []*known.Int32Value {
func (x *TestAllTypesProto3) GetRepeatedInt32Wrapper() []*wrapperspb.Int32Value {
if x != nil {
return x.RepeatedInt32Wrapper
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedInt64Wrapper() []*known.Int64Value {
func (x *TestAllTypesProto3) GetRepeatedInt64Wrapper() []*wrapperspb.Int64Value {
if x != nil {
return x.RepeatedInt64Wrapper
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedUint32Wrapper() []*known.UInt32Value {
func (x *TestAllTypesProto3) GetRepeatedUint32Wrapper() []*wrapperspb.UInt32Value {
if x != nil {
return x.RepeatedUint32Wrapper
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedUint64Wrapper() []*known.UInt64Value {
func (x *TestAllTypesProto3) GetRepeatedUint64Wrapper() []*wrapperspb.UInt64Value {
if x != nil {
return x.RepeatedUint64Wrapper
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedFloatWrapper() []*known.FloatValue {
func (x *TestAllTypesProto3) GetRepeatedFloatWrapper() []*wrapperspb.FloatValue {
if x != nil {
return x.RepeatedFloatWrapper
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedDoubleWrapper() []*known.DoubleValue {
func (x *TestAllTypesProto3) GetRepeatedDoubleWrapper() []*wrapperspb.DoubleValue {
if x != nil {
return x.RepeatedDoubleWrapper
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedStringWrapper() []*known.StringValue {
func (x *TestAllTypesProto3) GetRepeatedStringWrapper() []*wrapperspb.StringValue {
if x != nil {
return x.RepeatedStringWrapper
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedBytesWrapper() []*known.BytesValue {
func (x *TestAllTypesProto3) GetRepeatedBytesWrapper() []*wrapperspb.BytesValue {
if x != nil {
return x.RepeatedBytesWrapper
}
return nil
}
func (x *TestAllTypesProto3) GetOptionalDuration() *known.Duration {
func (x *TestAllTypesProto3) GetOptionalDuration() *durationpb.Duration {
if x != nil {
return x.OptionalDuration
}
return nil
}
func (x *TestAllTypesProto3) GetOptionalTimestamp() *known.Timestamp {
func (x *TestAllTypesProto3) GetOptionalTimestamp() *timestamppb.Timestamp {
if x != nil {
return x.OptionalTimestamp
}
return nil
}
func (x *TestAllTypesProto3) GetOptionalFieldMask() *known.FieldMask {
func (x *TestAllTypesProto3) GetOptionalFieldMask() *fieldmaskpb.FieldMask {
if x != nil {
return x.OptionalFieldMask
}
return nil
}
func (x *TestAllTypesProto3) GetOptionalStruct() *known.Struct {
func (x *TestAllTypesProto3) GetOptionalStruct() *structpb.Struct {
if x != nil {
return x.OptionalStruct
}
return nil
}
func (x *TestAllTypesProto3) GetOptionalAny() *known.Any {
func (x *TestAllTypesProto3) GetOptionalAny() *anypb.Any {
if x != nil {
return x.OptionalAny
}
return nil
}
func (x *TestAllTypesProto3) GetOptionalValue() *known.Value {
func (x *TestAllTypesProto3) GetOptionalValue() *structpb.Value {
if x != nil {
return x.OptionalValue
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedDuration() []*known.Duration {
func (x *TestAllTypesProto3) GetRepeatedDuration() []*durationpb.Duration {
if x != nil {
return x.RepeatedDuration
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedTimestamp() []*known.Timestamp {
func (x *TestAllTypesProto3) GetRepeatedTimestamp() []*timestamppb.Timestamp {
if x != nil {
return x.RepeatedTimestamp
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedFieldmask() []*known.FieldMask {
func (x *TestAllTypesProto3) GetRepeatedFieldmask() []*fieldmaskpb.FieldMask {
if x != nil {
return x.RepeatedFieldmask
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedStruct() []*known.Struct {
func (x *TestAllTypesProto3) GetRepeatedStruct() []*structpb.Struct {
if x != nil {
return x.RepeatedStruct
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedAny() []*known.Any {
func (x *TestAllTypesProto3) GetRepeatedAny() []*anypb.Any {
if x != nil {
return x.RepeatedAny
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedValue() []*known.Value {
func (x *TestAllTypesProto3) GetRepeatedValue() []*structpb.Value {
if x != nil {
return x.RepeatedValue
}
return nil
}
func (x *TestAllTypesProto3) GetRepeatedListValue() []*known.ListValue {
func (x *TestAllTypesProto3) GetRepeatedListValue() []*structpb.ListValue {
if x != nil {
return x.RepeatedListValue
}
@ -1993,16 +1998,15 @@ var file_google_protobuf_test_messages_proto3_proto_rawDesc = []byte{
0x69, 0x67, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0f, 0x0a, 0x0b, 0x46, 0x4f, 0x52, 0x45, 0x49,
0x47, 0x4e, 0x5f, 0x46, 0x4f, 0x4f, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x46, 0x4f, 0x52, 0x45,
0x49, 0x47, 0x4e, 0x5f, 0x42, 0x41, 0x52, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x46, 0x4f, 0x52,
0x45, 0x49, 0x47, 0x4e, 0x5f, 0x42, 0x41, 0x5a, 0x10, 0x02, 0x42, 0x80, 0x01, 0x0a, 0x28, 0x63,
0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x48, 0x01, 0x5a, 0x46, 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, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74,
0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72,
0x6d, 0x61, 0x6e, 0x63, 0x65, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63,
0x65, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x45, 0x49, 0x47, 0x4e, 0x5f, 0x42, 0x41, 0x5a, 0x10, 0x02, 0x42, 0x74, 0x0a, 0x28, 0x63, 0x6f,
0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x48, 0x01, 0x5a, 0x3a, 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, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65,
0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d,
0x61, 0x6e, 0x63, 0x65, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -2045,22 +2049,22 @@ var file_google_protobuf_test_messages_proto3_proto_goTypes = []interface{}{
nil, // 22: protobuf_test_messages.proto3.TestAllTypesProto3.MapStringForeignMessageEntry
nil, // 23: protobuf_test_messages.proto3.TestAllTypesProto3.MapStringNestedEnumEntry
nil, // 24: protobuf_test_messages.proto3.TestAllTypesProto3.MapStringForeignEnumEntry
(*known.BoolValue)(nil), // 25: google.protobuf.BoolValue
(*known.Int32Value)(nil), // 26: google.protobuf.Int32Value
(*known.Int64Value)(nil), // 27: google.protobuf.Int64Value
(*known.UInt32Value)(nil), // 28: google.protobuf.UInt32Value
(*known.UInt64Value)(nil), // 29: google.protobuf.UInt64Value
(*known.FloatValue)(nil), // 30: google.protobuf.FloatValue
(*known.DoubleValue)(nil), // 31: google.protobuf.DoubleValue
(*known.StringValue)(nil), // 32: google.protobuf.StringValue
(*known.BytesValue)(nil), // 33: google.protobuf.BytesValue
(*known.Duration)(nil), // 34: google.protobuf.Duration
(*known.Timestamp)(nil), // 35: google.protobuf.Timestamp
(*known.FieldMask)(nil), // 36: google.protobuf.FieldMask
(*known.Struct)(nil), // 37: google.protobuf.Struct
(*known.Any)(nil), // 38: google.protobuf.Any
(*known.Value)(nil), // 39: google.protobuf.Value
(*known.ListValue)(nil), // 40: google.protobuf.ListValue
(*wrapperspb.BoolValue)(nil), // 25: google.protobuf.BoolValue
(*wrapperspb.Int32Value)(nil), // 26: google.protobuf.Int32Value
(*wrapperspb.Int64Value)(nil), // 27: google.protobuf.Int64Value
(*wrapperspb.UInt32Value)(nil), // 28: google.protobuf.UInt32Value
(*wrapperspb.UInt64Value)(nil), // 29: google.protobuf.UInt64Value
(*wrapperspb.FloatValue)(nil), // 30: google.protobuf.FloatValue
(*wrapperspb.DoubleValue)(nil), // 31: google.protobuf.DoubleValue
(*wrapperspb.StringValue)(nil), // 32: google.protobuf.StringValue
(*wrapperspb.BytesValue)(nil), // 33: google.protobuf.BytesValue
(*durationpb.Duration)(nil), // 34: google.protobuf.Duration
(*timestamppb.Timestamp)(nil), // 35: google.protobuf.Timestamp
(*fieldmaskpb.FieldMask)(nil), // 36: google.protobuf.FieldMask
(*structpb.Struct)(nil), // 37: google.protobuf.Struct
(*anypb.Any)(nil), // 38: google.protobuf.Any
(*structpb.Value)(nil), // 39: google.protobuf.Value
(*structpb.ListValue)(nil), // 40: google.protobuf.ListValue
}
var file_google_protobuf_test_messages_proto3_proto_depIdxs = []int32{
5, // protobuf_test_messages.proto3.TestAllTypesProto3.optional_nested_message:type_name -> protobuf_test_messages.proto3.TestAllTypesProto3.NestedMessage

View File

@ -15,7 +15,7 @@ import (
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/reflect/protoregistry"
descriptorpb "google.golang.org/protobuf/types/descriptor"
"google.golang.org/protobuf/types/descriptorpb"
)
// TODO: Should we be responsible for validating other parts of the descriptor

View File

@ -7,7 +7,7 @@ import (
"google.golang.org/protobuf/internal/scalar"
"google.golang.org/protobuf/reflect/protoregistry"
descriptorpb "google.golang.org/protobuf/types/descriptor"
"google.golang.org/protobuf/types/descriptorpb"
)
// Tests validation logic for malformed descriptors.

View File

@ -9,7 +9,8 @@ import (
"google.golang.org/protobuf/internal/encoding/defval"
"google.golang.org/protobuf/internal/scalar"
"google.golang.org/protobuf/reflect/protoreflect"
descriptorpb "google.golang.org/protobuf/types/descriptor"
"google.golang.org/protobuf/types/descriptorpb"
)
// ToFileDescriptorProto converts a FileDescriptor to a

121
types/descriptor/stub.go Normal file
View File

@ -0,0 +1,121 @@
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// TODO: This file exists to have the minimum number of forwarding declarations
// to keep v1 working. This will be deleted in the near future.
package descriptor_proto
import "google.golang.org/protobuf/types/descriptorpb"
type (
DescriptorProto = descriptorpb.DescriptorProto
DescriptorProto_ExtensionRange = descriptorpb.DescriptorProto_ExtensionRange
DescriptorProto_ReservedRange = descriptorpb.DescriptorProto_ReservedRange
EnumDescriptorProto = descriptorpb.EnumDescriptorProto
EnumDescriptorProto_EnumReservedRange = descriptorpb.EnumDescriptorProto_EnumReservedRange
EnumOptions = descriptorpb.EnumOptions
EnumValueDescriptorProto = descriptorpb.EnumValueDescriptorProto
EnumValueOptions = descriptorpb.EnumValueOptions
ExtensionRangeOptions = descriptorpb.ExtensionRangeOptions
FieldDescriptorProto = descriptorpb.FieldDescriptorProto
FieldDescriptorProto_Label = descriptorpb.FieldDescriptorProto_Label
FieldDescriptorProto_Type = descriptorpb.FieldDescriptorProto_Type
FieldOptions = descriptorpb.FieldOptions
FieldOptions_CType = descriptorpb.FieldOptions_CType
FieldOptions_JSType = descriptorpb.FieldOptions_JSType
FileDescriptorProto = descriptorpb.FileDescriptorProto
FileDescriptorSet = descriptorpb.FileDescriptorSet
FileOptions = descriptorpb.FileOptions
FileOptions_OptimizeMode = descriptorpb.FileOptions_OptimizeMode
GeneratedCodeInfo = descriptorpb.GeneratedCodeInfo
GeneratedCodeInfo_Annotation = descriptorpb.GeneratedCodeInfo_Annotation
MessageOptions = descriptorpb.MessageOptions
MethodDescriptorProto = descriptorpb.MethodDescriptorProto
MethodOptions = descriptorpb.MethodOptions
MethodOptions_IdempotencyLevel = descriptorpb.MethodOptions_IdempotencyLevel
OneofDescriptorProto = descriptorpb.OneofDescriptorProto
OneofOptions = descriptorpb.OneofOptions
ServiceDescriptorProto = descriptorpb.ServiceDescriptorProto
ServiceOptions = descriptorpb.ServiceOptions
SourceCodeInfo = descriptorpb.SourceCodeInfo
SourceCodeInfo_Location = descriptorpb.SourceCodeInfo_Location
UninterpretedOption = descriptorpb.UninterpretedOption
UninterpretedOption_NamePart = descriptorpb.UninterpretedOption_NamePart
)
const (
Default_EnumOptions_Deprecated = descriptorpb.Default_EnumOptions_Deprecated
Default_EnumValueOptions_Deprecated = descriptorpb.Default_EnumValueOptions_Deprecated
Default_FieldOptions_Ctype = descriptorpb.Default_FieldOptions_Ctype
Default_FieldOptions_Deprecated = descriptorpb.Default_FieldOptions_Deprecated
Default_FieldOptions_Jstype = descriptorpb.Default_FieldOptions_Jstype
Default_FieldOptions_Lazy = descriptorpb.Default_FieldOptions_Lazy
Default_FieldOptions_Weak = descriptorpb.Default_FieldOptions_Weak
Default_FileOptions_CcEnableArenas = descriptorpb.Default_FileOptions_CcEnableArenas
Default_FileOptions_CcGenericServices = descriptorpb.Default_FileOptions_CcGenericServices
Default_FileOptions_Deprecated = descriptorpb.Default_FileOptions_Deprecated
Default_FileOptions_JavaGenericServices = descriptorpb.Default_FileOptions_JavaGenericServices
Default_FileOptions_JavaMultipleFiles = descriptorpb.Default_FileOptions_JavaMultipleFiles
Default_FileOptions_JavaStringCheckUtf8 = descriptorpb.Default_FileOptions_JavaStringCheckUtf8
Default_FileOptions_OptimizeFor = descriptorpb.Default_FileOptions_OptimizeFor
Default_FileOptions_PhpGenericServices = descriptorpb.Default_FileOptions_PhpGenericServices
Default_FileOptions_PyGenericServices = descriptorpb.Default_FileOptions_PyGenericServices
Default_MessageOptions_Deprecated = descriptorpb.Default_MessageOptions_Deprecated
Default_MessageOptions_MessageSetWireFormat = descriptorpb.Default_MessageOptions_MessageSetWireFormat
Default_MessageOptions_NoStandardDescriptorAccessor = descriptorpb.Default_MessageOptions_NoStandardDescriptorAccessor
Default_MethodDescriptorProto_ClientStreaming = descriptorpb.Default_MethodDescriptorProto_ClientStreaming
Default_MethodDescriptorProto_ServerStreaming = descriptorpb.Default_MethodDescriptorProto_ServerStreaming
Default_MethodOptions_Deprecated = descriptorpb.Default_MethodOptions_Deprecated
Default_MethodOptions_IdempotencyLevel = descriptorpb.Default_MethodOptions_IdempotencyLevel
Default_ServiceOptions_Deprecated = descriptorpb.Default_ServiceOptions_Deprecated
FieldDescriptorProto_LABEL_OPTIONAL = descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL
FieldDescriptorProto_LABEL_REPEATED = descriptorpb.FieldDescriptorProto_LABEL_REPEATED
FieldDescriptorProto_LABEL_REQUIRED = descriptorpb.FieldDescriptorProto_LABEL_REQUIRED
FieldDescriptorProto_TYPE_BOOL = descriptorpb.FieldDescriptorProto_TYPE_BOOL
FieldDescriptorProto_TYPE_BYTES = descriptorpb.FieldDescriptorProto_TYPE_BYTES
FieldDescriptorProto_TYPE_DOUBLE = descriptorpb.FieldDescriptorProto_TYPE_DOUBLE
FieldDescriptorProto_TYPE_ENUM = descriptorpb.FieldDescriptorProto_TYPE_ENUM
FieldDescriptorProto_TYPE_FIXED32 = descriptorpb.FieldDescriptorProto_TYPE_FIXED32
FieldDescriptorProto_TYPE_FIXED64 = descriptorpb.FieldDescriptorProto_TYPE_FIXED64
FieldDescriptorProto_TYPE_FLOAT = descriptorpb.FieldDescriptorProto_TYPE_FLOAT
FieldDescriptorProto_TYPE_GROUP = descriptorpb.FieldDescriptorProto_TYPE_GROUP
FieldDescriptorProto_TYPE_INT32 = descriptorpb.FieldDescriptorProto_TYPE_INT32
FieldDescriptorProto_TYPE_INT64 = descriptorpb.FieldDescriptorProto_TYPE_INT64
FieldDescriptorProto_TYPE_MESSAGE = descriptorpb.FieldDescriptorProto_TYPE_MESSAGE
FieldDescriptorProto_TYPE_SFIXED32 = descriptorpb.FieldDescriptorProto_TYPE_SFIXED32
FieldDescriptorProto_TYPE_SFIXED64 = descriptorpb.FieldDescriptorProto_TYPE_SFIXED64
FieldDescriptorProto_TYPE_SINT32 = descriptorpb.FieldDescriptorProto_TYPE_SINT32
FieldDescriptorProto_TYPE_SINT64 = descriptorpb.FieldDescriptorProto_TYPE_SINT64
FieldDescriptorProto_TYPE_STRING = descriptorpb.FieldDescriptorProto_TYPE_STRING
FieldDescriptorProto_TYPE_UINT32 = descriptorpb.FieldDescriptorProto_TYPE_UINT32
FieldDescriptorProto_TYPE_UINT64 = descriptorpb.FieldDescriptorProto_TYPE_UINT64
FieldOptions_CORD = descriptorpb.FieldOptions_CORD
FieldOptions_JS_NORMAL = descriptorpb.FieldOptions_JS_NORMAL
FieldOptions_JS_NUMBER = descriptorpb.FieldOptions_JS_NUMBER
FieldOptions_JS_STRING = descriptorpb.FieldOptions_JS_STRING
FieldOptions_STRING = descriptorpb.FieldOptions_STRING
FieldOptions_STRING_PIECE = descriptorpb.FieldOptions_STRING_PIECE
FileOptions_CODE_SIZE = descriptorpb.FileOptions_CODE_SIZE
FileOptions_LITE_RUNTIME = descriptorpb.FileOptions_LITE_RUNTIME
FileOptions_SPEED = descriptorpb.FileOptions_SPEED
MethodOptions_IDEMPOTENCY_UNKNOWN = descriptorpb.MethodOptions_IDEMPOTENCY_UNKNOWN
MethodOptions_IDEMPOTENT = descriptorpb.MethodOptions_IDEMPOTENT
MethodOptions_NO_SIDE_EFFECTS = descriptorpb.MethodOptions_NO_SIDE_EFFECTS
)
var (
FieldDescriptorProto_Label_name = descriptorpb.FieldDescriptorProto_Label_name
FieldDescriptorProto_Label_value = descriptorpb.FieldDescriptorProto_Label_value
FieldDescriptorProto_Type_name = descriptorpb.FieldDescriptorProto_Type_name
FieldDescriptorProto_Type_value = descriptorpb.FieldDescriptorProto_Type_value
FieldOptions_CType_name = descriptorpb.FieldOptions_CType_name
FieldOptions_CType_value = descriptorpb.FieldOptions_CType_value
FieldOptions_JSType_name = descriptorpb.FieldOptions_JSType_name
FieldOptions_JSType_value = descriptorpb.FieldOptions_JSType_value
File_google_protobuf_descriptor_proto = descriptorpb.File_google_protobuf_descriptor_proto
FileOptions_OptimizeMode_name = descriptorpb.FileOptions_OptimizeMode_name
FileOptions_OptimizeMode_value = descriptorpb.FileOptions_OptimizeMode_value
MethodOptions_IdempotencyLevel_name = descriptorpb.MethodOptions_IdempotencyLevel_name
MethodOptions_IdempotencyLevel_value = descriptorpb.MethodOptions_IdempotencyLevel_value
)

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/descriptor.proto
package descriptor_proto
package descriptorpb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -3199,14 +3199,13 @@ var file_google_protobuf_descriptor_proto_rawDesc = []byte{
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, 0x42, 0x8d, 0x01, 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, 0x3c, 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, 0x3b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1a, 0x47,
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 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,
}

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/any.proto
package known_proto
package anypb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -178,15 +178,15 @@ var file_google_protobuf_any_proto_rawDesc = []byte{
0x41, 0x6e, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x79, 0x70, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x14,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x42, 0x7c, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x61, 0x6c, 0x75, 0x65, 0x42, 0x76, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x08, 0x41, 0x6e, 0x79,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x3b,
0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xa2, 0x02, 0x03, 0x47, 0x50,
0x42, 0xaa, 0x02, 0x1e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70,
0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f,
0x61, 0x6e, 0x79, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e, 0x47, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65,
0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -1,13 +1,15 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/api.proto
package known_proto
package apipb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoregistry "google.golang.org/protobuf/reflect/protoregistry"
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
sourcecontextpb "google.golang.org/protobuf/types/known/sourcecontextpb"
typepb "google.golang.org/protobuf/types/known/typepb"
sync "sync"
)
@ -29,7 +31,7 @@ type Api struct {
// The methods of this interface, in unspecified order.
Methods []*Method `protobuf:"bytes,2,rep,name=methods,proto3" json:"methods,omitempty"`
// Any metadata attached to the interface.
Options []*Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"`
Options []*typepb.Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"`
// A version string for this interface. If specified, must have the form
// `major-version.minor-version`, as in `1.10`. If the minor version is
// omitted, it defaults to zero. If the entire version field is empty, the
@ -54,11 +56,11 @@ type Api struct {
Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
// Source context for the protocol buffer service represented by this
// message.
SourceContext *SourceContext `protobuf:"bytes,5,opt,name=source_context,json=sourceContext,proto3" json:"source_context,omitempty"`
SourceContext *sourcecontextpb.SourceContext `protobuf:"bytes,5,opt,name=source_context,json=sourceContext,proto3" json:"source_context,omitempty"`
// Included interfaces. See [Mixin][].
Mixins []*Mixin `protobuf:"bytes,6,rep,name=mixins,proto3" json:"mixins,omitempty"`
// The source syntax of the service.
Syntax Syntax `protobuf:"varint,7,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"`
Syntax typepb.Syntax `protobuf:"varint,7,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized protoimpl.UnknownFields `json:"-"`
XXX_sizecache protoimpl.SizeCache `json:"-"`
@ -101,7 +103,7 @@ func (x *Api) GetMethods() []*Method {
return nil
}
func (x *Api) GetOptions() []*Option {
func (x *Api) GetOptions() []*typepb.Option {
if x != nil {
return x.Options
}
@ -115,7 +117,7 @@ func (x *Api) GetVersion() string {
return ""
}
func (x *Api) GetSourceContext() *SourceContext {
func (x *Api) GetSourceContext() *sourcecontextpb.SourceContext {
if x != nil {
return x.SourceContext
}
@ -129,11 +131,11 @@ func (x *Api) GetMixins() []*Mixin {
return nil
}
func (x *Api) GetSyntax() Syntax {
func (x *Api) GetSyntax() typepb.Syntax {
if x != nil {
return x.Syntax
}
return Syntax_SYNTAX_PROTO2
return typepb.Syntax_SYNTAX_PROTO2
}
// Method represents a method of an API interface.
@ -149,9 +151,9 @@ type Method struct {
// If true, the response is streamed.
ResponseStreaming bool `protobuf:"varint,5,opt,name=response_streaming,json=responseStreaming,proto3" json:"response_streaming,omitempty"`
// Any metadata attached to the method.
Options []*Option `protobuf:"bytes,6,rep,name=options,proto3" json:"options,omitempty"`
Options []*typepb.Option `protobuf:"bytes,6,rep,name=options,proto3" json:"options,omitempty"`
// The source syntax of this method.
Syntax Syntax `protobuf:"varint,7,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"`
Syntax typepb.Syntax `protobuf:"varint,7,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized protoimpl.UnknownFields `json:"-"`
XXX_sizecache protoimpl.SizeCache `json:"-"`
@ -215,18 +217,18 @@ func (x *Method) GetResponseStreaming() bool {
return false
}
func (x *Method) GetOptions() []*Option {
func (x *Method) GetOptions() []*typepb.Option {
if x != nil {
return x.Options
}
return nil
}
func (x *Method) GetSyntax() Syntax {
func (x *Method) GetSyntax() typepb.Syntax {
if x != nil {
return x.Syntax
}
return Syntax_SYNTAX_PROTO2
return typepb.Syntax_SYNTAX_PROTO2
}
// Declares an API Interface to be included in this interface. The including
@ -407,15 +409,15 @@ var file_google_protobuf_api_proto_rawDesc = []byte{
0x06, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x22, 0x2f, 0x0a, 0x05, 0x4d, 0x69, 0x78, 0x69, 0x6e,
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x42, 0x7c, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e,
0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x42, 0x76, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42,
0x08, 0x41, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x6f, 0x6f,
0x08, 0x41, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e,
0x6f, 0x77, 0x6e, 0x3b, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xa2,
0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77,
0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6f, 0x77, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa,
0x02, 0x1e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -432,12 +434,12 @@ func file_google_protobuf_api_proto_rawDescGZIP() []byte {
var file_google_protobuf_api_proto_msgTypes = make([]protoimpl.MessageType, 3)
var file_google_protobuf_api_proto_goTypes = []interface{}{
(*Api)(nil), // 0: google.protobuf.Api
(*Method)(nil), // 1: google.protobuf.Method
(*Mixin)(nil), // 2: google.protobuf.Mixin
(*Option)(nil), // 3: google.protobuf.Option
(*SourceContext)(nil), // 4: google.protobuf.SourceContext
(Syntax)(0), // 5: google.protobuf.Syntax
(*Api)(nil), // 0: google.protobuf.Api
(*Method)(nil), // 1: google.protobuf.Method
(*Mixin)(nil), // 2: google.protobuf.Mixin
(*typepb.Option)(nil), // 3: google.protobuf.Option
(*sourcecontextpb.SourceContext)(nil), // 4: google.protobuf.SourceContext
(typepb.Syntax)(0), // 5: google.protobuf.Syntax
}
var file_google_protobuf_api_proto_depIdxs = []int32{
1, // google.protobuf.Api.methods:type_name -> google.protobuf.Method
@ -454,8 +456,6 @@ func file_google_protobuf_api_proto_init() {
if File_google_protobuf_api_proto != nil {
return
}
file_google_protobuf_source_context_proto_init()
file_google_protobuf_type_proto_init()
File_google_protobuf_api_proto = protoimpl.FileBuilder{
RawDescriptor: file_google_protobuf_api_proto_rawDesc,
GoTypes: file_google_protobuf_api_proto_goTypes,

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/duration.proto
package known_proto
package durationpb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -138,16 +138,16 @@ var file_google_protobuf_duration_proto_rawDesc = []byte{
0x66, 0x22, 0x3a, 0x0a, 0x08, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a,
0x07, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07,
0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x42, 0x84, 0x01,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x42, 0x83, 0x01,
0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x0d, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50,
0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67,
0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67,
0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x3b, 0x6b,
0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03,
0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54,
0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x64,
0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47,
0x50, 0x42, 0xaa, 0x02, 0x1e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79,
0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/empty.proto
package known_proto
package emptypb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -59,16 +59,15 @@ var file_google_protobuf_empty_proto_rawDesc = []byte{
0x0a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x07,
0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x81, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42,
0x0a, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67,
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f,
0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x3b, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e, 0x47, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c,
0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x7d, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x0a,
0x45, 0x6d, 0x70, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b,
0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2,
0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77,
0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/field_mask.proto
package known_proto
package fieldmaskpb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -263,8 +263,8 @@ var file_google_protobuf_field_mask_proto_rawDesc = []byte{
0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
0x5a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e,
0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70,
0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x3b, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e,
0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61,
0x73, 0x6b, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e,
0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/source_context.proto
package known_proto
package sourcecontextpb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -63,16 +63,16 @@ var file_google_protobuf_source_context_proto_rawDesc = []byte{
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x2c, 0x0a, 0x0d, 0x53, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65,
0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c,
0x65, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x86, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f,
0x65, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x8a, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x12, 0x53,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x74,
0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61,
0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61,
0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x3b, 0x6b, 0x6e, 0x6f, 0x77,
0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e,
0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x47, 0x50,
0x42, 0xaa, 0x02, 0x1e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70,
0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/struct.proto
package known_proto
package structpb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -343,16 +343,16 @@ var file_google_protobuf_struct_proto_rawDesc = []byte{
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56,
0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2a, 0x1b, 0x0a, 0x09,
0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x55, 0x4c,
0x4c, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x00, 0x42, 0x82, 0x01, 0x0a, 0x13, 0x63, 0x6f,
0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x42, 0x0b, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
0x5a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e,
0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70,
0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x3b, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e,
0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x4c, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x00, 0x42, 0x7f, 0x0a, 0x13, 0x63, 0x6f, 0x6d,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x42, 0x0b, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a,
0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f,
0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65,
0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x70, 0x62,
0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e, 0x47, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c,
0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var (

58
types/known/stub.go Normal file
View File

@ -0,0 +1,58 @@
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// TODO: This file exists to have the minimum number of forwarding declarations
// to keep v1 working. This will be deleted in the near future.
package known_proto
import (
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/emptypb"
"google.golang.org/protobuf/types/known/structpb"
"google.golang.org/protobuf/types/known/timestamppb"
"google.golang.org/protobuf/types/known/wrapperspb"
)
type (
Any = anypb.Any
BoolValue = wrapperspb.BoolValue
BytesValue = wrapperspb.BytesValue
DoubleValue = wrapperspb.DoubleValue
Duration = durationpb.Duration
Empty = emptypb.Empty
FloatValue = wrapperspb.FloatValue
Int32Value = wrapperspb.Int32Value
Int64Value = wrapperspb.Int64Value
ListValue = structpb.ListValue
NullValue = structpb.NullValue
StringValue = wrapperspb.StringValue
Struct = structpb.Struct
Timestamp = timestamppb.Timestamp
UInt32Value = wrapperspb.UInt32Value
UInt64Value = wrapperspb.UInt64Value
Value = structpb.Value
Value_BoolValue = structpb.Value_BoolValue
Value_ListValue = structpb.Value_ListValue
Value_NullValue = structpb.Value_NullValue
Value_NumberValue = structpb.Value_NumberValue
Value_StringValue = structpb.Value_StringValue
Value_StructValue = structpb.Value_StructValue
)
const (
NullValue_NULL_VALUE = structpb.NullValue_NULL_VALUE
)
var (
File_google_protobuf_any_proto = anypb.File_google_protobuf_any_proto
File_google_protobuf_duration_proto = durationpb.File_google_protobuf_duration_proto
File_google_protobuf_empty_proto = emptypb.File_google_protobuf_empty_proto
File_google_protobuf_struct_proto = structpb.File_google_protobuf_struct_proto
File_google_protobuf_timestamp_proto = timestamppb.File_google_protobuf_timestamp_proto
File_google_protobuf_wrappers_proto = wrapperspb.File_google_protobuf_wrappers_proto
NullValue_name = structpb.NullValue_name
NullValue_value = structpb.NullValue_value
)

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/timestamp.proto
package known_proto
package timestamppb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -164,7 +164,7 @@ var file_google_protobuf_timestamp_proto_rawDesc = []byte{
0x6d, 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77,
0x6e, 0x3b, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xf8, 0x01, 0x01,
0x6e, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x70, 0x62, 0xf8, 0x01, 0x01,
0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f,
0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,

View File

@ -1,13 +1,15 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/type.proto
package known_proto
package typepb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoregistry "google.golang.org/protobuf/reflect/protoregistry"
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
anypb "google.golang.org/protobuf/types/known/anypb"
sourcecontextpb "google.golang.org/protobuf/types/known/sourcecontextpb"
sync "sync"
)
@ -232,7 +234,7 @@ type Type struct {
// The protocol buffer options.
Options []*Option `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"`
// The source context.
SourceContext *SourceContext `protobuf:"bytes,5,opt,name=source_context,json=sourceContext,proto3" json:"source_context,omitempty"`
SourceContext *sourcecontextpb.SourceContext `protobuf:"bytes,5,opt,name=source_context,json=sourceContext,proto3" json:"source_context,omitempty"`
// The source syntax.
Syntax Syntax `protobuf:"varint,6,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@ -291,7 +293,7 @@ func (x *Type) GetOptions() []*Option {
return nil
}
func (x *Type) GetSourceContext() *SourceContext {
func (x *Type) GetSourceContext() *sourcecontextpb.SourceContext {
if x != nil {
return x.SourceContext
}
@ -436,7 +438,7 @@ type Enum struct {
// Protocol buffer options.
Options []*Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"`
// The source context.
SourceContext *SourceContext `protobuf:"bytes,4,opt,name=source_context,json=sourceContext,proto3" json:"source_context,omitempty"`
SourceContext *sourcecontextpb.SourceContext `protobuf:"bytes,4,opt,name=source_context,json=sourceContext,proto3" json:"source_context,omitempty"`
// The source syntax.
Syntax Syntax `protobuf:"varint,5,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@ -488,7 +490,7 @@ func (x *Enum) GetOptions() []*Option {
return nil
}
func (x *Enum) GetSourceContext() *SourceContext {
func (x *Enum) GetSourceContext() *sourcecontextpb.SourceContext {
if x != nil {
return x.SourceContext
}
@ -571,7 +573,7 @@ type Option struct {
// the corresponding wrapper type defined in google/protobuf/wrappers.proto
// should be used. If the value is an enum, it should be stored as an int32
// value using the google.protobuf.Int32Value type.
Value *Any `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
Value *anypb.Any `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized protoimpl.UnknownFields `json:"-"`
XXX_sizecache protoimpl.SizeCache `json:"-"`
@ -607,7 +609,7 @@ func (x *Option) GetName() string {
return ""
}
func (x *Option) GetValue() *Any {
func (x *Option) GetValue() *anypb.Any {
if x != nil {
return x.Value
}
@ -722,16 +724,16 @@ var file_google_protobuf_type_proto_rawDesc = []byte{
0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0x2e, 0x0a,
0x06, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x59, 0x4e, 0x54, 0x41,
0x58, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x32, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x59,
0x4e, 0x54, 0x41, 0x58, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x10, 0x01, 0x42, 0x80, 0x01,
0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x09, 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x50, 0x01, 0x5a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e,
0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74,
0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x3b, 0x6b, 0x6e, 0x6f, 0x77, 0x6e,
0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa,
0x02, 0x1e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x4e, 0x54, 0x41, 0x58, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x10, 0x01, 0x42, 0x7b, 0x0a,
0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x42, 0x09, 0x54, 0x79, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
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, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x70, 0x62,
0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e, 0x47, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c,
0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var (
@ -749,16 +751,16 @@ func file_google_protobuf_type_proto_rawDescGZIP() []byte {
var file_google_protobuf_type_proto_enumTypes = make([]protoreflect.EnumType, 3)
var file_google_protobuf_type_proto_msgTypes = make([]protoimpl.MessageType, 5)
var file_google_protobuf_type_proto_goTypes = []interface{}{
(Syntax)(0), // 0: google.protobuf.Syntax
(Field_Kind)(0), // 1: google.protobuf.Field.Kind
(Field_Cardinality)(0), // 2: google.protobuf.Field.Cardinality
(*Type)(nil), // 3: google.protobuf.Type
(*Field)(nil), // 4: google.protobuf.Field
(*Enum)(nil), // 5: google.protobuf.Enum
(*EnumValue)(nil), // 6: google.protobuf.EnumValue
(*Option)(nil), // 7: google.protobuf.Option
(*SourceContext)(nil), // 8: google.protobuf.SourceContext
(*Any)(nil), // 9: google.protobuf.Any
(Syntax)(0), // 0: google.protobuf.Syntax
(Field_Kind)(0), // 1: google.protobuf.Field.Kind
(Field_Cardinality)(0), // 2: google.protobuf.Field.Cardinality
(*Type)(nil), // 3: google.protobuf.Type
(*Field)(nil), // 4: google.protobuf.Field
(*Enum)(nil), // 5: google.protobuf.Enum
(*EnumValue)(nil), // 6: google.protobuf.EnumValue
(*Option)(nil), // 7: google.protobuf.Option
(*sourcecontextpb.SourceContext)(nil), // 8: google.protobuf.SourceContext
(*anypb.Any)(nil), // 9: google.protobuf.Any
}
var file_google_protobuf_type_proto_depIdxs = []int32{
4, // google.protobuf.Type.fields:type_name -> google.protobuf.Field
@ -781,8 +783,6 @@ func file_google_protobuf_type_proto_init() {
if File_google_protobuf_type_proto != nil {
return
}
file_google_protobuf_any_proto_init()
file_google_protobuf_source_context_proto_init()
File_google_protobuf_type_proto = protoimpl.FileBuilder{
RawDescriptor: file_google_protobuf_type_proto_rawDesc,
GoTypes: file_google_protobuf_type_proto_goTypes,

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/wrappers.proto
package known_proto
package wrapperspb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -426,16 +426,16 @@ var file_google_protobuf_wrappers_proto_rawDesc = []byte{
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x22, 0x22, 0x0a, 0x0a, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c,
0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x84, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d,
0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x83, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x42, 0x0d, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
0x01, 0x5a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67,
0x01, 0x5a, 0x31, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67,
0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x3b, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02,
0x1e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65,
0x72, 0x73, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e,
0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

21
types/plugin/stub.go Normal file
View File

@ -0,0 +1,21 @@
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// TODO: This file exists to have the minimum number of forwarding declarations
// to keep v1 working. This will be deleted in the near future.
package plugin_proto
import "google.golang.org/protobuf/types/pluginpb"
type (
CodeGeneratorRequest = pluginpb.CodeGeneratorRequest
CodeGeneratorResponse = pluginpb.CodeGeneratorResponse
CodeGeneratorResponse_File = pluginpb.CodeGeneratorResponse_File
Version = pluginpb.Version
)
var (
File_google_protobuf_compiler_plugin_proto = pluginpb.File_google_protobuf_compiler_plugin_proto
)

View File

@ -1,14 +1,14 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/compiler/plugin.proto
package plugin_proto
package pluginpb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoregistry "google.golang.org/protobuf/reflect/protoregistry"
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
descriptor "google.golang.org/protobuf/types/descriptor"
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
sync "sync"
)
@ -100,7 +100,7 @@ type CodeGeneratorRequest struct {
//
// Type names of fields and extensions in the FileDescriptorProto are always
// fully qualified.
ProtoFile []*descriptor.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file,json=protoFile" json:"proto_file,omitempty"`
ProtoFile []*descriptorpb.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file,json=protoFile" json:"proto_file,omitempty"`
// The version number of protocol compiler.
CompilerVersion *Version `protobuf:"bytes,3,opt,name=compiler_version,json=compilerVersion" json:"compiler_version,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@ -145,7 +145,7 @@ func (x *CodeGeneratorRequest) GetParameter() string {
return ""
}
func (x *CodeGeneratorRequest) GetProtoFile() []*descriptor.FileDescriptorProto {
func (x *CodeGeneratorRequest) GetProtoFile() []*descriptorpb.FileDescriptorProto {
if x != nil {
return x.ProtoFile
}
@ -360,13 +360,12 @@ var file_google_protobuf_compiler_plugin_proto_rawDesc = []byte{
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, 0x42, 0x62, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f,
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x57, 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, 0x34, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61,
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, 0x3b, 0x70, 0x6c, 0x75,
0x67, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x70, 0x62,
}
var (
@ -383,11 +382,11 @@ func file_google_protobuf_compiler_plugin_proto_rawDescGZIP() []byte {
var file_google_protobuf_compiler_plugin_proto_msgTypes = make([]protoimpl.MessageType, 4)
var file_google_protobuf_compiler_plugin_proto_goTypes = []interface{}{
(*Version)(nil), // 0: google.protobuf.compiler.Version
(*CodeGeneratorRequest)(nil), // 1: google.protobuf.compiler.CodeGeneratorRequest
(*CodeGeneratorResponse)(nil), // 2: google.protobuf.compiler.CodeGeneratorResponse
(*CodeGeneratorResponse_File)(nil), // 3: google.protobuf.compiler.CodeGeneratorResponse.File
(*descriptor.FileDescriptorProto)(nil), // 4: google.protobuf.FileDescriptorProto
(*Version)(nil), // 0: google.protobuf.compiler.Version
(*CodeGeneratorRequest)(nil), // 1: google.protobuf.compiler.CodeGeneratorRequest
(*CodeGeneratorResponse)(nil), // 2: google.protobuf.compiler.CodeGeneratorResponse
(*CodeGeneratorResponse_File)(nil), // 3: google.protobuf.compiler.CodeGeneratorResponse.File
(*descriptorpb.FileDescriptorProto)(nil), // 4: google.protobuf.FileDescriptorProto
}
var file_google_protobuf_compiler_plugin_proto_depIdxs = []int32{
4, // google.protobuf.compiler.CodeGeneratorRequest.proto_file:type_name -> google.protobuf.FileDescriptorProto