devconnect

package
v1.19.2-20260414192125... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: unknown License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// QueryExecuteProcedure is the fully-qualified name of the Query's Execute RPC.
	QueryExecuteProcedure = "/vitess.queryservice.dev.Query/Execute"
	// QueryStreamExecuteProcedure is the fully-qualified name of the Query's StreamExecute RPC.
	QueryStreamExecuteProcedure = "/vitess.queryservice.dev.Query/StreamExecute"
	// QueryBeginProcedure is the fully-qualified name of the Query's Begin RPC.
	QueryBeginProcedure = "/vitess.queryservice.dev.Query/Begin"
	// QueryCommitProcedure is the fully-qualified name of the Query's Commit RPC.
	QueryCommitProcedure = "/vitess.queryservice.dev.Query/Commit"
	// QueryRollbackProcedure is the fully-qualified name of the Query's Rollback RPC.
	QueryRollbackProcedure = "/vitess.queryservice.dev.Query/Rollback"
	// QueryPrepareProcedure is the fully-qualified name of the Query's Prepare RPC.
	QueryPrepareProcedure = "/vitess.queryservice.dev.Query/Prepare"
	// QueryCommitPreparedProcedure is the fully-qualified name of the Query's CommitPrepared RPC.
	QueryCommitPreparedProcedure = "/vitess.queryservice.dev.Query/CommitPrepared"
	// QueryRollbackPreparedProcedure is the fully-qualified name of the Query's RollbackPrepared RPC.
	QueryRollbackPreparedProcedure = "/vitess.queryservice.dev.Query/RollbackPrepared"
	// QueryCreateTransactionProcedure is the fully-qualified name of the Query's CreateTransaction RPC.
	QueryCreateTransactionProcedure = "/vitess.queryservice.dev.Query/CreateTransaction"
	// QueryStartCommitProcedure is the fully-qualified name of the Query's StartCommit RPC.
	QueryStartCommitProcedure = "/vitess.queryservice.dev.Query/StartCommit"
	// QuerySetRollbackProcedure is the fully-qualified name of the Query's SetRollback RPC.
	QuerySetRollbackProcedure = "/vitess.queryservice.dev.Query/SetRollback"
	// QueryConcludeTransactionProcedure is the fully-qualified name of the Query's ConcludeTransaction
	// RPC.
	QueryConcludeTransactionProcedure = "/vitess.queryservice.dev.Query/ConcludeTransaction"
	// QueryReadTransactionProcedure is the fully-qualified name of the Query's ReadTransaction RPC.
	QueryReadTransactionProcedure = "/vitess.queryservice.dev.Query/ReadTransaction"
	// QueryUnresolvedTransactionsProcedure is the fully-qualified name of the Query's
	// UnresolvedTransactions RPC.
	QueryUnresolvedTransactionsProcedure = "/vitess.queryservice.dev.Query/UnresolvedTransactions"
	// QueryBeginExecuteProcedure is the fully-qualified name of the Query's BeginExecute RPC.
	QueryBeginExecuteProcedure = "/vitess.queryservice.dev.Query/BeginExecute"
	// QueryBeginStreamExecuteProcedure is the fully-qualified name of the Query's BeginStreamExecute
	// RPC.
	QueryBeginStreamExecuteProcedure = "/vitess.queryservice.dev.Query/BeginStreamExecute"
	// QueryMessageStreamProcedure is the fully-qualified name of the Query's MessageStream RPC.
	QueryMessageStreamProcedure = "/vitess.queryservice.dev.Query/MessageStream"
	// QueryMessageAckProcedure is the fully-qualified name of the Query's MessageAck RPC.
	QueryMessageAckProcedure = "/vitess.queryservice.dev.Query/MessageAck"
	// QueryReserveExecuteProcedure is the fully-qualified name of the Query's ReserveExecute RPC.
	QueryReserveExecuteProcedure = "/vitess.queryservice.dev.Query/ReserveExecute"
	// QueryReserveBeginExecuteProcedure is the fully-qualified name of the Query's ReserveBeginExecute
	// RPC.
	QueryReserveBeginExecuteProcedure = "/vitess.queryservice.dev.Query/ReserveBeginExecute"
	// QueryReserveStreamExecuteProcedure is the fully-qualified name of the Query's
	// ReserveStreamExecute RPC.
	QueryReserveStreamExecuteProcedure = "/vitess.queryservice.dev.Query/ReserveStreamExecute"
	// QueryReserveBeginStreamExecuteProcedure is the fully-qualified name of the Query's
	// ReserveBeginStreamExecute RPC.
	QueryReserveBeginStreamExecuteProcedure = "/vitess.queryservice.dev.Query/ReserveBeginStreamExecute"
	// QueryReleaseProcedure is the fully-qualified name of the Query's Release RPC.
	QueryReleaseProcedure = "/vitess.queryservice.dev.Query/Release"
	// QueryStreamHealthProcedure is the fully-qualified name of the Query's StreamHealth RPC.
	QueryStreamHealthProcedure = "/vitess.queryservice.dev.Query/StreamHealth"
	// QueryVStreamProcedure is the fully-qualified name of the Query's VStream RPC.
	QueryVStreamProcedure = "/vitess.queryservice.dev.Query/VStream"
	// QueryVStreamRowsProcedure is the fully-qualified name of the Query's VStreamRows RPC.
	QueryVStreamRowsProcedure = "/vitess.queryservice.dev.Query/VStreamRows"
	// QueryVStreamTablesProcedure is the fully-qualified name of the Query's VStreamTables RPC.
	QueryVStreamTablesProcedure = "/vitess.queryservice.dev.Query/VStreamTables"
	// QueryVStreamResultsProcedure is the fully-qualified name of the Query's VStreamResults RPC.
	QueryVStreamResultsProcedure = "/vitess.queryservice.dev.Query/VStreamResults"
	// QueryGetSchemaProcedure is the fully-qualified name of the Query's GetSchema RPC.
	QueryGetSchemaProcedure = "/vitess.queryservice.dev.Query/GetSchema"
	// QueryBinlogDumpGTIDProcedure is the fully-qualified name of the Query's BinlogDumpGTID RPC.
	QueryBinlogDumpGTIDProcedure = "/vitess.queryservice.dev.Query/BinlogDumpGTID"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// QueryName is the fully-qualified name of the Query service.
	QueryName = "vitess.queryservice.dev.Query"
)

Variables

This section is empty.

Functions

func NewQueryHandler

func NewQueryHandler(svc QueryHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewQueryHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type QueryClient

type QueryClient interface {
	// Execute executes the specified SQL query (might be in a
	// transaction context, if Query.transaction_id is set).
	Execute(context.Context, *connect.Request[dev.ExecuteRequest]) (*connect.Response[dev.ExecuteResponse], error)
	// StreamExecute executes a streaming query. Use this method if the
	// query returns a large number of rows. The first QueryResult will
	// contain the Fields, subsequent QueryResult messages will contain
	// the rows.
	StreamExecute(context.Context, *connect.Request[dev.StreamExecuteRequest]) (*connect.ServerStreamForClient[dev.StreamExecuteResponse], error)
	// Begin a transaction.
	Begin(context.Context, *connect.Request[dev.BeginRequest]) (*connect.Response[dev.BeginResponse], error)
	// Commit a transaction.
	Commit(context.Context, *connect.Request[dev.CommitRequest]) (*connect.Response[dev.CommitResponse], error)
	// Rollback a transaction.
	Rollback(context.Context, *connect.Request[dev.RollbackRequest]) (*connect.Response[dev.RollbackResponse], error)
	// Prepare preares a transaction.
	Prepare(context.Context, *connect.Request[dev.PrepareRequest]) (*connect.Response[dev.PrepareResponse], error)
	// CommitPrepared commits a prepared transaction.
	CommitPrepared(context.Context, *connect.Request[dev.CommitPreparedRequest]) (*connect.Response[dev.CommitPreparedResponse], error)
	// RollbackPrepared rolls back a prepared transaction.
	RollbackPrepared(context.Context, *connect.Request[dev.RollbackPreparedRequest]) (*connect.Response[dev.RollbackPreparedResponse], error)
	// CreateTransaction creates the metadata for a 2pc transaction.
	CreateTransaction(context.Context, *connect.Request[dev.CreateTransactionRequest]) (*connect.Response[dev.CreateTransactionResponse], error)
	// StartCommit initiates a commit for a 2pc transaction.
	StartCommit(context.Context, *connect.Request[dev.StartCommitRequest]) (*connect.Response[dev.StartCommitResponse], error)
	// SetRollback marks the 2pc transaction for rollback.
	SetRollback(context.Context, *connect.Request[dev.SetRollbackRequest]) (*connect.Response[dev.SetRollbackResponse], error)
	// ConcludeTransaction marks the 2pc transaction as resolved.
	ConcludeTransaction(context.Context, *connect.Request[dev.ConcludeTransactionRequest]) (*connect.Response[dev.ConcludeTransactionResponse], error)
	// ReadTransaction returns the 2pc transaction info.
	ReadTransaction(context.Context, *connect.Request[dev.ReadTransactionRequest]) (*connect.Response[dev.ReadTransactionResponse], error)
	// UnresolvedTransactions returns the 2pc transaction info.
	UnresolvedTransactions(context.Context, *connect.Request[dev.UnresolvedTransactionsRequest]) (*connect.Response[dev.UnresolvedTransactionsResponse], error)
	// BeginExecute executes a begin and the specified SQL query.
	BeginExecute(context.Context, *connect.Request[dev.BeginExecuteRequest]) (*connect.Response[dev.BeginExecuteResponse], error)
	// BeginStreamExecute executes a begin and the specified SQL query.
	BeginStreamExecute(context.Context, *connect.Request[dev.BeginStreamExecuteRequest]) (*connect.ServerStreamForClient[dev.BeginStreamExecuteResponse], error)
	// MessageStream streams messages from a message table.
	MessageStream(context.Context, *connect.Request[dev.MessageStreamRequest]) (*connect.ServerStreamForClient[dev.MessageStreamResponse], error)
	// MessageAck acks messages for a table.
	MessageAck(context.Context, *connect.Request[dev.MessageAckRequest]) (*connect.Response[dev.MessageAckResponse], error)
	// ReserveExecute executes a query on a reserved connection
	ReserveExecute(context.Context, *connect.Request[dev.ReserveExecuteRequest]) (*connect.Response[dev.ReserveExecuteResponse], error)
	// ReserveBeginExecute starts a transaction and executes a query in the transaction on a reserved connection
	ReserveBeginExecute(context.Context, *connect.Request[dev.ReserveBeginExecuteRequest]) (*connect.Response[dev.ReserveBeginExecuteResponse], error)
	// ReserveStreamExecute executes a streaming query on a reserved connection
	ReserveStreamExecute(context.Context, *connect.Request[dev.ReserveStreamExecuteRequest]) (*connect.ServerStreamForClient[dev.ReserveStreamExecuteResponse], error)
	// ReserveBeginStreamExecute starts a transaction and executes a streaming query in the transaction on a reserved connection
	ReserveBeginStreamExecute(context.Context, *connect.Request[dev.ReserveBeginStreamExecuteRequest]) (*connect.ServerStreamForClient[dev.ReserveBeginStreamExecuteResponse], error)
	// Release releases the connection
	Release(context.Context, *connect.Request[dev.ReleaseRequest]) (*connect.Response[dev.ReleaseResponse], error)
	// StreamHealth runs a streaming RPC to the tablet, that returns the
	// current health of the tablet on a regular basis.
	StreamHealth(context.Context, *connect.Request[dev.StreamHealthRequest]) (*connect.ServerStreamForClient[dev.StreamHealthResponse], error)
	// VStream streams vreplication events.
	VStream(context.Context, *connect.Request[dev1.VStreamRequest]) (*connect.ServerStreamForClient[dev1.VStreamResponse], error)
	// VStreamRows streams rows from the specified starting point.
	VStreamRows(context.Context, *connect.Request[dev1.VStreamRowsRequest]) (*connect.ServerStreamForClient[dev1.VStreamRowsResponse], error)
	// VStreamTables streams rows from the specified starting point.
	VStreamTables(context.Context, *connect.Request[dev1.VStreamTablesRequest]) (*connect.ServerStreamForClient[dev1.VStreamTablesResponse], error)
	// VStreamResults streams results along with the gtid of the snapshot.
	VStreamResults(context.Context, *connect.Request[dev1.VStreamResultsRequest]) (*connect.ServerStreamForClient[dev1.VStreamResultsResponse], error)
	// GetSchema returns the schema information.
	GetSchema(context.Context, *connect.Request[dev.GetSchemaRequest]) (*connect.ServerStreamForClient[dev.GetSchemaResponse], error)
	// BinlogDumpGTID streams raw binlog events from MySQL using COM_BINLOG_DUMP_GTID (GTID-based).
	BinlogDumpGTID(context.Context, *connect.Request[dev1.BinlogDumpGTIDRequest]) (*connect.ServerStreamForClient[dev1.BinlogDumpResponse], error)
}

QueryClient is a client for the vitess.queryservice.dev.Query service.

func NewQueryClient

func NewQueryClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) QueryClient

NewQueryClient constructs a client for the vitess.queryservice.dev.Query service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type QueryHandler

type QueryHandler interface {
	// Execute executes the specified SQL query (might be in a
	// transaction context, if Query.transaction_id is set).
	Execute(context.Context, *connect.Request[dev.ExecuteRequest]) (*connect.Response[dev.ExecuteResponse], error)
	// StreamExecute executes a streaming query. Use this method if the
	// query returns a large number of rows. The first QueryResult will
	// contain the Fields, subsequent QueryResult messages will contain
	// the rows.
	StreamExecute(context.Context, *connect.Request[dev.StreamExecuteRequest], *connect.ServerStream[dev.StreamExecuteResponse]) error
	// Begin a transaction.
	Begin(context.Context, *connect.Request[dev.BeginRequest]) (*connect.Response[dev.BeginResponse], error)
	// Commit a transaction.
	Commit(context.Context, *connect.Request[dev.CommitRequest]) (*connect.Response[dev.CommitResponse], error)
	// Rollback a transaction.
	Rollback(context.Context, *connect.Request[dev.RollbackRequest]) (*connect.Response[dev.RollbackResponse], error)
	// Prepare preares a transaction.
	Prepare(context.Context, *connect.Request[dev.PrepareRequest]) (*connect.Response[dev.PrepareResponse], error)
	// CommitPrepared commits a prepared transaction.
	CommitPrepared(context.Context, *connect.Request[dev.CommitPreparedRequest]) (*connect.Response[dev.CommitPreparedResponse], error)
	// RollbackPrepared rolls back a prepared transaction.
	RollbackPrepared(context.Context, *connect.Request[dev.RollbackPreparedRequest]) (*connect.Response[dev.RollbackPreparedResponse], error)
	// CreateTransaction creates the metadata for a 2pc transaction.
	CreateTransaction(context.Context, *connect.Request[dev.CreateTransactionRequest]) (*connect.Response[dev.CreateTransactionResponse], error)
	// StartCommit initiates a commit for a 2pc transaction.
	StartCommit(context.Context, *connect.Request[dev.StartCommitRequest]) (*connect.Response[dev.StartCommitResponse], error)
	// SetRollback marks the 2pc transaction for rollback.
	SetRollback(context.Context, *connect.Request[dev.SetRollbackRequest]) (*connect.Response[dev.SetRollbackResponse], error)
	// ConcludeTransaction marks the 2pc transaction as resolved.
	ConcludeTransaction(context.Context, *connect.Request[dev.ConcludeTransactionRequest]) (*connect.Response[dev.ConcludeTransactionResponse], error)
	// ReadTransaction returns the 2pc transaction info.
	ReadTransaction(context.Context, *connect.Request[dev.ReadTransactionRequest]) (*connect.Response[dev.ReadTransactionResponse], error)
	// UnresolvedTransactions returns the 2pc transaction info.
	UnresolvedTransactions(context.Context, *connect.Request[dev.UnresolvedTransactionsRequest]) (*connect.Response[dev.UnresolvedTransactionsResponse], error)
	// BeginExecute executes a begin and the specified SQL query.
	BeginExecute(context.Context, *connect.Request[dev.BeginExecuteRequest]) (*connect.Response[dev.BeginExecuteResponse], error)
	// BeginStreamExecute executes a begin and the specified SQL query.
	BeginStreamExecute(context.Context, *connect.Request[dev.BeginStreamExecuteRequest], *connect.ServerStream[dev.BeginStreamExecuteResponse]) error
	// MessageStream streams messages from a message table.
	MessageStream(context.Context, *connect.Request[dev.MessageStreamRequest], *connect.ServerStream[dev.MessageStreamResponse]) error
	// MessageAck acks messages for a table.
	MessageAck(context.Context, *connect.Request[dev.MessageAckRequest]) (*connect.Response[dev.MessageAckResponse], error)
	// ReserveExecute executes a query on a reserved connection
	ReserveExecute(context.Context, *connect.Request[dev.ReserveExecuteRequest]) (*connect.Response[dev.ReserveExecuteResponse], error)
	// ReserveBeginExecute starts a transaction and executes a query in the transaction on a reserved connection
	ReserveBeginExecute(context.Context, *connect.Request[dev.ReserveBeginExecuteRequest]) (*connect.Response[dev.ReserveBeginExecuteResponse], error)
	// ReserveStreamExecute executes a streaming query on a reserved connection
	ReserveStreamExecute(context.Context, *connect.Request[dev.ReserveStreamExecuteRequest], *connect.ServerStream[dev.ReserveStreamExecuteResponse]) error
	// ReserveBeginStreamExecute starts a transaction and executes a streaming query in the transaction on a reserved connection
	ReserveBeginStreamExecute(context.Context, *connect.Request[dev.ReserveBeginStreamExecuteRequest], *connect.ServerStream[dev.ReserveBeginStreamExecuteResponse]) error
	// Release releases the connection
	Release(context.Context, *connect.Request[dev.ReleaseRequest]) (*connect.Response[dev.ReleaseResponse], error)
	// StreamHealth runs a streaming RPC to the tablet, that returns the
	// current health of the tablet on a regular basis.
	StreamHealth(context.Context, *connect.Request[dev.StreamHealthRequest], *connect.ServerStream[dev.StreamHealthResponse]) error
	// VStream streams vreplication events.
	VStream(context.Context, *connect.Request[dev1.VStreamRequest], *connect.ServerStream[dev1.VStreamResponse]) error
	// VStreamRows streams rows from the specified starting point.
	VStreamRows(context.Context, *connect.Request[dev1.VStreamRowsRequest], *connect.ServerStream[dev1.VStreamRowsResponse]) error
	// VStreamTables streams rows from the specified starting point.
	VStreamTables(context.Context, *connect.Request[dev1.VStreamTablesRequest], *connect.ServerStream[dev1.VStreamTablesResponse]) error
	// VStreamResults streams results along with the gtid of the snapshot.
	VStreamResults(context.Context, *connect.Request[dev1.VStreamResultsRequest], *connect.ServerStream[dev1.VStreamResultsResponse]) error
	// GetSchema returns the schema information.
	GetSchema(context.Context, *connect.Request[dev.GetSchemaRequest], *connect.ServerStream[dev.GetSchemaResponse]) error
	// BinlogDumpGTID streams raw binlog events from MySQL using COM_BINLOG_DUMP_GTID (GTID-based).
	BinlogDumpGTID(context.Context, *connect.Request[dev1.BinlogDumpGTIDRequest], *connect.ServerStream[dev1.BinlogDumpResponse]) error
}

QueryHandler is an implementation of the vitess.queryservice.dev.Query service.

type UnimplementedQueryHandler

type UnimplementedQueryHandler struct{}

UnimplementedQueryHandler returns CodeUnimplemented from all methods.

func (UnimplementedQueryHandler) Begin

func (UnimplementedQueryHandler) BeginExecute

func (UnimplementedQueryHandler) BeginStreamExecute

func (UnimplementedQueryHandler) BinlogDumpGTID

func (UnimplementedQueryHandler) Commit

func (UnimplementedQueryHandler) CommitPrepared

func (UnimplementedQueryHandler) ConcludeTransaction

func (UnimplementedQueryHandler) CreateTransaction

func (UnimplementedQueryHandler) Execute

func (UnimplementedQueryHandler) GetSchema

func (UnimplementedQueryHandler) MessageAck

func (UnimplementedQueryHandler) MessageStream

func (UnimplementedQueryHandler) Prepare

func (UnimplementedQueryHandler) ReadTransaction

func (UnimplementedQueryHandler) Release

func (UnimplementedQueryHandler) ReserveBeginExecute

func (UnimplementedQueryHandler) ReserveBeginStreamExecute

func (UnimplementedQueryHandler) ReserveExecute

func (UnimplementedQueryHandler) ReserveStreamExecute

func (UnimplementedQueryHandler) Rollback

func (UnimplementedQueryHandler) RollbackPrepared

func (UnimplementedQueryHandler) SetRollback

func (UnimplementedQueryHandler) StartCommit

func (UnimplementedQueryHandler) StreamExecute

func (UnimplementedQueryHandler) StreamHealth

func (UnimplementedQueryHandler) UnresolvedTransactions

func (UnimplementedQueryHandler) VStreamResults

func (UnimplementedQueryHandler) VStreamRows

func (UnimplementedQueryHandler) VStreamTables

Source Files

  • queryservice.connect.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL