vitess.io/vitess@v0.16.2/go/vt/proto/vtgateservice/vtgateservice_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.2.0
     4  // - protoc             v3.21.3
     5  // source: vtgateservice.proto
     6  
     7  package vtgateservice
     8  
     9  import (
    10  	context "context"
    11  	grpc "google.golang.org/grpc"
    12  	codes "google.golang.org/grpc/codes"
    13  	status "google.golang.org/grpc/status"
    14  	vtgate "vitess.io/vitess/go/vt/proto/vtgate"
    15  )
    16  
    17  // This is a compile-time assertion to ensure that this generated file
    18  // is compatible with the grpc package it is being compiled against.
    19  // Requires gRPC-Go v1.32.0 or later.
    20  const _ = grpc.SupportPackageIsVersion7
    21  
    22  // VitessClient is the client API for Vitess 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 VitessClient interface {
    26  	// Execute tries to route the query to the right shard.
    27  	// It depends on the query and bind variables to provide enough
    28  	// information in conjunction with the vindexes to route the query.
    29  	// API group: v3
    30  	Execute(ctx context.Context, in *vtgate.ExecuteRequest, opts ...grpc.CallOption) (*vtgate.ExecuteResponse, error)
    31  	// ExecuteBatch tries to route the list of queries on the right shards.
    32  	// It depends on the query and bind variables to provide enough
    33  	// information in conjunction with the vindexes to route the query.
    34  	// API group: v3
    35  	ExecuteBatch(ctx context.Context, in *vtgate.ExecuteBatchRequest, opts ...grpc.CallOption) (*vtgate.ExecuteBatchResponse, error)
    36  	// StreamExecute executes a streaming query based on shards.
    37  	// It depends on the query and bind variables to provide enough
    38  	// information in conjunction with the vindexes to route the query.
    39  	// Use this method if the query returns a large number of rows.
    40  	// API group: v3
    41  	StreamExecute(ctx context.Context, in *vtgate.StreamExecuteRequest, opts ...grpc.CallOption) (Vitess_StreamExecuteClient, error)
    42  	// ResolveTransaction resolves a transaction.
    43  	// API group: Transactions
    44  	ResolveTransaction(ctx context.Context, in *vtgate.ResolveTransactionRequest, opts ...grpc.CallOption) (*vtgate.ResolveTransactionResponse, error)
    45  	// VStream streams binlog events from the requested sources.
    46  	VStream(ctx context.Context, in *vtgate.VStreamRequest, opts ...grpc.CallOption) (Vitess_VStreamClient, error)
    47  	// Prepare is used by the MySQL server plugin as part of supporting prepared statements.
    48  	Prepare(ctx context.Context, in *vtgate.PrepareRequest, opts ...grpc.CallOption) (*vtgate.PrepareResponse, error)
    49  	// CloseSession closes the session, rolling back any implicit transactions.
    50  	// This has the same effect as if a "rollback" statement was executed,
    51  	// but does not affect the query statistics.
    52  	CloseSession(ctx context.Context, in *vtgate.CloseSessionRequest, opts ...grpc.CallOption) (*vtgate.CloseSessionResponse, error)
    53  }
    54  
    55  type vitessClient struct {
    56  	cc grpc.ClientConnInterface
    57  }
    58  
    59  func NewVitessClient(cc grpc.ClientConnInterface) VitessClient {
    60  	return &vitessClient{cc}
    61  }
    62  
    63  func (c *vitessClient) Execute(ctx context.Context, in *vtgate.ExecuteRequest, opts ...grpc.CallOption) (*vtgate.ExecuteResponse, error) {
    64  	out := new(vtgate.ExecuteResponse)
    65  	err := c.cc.Invoke(ctx, "/vtgateservice.Vitess/Execute", in, out, opts...)
    66  	if err != nil {
    67  		return nil, err
    68  	}
    69  	return out, nil
    70  }
    71  
    72  func (c *vitessClient) ExecuteBatch(ctx context.Context, in *vtgate.ExecuteBatchRequest, opts ...grpc.CallOption) (*vtgate.ExecuteBatchResponse, error) {
    73  	out := new(vtgate.ExecuteBatchResponse)
    74  	err := c.cc.Invoke(ctx, "/vtgateservice.Vitess/ExecuteBatch", in, out, opts...)
    75  	if err != nil {
    76  		return nil, err
    77  	}
    78  	return out, nil
    79  }
    80  
    81  func (c *vitessClient) StreamExecute(ctx context.Context, in *vtgate.StreamExecuteRequest, opts ...grpc.CallOption) (Vitess_StreamExecuteClient, error) {
    82  	stream, err := c.cc.NewStream(ctx, &Vitess_ServiceDesc.Streams[0], "/vtgateservice.Vitess/StreamExecute", opts...)
    83  	if err != nil {
    84  		return nil, err
    85  	}
    86  	x := &vitessStreamExecuteClient{stream}
    87  	if err := x.ClientStream.SendMsg(in); err != nil {
    88  		return nil, err
    89  	}
    90  	if err := x.ClientStream.CloseSend(); err != nil {
    91  		return nil, err
    92  	}
    93  	return x, nil
    94  }
    95  
    96  type Vitess_StreamExecuteClient interface {
    97  	Recv() (*vtgate.StreamExecuteResponse, error)
    98  	grpc.ClientStream
    99  }
   100  
   101  type vitessStreamExecuteClient struct {
   102  	grpc.ClientStream
   103  }
   104  
   105  func (x *vitessStreamExecuteClient) Recv() (*vtgate.StreamExecuteResponse, error) {
   106  	m := new(vtgate.StreamExecuteResponse)
   107  	if err := x.ClientStream.RecvMsg(m); err != nil {
   108  		return nil, err
   109  	}
   110  	return m, nil
   111  }
   112  
   113  func (c *vitessClient) ResolveTransaction(ctx context.Context, in *vtgate.ResolveTransactionRequest, opts ...grpc.CallOption) (*vtgate.ResolveTransactionResponse, error) {
   114  	out := new(vtgate.ResolveTransactionResponse)
   115  	err := c.cc.Invoke(ctx, "/vtgateservice.Vitess/ResolveTransaction", in, out, opts...)
   116  	if err != nil {
   117  		return nil, err
   118  	}
   119  	return out, nil
   120  }
   121  
   122  func (c *vitessClient) VStream(ctx context.Context, in *vtgate.VStreamRequest, opts ...grpc.CallOption) (Vitess_VStreamClient, error) {
   123  	stream, err := c.cc.NewStream(ctx, &Vitess_ServiceDesc.Streams[1], "/vtgateservice.Vitess/VStream", opts...)
   124  	if err != nil {
   125  		return nil, err
   126  	}
   127  	x := &vitessVStreamClient{stream}
   128  	if err := x.ClientStream.SendMsg(in); err != nil {
   129  		return nil, err
   130  	}
   131  	if err := x.ClientStream.CloseSend(); err != nil {
   132  		return nil, err
   133  	}
   134  	return x, nil
   135  }
   136  
   137  type Vitess_VStreamClient interface {
   138  	Recv() (*vtgate.VStreamResponse, error)
   139  	grpc.ClientStream
   140  }
   141  
   142  type vitessVStreamClient struct {
   143  	grpc.ClientStream
   144  }
   145  
   146  func (x *vitessVStreamClient) Recv() (*vtgate.VStreamResponse, error) {
   147  	m := new(vtgate.VStreamResponse)
   148  	if err := x.ClientStream.RecvMsg(m); err != nil {
   149  		return nil, err
   150  	}
   151  	return m, nil
   152  }
   153  
   154  func (c *vitessClient) Prepare(ctx context.Context, in *vtgate.PrepareRequest, opts ...grpc.CallOption) (*vtgate.PrepareResponse, error) {
   155  	out := new(vtgate.PrepareResponse)
   156  	err := c.cc.Invoke(ctx, "/vtgateservice.Vitess/Prepare", in, out, opts...)
   157  	if err != nil {
   158  		return nil, err
   159  	}
   160  	return out, nil
   161  }
   162  
   163  func (c *vitessClient) CloseSession(ctx context.Context, in *vtgate.CloseSessionRequest, opts ...grpc.CallOption) (*vtgate.CloseSessionResponse, error) {
   164  	out := new(vtgate.CloseSessionResponse)
   165  	err := c.cc.Invoke(ctx, "/vtgateservice.Vitess/CloseSession", in, out, opts...)
   166  	if err != nil {
   167  		return nil, err
   168  	}
   169  	return out, nil
   170  }
   171  
   172  // VitessServer is the server API for Vitess service.
   173  // All implementations must embed UnimplementedVitessServer
   174  // for forward compatibility
   175  type VitessServer interface {
   176  	// Execute tries to route the query to the right shard.
   177  	// It depends on the query and bind variables to provide enough
   178  	// information in conjunction with the vindexes to route the query.
   179  	// API group: v3
   180  	Execute(context.Context, *vtgate.ExecuteRequest) (*vtgate.ExecuteResponse, error)
   181  	// ExecuteBatch tries to route the list of queries on the right shards.
   182  	// It depends on the query and bind variables to provide enough
   183  	// information in conjunction with the vindexes to route the query.
   184  	// API group: v3
   185  	ExecuteBatch(context.Context, *vtgate.ExecuteBatchRequest) (*vtgate.ExecuteBatchResponse, error)
   186  	// StreamExecute executes a streaming query based on shards.
   187  	// It depends on the query and bind variables to provide enough
   188  	// information in conjunction with the vindexes to route the query.
   189  	// Use this method if the query returns a large number of rows.
   190  	// API group: v3
   191  	StreamExecute(*vtgate.StreamExecuteRequest, Vitess_StreamExecuteServer) error
   192  	// ResolveTransaction resolves a transaction.
   193  	// API group: Transactions
   194  	ResolveTransaction(context.Context, *vtgate.ResolveTransactionRequest) (*vtgate.ResolveTransactionResponse, error)
   195  	// VStream streams binlog events from the requested sources.
   196  	VStream(*vtgate.VStreamRequest, Vitess_VStreamServer) error
   197  	// Prepare is used by the MySQL server plugin as part of supporting prepared statements.
   198  	Prepare(context.Context, *vtgate.PrepareRequest) (*vtgate.PrepareResponse, error)
   199  	// CloseSession closes the session, rolling back any implicit transactions.
   200  	// This has the same effect as if a "rollback" statement was executed,
   201  	// but does not affect the query statistics.
   202  	CloseSession(context.Context, *vtgate.CloseSessionRequest) (*vtgate.CloseSessionResponse, error)
   203  	mustEmbedUnimplementedVitessServer()
   204  }
   205  
   206  // UnimplementedVitessServer must be embedded to have forward compatible implementations.
   207  type UnimplementedVitessServer struct {
   208  }
   209  
   210  func (UnimplementedVitessServer) Execute(context.Context, *vtgate.ExecuteRequest) (*vtgate.ExecuteResponse, error) {
   211  	return nil, status.Errorf(codes.Unimplemented, "method Execute not implemented")
   212  }
   213  func (UnimplementedVitessServer) ExecuteBatch(context.Context, *vtgate.ExecuteBatchRequest) (*vtgate.ExecuteBatchResponse, error) {
   214  	return nil, status.Errorf(codes.Unimplemented, "method ExecuteBatch not implemented")
   215  }
   216  func (UnimplementedVitessServer) StreamExecute(*vtgate.StreamExecuteRequest, Vitess_StreamExecuteServer) error {
   217  	return status.Errorf(codes.Unimplemented, "method StreamExecute not implemented")
   218  }
   219  func (UnimplementedVitessServer) ResolveTransaction(context.Context, *vtgate.ResolveTransactionRequest) (*vtgate.ResolveTransactionResponse, error) {
   220  	return nil, status.Errorf(codes.Unimplemented, "method ResolveTransaction not implemented")
   221  }
   222  func (UnimplementedVitessServer) VStream(*vtgate.VStreamRequest, Vitess_VStreamServer) error {
   223  	return status.Errorf(codes.Unimplemented, "method VStream not implemented")
   224  }
   225  func (UnimplementedVitessServer) Prepare(context.Context, *vtgate.PrepareRequest) (*vtgate.PrepareResponse, error) {
   226  	return nil, status.Errorf(codes.Unimplemented, "method Prepare not implemented")
   227  }
   228  func (UnimplementedVitessServer) CloseSession(context.Context, *vtgate.CloseSessionRequest) (*vtgate.CloseSessionResponse, error) {
   229  	return nil, status.Errorf(codes.Unimplemented, "method CloseSession not implemented")
   230  }
   231  func (UnimplementedVitessServer) mustEmbedUnimplementedVitessServer() {}
   232  
   233  // UnsafeVitessServer may be embedded to opt out of forward compatibility for this service.
   234  // Use of this interface is not recommended, as added methods to VitessServer will
   235  // result in compilation errors.
   236  type UnsafeVitessServer interface {
   237  	mustEmbedUnimplementedVitessServer()
   238  }
   239  
   240  func RegisterVitessServer(s grpc.ServiceRegistrar, srv VitessServer) {
   241  	s.RegisterService(&Vitess_ServiceDesc, srv)
   242  }
   243  
   244  func _Vitess_Execute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   245  	in := new(vtgate.ExecuteRequest)
   246  	if err := dec(in); err != nil {
   247  		return nil, err
   248  	}
   249  	if interceptor == nil {
   250  		return srv.(VitessServer).Execute(ctx, in)
   251  	}
   252  	info := &grpc.UnaryServerInfo{
   253  		Server:     srv,
   254  		FullMethod: "/vtgateservice.Vitess/Execute",
   255  	}
   256  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   257  		return srv.(VitessServer).Execute(ctx, req.(*vtgate.ExecuteRequest))
   258  	}
   259  	return interceptor(ctx, in, info, handler)
   260  }
   261  
   262  func _Vitess_ExecuteBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   263  	in := new(vtgate.ExecuteBatchRequest)
   264  	if err := dec(in); err != nil {
   265  		return nil, err
   266  	}
   267  	if interceptor == nil {
   268  		return srv.(VitessServer).ExecuteBatch(ctx, in)
   269  	}
   270  	info := &grpc.UnaryServerInfo{
   271  		Server:     srv,
   272  		FullMethod: "/vtgateservice.Vitess/ExecuteBatch",
   273  	}
   274  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   275  		return srv.(VitessServer).ExecuteBatch(ctx, req.(*vtgate.ExecuteBatchRequest))
   276  	}
   277  	return interceptor(ctx, in, info, handler)
   278  }
   279  
   280  func _Vitess_StreamExecute_Handler(srv interface{}, stream grpc.ServerStream) error {
   281  	m := new(vtgate.StreamExecuteRequest)
   282  	if err := stream.RecvMsg(m); err != nil {
   283  		return err
   284  	}
   285  	return srv.(VitessServer).StreamExecute(m, &vitessStreamExecuteServer{stream})
   286  }
   287  
   288  type Vitess_StreamExecuteServer interface {
   289  	Send(*vtgate.StreamExecuteResponse) error
   290  	grpc.ServerStream
   291  }
   292  
   293  type vitessStreamExecuteServer struct {
   294  	grpc.ServerStream
   295  }
   296  
   297  func (x *vitessStreamExecuteServer) Send(m *vtgate.StreamExecuteResponse) error {
   298  	return x.ServerStream.SendMsg(m)
   299  }
   300  
   301  func _Vitess_ResolveTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   302  	in := new(vtgate.ResolveTransactionRequest)
   303  	if err := dec(in); err != nil {
   304  		return nil, err
   305  	}
   306  	if interceptor == nil {
   307  		return srv.(VitessServer).ResolveTransaction(ctx, in)
   308  	}
   309  	info := &grpc.UnaryServerInfo{
   310  		Server:     srv,
   311  		FullMethod: "/vtgateservice.Vitess/ResolveTransaction",
   312  	}
   313  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   314  		return srv.(VitessServer).ResolveTransaction(ctx, req.(*vtgate.ResolveTransactionRequest))
   315  	}
   316  	return interceptor(ctx, in, info, handler)
   317  }
   318  
   319  func _Vitess_VStream_Handler(srv interface{}, stream grpc.ServerStream) error {
   320  	m := new(vtgate.VStreamRequest)
   321  	if err := stream.RecvMsg(m); err != nil {
   322  		return err
   323  	}
   324  	return srv.(VitessServer).VStream(m, &vitessVStreamServer{stream})
   325  }
   326  
   327  type Vitess_VStreamServer interface {
   328  	Send(*vtgate.VStreamResponse) error
   329  	grpc.ServerStream
   330  }
   331  
   332  type vitessVStreamServer struct {
   333  	grpc.ServerStream
   334  }
   335  
   336  func (x *vitessVStreamServer) Send(m *vtgate.VStreamResponse) error {
   337  	return x.ServerStream.SendMsg(m)
   338  }
   339  
   340  func _Vitess_Prepare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   341  	in := new(vtgate.PrepareRequest)
   342  	if err := dec(in); err != nil {
   343  		return nil, err
   344  	}
   345  	if interceptor == nil {
   346  		return srv.(VitessServer).Prepare(ctx, in)
   347  	}
   348  	info := &grpc.UnaryServerInfo{
   349  		Server:     srv,
   350  		FullMethod: "/vtgateservice.Vitess/Prepare",
   351  	}
   352  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   353  		return srv.(VitessServer).Prepare(ctx, req.(*vtgate.PrepareRequest))
   354  	}
   355  	return interceptor(ctx, in, info, handler)
   356  }
   357  
   358  func _Vitess_CloseSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   359  	in := new(vtgate.CloseSessionRequest)
   360  	if err := dec(in); err != nil {
   361  		return nil, err
   362  	}
   363  	if interceptor == nil {
   364  		return srv.(VitessServer).CloseSession(ctx, in)
   365  	}
   366  	info := &grpc.UnaryServerInfo{
   367  		Server:     srv,
   368  		FullMethod: "/vtgateservice.Vitess/CloseSession",
   369  	}
   370  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   371  		return srv.(VitessServer).CloseSession(ctx, req.(*vtgate.CloseSessionRequest))
   372  	}
   373  	return interceptor(ctx, in, info, handler)
   374  }
   375  
   376  // Vitess_ServiceDesc is the grpc.ServiceDesc for Vitess service.
   377  // It's only intended for direct use with grpc.RegisterService,
   378  // and not to be introspected or modified (even as a copy)
   379  var Vitess_ServiceDesc = grpc.ServiceDesc{
   380  	ServiceName: "vtgateservice.Vitess",
   381  	HandlerType: (*VitessServer)(nil),
   382  	Methods: []grpc.MethodDesc{
   383  		{
   384  			MethodName: "Execute",
   385  			Handler:    _Vitess_Execute_Handler,
   386  		},
   387  		{
   388  			MethodName: "ExecuteBatch",
   389  			Handler:    _Vitess_ExecuteBatch_Handler,
   390  		},
   391  		{
   392  			MethodName: "ResolveTransaction",
   393  			Handler:    _Vitess_ResolveTransaction_Handler,
   394  		},
   395  		{
   396  			MethodName: "Prepare",
   397  			Handler:    _Vitess_Prepare_Handler,
   398  		},
   399  		{
   400  			MethodName: "CloseSession",
   401  			Handler:    _Vitess_CloseSession_Handler,
   402  		},
   403  	},
   404  	Streams: []grpc.StreamDesc{
   405  		{
   406  			StreamName:    "StreamExecute",
   407  			Handler:       _Vitess_StreamExecute_Handler,
   408  			ServerStreams: true,
   409  		},
   410  		{
   411  			StreamName:    "VStream",
   412  			Handler:       _Vitess_VStream_Handler,
   413  			ServerStreams: true,
   414  		},
   415  	},
   416  	Metadata: "vtgateservice.proto",
   417  }