...

Source file src/google.golang.org/protobuf/cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go

Documentation: google.golang.org/protobuf/cmd/protoc-gen-go/testdata/nopackage

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated by protoc-gen-go. DO NOT EDIT.
     6  // source: cmd/protoc-gen-go/testdata/nopackage/nopackage.proto
     7  
     8  package nopackage
     9  
    10  import (
    11  	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
    12  	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
    13  	reflect "reflect"
    14  	sync "sync"
    15  )
    16  
    17  type Enum int32
    18  
    19  const (
    20  	Enum_ZERO Enum = 0
    21  )
    22  
    23  // Enum value maps for Enum.
    24  var (
    25  	Enum_name = map[int32]string{
    26  		0: "ZERO",
    27  	}
    28  	Enum_value = map[string]int32{
    29  		"ZERO": 0,
    30  	}
    31  )
    32  
    33  func (x Enum) Enum() *Enum {
    34  	p := new(Enum)
    35  	*p = x
    36  	return p
    37  }
    38  
    39  func (x Enum) String() string {
    40  	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
    41  }
    42  
    43  func (Enum) Descriptor() protoreflect.EnumDescriptor {
    44  	return file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_enumTypes[0].Descriptor()
    45  }
    46  
    47  func (Enum) Type() protoreflect.EnumType {
    48  	return &file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_enumTypes[0]
    49  }
    50  
    51  func (x Enum) Number() protoreflect.EnumNumber {
    52  	return protoreflect.EnumNumber(x)
    53  }
    54  
    55  // Deprecated: Do not use.
    56  func (x *Enum) UnmarshalJSON(b []byte) error {
    57  	num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b)
    58  	if err != nil {
    59  		return err
    60  	}
    61  	*x = Enum(num)
    62  	return nil
    63  }
    64  
    65  // Deprecated: Use Enum.Descriptor instead.
    66  func (Enum) EnumDescriptor() ([]byte, []int) {
    67  	return file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_rawDescGZIP(), []int{0}
    68  }
    69  
    70  type Message struct {
    71  	state         protoimpl.MessageState
    72  	sizeCache     protoimpl.SizeCache
    73  	unknownFields protoimpl.UnknownFields
    74  
    75  	StringField *string `protobuf:"bytes,1,opt,name=string_field,json=stringField" json:"string_field,omitempty"`
    76  	EnumField   *Enum   `protobuf:"varint,2,opt,name=enum_field,json=enumField,enum=Enum,def=0" json:"enum_field,omitempty"`
    77  }
    78  
    79  // Default values for Message fields.
    80  const (
    81  	Default_Message_EnumField = Enum_ZERO
    82  )
    83  
    84  func (x *Message) Reset() {
    85  	*x = Message{}
    86  	if protoimpl.UnsafeEnabled {
    87  		mi := &file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_msgTypes[0]
    88  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    89  		ms.StoreMessageInfo(mi)
    90  	}
    91  }
    92  
    93  func (x *Message) String() string {
    94  	return protoimpl.X.MessageStringOf(x)
    95  }
    96  
    97  func (*Message) ProtoMessage() {}
    98  
    99  func (x *Message) ProtoReflect() protoreflect.Message {
   100  	mi := &file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_msgTypes[0]
   101  	if protoimpl.UnsafeEnabled && x != nil {
   102  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   103  		if ms.LoadMessageInfo() == nil {
   104  			ms.StoreMessageInfo(mi)
   105  		}
   106  		return ms
   107  	}
   108  	return mi.MessageOf(x)
   109  }
   110  
   111  // Deprecated: Use Message.ProtoReflect.Descriptor instead.
   112  func (*Message) Descriptor() ([]byte, []int) {
   113  	return file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_rawDescGZIP(), []int{0}
   114  }
   115  
   116  func (x *Message) GetStringField() string {
   117  	if x != nil && x.StringField != nil {
   118  		return *x.StringField
   119  	}
   120  	return ""
   121  }
   122  
   123  func (x *Message) GetEnumField() Enum {
   124  	if x != nil && x.EnumField != nil {
   125  		return *x.EnumField
   126  	}
   127  	return Default_Message_EnumField
   128  }
   129  
   130  var File_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto protoreflect.FileDescriptor
   131  
   132  var file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_rawDesc = []byte{
   133  	0x0a, 0x34, 0x63, 0x6d, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e,
   134  	0x2d, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6e, 0x6f, 0x70,
   135  	0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2f, 0x6e, 0x6f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65,
   136  	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x58, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
   137  	0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x69, 0x65, 0x6c,
   138  	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46,
   139  	0x69, 0x65, 0x6c, 0x64, 0x12, 0x2a, 0x0a, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x66, 0x69, 0x65,
   140  	0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x05, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x3a,
   141  	0x04, 0x5a, 0x45, 0x52, 0x4f, 0x52, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x46, 0x69, 0x65, 0x6c, 0x64,
   142  	0x2a, 0x10, 0x0a, 0x04, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x08, 0x0a, 0x04, 0x5a, 0x45, 0x52, 0x4f,
   143  	0x10, 0x00,
   144  }
   145  
   146  var (
   147  	file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_rawDescOnce sync.Once
   148  	file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_rawDescData = file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_rawDesc
   149  )
   150  
   151  func file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_rawDescGZIP() []byte {
   152  	file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_rawDescOnce.Do(func() {
   153  		file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_rawDescData = protoimpl.X.CompressGZIP(file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_rawDescData)
   154  	})
   155  	return file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_rawDescData
   156  }
   157  
   158  var file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
   159  var file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
   160  var file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_goTypes = []interface{}{
   161  	(Enum)(0),       // 0: Enum
   162  	(*Message)(nil), // 1: Message
   163  }
   164  var file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_depIdxs = []int32{
   165  	0, // 0: Message.enum_field:type_name -> Enum
   166  	1, // [1:1] is the sub-list for method output_type
   167  	1, // [1:1] is the sub-list for method input_type
   168  	1, // [1:1] is the sub-list for extension type_name
   169  	1, // [1:1] is the sub-list for extension extendee
   170  	0, // [0:1] is the sub-list for field type_name
   171  }
   172  
   173  func init() { file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_init() }
   174  func file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_init() {
   175  	if File_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto != nil {
   176  		return
   177  	}
   178  	if !protoimpl.UnsafeEnabled {
   179  		file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
   180  			switch v := v.(*Message); i {
   181  			case 0:
   182  				return &v.state
   183  			case 1:
   184  				return &v.sizeCache
   185  			case 2:
   186  				return &v.unknownFields
   187  			default:
   188  				return nil
   189  			}
   190  		}
   191  	}
   192  	type x struct{}
   193  	out := protoimpl.TypeBuilder{
   194  		File: protoimpl.DescBuilder{
   195  			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
   196  			RawDescriptor: file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_rawDesc,
   197  			NumEnums:      1,
   198  			NumMessages:   1,
   199  			NumExtensions: 0,
   200  			NumServices:   0,
   201  		},
   202  		GoTypes:           file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_goTypes,
   203  		DependencyIndexes: file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_depIdxs,
   204  		EnumInfos:         file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_enumTypes,
   205  		MessageInfos:      file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_msgTypes,
   206  	}.Build()
   207  	File_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto = out.File
   208  	file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_rawDesc = nil
   209  	file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_goTypes = nil
   210  	file_cmd_protoc_gen_go_testdata_nopackage_nopackage_proto_depIdxs = nil
   211  }
   212  

View as plain text