hw_grpc.pb.go 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. package helloworld
  3. import (
  4. context "context"
  5. empty "github.com/golang/protobuf/ptypes/empty"
  6. wrappers "github.com/golang/protobuf/ptypes/wrappers"
  7. grpc "google.golang.org/grpc"
  8. codes "google.golang.org/grpc/codes"
  9. status "google.golang.org/grpc/status"
  10. )
  11. // This is a compile-time assertion to ensure that this generated file
  12. // is compatible with the grpc package it is being compiled against.
  13. // Requires gRPC-Go v1.32.0 or later.
  14. const _ = grpc.SupportPackageIsVersion7
  15. // GreeterClient is the client API for Greeter service.
  16. //
  17. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
  18. type GreeterClient interface {
  19. // Sends a greeting
  20. SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
  21. Compute(ctx context.Context, in *InferRequest, opts ...grpc.CallOption) (*Response, error)
  22. // Primitive type param. Not supported for rest json
  23. GetFeature(ctx context.Context, in *wrappers.BytesValue, opts ...grpc.CallOption) (*FeatureResponse, error)
  24. ObjectDetection(ctx context.Context, in *ObjectDetectionRequest, opts ...grpc.CallOption) (*ObjectDetectionResponse, error)
  25. GetStatus(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*wrappers.BoolValue, error)
  26. }
  27. type greeterClient struct {
  28. cc grpc.ClientConnInterface
  29. }
  30. func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient {
  31. return &greeterClient{cc}
  32. }
  33. func (c *greeterClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) {
  34. out := new(HelloReply)
  35. err := c.cc.Invoke(ctx, "/helloworld.Greeter/SayHello", in, out, opts...)
  36. if err != nil {
  37. return nil, err
  38. }
  39. return out, nil
  40. }
  41. func (c *greeterClient) Compute(ctx context.Context, in *InferRequest, opts ...grpc.CallOption) (*Response, error) {
  42. out := new(Response)
  43. err := c.cc.Invoke(ctx, "/helloworld.Greeter/Compute", in, out, opts...)
  44. if err != nil {
  45. return nil, err
  46. }
  47. return out, nil
  48. }
  49. func (c *greeterClient) GetFeature(ctx context.Context, in *wrappers.BytesValue, opts ...grpc.CallOption) (*FeatureResponse, error) {
  50. out := new(FeatureResponse)
  51. err := c.cc.Invoke(ctx, "/helloworld.Greeter/get_feature", in, out, opts...)
  52. if err != nil {
  53. return nil, err
  54. }
  55. return out, nil
  56. }
  57. func (c *greeterClient) ObjectDetection(ctx context.Context, in *ObjectDetectionRequest, opts ...grpc.CallOption) (*ObjectDetectionResponse, error) {
  58. out := new(ObjectDetectionResponse)
  59. err := c.cc.Invoke(ctx, "/helloworld.Greeter/object_detection", in, out, opts...)
  60. if err != nil {
  61. return nil, err
  62. }
  63. return out, nil
  64. }
  65. func (c *greeterClient) GetStatus(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*wrappers.BoolValue, error) {
  66. out := new(wrappers.BoolValue)
  67. err := c.cc.Invoke(ctx, "/helloworld.Greeter/getStatus", in, out, opts...)
  68. if err != nil {
  69. return nil, err
  70. }
  71. return out, nil
  72. }
  73. // GreeterServer is the server API for Greeter service.
  74. // All implementations must embed UnimplementedGreeterServer
  75. // for forward compatibility
  76. type GreeterServer interface {
  77. // Sends a greeting
  78. SayHello(context.Context, *HelloRequest) (*HelloReply, error)
  79. Compute(context.Context, *InferRequest) (*Response, error)
  80. // Primitive type param. Not supported for rest json
  81. GetFeature(context.Context, *wrappers.BytesValue) (*FeatureResponse, error)
  82. ObjectDetection(context.Context, *ObjectDetectionRequest) (*ObjectDetectionResponse, error)
  83. GetStatus(context.Context, *empty.Empty) (*wrappers.BoolValue, error)
  84. mustEmbedUnimplementedGreeterServer()
  85. }
  86. // UnimplementedGreeterServer must be embedded to have forward compatible implementations.
  87. type UnimplementedGreeterServer struct {
  88. }
  89. func (UnimplementedGreeterServer) SayHello(context.Context, *HelloRequest) (*HelloReply, error) {
  90. return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented")
  91. }
  92. func (UnimplementedGreeterServer) Compute(context.Context, *InferRequest) (*Response, error) {
  93. return nil, status.Errorf(codes.Unimplemented, "method Compute not implemented")
  94. }
  95. func (UnimplementedGreeterServer) GetFeature(context.Context, *wrappers.BytesValue) (*FeatureResponse, error) {
  96. return nil, status.Errorf(codes.Unimplemented, "method GetFeature not implemented")
  97. }
  98. func (UnimplementedGreeterServer) ObjectDetection(context.Context, *ObjectDetectionRequest) (*ObjectDetectionResponse, error) {
  99. return nil, status.Errorf(codes.Unimplemented, "method ObjectDetection not implemented")
  100. }
  101. func (UnimplementedGreeterServer) GetStatus(context.Context, *empty.Empty) (*wrappers.BoolValue, error) {
  102. return nil, status.Errorf(codes.Unimplemented, "method GetStatus not implemented")
  103. }
  104. func (UnimplementedGreeterServer) mustEmbedUnimplementedGreeterServer() {}
  105. // UnsafeGreeterServer may be embedded to opt out of forward compatibility for this service.
  106. // Use of this interface is not recommended, as added methods to GreeterServer will
  107. // result in compilation errors.
  108. type UnsafeGreeterServer interface {
  109. mustEmbedUnimplementedGreeterServer()
  110. }
  111. func RegisterGreeterServer(s grpc.ServiceRegistrar, srv GreeterServer) {
  112. s.RegisterService(&Greeter_ServiceDesc, srv)
  113. }
  114. func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  115. in := new(HelloRequest)
  116. if err := dec(in); err != nil {
  117. return nil, err
  118. }
  119. if interceptor == nil {
  120. return srv.(GreeterServer).SayHello(ctx, in)
  121. }
  122. info := &grpc.UnaryServerInfo{
  123. Server: srv,
  124. FullMethod: "/helloworld.Greeter/SayHello",
  125. }
  126. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  127. return srv.(GreeterServer).SayHello(ctx, req.(*HelloRequest))
  128. }
  129. return interceptor(ctx, in, info, handler)
  130. }
  131. func _Greeter_Compute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  132. in := new(InferRequest)
  133. if err := dec(in); err != nil {
  134. return nil, err
  135. }
  136. if interceptor == nil {
  137. return srv.(GreeterServer).Compute(ctx, in)
  138. }
  139. info := &grpc.UnaryServerInfo{
  140. Server: srv,
  141. FullMethod: "/helloworld.Greeter/Compute",
  142. }
  143. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  144. return srv.(GreeterServer).Compute(ctx, req.(*InferRequest))
  145. }
  146. return interceptor(ctx, in, info, handler)
  147. }
  148. func _Greeter_GetFeature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  149. in := new(wrappers.BytesValue)
  150. if err := dec(in); err != nil {
  151. return nil, err
  152. }
  153. if interceptor == nil {
  154. return srv.(GreeterServer).GetFeature(ctx, in)
  155. }
  156. info := &grpc.UnaryServerInfo{
  157. Server: srv,
  158. FullMethod: "/helloworld.Greeter/get_feature",
  159. }
  160. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  161. return srv.(GreeterServer).GetFeature(ctx, req.(*wrappers.BytesValue))
  162. }
  163. return interceptor(ctx, in, info, handler)
  164. }
  165. func _Greeter_ObjectDetection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  166. in := new(ObjectDetectionRequest)
  167. if err := dec(in); err != nil {
  168. return nil, err
  169. }
  170. if interceptor == nil {
  171. return srv.(GreeterServer).ObjectDetection(ctx, in)
  172. }
  173. info := &grpc.UnaryServerInfo{
  174. Server: srv,
  175. FullMethod: "/helloworld.Greeter/object_detection",
  176. }
  177. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  178. return srv.(GreeterServer).ObjectDetection(ctx, req.(*ObjectDetectionRequest))
  179. }
  180. return interceptor(ctx, in, info, handler)
  181. }
  182. func _Greeter_GetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  183. in := new(empty.Empty)
  184. if err := dec(in); err != nil {
  185. return nil, err
  186. }
  187. if interceptor == nil {
  188. return srv.(GreeterServer).GetStatus(ctx, in)
  189. }
  190. info := &grpc.UnaryServerInfo{
  191. Server: srv,
  192. FullMethod: "/helloworld.Greeter/getStatus",
  193. }
  194. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  195. return srv.(GreeterServer).GetStatus(ctx, req.(*empty.Empty))
  196. }
  197. return interceptor(ctx, in, info, handler)
  198. }
  199. // Greeter_ServiceDesc is the grpc.ServiceDesc for Greeter service.
  200. // It's only intended for direct use with grpc.RegisterService,
  201. // and not to be introspected or modified (even as a copy)
  202. var Greeter_ServiceDesc = grpc.ServiceDesc{
  203. ServiceName: "helloworld.Greeter",
  204. HandlerType: (*GreeterServer)(nil),
  205. Methods: []grpc.MethodDesc{
  206. {
  207. MethodName: "SayHello",
  208. Handler: _Greeter_SayHello_Handler,
  209. },
  210. {
  211. MethodName: "Compute",
  212. Handler: _Greeter_Compute_Handler,
  213. },
  214. {
  215. MethodName: "get_feature",
  216. Handler: _Greeter_GetFeature_Handler,
  217. },
  218. {
  219. MethodName: "object_detection",
  220. Handler: _Greeter_ObjectDetection_Handler,
  221. },
  222. {
  223. MethodName: "getStatus",
  224. Handler: _Greeter_GetStatus_Handler,
  225. },
  226. },
  227. Streams: []grpc.StreamDesc{},
  228. Metadata: "hw.proto",
  229. }