vtgateservicev17connect

package
v0.0.0-...-770e144 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VitessExecuteProcedure is the fully-qualified name of the Vitess's Execute RPC.
	VitessExecuteProcedure = "/vtgateservice.Vitess/Execute"
	// VitessExecuteBatchProcedure is the fully-qualified name of the Vitess's ExecuteBatch RPC.
	VitessExecuteBatchProcedure = "/vtgateservice.Vitess/ExecuteBatch"
	// VitessStreamExecuteProcedure is the fully-qualified name of the Vitess's StreamExecute RPC.
	VitessStreamExecuteProcedure = "/vtgateservice.Vitess/StreamExecute"
	// VitessResolveTransactionProcedure is the fully-qualified name of the Vitess's ResolveTransaction
	// RPC.
	VitessResolveTransactionProcedure = "/vtgateservice.Vitess/ResolveTransaction"
	// VitessVStreamProcedure is the fully-qualified name of the Vitess's VStream RPC.
	VitessVStreamProcedure = "/vtgateservice.Vitess/VStream"
	// VitessPrepareProcedure is the fully-qualified name of the Vitess's Prepare RPC.
	VitessPrepareProcedure = "/vtgateservice.Vitess/Prepare"
	// VitessCloseSessionProcedure is the fully-qualified name of the Vitess's CloseSession RPC.
	VitessCloseSessionProcedure = "/vtgateservice.Vitess/CloseSession"
)

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 (
	// VitessName is the fully-qualified name of the Vitess service.
	VitessName = "vtgateservice.Vitess"
)

Variables

This section is empty.

Functions

func NewVitessHandler

func NewVitessHandler(svc VitessHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewVitessHandler 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 UnimplementedVitessHandler

type UnimplementedVitessHandler struct{}

UnimplementedVitessHandler returns CodeUnimplemented from all methods.

type VitessClient

type VitessClient interface {
	// Execute tries to route the query to the right shard.
	// It depends on the query and bind variables to provide enough
	// information in conjunction with the vindexes to route the query.
	// API group: v3
	Execute(context.Context, *connect.Request[v17.ExecuteRequest]) (*connect.Response[v17.ExecuteResponse], error)
	// ExecuteBatch tries to route the list of queries on the right shards.
	// It depends on the query and bind variables to provide enough
	// information in conjunction with the vindexes to route the query.
	// API group: v3
	ExecuteBatch(context.Context, *connect.Request[v17.ExecuteBatchRequest]) (*connect.Response[v17.ExecuteBatchResponse], error)
	// StreamExecute executes a streaming query based on shards.
	// It depends on the query and bind variables to provide enough
	// information in conjunction with the vindexes to route the query.
	// Use this method if the query returns a large number of rows.
	// API group: v3
	StreamExecute(context.Context, *connect.Request[v17.StreamExecuteRequest]) (*connect.ServerStreamForClient[v17.StreamExecuteResponse], error)
	// ResolveTransaction resolves a transaction.
	// API group: Transactions
	ResolveTransaction(context.Context, *connect.Request[v17.ResolveTransactionRequest]) (*connect.Response[v17.ResolveTransactionResponse], error)
	// VStream streams binlog events from the requested sources.
	VStream(context.Context, *connect.Request[v17.VStreamRequest]) (*connect.ServerStreamForClient[v17.VStreamResponse], error)
	// Prepare is used by the MySQL server plugin as part of supporting prepared statements.
	Prepare(context.Context, *connect.Request[v17.PrepareRequest]) (*connect.Response[v17.PrepareResponse], error)
	// CloseSession closes the session, rolling back any implicit transactions.
	// This has the same effect as if a "rollback" statement was executed,
	// but does not affect the query statistics.
	CloseSession(context.Context, *connect.Request[v17.CloseSessionRequest]) (*connect.Response[v17.CloseSessionResponse], error)
}

VitessClient is a client for the vtgateservice.Vitess service.

func NewVitessClient

func NewVitessClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) VitessClient

NewVitessClient constructs a client for the vtgateservice.Vitess 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 VitessHandler

type VitessHandler interface {
	// Execute tries to route the query to the right shard.
	// It depends on the query and bind variables to provide enough
	// information in conjunction with the vindexes to route the query.
	// API group: v3
	Execute(context.Context, *connect.Request[v17.ExecuteRequest]) (*connect.Response[v17.ExecuteResponse], error)
	// ExecuteBatch tries to route the list of queries on the right shards.
	// It depends on the query and bind variables to provide enough
	// information in conjunction with the vindexes to route the query.
	// API group: v3
	ExecuteBatch(context.Context, *connect.Request[v17.ExecuteBatchRequest]) (*connect.Response[v17.ExecuteBatchResponse], error)
	// StreamExecute executes a streaming query based on shards.
	// It depends on the query and bind variables to provide enough
	// information in conjunction with the vindexes to route the query.
	// Use this method if the query returns a large number of rows.
	// API group: v3
	StreamExecute(context.Context, *connect.Request[v17.StreamExecuteRequest], *connect.ServerStream[v17.StreamExecuteResponse]) error
	// ResolveTransaction resolves a transaction.
	// API group: Transactions
	ResolveTransaction(context.Context, *connect.Request[v17.ResolveTransactionRequest]) (*connect.Response[v17.ResolveTransactionResponse], error)
	// VStream streams binlog events from the requested sources.
	VStream(context.Context, *connect.Request[v17.VStreamRequest], *connect.ServerStream[v17.VStreamResponse]) error
	// Prepare is used by the MySQL server plugin as part of supporting prepared statements.
	Prepare(context.Context, *connect.Request[v17.PrepareRequest]) (*connect.Response[v17.PrepareResponse], error)
	// CloseSession closes the session, rolling back any implicit transactions.
	// This has the same effect as if a "rollback" statement was executed,
	// but does not affect the query statistics.
	CloseSession(context.Context, *connect.Request[v17.CloseSessionRequest]) (*connect.Response[v17.CloseSessionResponse], error)
}

VitessHandler is an implementation of the vtgateservice.Vitess service.

Jump to

Keyboard shortcuts

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