gitee.com/liuxuezhan/go-micro-v1.18.0@v1.0.0/transport/grpc/proto/transport.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // source: go-micro/transport/grpc/proto/transport.proto 3 4 package go_micro_grpc_transport 5 6 import ( 7 context "context" 8 fmt "fmt" 9 proto "github.com/golang/protobuf/proto" 10 grpc "google.golang.org/grpc" 11 math "math" 12 ) 13 14 // Reference imports to suppress errors if they are not otherwise used. 15 var _ = proto.Marshal 16 var _ = fmt.Errorf 17 var _ = math.Inf 18 19 // This is a compile-time assertion to ensure that this generated file 20 // is compatible with the proto package it is being compiled against. 21 // A compilation error at this line likely means your copy of the 22 // proto package needs to be updated. 23 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 24 25 type Message struct { 26 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"` 27 Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` 28 XXX_NoUnkeyedLiteral struct{} `json:"-"` 29 XXX_unrecognized []byte `json:"-"` 30 XXX_sizecache int32 `json:"-"` 31 } 32 33 func (m *Message) Reset() { *m = Message{} } 34 func (m *Message) String() string { return proto.CompactTextString(m) } 35 func (*Message) ProtoMessage() {} 36 func (*Message) Descriptor() ([]byte, []int) { 37 return fileDescriptor_29b90b9ccd5e0da5, []int{0} 38 } 39 40 func (m *Message) XXX_Unmarshal(b []byte) error { 41 return xxx_messageInfo_Message.Unmarshal(m, b) 42 } 43 func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 44 return xxx_messageInfo_Message.Marshal(b, m, deterministic) 45 } 46 func (m *Message) XXX_Merge(src proto.Message) { 47 xxx_messageInfo_Message.Merge(m, src) 48 } 49 func (m *Message) XXX_Size() int { 50 return xxx_messageInfo_Message.Size(m) 51 } 52 func (m *Message) XXX_DiscardUnknown() { 53 xxx_messageInfo_Message.DiscardUnknown(m) 54 } 55 56 var xxx_messageInfo_Message proto.InternalMessageInfo 57 58 func (m *Message) GetHeader() map[string]string { 59 if m != nil { 60 return m.Header 61 } 62 return nil 63 } 64 65 func (m *Message) GetBody() []byte { 66 if m != nil { 67 return m.Body 68 } 69 return nil 70 } 71 72 func init() { 73 proto.RegisterType((*Message)(nil), "go.micro.grpc.transport.Message") 74 proto.RegisterMapType((map[string]string)(nil), "go.micro.grpc.transport.Message.HeaderEntry") 75 } 76 77 func init() { 78 proto.RegisterFile("go-micro/transport/grpc/proto/transport.proto", fileDescriptor_29b90b9ccd5e0da5) 79 } 80 81 var fileDescriptor_29b90b9ccd5e0da5 = []byte{ 82 // 214 bytes of a gzipped FileDescriptorProto 83 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4d, 0xcf, 0xd7, 0xcd, 84 0xcd, 0x4c, 0x2e, 0xca, 0xd7, 0x2f, 0x29, 0x4a, 0xcc, 0x2b, 0x2e, 0xc8, 0x2f, 0x2a, 0xd1, 0x4f, 85 0x2f, 0x2a, 0x48, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0x41, 0x12, 0xd4, 0x03, 0xf3, 0x85, 0xc4, 0xd3, 86 0xf3, 0xf5, 0xc0, 0xca, 0xf5, 0x40, 0x8a, 0xf4, 0xe0, 0xd2, 0x4a, 0xf3, 0x18, 0xb9, 0xd8, 0x7d, 87 0x53, 0x8b, 0x8b, 0x13, 0xd3, 0x53, 0x85, 0x5c, 0xb8, 0xd8, 0x32, 0x52, 0x13, 0x53, 0x52, 0x8b, 88 0x24, 0x18, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0x74, 0xf4, 0x70, 0xe8, 0xd2, 0x83, 0xea, 0xd0, 0xf3, 89 0x00, 0x2b, 0x77, 0xcd, 0x2b, 0x29, 0xaa, 0x0c, 0x82, 0xea, 0x15, 0x12, 0xe2, 0x62, 0x49, 0xca, 90 0x4f, 0xa9, 0x94, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x09, 0x02, 0xb3, 0xa5, 0x2c, 0xb9, 0xb8, 0x91, 91 0x94, 0x0a, 0x09, 0x70, 0x31, 0x67, 0xa7, 0x56, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x81, 92 0x98, 0x42, 0x22, 0x5c, 0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x60, 0x5d, 0x9c, 0x41, 0x10, 0x8e, 93 0x15, 0x93, 0x05, 0xa3, 0x51, 0x3c, 0x17, 0x67, 0x08, 0xcc, 0x5e, 0xa1, 0x20, 0x2e, 0xb6, 0xe0, 94 0x92, 0xa2, 0xd4, 0xc4, 0x5c, 0x21, 0x05, 0x42, 0x6e, 0x93, 0x22, 0xa8, 0x42, 0x89, 0x41, 0x83, 95 0xd1, 0x80, 0x31, 0x89, 0x0d, 0x1c, 0x42, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x77, 0xa1, 96 0xa4, 0xcb, 0x52, 0x01, 0x00, 0x00, 97 } 98 99 // Reference imports to suppress errors if they are not otherwise used. 100 var _ context.Context 101 var _ grpc.ClientConn 102 103 // This is a compile-time assertion to ensure that this generated file 104 // is compatible with the grpc package it is being compiled against. 105 const _ = grpc.SupportPackageIsVersion4 106 107 // TransportClient is the client API for Transport service. 108 // 109 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 110 type TransportClient interface { 111 Stream(ctx context.Context, opts ...grpc.CallOption) (Transport_StreamClient, error) 112 } 113 114 type transportClient struct { 115 cc *grpc.ClientConn 116 } 117 118 func NewTransportClient(cc *grpc.ClientConn) TransportClient { 119 return &transportClient{cc} 120 } 121 122 func (c *transportClient) Stream(ctx context.Context, opts ...grpc.CallOption) (Transport_StreamClient, error) { 123 stream, err := c.cc.NewStream(ctx, &_Transport_serviceDesc.Streams[0], "/go.micro.grpc.transport.Transport/Stream", opts...) 124 if err != nil { 125 return nil, err 126 } 127 x := &transportStreamClient{stream} 128 return x, nil 129 } 130 131 type Transport_StreamClient interface { 132 Send(*Message) error 133 Recv() (*Message, error) 134 grpc.ClientStream 135 } 136 137 type transportStreamClient struct { 138 grpc.ClientStream 139 } 140 141 func (x *transportStreamClient) Send(m *Message) error { 142 return x.ClientStream.SendMsg(m) 143 } 144 145 func (x *transportStreamClient) Recv() (*Message, error) { 146 m := new(Message) 147 if err := x.ClientStream.RecvMsg(m); err != nil { 148 return nil, err 149 } 150 return m, nil 151 } 152 153 // TransportServer is the server API for Transport service. 154 type TransportServer interface { 155 Stream(Transport_StreamServer) error 156 } 157 158 func RegisterTransportServer(s *grpc.Server, srv TransportServer) { 159 s.RegisterService(&_Transport_serviceDesc, srv) 160 } 161 162 func _Transport_Stream_Handler(srv interface{}, stream grpc.ServerStream) error { 163 return srv.(TransportServer).Stream(&transportStreamServer{stream}) 164 } 165 166 type Transport_StreamServer interface { 167 Send(*Message) error 168 Recv() (*Message, error) 169 grpc.ServerStream 170 } 171 172 type transportStreamServer struct { 173 grpc.ServerStream 174 } 175 176 func (x *transportStreamServer) Send(m *Message) error { 177 return x.ServerStream.SendMsg(m) 178 } 179 180 func (x *transportStreamServer) Recv() (*Message, error) { 181 m := new(Message) 182 if err := x.ServerStream.RecvMsg(m); err != nil { 183 return nil, err 184 } 185 return m, nil 186 } 187 188 var _Transport_serviceDesc = grpc.ServiceDesc{ 189 ServiceName: "go.micro.grpc.transport.Transport", 190 HandlerType: (*TransportServer)(nil), 191 Methods: []grpc.MethodDesc{}, 192 Streams: []grpc.StreamDesc{ 193 { 194 StreamName: "Stream", 195 Handler: _Transport_Stream_Handler, 196 ServerStreams: true, 197 ClientStreams: true, 198 }, 199 }, 200 Metadata: "go-micro/transport/grpc/proto/transport.proto", 201 }