command_grpc.pb.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.2.0
  4. // - protoc v3.12.4
  5. // source: v1/command.proto
  6. package v1
  7. import (
  8. context "context"
  9. request "git.sxidc.com/service-supports/dps-sdk/pb/v1/request"
  10. response "git.sxidc.com/service-supports/dps-sdk/pb/v1/response"
  11. empty "github.com/golang/protobuf/ptypes/empty"
  12. grpc "google.golang.org/grpc"
  13. codes "google.golang.org/grpc/codes"
  14. status "google.golang.org/grpc/status"
  15. )
  16. // This is a compile-time assertion to ensure that this generated file
  17. // is compatible with the grpc package it is being compiled against.
  18. // Requires gRPC-Go v1.32.0 or later.
  19. const _ = grpc.SupportPackageIsVersion7
  20. // CommandServiceClient is the client API for CommandService service.
  21. //
  22. // 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.
  23. type CommandServiceClient interface {
  24. AutoMigrate(ctx context.Context, in *request.AutoMigrateRequest, opts ...grpc.CallOption) (*empty.Empty, error)
  25. Transaction(ctx context.Context, opts ...grpc.CallOption) (CommandService_TransactionClient, error)
  26. Insert(ctx context.Context, in *request.InsertRequest, opts ...grpc.CallOption) (*response.CommandStatementResponse, error)
  27. InsertBatch(ctx context.Context, in *request.InsertBatchRequest, opts ...grpc.CallOption) (*response.CommandStatementResponse, error)
  28. Delete(ctx context.Context, in *request.DeleteRequest, opts ...grpc.CallOption) (*response.CommandStatementResponse, error)
  29. DeleteWhere(ctx context.Context, in *request.DeleteWhereRequest, opts ...grpc.CallOption) (*response.CommandStatementResponse, error)
  30. Update(ctx context.Context, in *request.UpdateRequest, opts ...grpc.CallOption) (*response.CommandStatementResponse, error)
  31. UpdateWhere(ctx context.Context, in *request.UpdateWhereRequest, opts ...grpc.CallOption) (*response.CommandStatementResponse, error)
  32. Replay(ctx context.Context, in *request.ReplayRequest, opts ...grpc.CallOption) (*response.CommandStatementResponse, error)
  33. }
  34. type commandServiceClient struct {
  35. cc grpc.ClientConnInterface
  36. }
  37. func NewCommandServiceClient(cc grpc.ClientConnInterface) CommandServiceClient {
  38. return &commandServiceClient{cc}
  39. }
  40. func (c *commandServiceClient) AutoMigrate(ctx context.Context, in *request.AutoMigrateRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
  41. out := new(empty.Empty)
  42. err := c.cc.Invoke(ctx, "/v1.CommandService/AutoMigrate", in, out, opts...)
  43. if err != nil {
  44. return nil, err
  45. }
  46. return out, nil
  47. }
  48. func (c *commandServiceClient) Transaction(ctx context.Context, opts ...grpc.CallOption) (CommandService_TransactionClient, error) {
  49. stream, err := c.cc.NewStream(ctx, &CommandService_ServiceDesc.Streams[0], "/v1.CommandService/Transaction", opts...)
  50. if err != nil {
  51. return nil, err
  52. }
  53. x := &commandServiceTransactionClient{stream}
  54. return x, nil
  55. }
  56. type CommandService_TransactionClient interface {
  57. Send(*request.TransactionOperation) error
  58. Recv() (*response.CommandStatementResponse, error)
  59. grpc.ClientStream
  60. }
  61. type commandServiceTransactionClient struct {
  62. grpc.ClientStream
  63. }
  64. func (x *commandServiceTransactionClient) Send(m *request.TransactionOperation) error {
  65. return x.ClientStream.SendMsg(m)
  66. }
  67. func (x *commandServiceTransactionClient) Recv() (*response.CommandStatementResponse, error) {
  68. m := new(response.CommandStatementResponse)
  69. if err := x.ClientStream.RecvMsg(m); err != nil {
  70. return nil, err
  71. }
  72. return m, nil
  73. }
  74. func (c *commandServiceClient) Insert(ctx context.Context, in *request.InsertRequest, opts ...grpc.CallOption) (*response.CommandStatementResponse, error) {
  75. out := new(response.CommandStatementResponse)
  76. err := c.cc.Invoke(ctx, "/v1.CommandService/Insert", in, out, opts...)
  77. if err != nil {
  78. return nil, err
  79. }
  80. return out, nil
  81. }
  82. func (c *commandServiceClient) InsertBatch(ctx context.Context, in *request.InsertBatchRequest, opts ...grpc.CallOption) (*response.CommandStatementResponse, error) {
  83. out := new(response.CommandStatementResponse)
  84. err := c.cc.Invoke(ctx, "/v1.CommandService/InsertBatch", in, out, opts...)
  85. if err != nil {
  86. return nil, err
  87. }
  88. return out, nil
  89. }
  90. func (c *commandServiceClient) Delete(ctx context.Context, in *request.DeleteRequest, opts ...grpc.CallOption) (*response.CommandStatementResponse, error) {
  91. out := new(response.CommandStatementResponse)
  92. err := c.cc.Invoke(ctx, "/v1.CommandService/Delete", in, out, opts...)
  93. if err != nil {
  94. return nil, err
  95. }
  96. return out, nil
  97. }
  98. func (c *commandServiceClient) DeleteWhere(ctx context.Context, in *request.DeleteWhereRequest, opts ...grpc.CallOption) (*response.CommandStatementResponse, error) {
  99. out := new(response.CommandStatementResponse)
  100. err := c.cc.Invoke(ctx, "/v1.CommandService/DeleteWhere", in, out, opts...)
  101. if err != nil {
  102. return nil, err
  103. }
  104. return out, nil
  105. }
  106. func (c *commandServiceClient) Update(ctx context.Context, in *request.UpdateRequest, opts ...grpc.CallOption) (*response.CommandStatementResponse, error) {
  107. out := new(response.CommandStatementResponse)
  108. err := c.cc.Invoke(ctx, "/v1.CommandService/Update", in, out, opts...)
  109. if err != nil {
  110. return nil, err
  111. }
  112. return out, nil
  113. }
  114. func (c *commandServiceClient) UpdateWhere(ctx context.Context, in *request.UpdateWhereRequest, opts ...grpc.CallOption) (*response.CommandStatementResponse, error) {
  115. out := new(response.CommandStatementResponse)
  116. err := c.cc.Invoke(ctx, "/v1.CommandService/UpdateWhere", in, out, opts...)
  117. if err != nil {
  118. return nil, err
  119. }
  120. return out, nil
  121. }
  122. func (c *commandServiceClient) Replay(ctx context.Context, in *request.ReplayRequest, opts ...grpc.CallOption) (*response.CommandStatementResponse, error) {
  123. out := new(response.CommandStatementResponse)
  124. err := c.cc.Invoke(ctx, "/v1.CommandService/Replay", in, out, opts...)
  125. if err != nil {
  126. return nil, err
  127. }
  128. return out, nil
  129. }
  130. // CommandServiceServer is the server API for CommandService service.
  131. // All implementations must embed UnimplementedCommandServiceServer
  132. // for forward compatibility
  133. type CommandServiceServer interface {
  134. AutoMigrate(context.Context, *request.AutoMigrateRequest) (*empty.Empty, error)
  135. Transaction(CommandService_TransactionServer) error
  136. Insert(context.Context, *request.InsertRequest) (*response.CommandStatementResponse, error)
  137. InsertBatch(context.Context, *request.InsertBatchRequest) (*response.CommandStatementResponse, error)
  138. Delete(context.Context, *request.DeleteRequest) (*response.CommandStatementResponse, error)
  139. DeleteWhere(context.Context, *request.DeleteWhereRequest) (*response.CommandStatementResponse, error)
  140. Update(context.Context, *request.UpdateRequest) (*response.CommandStatementResponse, error)
  141. UpdateWhere(context.Context, *request.UpdateWhereRequest) (*response.CommandStatementResponse, error)
  142. Replay(context.Context, *request.ReplayRequest) (*response.CommandStatementResponse, error)
  143. mustEmbedUnimplementedCommandServiceServer()
  144. }
  145. // UnimplementedCommandServiceServer must be embedded to have forward compatible implementations.
  146. type UnimplementedCommandServiceServer struct {
  147. }
  148. func (UnimplementedCommandServiceServer) AutoMigrate(context.Context, *request.AutoMigrateRequest) (*empty.Empty, error) {
  149. return nil, status.Errorf(codes.Unimplemented, "method AutoMigrate not implemented")
  150. }
  151. func (UnimplementedCommandServiceServer) Transaction(CommandService_TransactionServer) error {
  152. return status.Errorf(codes.Unimplemented, "method Transaction not implemented")
  153. }
  154. func (UnimplementedCommandServiceServer) Insert(context.Context, *request.InsertRequest) (*response.CommandStatementResponse, error) {
  155. return nil, status.Errorf(codes.Unimplemented, "method Insert not implemented")
  156. }
  157. func (UnimplementedCommandServiceServer) InsertBatch(context.Context, *request.InsertBatchRequest) (*response.CommandStatementResponse, error) {
  158. return nil, status.Errorf(codes.Unimplemented, "method InsertBatch not implemented")
  159. }
  160. func (UnimplementedCommandServiceServer) Delete(context.Context, *request.DeleteRequest) (*response.CommandStatementResponse, error) {
  161. return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
  162. }
  163. func (UnimplementedCommandServiceServer) DeleteWhere(context.Context, *request.DeleteWhereRequest) (*response.CommandStatementResponse, error) {
  164. return nil, status.Errorf(codes.Unimplemented, "method DeleteWhere not implemented")
  165. }
  166. func (UnimplementedCommandServiceServer) Update(context.Context, *request.UpdateRequest) (*response.CommandStatementResponse, error) {
  167. return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
  168. }
  169. func (UnimplementedCommandServiceServer) UpdateWhere(context.Context, *request.UpdateWhereRequest) (*response.CommandStatementResponse, error) {
  170. return nil, status.Errorf(codes.Unimplemented, "method UpdateWhere not implemented")
  171. }
  172. func (UnimplementedCommandServiceServer) Replay(context.Context, *request.ReplayRequest) (*response.CommandStatementResponse, error) {
  173. return nil, status.Errorf(codes.Unimplemented, "method Replay not implemented")
  174. }
  175. func (UnimplementedCommandServiceServer) mustEmbedUnimplementedCommandServiceServer() {}
  176. // UnsafeCommandServiceServer may be embedded to opt out of forward compatibility for this service.
  177. // Use of this interface is not recommended, as added methods to CommandServiceServer will
  178. // result in compilation errors.
  179. type UnsafeCommandServiceServer interface {
  180. mustEmbedUnimplementedCommandServiceServer()
  181. }
  182. func RegisterCommandServiceServer(s grpc.ServiceRegistrar, srv CommandServiceServer) {
  183. s.RegisterService(&CommandService_ServiceDesc, srv)
  184. }
  185. func _CommandService_AutoMigrate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  186. in := new(request.AutoMigrateRequest)
  187. if err := dec(in); err != nil {
  188. return nil, err
  189. }
  190. if interceptor == nil {
  191. return srv.(CommandServiceServer).AutoMigrate(ctx, in)
  192. }
  193. info := &grpc.UnaryServerInfo{
  194. Server: srv,
  195. FullMethod: "/v1.CommandService/AutoMigrate",
  196. }
  197. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  198. return srv.(CommandServiceServer).AutoMigrate(ctx, req.(*request.AutoMigrateRequest))
  199. }
  200. return interceptor(ctx, in, info, handler)
  201. }
  202. func _CommandService_Transaction_Handler(srv interface{}, stream grpc.ServerStream) error {
  203. return srv.(CommandServiceServer).Transaction(&commandServiceTransactionServer{stream})
  204. }
  205. type CommandService_TransactionServer interface {
  206. Send(*response.CommandStatementResponse) error
  207. Recv() (*request.TransactionOperation, error)
  208. grpc.ServerStream
  209. }
  210. type commandServiceTransactionServer struct {
  211. grpc.ServerStream
  212. }
  213. func (x *commandServiceTransactionServer) Send(m *response.CommandStatementResponse) error {
  214. return x.ServerStream.SendMsg(m)
  215. }
  216. func (x *commandServiceTransactionServer) Recv() (*request.TransactionOperation, error) {
  217. m := new(request.TransactionOperation)
  218. if err := x.ServerStream.RecvMsg(m); err != nil {
  219. return nil, err
  220. }
  221. return m, nil
  222. }
  223. func _CommandService_Insert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  224. in := new(request.InsertRequest)
  225. if err := dec(in); err != nil {
  226. return nil, err
  227. }
  228. if interceptor == nil {
  229. return srv.(CommandServiceServer).Insert(ctx, in)
  230. }
  231. info := &grpc.UnaryServerInfo{
  232. Server: srv,
  233. FullMethod: "/v1.CommandService/Insert",
  234. }
  235. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  236. return srv.(CommandServiceServer).Insert(ctx, req.(*request.InsertRequest))
  237. }
  238. return interceptor(ctx, in, info, handler)
  239. }
  240. func _CommandService_InsertBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  241. in := new(request.InsertBatchRequest)
  242. if err := dec(in); err != nil {
  243. return nil, err
  244. }
  245. if interceptor == nil {
  246. return srv.(CommandServiceServer).InsertBatch(ctx, in)
  247. }
  248. info := &grpc.UnaryServerInfo{
  249. Server: srv,
  250. FullMethod: "/v1.CommandService/InsertBatch",
  251. }
  252. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  253. return srv.(CommandServiceServer).InsertBatch(ctx, req.(*request.InsertBatchRequest))
  254. }
  255. return interceptor(ctx, in, info, handler)
  256. }
  257. func _CommandService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  258. in := new(request.DeleteRequest)
  259. if err := dec(in); err != nil {
  260. return nil, err
  261. }
  262. if interceptor == nil {
  263. return srv.(CommandServiceServer).Delete(ctx, in)
  264. }
  265. info := &grpc.UnaryServerInfo{
  266. Server: srv,
  267. FullMethod: "/v1.CommandService/Delete",
  268. }
  269. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  270. return srv.(CommandServiceServer).Delete(ctx, req.(*request.DeleteRequest))
  271. }
  272. return interceptor(ctx, in, info, handler)
  273. }
  274. func _CommandService_DeleteWhere_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  275. in := new(request.DeleteWhereRequest)
  276. if err := dec(in); err != nil {
  277. return nil, err
  278. }
  279. if interceptor == nil {
  280. return srv.(CommandServiceServer).DeleteWhere(ctx, in)
  281. }
  282. info := &grpc.UnaryServerInfo{
  283. Server: srv,
  284. FullMethod: "/v1.CommandService/DeleteWhere",
  285. }
  286. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  287. return srv.(CommandServiceServer).DeleteWhere(ctx, req.(*request.DeleteWhereRequest))
  288. }
  289. return interceptor(ctx, in, info, handler)
  290. }
  291. func _CommandService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  292. in := new(request.UpdateRequest)
  293. if err := dec(in); err != nil {
  294. return nil, err
  295. }
  296. if interceptor == nil {
  297. return srv.(CommandServiceServer).Update(ctx, in)
  298. }
  299. info := &grpc.UnaryServerInfo{
  300. Server: srv,
  301. FullMethod: "/v1.CommandService/Update",
  302. }
  303. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  304. return srv.(CommandServiceServer).Update(ctx, req.(*request.UpdateRequest))
  305. }
  306. return interceptor(ctx, in, info, handler)
  307. }
  308. func _CommandService_UpdateWhere_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  309. in := new(request.UpdateWhereRequest)
  310. if err := dec(in); err != nil {
  311. return nil, err
  312. }
  313. if interceptor == nil {
  314. return srv.(CommandServiceServer).UpdateWhere(ctx, in)
  315. }
  316. info := &grpc.UnaryServerInfo{
  317. Server: srv,
  318. FullMethod: "/v1.CommandService/UpdateWhere",
  319. }
  320. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  321. return srv.(CommandServiceServer).UpdateWhere(ctx, req.(*request.UpdateWhereRequest))
  322. }
  323. return interceptor(ctx, in, info, handler)
  324. }
  325. func _CommandService_Replay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  326. in := new(request.ReplayRequest)
  327. if err := dec(in); err != nil {
  328. return nil, err
  329. }
  330. if interceptor == nil {
  331. return srv.(CommandServiceServer).Replay(ctx, in)
  332. }
  333. info := &grpc.UnaryServerInfo{
  334. Server: srv,
  335. FullMethod: "/v1.CommandService/Replay",
  336. }
  337. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  338. return srv.(CommandServiceServer).Replay(ctx, req.(*request.ReplayRequest))
  339. }
  340. return interceptor(ctx, in, info, handler)
  341. }
  342. // CommandService_ServiceDesc is the grpc.ServiceDesc for CommandService service.
  343. // It's only intended for direct use with grpc.RegisterService,
  344. // and not to be introspected or modified (even as a copy)
  345. var CommandService_ServiceDesc = grpc.ServiceDesc{
  346. ServiceName: "v1.CommandService",
  347. HandlerType: (*CommandServiceServer)(nil),
  348. Methods: []grpc.MethodDesc{
  349. {
  350. MethodName: "AutoMigrate",
  351. Handler: _CommandService_AutoMigrate_Handler,
  352. },
  353. {
  354. MethodName: "Insert",
  355. Handler: _CommandService_Insert_Handler,
  356. },
  357. {
  358. MethodName: "InsertBatch",
  359. Handler: _CommandService_InsertBatch_Handler,
  360. },
  361. {
  362. MethodName: "Delete",
  363. Handler: _CommandService_Delete_Handler,
  364. },
  365. {
  366. MethodName: "DeleteWhere",
  367. Handler: _CommandService_DeleteWhere_Handler,
  368. },
  369. {
  370. MethodName: "Update",
  371. Handler: _CommandService_Update_Handler,
  372. },
  373. {
  374. MethodName: "UpdateWhere",
  375. Handler: _CommandService_UpdateWhere_Handler,
  376. },
  377. {
  378. MethodName: "Replay",
  379. Handler: _CommandService_Replay_Handler,
  380. },
  381. },
  382. Streams: []grpc.StreamDesc{
  383. {
  384. StreamName: "Transaction",
  385. Handler: _CommandService_Transaction_Handler,
  386. ServerStreams: true,
  387. ClientStreams: true,
  388. },
  389. },
  390. Metadata: "v1/command.proto",
  391. }