dubbo.apache.org/dubbo-go/v3@v3.1.1/protocol/grpc/internal/helloworld/helloworld.pb.go (about) 1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 // Code generated by protoc-gen-go. DO NOT EDIT. 19 // source: helloworld.proto 20 21 package helloworld 22 23 import ( 24 context "context" 25 fmt "fmt" 26 math "math" 27 ) 28 29 import ( 30 proto "github.com/golang/protobuf/proto" 31 32 grpc "google.golang.org/grpc" 33 codes "google.golang.org/grpc/codes" 34 status "google.golang.org/grpc/status" 35 ) 36 37 import ( 38 "dubbo.apache.org/dubbo-go/v3/protocol" 39 "dubbo.apache.org/dubbo-go/v3/protocol/invocation" 40 ) 41 42 // Reference imports to suppress errors if they are not otherwise used. 43 var _ = proto.Marshal 44 var _ = fmt.Errorf 45 var _ = math.Inf 46 47 // This is a compile-time assertion to ensure that this generated file 48 // is compatible with the proto package it is being compiled against. 49 // A compilation error at this line likely means your copy of the 50 // proto package needs to be updated. 51 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 52 53 // The request message containing the user's name. 54 type HelloRequest struct { 55 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 56 XXX_NoUnkeyedLiteral struct{} `json:"-"` 57 XXX_unrecognized []byte `json:"-"` 58 XXX_sizecache int32 `json:"-"` 59 } 60 61 func (m *HelloRequest) Reset() { *m = HelloRequest{} } 62 func (m *HelloRequest) String() string { return proto.CompactTextString(m) } 63 func (*HelloRequest) ProtoMessage() {} 64 func (*HelloRequest) Descriptor() ([]byte, []int) { 65 return fileDescriptor_17b8c58d586b62f2, []int{0} 66 } 67 68 func (m *HelloRequest) XXX_Unmarshal(b []byte) error { 69 return xxx_messageInfo_HelloRequest.Unmarshal(m, b) 70 } 71 func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 72 return xxx_messageInfo_HelloRequest.Marshal(b, m, deterministic) 73 } 74 func (m *HelloRequest) XXX_Merge(src proto.Message) { 75 xxx_messageInfo_HelloRequest.Merge(m, src) 76 } 77 func (m *HelloRequest) XXX_Size() int { 78 return xxx_messageInfo_HelloRequest.Size(m) 79 } 80 func (m *HelloRequest) XXX_DiscardUnknown() { 81 xxx_messageInfo_HelloRequest.DiscardUnknown(m) 82 } 83 84 var xxx_messageInfo_HelloRequest proto.InternalMessageInfo 85 86 func (m *HelloRequest) GetName() string { 87 if m != nil { 88 return m.Name 89 } 90 return "" 91 } 92 93 // The response message containing the greetings 94 type HelloReply struct { 95 Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` 96 XXX_NoUnkeyedLiteral struct{} `json:"-"` 97 XXX_unrecognized []byte `json:"-"` 98 XXX_sizecache int32 `json:"-"` 99 } 100 101 func (m *HelloReply) Reset() { *m = HelloReply{} } 102 func (m *HelloReply) String() string { return proto.CompactTextString(m) } 103 func (*HelloReply) ProtoMessage() {} 104 func (*HelloReply) Descriptor() ([]byte, []int) { 105 return fileDescriptor_17b8c58d586b62f2, []int{1} 106 } 107 108 func (m *HelloReply) XXX_Unmarshal(b []byte) error { 109 return xxx_messageInfo_HelloReply.Unmarshal(m, b) 110 } 111 func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 112 return xxx_messageInfo_HelloReply.Marshal(b, m, deterministic) 113 } 114 func (m *HelloReply) XXX_Merge(src proto.Message) { 115 xxx_messageInfo_HelloReply.Merge(m, src) 116 } 117 func (m *HelloReply) XXX_Size() int { 118 return xxx_messageInfo_HelloReply.Size(m) 119 } 120 func (m *HelloReply) XXX_DiscardUnknown() { 121 xxx_messageInfo_HelloReply.DiscardUnknown(m) 122 } 123 124 var xxx_messageInfo_HelloReply proto.InternalMessageInfo 125 126 func (m *HelloReply) GetMessage() string { 127 if m != nil { 128 return m.Message 129 } 130 return "" 131 } 132 133 func init() { 134 proto.RegisterType((*HelloRequest)(nil), "helloworld.HelloRequest") 135 proto.RegisterType((*HelloReply)(nil), "helloworld.HelloReply") 136 } 137 138 func init() { proto.RegisterFile("helloworld.proto", fileDescriptor_17b8c58d586b62f2) } 139 140 var fileDescriptor_17b8c58d586b62f2 = []byte{ 141 // 181 bytes of a gzipped FileDescriptorProto 142 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0x48, 0xcd, 0xc9, 143 0xc9, 0x2f, 0xcf, 0x2f, 0xca, 0x49, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x42, 0x88, 144 0x28, 0x29, 0x71, 0xf1, 0x78, 0x80, 0x78, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x42, 0x42, 145 0x5c, 0x2c, 0x79, 0x89, 0xb9, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x60, 0xb6, 0x92, 146 0x1a, 0x17, 0x17, 0x54, 0x4d, 0x41, 0x4e, 0xa5, 0x90, 0x04, 0x17, 0x7b, 0x6e, 0x6a, 0x71, 0x71, 147 0x62, 0x3a, 0x4c, 0x11, 0x8c, 0x6b, 0xe4, 0xc9, 0xc5, 0xee, 0x5e, 0x94, 0x9a, 0x5a, 0x92, 0x5a, 148 0x24, 0x64, 0xc7, 0xc5, 0x11, 0x9c, 0x58, 0x09, 0xd6, 0x25, 0x24, 0xa1, 0x87, 0xe4, 0x02, 0x64, 149 0xcb, 0xa4, 0xc4, 0xb0, 0xc8, 0x14, 0xe4, 0x54, 0x2a, 0x31, 0x38, 0x99, 0x71, 0x49, 0x67, 0xe6, 150 0xeb, 0xa5, 0x17, 0x15, 0x24, 0xeb, 0xa5, 0x56, 0x24, 0xe6, 0x16, 0xe4, 0xa4, 0x16, 0x23, 0xa9, 151 0x75, 0xe2, 0x07, 0x2b, 0x0e, 0x07, 0xb1, 0x03, 0x40, 0x5e, 0x0a, 0x60, 0x5c, 0xc4, 0xc4, 0xec, 152 0xe1, 0x13, 0x9e, 0xc4, 0x06, 0xf6, 0xa1, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x0a, 0xdc, 153 0xe8, 0xf5, 0x00, 0x00, 0x00, 154 } 155 156 // Reference imports to suppress errors if they are not otherwise used. 157 var _ context.Context 158 var _ grpc.ClientConnInterface 159 160 // This is a compile-time assertion to ensure that this generated file 161 // is compatible with the grpc package it is being compiled against. 162 const _ = grpc.SupportPackageIsVersion6 163 164 // GreeterClient is the client API for Greeter service. 165 // 166 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 167 type GreeterClient interface { 168 // Sends a greeting 169 SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) 170 } 171 172 type greeterClient struct { 173 cc grpc.ClientConnInterface 174 } 175 176 func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient { 177 return &greeterClient{cc} 178 } 179 180 func (c *greeterClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) { 181 out := new(HelloReply) 182 err := c.cc.Invoke(ctx, "/helloworld.Greeter/SayHello", in, out, opts...) 183 if err != nil { 184 return nil, err 185 } 186 return out, nil 187 } 188 189 // GreeterServer is the server API for Greeter service. 190 type GreeterServer interface { 191 // Sends a greeting 192 SayHello(context.Context, *HelloRequest) (*HelloReply, error) 193 } 194 195 // UnimplementedGreeterServer can be embedded to have forward compatible implementations. 196 type UnimplementedGreeterServer struct { 197 } 198 199 func (*UnimplementedGreeterServer) SayHello(ctx context.Context, req *HelloRequest) (*HelloReply, error) { 200 return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented") 201 } 202 203 func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) { 204 s.RegisterService(&_Greeter_serviceDesc, srv) 205 } 206 207 func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 208 in := new(HelloRequest) 209 if err := dec(in); err != nil { 210 return nil, err 211 } 212 if interceptor == nil { 213 return srv.(GreeterServer).SayHello(ctx, in) 214 } 215 info := &grpc.UnaryServerInfo{ 216 Server: srv, 217 FullMethod: "/helloworld.Greeter/SayHello", 218 } 219 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 220 return srv.(GreeterServer).SayHello(ctx, req.(*HelloRequest)) 221 } 222 return interceptor(ctx, in, info, handler) 223 } 224 225 var _Greeter_serviceDesc = grpc.ServiceDesc{ 226 ServiceName: "helloworld.Greeter", 227 HandlerType: (*GreeterServer)(nil), 228 Methods: []grpc.MethodDesc{ 229 { 230 MethodName: "SayHello", 231 Handler: _Greeter_SayHello_Handler, 232 }, 233 }, 234 Streams: []grpc.StreamDesc{}, 235 Metadata: "helloworld.proto", 236 } 237 238 // GreeterClientImpl is the client API for Greeter service. 239 // 240 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 241 type GreeterClientImpl struct { 242 // Sends a greeting 243 SayHello func(ctx context.Context, in *HelloRequest, out *HelloReply) error 244 } 245 246 func (c *GreeterClientImpl) Reference() string { 247 return "greeterImpl" 248 } 249 250 func (c *GreeterClientImpl) GetDubboStub(cc *grpc.ClientConn) GreeterClient { 251 return NewGreeterClient(cc) 252 } 253 254 type GreeterProviderBase struct { 255 proxyImpl protocol.Invoker 256 } 257 258 func (s *GreeterProviderBase) SetProxyImpl(impl protocol.Invoker) { 259 s.proxyImpl = impl 260 } 261 262 func (s *GreeterProviderBase) GetProxyImpl() protocol.Invoker { 263 return s.proxyImpl 264 } 265 266 func (c *GreeterProviderBase) Reference() string { 267 return "greeterImpl" 268 } 269 270 func _DUBBO_Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 271 in := new(HelloRequest) 272 if err := dec(in); err != nil { 273 return nil, err 274 } 275 // DubboGrpcService is gRPC service 276 type DubboGrpcService interface { 277 // SetProxyImpl sets proxy. 278 SetProxyImpl(impl protocol.Invoker) 279 // GetProxyImpl gets proxy. 280 GetProxyImpl() protocol.Invoker 281 // ServiceDesc gets an RPC service's specification. 282 ServiceDesc() *grpc.ServiceDesc 283 } 284 base := srv.(DubboGrpcService) 285 args := []interface{}{} 286 args = append(args, in) 287 invo := invocation.NewRPCInvocation("SayHello", args, nil) 288 if interceptor == nil { 289 result := base.GetProxyImpl().Invoke(ctx, invo) 290 return result.Result(), result.Error() 291 } 292 info := &grpc.UnaryServerInfo{ 293 Server: srv, 294 FullMethod: "/helloworld.Greeter/SayHello", 295 } 296 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 297 result := base.GetProxyImpl().Invoke(ctx, invo) 298 return result.Result(), result.Error() 299 } 300 return interceptor(ctx, in, info, handler) 301 } 302 303 func (s *GreeterProviderBase) ServiceDesc() *grpc.ServiceDesc { 304 return &grpc.ServiceDesc{ 305 ServiceName: "helloworld.Greeter", 306 HandlerType: (*GreeterServer)(nil), 307 Methods: []grpc.MethodDesc{ 308 { 309 MethodName: "SayHello", 310 Handler: _DUBBO_Greeter_SayHello_Handler, 311 }, 312 }, 313 Streams: []grpc.StreamDesc{}, 314 Metadata: "helloworld.proto", 315 } 316 }