sql_grpc.pb.go 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.5.1
  4. // - protoc v3.12.4
  5. // source: v1/sql.proto
  6. package v1
  7. import (
  8. context "context"
  9. response "git.sxidc.com/service-supports/ds-sdk/grpc_client/v1/response"
  10. request "git.sxidc.com/service-supports/ds-sdk/grpc_client/v1/request"
  11. grpc "google.golang.org/grpc"
  12. codes "google.golang.org/grpc/codes"
  13. status "google.golang.org/grpc/status"
  14. )
  15. // This is a compile-time assertion to ensure that this generated file
  16. // is compatible with the grpc package it is being compiled against.
  17. // Requires gRPC-Go v1.64.0 or later.
  18. const _ = grpc.SupportPackageIsVersion9
  19. const (
  20. SqlService_Transaction_FullMethodName = "/v1.SqlService/Transaction"
  21. )
  22. // SqlServiceClient is the client API for SqlService service.
  23. //
  24. // 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.
  25. type SqlServiceClient interface {
  26. Transaction(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[request.TransactionOperation, response.TransactionResponse], error)
  27. }
  28. type sqlServiceClient struct {
  29. cc grpc.ClientConnInterface
  30. }
  31. func NewSqlServiceClient(cc grpc.ClientConnInterface) SqlServiceClient {
  32. return &sqlServiceClient{cc}
  33. }
  34. func (c *sqlServiceClient) Transaction(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[request.TransactionOperation, response.TransactionResponse], error) {
  35. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  36. stream, err := c.cc.NewStream(ctx, &SqlService_ServiceDesc.Streams[0], SqlService_Transaction_FullMethodName, cOpts...)
  37. if err != nil {
  38. return nil, err
  39. }
  40. x := &grpc.GenericClientStream[request.TransactionOperation, response.TransactionResponse]{ClientStream: stream}
  41. return x, nil
  42. }
  43. // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
  44. type SqlService_TransactionClient = grpc.BidiStreamingClient[request.TransactionOperation, response.TransactionResponse]
  45. // SqlServiceServer is the server API for SqlService service.
  46. // All implementations must embed UnimplementedSqlServiceServer
  47. // for forward compatibility.
  48. type SqlServiceServer interface {
  49. Transaction(grpc.BidiStreamingServer[request.TransactionOperation, response.TransactionResponse]) error
  50. mustEmbedUnimplementedSqlServiceServer()
  51. }
  52. // UnimplementedSqlServiceServer must be embedded to have
  53. // forward compatible implementations.
  54. //
  55. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  56. // pointer dereference when methods are called.
  57. type UnimplementedSqlServiceServer struct{}
  58. func (UnimplementedSqlServiceServer) Transaction(grpc.BidiStreamingServer[request.TransactionOperation, response.TransactionResponse]) error {
  59. return status.Errorf(codes.Unimplemented, "method Transaction not implemented")
  60. }
  61. func (UnimplementedSqlServiceServer) mustEmbedUnimplementedSqlServiceServer() {}
  62. func (UnimplementedSqlServiceServer) testEmbeddedByValue() {}
  63. // UnsafeSqlServiceServer may be embedded to opt out of forward compatibility for this service.
  64. // Use of this interface is not recommended, as added methods to SqlServiceServer will
  65. // result in compilation errors.
  66. type UnsafeSqlServiceServer interface {
  67. mustEmbedUnimplementedSqlServiceServer()
  68. }
  69. func RegisterSqlServiceServer(s grpc.ServiceRegistrar, srv SqlServiceServer) {
  70. // If the following call pancis, it indicates UnimplementedSqlServiceServer was
  71. // embedded by pointer and is nil. This will cause panics if an
  72. // unimplemented method is ever invoked, so we test this at initialization
  73. // time to prevent it from happening at runtime later due to I/O.
  74. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  75. t.testEmbeddedByValue()
  76. }
  77. s.RegisterService(&SqlService_ServiceDesc, srv)
  78. }
  79. func _SqlService_Transaction_Handler(srv interface{}, stream grpc.ServerStream) error {
  80. return srv.(SqlServiceServer).Transaction(&grpc.GenericServerStream[request.TransactionOperation, response.TransactionResponse]{ServerStream: stream})
  81. }
  82. // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
  83. type SqlService_TransactionServer = grpc.BidiStreamingServer[request.TransactionOperation, response.TransactionResponse]
  84. // SqlService_ServiceDesc is the grpc.ServiceDesc for SqlService service.
  85. // It's only intended for direct use with grpc.RegisterService,
  86. // and not to be introspected or modified (even as a copy)
  87. var SqlService_ServiceDesc = grpc.ServiceDesc{
  88. ServiceName: "v1.SqlService",
  89. HandlerType: (*SqlServiceServer)(nil),
  90. Methods: []grpc.MethodDesc{},
  91. Streams: []grpc.StreamDesc{
  92. {
  93. StreamName: "Transaction",
  94. Handler: _SqlService_Transaction_Handler,
  95. ServerStreams: true,
  96. ClientStreams: true,
  97. },
  98. },
  99. Metadata: "v1/sql.proto",
  100. }