github.com/micro/go-micro/v2@v2.9.1/transport/grpc/proto/transport.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // source: transport/grpc/proto/transport.proto 3 4 package go_micro_transport_grpc 5 6 import ( 7 context "context" 8 fmt "fmt" 9 proto "github.com/golang/protobuf/proto" 10 grpc "google.golang.org/grpc" 11 codes "google.golang.org/grpc/codes" 12 status "google.golang.org/grpc/status" 13 math "math" 14 ) 15 16 // Reference imports to suppress errors if they are not otherwise used. 17 var _ = proto.Marshal 18 var _ = fmt.Errorf 19 var _ = math.Inf 20 21 // This is a compile-time assertion to ensure that this generated file 22 // is compatible with the proto package it is being compiled against. 23 // A compilation error at this line likely means your copy of the 24 // proto package needs to be updated. 25 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 26 27 type Message struct { 28 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"` 29 Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` 30 XXX_NoUnkeyedLiteral struct{} `json:"-"` 31 XXX_unrecognized []byte `json:"-"` 32 XXX_sizecache int32 `json:"-"` 33 } 34 35 func (m *Message) Reset() { *m = Message{} } 36 func (m *Message) String() string { return proto.CompactTextString(m) } 37 func (*Message) ProtoMessage() {} 38 func (*Message) Descriptor() ([]byte, []int) { 39 return fileDescriptor_651718cd7c7ae974, []int{0} 40 } 41 42 func (m *Message) XXX_Unmarshal(b []byte) error { 43 return xxx_messageInfo_Message.Unmarshal(m, b) 44 } 45 func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 46 return xxx_messageInfo_Message.Marshal(b, m, deterministic) 47 } 48 func (m *Message) XXX_Merge(src proto.Message) { 49 xxx_messageInfo_Message.Merge(m, src) 50 } 51 func (m *Message) XXX_Size() int { 52 return xxx_messageInfo_Message.Size(m) 53 } 54 func (m *Message) XXX_DiscardUnknown() { 55 xxx_messageInfo_Message.DiscardUnknown(m) 56 } 57 58 var xxx_messageInfo_Message proto.InternalMessageInfo 59 60 func (m *Message) GetHeader() map[string]string { 61 if m != nil { 62 return m.Header 63 } 64 return nil 65 } 66 67 func (m *Message) GetBody() []byte { 68 if m != nil { 69 return m.Body 70 } 71 return nil 72 } 73 74 func init() { 75 proto.RegisterType((*Message)(nil), "go.micro.transport.grpc.Message") 76 proto.RegisterMapType((map[string]string)(nil), "go.micro.transport.grpc.Message.HeaderEntry") 77 } 78 79 func init() { 80 proto.RegisterFile("transport/grpc/proto/transport.proto", fileDescriptor_651718cd7c7ae974) 81 } 82 83 var fileDescriptor_651718cd7c7ae974 = []byte{ 84 // 209 bytes of a gzipped FileDescriptorProto 85 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x29, 0x29, 0x4a, 0xcc, 86 0x2b, 0x2e, 0xc8, 0x2f, 0x2a, 0xd1, 0x4f, 0x2f, 0x2a, 0x48, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 87 0xd7, 0x87, 0x0b, 0xea, 0x81, 0xf9, 0x42, 0xe2, 0xe9, 0xf9, 0x7a, 0xb9, 0x99, 0xc9, 0x45, 0xf9, 88 0x7a, 0x08, 0x19, 0x90, 0x72, 0xa5, 0x79, 0x8c, 0x5c, 0xec, 0xbe, 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 89 0xa9, 0x42, 0x2e, 0x5c, 0x6c, 0x19, 0xa9, 0x89, 0x29, 0xa9, 0x45, 0x12, 0x8c, 0x0a, 0xcc, 0x1a, 90 0xdc, 0x46, 0x3a, 0x7a, 0x38, 0x74, 0xe9, 0x41, 0x75, 0xe8, 0x79, 0x80, 0x95, 0xbb, 0xe6, 0x95, 91 0x14, 0x55, 0x06, 0x41, 0xf5, 0x0a, 0x09, 0x71, 0xb1, 0x24, 0xe5, 0xa7, 0x54, 0x4a, 0x30, 0x29, 92 0x30, 0x6a, 0xf0, 0x04, 0x81, 0xd9, 0x52, 0x96, 0x5c, 0xdc, 0x48, 0x4a, 0x85, 0x04, 0xb8, 0x98, 93 0xb3, 0x53, 0x2b, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x40, 0x4c, 0x21, 0x11, 0x2e, 0xd6, 94 0xb2, 0xc4, 0x9c, 0xd2, 0x54, 0xb0, 0x2e, 0xce, 0x20, 0x08, 0xc7, 0x8a, 0xc9, 0x82, 0xd1, 0x28, 95 0x9e, 0x8b, 0x33, 0x04, 0x66, 0xb9, 0x50, 0x10, 0x17, 0x5b, 0x70, 0x49, 0x51, 0x6a, 0x62, 0xae, 96 0x90, 0x02, 0x21, 0xb7, 0x49, 0x11, 0x54, 0xa1, 0xc4, 0xa0, 0xc1, 0x68, 0xc0, 0x98, 0xc4, 0x06, 97 0x0e, 0x21, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd4, 0xd0, 0x4b, 0x4b, 0x49, 0x01, 0x00, 98 0x00, 99 } 100 101 // Reference imports to suppress errors if they are not otherwise used. 102 var _ context.Context 103 var _ grpc.ClientConn 104 105 // This is a compile-time assertion to ensure that this generated file 106 // is compatible with the grpc package it is being compiled against. 107 const _ = grpc.SupportPackageIsVersion4 108 109 // TransportClient is the client API for Transport service. 110 // 111 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 112 type TransportClient interface { 113 Stream(ctx context.Context, opts ...grpc.CallOption) (Transport_StreamClient, error) 114 } 115 116 type transportClient struct { 117 cc *grpc.ClientConn 118 } 119 120 func NewTransportClient(cc *grpc.ClientConn) TransportClient { 121 return &transportClient{cc} 122 } 123 124 func (c *transportClient) Stream(ctx context.Context, opts ...grpc.CallOption) (Transport_StreamClient, error) { 125 stream, err := c.cc.NewStream(ctx, &_Transport_serviceDesc.Streams[0], "/go.micro.transport.grpc.Transport/Stream", opts...) 126 if err != nil { 127 return nil, err 128 } 129 x := &transportStreamClient{stream} 130 return x, nil 131 } 132 133 type Transport_StreamClient interface { 134 Send(*Message) error 135 Recv() (*Message, error) 136 grpc.ClientStream 137 } 138 139 type transportStreamClient struct { 140 grpc.ClientStream 141 } 142 143 func (x *transportStreamClient) Send(m *Message) error { 144 return x.ClientStream.SendMsg(m) 145 } 146 147 func (x *transportStreamClient) Recv() (*Message, error) { 148 m := new(Message) 149 if err := x.ClientStream.RecvMsg(m); err != nil { 150 return nil, err 151 } 152 return m, nil 153 } 154 155 // TransportServer is the server API for Transport service. 156 type TransportServer interface { 157 Stream(Transport_StreamServer) error 158 } 159 160 // UnimplementedTransportServer can be embedded to have forward compatible implementations. 161 type UnimplementedTransportServer struct { 162 } 163 164 func (*UnimplementedTransportServer) Stream(srv Transport_StreamServer) error { 165 return status.Errorf(codes.Unimplemented, "method Stream not implemented") 166 } 167 168 func RegisterTransportServer(s *grpc.Server, srv TransportServer) { 169 s.RegisterService(&_Transport_serviceDesc, srv) 170 } 171 172 func _Transport_Stream_Handler(srv interface{}, stream grpc.ServerStream) error { 173 return srv.(TransportServer).Stream(&transportStreamServer{stream}) 174 } 175 176 type Transport_StreamServer interface { 177 Send(*Message) error 178 Recv() (*Message, error) 179 grpc.ServerStream 180 } 181 182 type transportStreamServer struct { 183 grpc.ServerStream 184 } 185 186 func (x *transportStreamServer) Send(m *Message) error { 187 return x.ServerStream.SendMsg(m) 188 } 189 190 func (x *transportStreamServer) Recv() (*Message, error) { 191 m := new(Message) 192 if err := x.ServerStream.RecvMsg(m); err != nil { 193 return nil, err 194 } 195 return m, nil 196 } 197 198 var _Transport_serviceDesc = grpc.ServiceDesc{ 199 ServiceName: "go.micro.transport.grpc.Transport", 200 HandlerType: (*TransportServer)(nil), 201 Methods: []grpc.MethodDesc{}, 202 Streams: []grpc.StreamDesc{ 203 { 204 StreamName: "Stream", 205 Handler: _Transport_Stream_Handler, 206 ServerStreams: true, 207 ClientStreams: true, 208 }, 209 }, 210 Metadata: "transport/grpc/proto/transport.proto", 211 }