node_grpc.pb.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. package nodepb
  3. import (
  4. context "context"
  5. grpc "google.golang.org/grpc"
  6. codes "google.golang.org/grpc/codes"
  7. status "google.golang.org/grpc/status"
  8. )
  9. // This is a compile-time assertion to ensure that this generated file
  10. // is compatible with the grpc package it is being compiled against.
  11. // Requires gRPC-Go v1.32.0 or later.
  12. const _ = grpc.SupportPackageIsVersion7
  13. // NodeServiceClient is the client API for NodeService service.
  14. //
  15. // 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.
  16. type NodeServiceClient interface {
  17. Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
  18. CreateNode(ctx context.Context, in *CreateNodeReq, opts ...grpc.CallOption) (*CreateNodeRes, error)
  19. ReadNode(ctx context.Context, in *ReadNodeReq, opts ...grpc.CallOption) (*ReadNodeRes, error)
  20. UpdateNode(ctx context.Context, in *UpdateNodeReq, opts ...grpc.CallOption) (*UpdateNodeRes, error)
  21. DeleteNode(ctx context.Context, in *DeleteNodeReq, opts ...grpc.CallOption) (*DeleteNodeRes, error)
  22. GetPeers(ctx context.Context, in *GetPeersReq, opts ...grpc.CallOption) (NodeService_GetPeersClient, error)
  23. CheckIn(ctx context.Context, in *CheckInReq, opts ...grpc.CallOption) (*CheckInRes, error)
  24. }
  25. type nodeServiceClient struct {
  26. cc grpc.ClientConnInterface
  27. }
  28. func NewNodeServiceClient(cc grpc.ClientConnInterface) NodeServiceClient {
  29. return &nodeServiceClient{cc}
  30. }
  31. func (c *nodeServiceClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {
  32. out := new(LoginResponse)
  33. err := c.cc.Invoke(ctx, "/node.NodeService/Login", in, out, opts...)
  34. if err != nil {
  35. return nil, err
  36. }
  37. return out, nil
  38. }
  39. func (c *nodeServiceClient) CreateNode(ctx context.Context, in *CreateNodeReq, opts ...grpc.CallOption) (*CreateNodeRes, error) {
  40. out := new(CreateNodeRes)
  41. err := c.cc.Invoke(ctx, "/node.NodeService/CreateNode", in, out, opts...)
  42. if err != nil {
  43. return nil, err
  44. }
  45. return out, nil
  46. }
  47. func (c *nodeServiceClient) ReadNode(ctx context.Context, in *ReadNodeReq, opts ...grpc.CallOption) (*ReadNodeRes, error) {
  48. out := new(ReadNodeRes)
  49. err := c.cc.Invoke(ctx, "/node.NodeService/ReadNode", in, out, opts...)
  50. if err != nil {
  51. return nil, err
  52. }
  53. return out, nil
  54. }
  55. func (c *nodeServiceClient) UpdateNode(ctx context.Context, in *UpdateNodeReq, opts ...grpc.CallOption) (*UpdateNodeRes, error) {
  56. out := new(UpdateNodeRes)
  57. err := c.cc.Invoke(ctx, "/node.NodeService/UpdateNode", in, out, opts...)
  58. if err != nil {
  59. return nil, err
  60. }
  61. return out, nil
  62. }
  63. func (c *nodeServiceClient) DeleteNode(ctx context.Context, in *DeleteNodeReq, opts ...grpc.CallOption) (*DeleteNodeRes, error) {
  64. out := new(DeleteNodeRes)
  65. err := c.cc.Invoke(ctx, "/node.NodeService/DeleteNode", in, out, opts...)
  66. if err != nil {
  67. return nil, err
  68. }
  69. return out, nil
  70. }
  71. func (c *nodeServiceClient) GetPeers(ctx context.Context, in *GetPeersReq, opts ...grpc.CallOption) (NodeService_GetPeersClient, error) {
  72. stream, err := c.cc.NewStream(ctx, &NodeService_ServiceDesc.Streams[0], "/node.NodeService/GetPeers", opts...)
  73. if err != nil {
  74. return nil, err
  75. }
  76. x := &nodeServiceGetPeersClient{stream}
  77. if err := x.ClientStream.SendMsg(in); err != nil {
  78. return nil, err
  79. }
  80. if err := x.ClientStream.CloseSend(); err != nil {
  81. return nil, err
  82. }
  83. return x, nil
  84. }
  85. type NodeService_GetPeersClient interface {
  86. Recv() (*GetPeersRes, error)
  87. grpc.ClientStream
  88. }
  89. type nodeServiceGetPeersClient struct {
  90. grpc.ClientStream
  91. }
  92. func (x *nodeServiceGetPeersClient) Recv() (*GetPeersRes, error) {
  93. m := new(GetPeersRes)
  94. if err := x.ClientStream.RecvMsg(m); err != nil {
  95. return nil, err
  96. }
  97. return m, nil
  98. }
  99. func (c *nodeServiceClient) CheckIn(ctx context.Context, in *CheckInReq, opts ...grpc.CallOption) (*CheckInRes, error) {
  100. out := new(CheckInRes)
  101. err := c.cc.Invoke(ctx, "/node.NodeService/CheckIn", in, out, opts...)
  102. if err != nil {
  103. return nil, err
  104. }
  105. return out, nil
  106. }
  107. // NodeServiceServer is the server API for NodeService service.
  108. // All implementations must embed UnimplementedNodeServiceServer
  109. // for forward compatibility
  110. type NodeServiceServer interface {
  111. Login(context.Context, *LoginRequest) (*LoginResponse, error)
  112. CreateNode(context.Context, *CreateNodeReq) (*CreateNodeRes, error)
  113. ReadNode(context.Context, *ReadNodeReq) (*ReadNodeRes, error)
  114. UpdateNode(context.Context, *UpdateNodeReq) (*UpdateNodeRes, error)
  115. DeleteNode(context.Context, *DeleteNodeReq) (*DeleteNodeRes, error)
  116. GetPeers(*GetPeersReq, NodeService_GetPeersServer) error
  117. CheckIn(context.Context, *CheckInReq) (*CheckInRes, error)
  118. mustEmbedUnimplementedNodeServiceServer()
  119. }
  120. // UnimplementedNodeServiceServer must be embedded to have forward compatible implementations.
  121. type UnimplementedNodeServiceServer struct {
  122. }
  123. func (UnimplementedNodeServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) {
  124. return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
  125. }
  126. func (UnimplementedNodeServiceServer) CreateNode(context.Context, *CreateNodeReq) (*CreateNodeRes, error) {
  127. return nil, status.Errorf(codes.Unimplemented, "method CreateNode not implemented")
  128. }
  129. func (UnimplementedNodeServiceServer) ReadNode(context.Context, *ReadNodeReq) (*ReadNodeRes, error) {
  130. return nil, status.Errorf(codes.Unimplemented, "method ReadNode not implemented")
  131. }
  132. func (UnimplementedNodeServiceServer) UpdateNode(context.Context, *UpdateNodeReq) (*UpdateNodeRes, error) {
  133. return nil, status.Errorf(codes.Unimplemented, "method UpdateNode not implemented")
  134. }
  135. func (UnimplementedNodeServiceServer) DeleteNode(context.Context, *DeleteNodeReq) (*DeleteNodeRes, error) {
  136. return nil, status.Errorf(codes.Unimplemented, "method DeleteNode not implemented")
  137. }
  138. func (UnimplementedNodeServiceServer) GetPeers(*GetPeersReq, NodeService_GetPeersServer) error {
  139. return status.Errorf(codes.Unimplemented, "method GetPeers not implemented")
  140. }
  141. func (UnimplementedNodeServiceServer) CheckIn(context.Context, *CheckInReq) (*CheckInRes, error) {
  142. return nil, status.Errorf(codes.Unimplemented, "method CheckIn not implemented")
  143. }
  144. func (UnimplementedNodeServiceServer) mustEmbedUnimplementedNodeServiceServer() {}
  145. // UnsafeNodeServiceServer may be embedded to opt out of forward compatibility for this service.
  146. // Use of this interface is not recommended, as added methods to NodeServiceServer will
  147. // result in compilation errors.
  148. type UnsafeNodeServiceServer interface {
  149. mustEmbedUnimplementedNodeServiceServer()
  150. }
  151. func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer) {
  152. s.RegisterService(&NodeService_ServiceDesc, srv)
  153. }
  154. func _NodeService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  155. in := new(LoginRequest)
  156. if err := dec(in); err != nil {
  157. return nil, err
  158. }
  159. if interceptor == nil {
  160. return srv.(NodeServiceServer).Login(ctx, in)
  161. }
  162. info := &grpc.UnaryServerInfo{
  163. Server: srv,
  164. FullMethod: "/node.NodeService/Login",
  165. }
  166. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  167. return srv.(NodeServiceServer).Login(ctx, req.(*LoginRequest))
  168. }
  169. return interceptor(ctx, in, info, handler)
  170. }
  171. func _NodeService_CreateNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  172. in := new(CreateNodeReq)
  173. if err := dec(in); err != nil {
  174. return nil, err
  175. }
  176. if interceptor == nil {
  177. return srv.(NodeServiceServer).CreateNode(ctx, in)
  178. }
  179. info := &grpc.UnaryServerInfo{
  180. Server: srv,
  181. FullMethod: "/node.NodeService/CreateNode",
  182. }
  183. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  184. return srv.(NodeServiceServer).CreateNode(ctx, req.(*CreateNodeReq))
  185. }
  186. return interceptor(ctx, in, info, handler)
  187. }
  188. func _NodeService_ReadNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  189. in := new(ReadNodeReq)
  190. if err := dec(in); err != nil {
  191. return nil, err
  192. }
  193. if interceptor == nil {
  194. return srv.(NodeServiceServer).ReadNode(ctx, in)
  195. }
  196. info := &grpc.UnaryServerInfo{
  197. Server: srv,
  198. FullMethod: "/node.NodeService/ReadNode",
  199. }
  200. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  201. return srv.(NodeServiceServer).ReadNode(ctx, req.(*ReadNodeReq))
  202. }
  203. return interceptor(ctx, in, info, handler)
  204. }
  205. func _NodeService_UpdateNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  206. in := new(UpdateNodeReq)
  207. if err := dec(in); err != nil {
  208. return nil, err
  209. }
  210. if interceptor == nil {
  211. return srv.(NodeServiceServer).UpdateNode(ctx, in)
  212. }
  213. info := &grpc.UnaryServerInfo{
  214. Server: srv,
  215. FullMethod: "/node.NodeService/UpdateNode",
  216. }
  217. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  218. return srv.(NodeServiceServer).UpdateNode(ctx, req.(*UpdateNodeReq))
  219. }
  220. return interceptor(ctx, in, info, handler)
  221. }
  222. func _NodeService_DeleteNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  223. in := new(DeleteNodeReq)
  224. if err := dec(in); err != nil {
  225. return nil, err
  226. }
  227. if interceptor == nil {
  228. return srv.(NodeServiceServer).DeleteNode(ctx, in)
  229. }
  230. info := &grpc.UnaryServerInfo{
  231. Server: srv,
  232. FullMethod: "/node.NodeService/DeleteNode",
  233. }
  234. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  235. return srv.(NodeServiceServer).DeleteNode(ctx, req.(*DeleteNodeReq))
  236. }
  237. return interceptor(ctx, in, info, handler)
  238. }
  239. func _NodeService_GetPeers_Handler(srv interface{}, stream grpc.ServerStream) error {
  240. m := new(GetPeersReq)
  241. if err := stream.RecvMsg(m); err != nil {
  242. return err
  243. }
  244. return srv.(NodeServiceServer).GetPeers(m, &nodeServiceGetPeersServer{stream})
  245. }
  246. type NodeService_GetPeersServer interface {
  247. Send(*GetPeersRes) error
  248. grpc.ServerStream
  249. }
  250. type nodeServiceGetPeersServer struct {
  251. grpc.ServerStream
  252. }
  253. func (x *nodeServiceGetPeersServer) Send(m *GetPeersRes) error {
  254. return x.ServerStream.SendMsg(m)
  255. }
  256. func _NodeService_CheckIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  257. in := new(CheckInReq)
  258. if err := dec(in); err != nil {
  259. return nil, err
  260. }
  261. if interceptor == nil {
  262. return srv.(NodeServiceServer).CheckIn(ctx, in)
  263. }
  264. info := &grpc.UnaryServerInfo{
  265. Server: srv,
  266. FullMethod: "/node.NodeService/CheckIn",
  267. }
  268. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  269. return srv.(NodeServiceServer).CheckIn(ctx, req.(*CheckInReq))
  270. }
  271. return interceptor(ctx, in, info, handler)
  272. }
  273. // NodeService_ServiceDesc is the grpc.ServiceDesc for NodeService service.
  274. // It's only intended for direct use with grpc.RegisterService,
  275. // and not to be introspected or modified (even as a copy)
  276. var NodeService_ServiceDesc = grpc.ServiceDesc{
  277. ServiceName: "node.NodeService",
  278. HandlerType: (*NodeServiceServer)(nil),
  279. Methods: []grpc.MethodDesc{
  280. {
  281. MethodName: "Login",
  282. Handler: _NodeService_Login_Handler,
  283. },
  284. {
  285. MethodName: "CreateNode",
  286. Handler: _NodeService_CreateNode_Handler,
  287. },
  288. {
  289. MethodName: "ReadNode",
  290. Handler: _NodeService_ReadNode_Handler,
  291. },
  292. {
  293. MethodName: "UpdateNode",
  294. Handler: _NodeService_UpdateNode_Handler,
  295. },
  296. {
  297. MethodName: "DeleteNode",
  298. Handler: _NodeService_DeleteNode_Handler,
  299. },
  300. {
  301. MethodName: "CheckIn",
  302. Handler: _NodeService_CheckIn_Handler,
  303. },
  304. },
  305. Streams: []grpc.StreamDesc{
  306. {
  307. StreamName: "GetPeers",
  308. Handler: _NodeService_GetPeers_Handler,
  309. ServerStreams: true,
  310. },
  311. },
  312. Metadata: "grpc/node.proto",
  313. }