github.com/annwntech/go-micro/v2@v2.9.5/transport/grpc/proto/transport.pb.go (about)

     1  // Code generated by protoc-gen-go. DO NOT EDIT.
     2  // versions:
     3  // 	protoc-gen-go v1.25.0
     4  // 	protoc        v3.13.0
     5  // source: transport/grpc/proto/transport.proto
     6  
     7  package go_micro_transport_grpc
     8  
     9  import (
    10  	context "context"
    11  	proto "github.com/golang/protobuf/proto"
    12  	grpc "google.golang.org/grpc"
    13  	codes "google.golang.org/grpc/codes"
    14  	status "google.golang.org/grpc/status"
    15  	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
    16  	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
    17  	reflect "reflect"
    18  	sync "sync"
    19  )
    20  
    21  const (
    22  	// Verify that this generated code is sufficiently up-to-date.
    23  	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
    24  	// Verify that runtime/protoimpl is sufficiently up-to-date.
    25  	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
    26  )
    27  
    28  // This is a compile-time assertion that a sufficiently up-to-date version
    29  // of the legacy proto package is being used.
    30  const _ = proto.ProtoPackageIsVersion4
    31  
    32  type Message struct {
    33  	state         protoimpl.MessageState
    34  	sizeCache     protoimpl.SizeCache
    35  	unknownFields protoimpl.UnknownFields
    36  
    37  	Header map[string]string `protobuf:"bytes,1,rep,name=header,proto3" json:"header,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
    38  	Body   []byte            `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
    39  }
    40  
    41  func (x *Message) Reset() {
    42  	*x = Message{}
    43  	if protoimpl.UnsafeEnabled {
    44  		mi := &file_transport_grpc_proto_transport_proto_msgTypes[0]
    45  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    46  		ms.StoreMessageInfo(mi)
    47  	}
    48  }
    49  
    50  func (x *Message) String() string {
    51  	return protoimpl.X.MessageStringOf(x)
    52  }
    53  
    54  func (*Message) ProtoMessage() {}
    55  
    56  func (x *Message) ProtoReflect() protoreflect.Message {
    57  	mi := &file_transport_grpc_proto_transport_proto_msgTypes[0]
    58  	if protoimpl.UnsafeEnabled && x != nil {
    59  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    60  		if ms.LoadMessageInfo() == nil {
    61  			ms.StoreMessageInfo(mi)
    62  		}
    63  		return ms
    64  	}
    65  	return mi.MessageOf(x)
    66  }
    67  
    68  // Deprecated: Use Message.ProtoReflect.Descriptor instead.
    69  func (*Message) Descriptor() ([]byte, []int) {
    70  	return file_transport_grpc_proto_transport_proto_rawDescGZIP(), []int{0}
    71  }
    72  
    73  func (x *Message) GetHeader() map[string]string {
    74  	if x != nil {
    75  		return x.Header
    76  	}
    77  	return nil
    78  }
    79  
    80  func (x *Message) GetBody() []byte {
    81  	if x != nil {
    82  		return x.Body
    83  	}
    84  	return nil
    85  }
    86  
    87  var File_transport_grpc_proto_transport_proto protoreflect.FileDescriptor
    88  
    89  var file_transport_grpc_proto_transport_proto_rawDesc = []byte{
    90  	0x0a, 0x24, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63,
    91  	0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74,
    92  	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f,
    93  	0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x22,
    94  	0x9e, 0x01, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x44, 0x0a, 0x06, 0x68,
    95  	0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f,
    96  	0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74,
    97  	0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x48, 0x65,
    98  	0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65,
    99  	0x72, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52,
   100  	0x04, 0x62, 0x6f, 0x64, 0x79, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45,
   101  	0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
   102  	0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
   103  	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
   104  	0x32, 0x5f, 0x0a, 0x09, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x52, 0x0a,
   105  	0x06, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x20, 0x2e, 0x67, 0x6f, 0x2e, 0x6d, 0x69, 0x63,
   106  	0x72, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x67, 0x72, 0x70,
   107  	0x63, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x20, 0x2e, 0x67, 0x6f, 0x2e, 0x6d,
   108  	0x69, 0x63, 0x72, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x67,
   109  	0x72, 0x70, 0x63, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30,
   110  	0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
   111  }
   112  
   113  var (
   114  	file_transport_grpc_proto_transport_proto_rawDescOnce sync.Once
   115  	file_transport_grpc_proto_transport_proto_rawDescData = file_transport_grpc_proto_transport_proto_rawDesc
   116  )
   117  
   118  func file_transport_grpc_proto_transport_proto_rawDescGZIP() []byte {
   119  	file_transport_grpc_proto_transport_proto_rawDescOnce.Do(func() {
   120  		file_transport_grpc_proto_transport_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_grpc_proto_transport_proto_rawDescData)
   121  	})
   122  	return file_transport_grpc_proto_transport_proto_rawDescData
   123  }
   124  
   125  var file_transport_grpc_proto_transport_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
   126  var file_transport_grpc_proto_transport_proto_goTypes = []interface{}{
   127  	(*Message)(nil), // 0: go.micro.transport.grpc.Message
   128  	nil,             // 1: go.micro.transport.grpc.Message.HeaderEntry
   129  }
   130  var file_transport_grpc_proto_transport_proto_depIdxs = []int32{
   131  	1, // 0: go.micro.transport.grpc.Message.header:type_name -> go.micro.transport.grpc.Message.HeaderEntry
   132  	0, // 1: go.micro.transport.grpc.Transport.Stream:input_type -> go.micro.transport.grpc.Message
   133  	0, // 2: go.micro.transport.grpc.Transport.Stream:output_type -> go.micro.transport.grpc.Message
   134  	2, // [2:3] is the sub-list for method output_type
   135  	1, // [1:2] is the sub-list for method input_type
   136  	1, // [1:1] is the sub-list for extension type_name
   137  	1, // [1:1] is the sub-list for extension extendee
   138  	0, // [0:1] is the sub-list for field type_name
   139  }
   140  
   141  func init() { file_transport_grpc_proto_transport_proto_init() }
   142  func file_transport_grpc_proto_transport_proto_init() {
   143  	if File_transport_grpc_proto_transport_proto != nil {
   144  		return
   145  	}
   146  	if !protoimpl.UnsafeEnabled {
   147  		file_transport_grpc_proto_transport_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
   148  			switch v := v.(*Message); i {
   149  			case 0:
   150  				return &v.state
   151  			case 1:
   152  				return &v.sizeCache
   153  			case 2:
   154  				return &v.unknownFields
   155  			default:
   156  				return nil
   157  			}
   158  		}
   159  	}
   160  	type x struct{}
   161  	out := protoimpl.TypeBuilder{
   162  		File: protoimpl.DescBuilder{
   163  			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
   164  			RawDescriptor: file_transport_grpc_proto_transport_proto_rawDesc,
   165  			NumEnums:      0,
   166  			NumMessages:   2,
   167  			NumExtensions: 0,
   168  			NumServices:   1,
   169  		},
   170  		GoTypes:           file_transport_grpc_proto_transport_proto_goTypes,
   171  		DependencyIndexes: file_transport_grpc_proto_transport_proto_depIdxs,
   172  		MessageInfos:      file_transport_grpc_proto_transport_proto_msgTypes,
   173  	}.Build()
   174  	File_transport_grpc_proto_transport_proto = out.File
   175  	file_transport_grpc_proto_transport_proto_rawDesc = nil
   176  	file_transport_grpc_proto_transport_proto_goTypes = nil
   177  	file_transport_grpc_proto_transport_proto_depIdxs = nil
   178  }
   179  
   180  // Reference imports to suppress errors if they are not otherwise used.
   181  var _ context.Context
   182  var _ grpc.ClientConnInterface
   183  
   184  // This is a compile-time assertion to ensure that this generated file
   185  // is compatible with the grpc package it is being compiled against.
   186  const _ = grpc.SupportPackageIsVersion6
   187  
   188  // TransportClient is the client API for Transport service.
   189  //
   190  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
   191  type TransportClient interface {
   192  	Stream(ctx context.Context, opts ...grpc.CallOption) (Transport_StreamClient, error)
   193  }
   194  
   195  type transportClient struct {
   196  	cc grpc.ClientConnInterface
   197  }
   198  
   199  func NewTransportClient(cc grpc.ClientConnInterface) TransportClient {
   200  	return &transportClient{cc}
   201  }
   202  
   203  func (c *transportClient) Stream(ctx context.Context, opts ...grpc.CallOption) (Transport_StreamClient, error) {
   204  	stream, err := c.cc.NewStream(ctx, &_Transport_serviceDesc.Streams[0], "/go.micro.transport.grpc.Transport/Stream", opts...)
   205  	if err != nil {
   206  		return nil, err
   207  	}
   208  	x := &transportStreamClient{stream}
   209  	return x, nil
   210  }
   211  
   212  type Transport_StreamClient interface {
   213  	Send(*Message) error
   214  	Recv() (*Message, error)
   215  	grpc.ClientStream
   216  }
   217  
   218  type transportStreamClient struct {
   219  	grpc.ClientStream
   220  }
   221  
   222  func (x *transportStreamClient) Send(m *Message) error {
   223  	return x.ClientStream.SendMsg(m)
   224  }
   225  
   226  func (x *transportStreamClient) Recv() (*Message, error) {
   227  	m := new(Message)
   228  	if err := x.ClientStream.RecvMsg(m); err != nil {
   229  		return nil, err
   230  	}
   231  	return m, nil
   232  }
   233  
   234  // TransportServer is the server API for Transport service.
   235  type TransportServer interface {
   236  	Stream(Transport_StreamServer) error
   237  }
   238  
   239  // UnimplementedTransportServer can be embedded to have forward compatible implementations.
   240  type UnimplementedTransportServer struct {
   241  }
   242  
   243  func (*UnimplementedTransportServer) Stream(Transport_StreamServer) error {
   244  	return status.Errorf(codes.Unimplemented, "method Stream not implemented")
   245  }
   246  
   247  func RegisterTransportServer(s *grpc.Server, srv TransportServer) {
   248  	s.RegisterService(&_Transport_serviceDesc, srv)
   249  }
   250  
   251  func _Transport_Stream_Handler(srv interface{}, stream grpc.ServerStream) error {
   252  	return srv.(TransportServer).Stream(&transportStreamServer{stream})
   253  }
   254  
   255  type Transport_StreamServer interface {
   256  	Send(*Message) error
   257  	Recv() (*Message, error)
   258  	grpc.ServerStream
   259  }
   260  
   261  type transportStreamServer struct {
   262  	grpc.ServerStream
   263  }
   264  
   265  func (x *transportStreamServer) Send(m *Message) error {
   266  	return x.ServerStream.SendMsg(m)
   267  }
   268  
   269  func (x *transportStreamServer) Recv() (*Message, error) {
   270  	m := new(Message)
   271  	if err := x.ServerStream.RecvMsg(m); err != nil {
   272  		return nil, err
   273  	}
   274  	return m, nil
   275  }
   276  
   277  var _Transport_serviceDesc = grpc.ServiceDesc{
   278  	ServiceName: "go.micro.transport.grpc.Transport",
   279  	HandlerType: (*TransportServer)(nil),
   280  	Methods:     []grpc.MethodDesc{},
   281  	Streams: []grpc.StreamDesc{
   282  		{
   283  			StreamName:    "Stream",
   284  			Handler:       _Transport_Stream_Handler,
   285  			ServerStreams: true,
   286  			ClientStreams: true,
   287  		},
   288  	},
   289  	Metadata: "transport/grpc/proto/transport.proto",
   290  }