command_grpc.pb.go 15 KB

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