Documentation ¶
Index ¶
- Constants
- func NewVitessHandler(svc VitessHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type UnimplementedVitessHandler
- func (UnimplementedVitessHandler) CloseSession(context.Context, *connect.Request[v18.CloseSessionRequest]) (*connect.Response[v18.CloseSessionResponse], error)
- func (UnimplementedVitessHandler) Execute(context.Context, *connect.Request[v18.ExecuteRequest]) (*connect.Response[v18.ExecuteResponse], error)
- func (UnimplementedVitessHandler) ExecuteBatch(context.Context, *connect.Request[v18.ExecuteBatchRequest]) (*connect.Response[v18.ExecuteBatchResponse], error)
- func (UnimplementedVitessHandler) Prepare(context.Context, *connect.Request[v18.PrepareRequest]) (*connect.Response[v18.PrepareResponse], error)
- func (UnimplementedVitessHandler) ResolveTransaction(context.Context, *connect.Request[v18.ResolveTransactionRequest]) (*connect.Response[v18.ResolveTransactionResponse], error)
- func (UnimplementedVitessHandler) StreamExecute(context.Context, *connect.Request[v18.StreamExecuteRequest], ...) error
- func (UnimplementedVitessHandler) VStream(context.Context, *connect.Request[v18.VStreamRequest], ...) error
- type VitessClient
- type VitessHandler
Constants ¶
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.
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.
func (UnimplementedVitessHandler) CloseSession ¶
func (UnimplementedVitessHandler) CloseSession(context.Context, *connect.Request[v18.CloseSessionRequest]) (*connect.Response[v18.CloseSessionResponse], error)
func (UnimplementedVitessHandler) Execute ¶
func (UnimplementedVitessHandler) Execute(context.Context, *connect.Request[v18.ExecuteRequest]) (*connect.Response[v18.ExecuteResponse], error)
func (UnimplementedVitessHandler) ExecuteBatch ¶
func (UnimplementedVitessHandler) ExecuteBatch(context.Context, *connect.Request[v18.ExecuteBatchRequest]) (*connect.Response[v18.ExecuteBatchResponse], error)
func (UnimplementedVitessHandler) Prepare ¶
func (UnimplementedVitessHandler) Prepare(context.Context, *connect.Request[v18.PrepareRequest]) (*connect.Response[v18.PrepareResponse], error)
func (UnimplementedVitessHandler) ResolveTransaction ¶
func (UnimplementedVitessHandler) ResolveTransaction(context.Context, *connect.Request[v18.ResolveTransactionRequest]) (*connect.Response[v18.ResolveTransactionResponse], error)
func (UnimplementedVitessHandler) StreamExecute ¶
func (UnimplementedVitessHandler) StreamExecute(context.Context, *connect.Request[v18.StreamExecuteRequest], *connect.ServerStream[v18.StreamExecuteResponse]) error
func (UnimplementedVitessHandler) VStream ¶
func (UnimplementedVitessHandler) VStream(context.Context, *connect.Request[v18.VStreamRequest], *connect.ServerStream[v18.VStreamResponse]) error
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[v18.ExecuteRequest]) (*connect.Response[v18.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[v18.ExecuteBatchRequest]) (*connect.Response[v18.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[v18.StreamExecuteRequest]) (*connect.ServerStreamForClient[v18.StreamExecuteResponse], error) // ResolveTransaction resolves a transaction. // API group: Transactions ResolveTransaction(context.Context, *connect.Request[v18.ResolveTransactionRequest]) (*connect.Response[v18.ResolveTransactionResponse], error) // VStream streams binlog events from the requested sources. VStream(context.Context, *connect.Request[v18.VStreamRequest]) (*connect.ServerStreamForClient[v18.VStreamResponse], error) // Prepare is used by the MySQL server plugin as part of supporting prepared statements. Prepare(context.Context, *connect.Request[v18.PrepareRequest]) (*connect.Response[v18.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[v18.CloseSessionRequest]) (*connect.Response[v18.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[v18.ExecuteRequest]) (*connect.Response[v18.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[v18.ExecuteBatchRequest]) (*connect.Response[v18.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[v18.StreamExecuteRequest], *connect.ServerStream[v18.StreamExecuteResponse]) error // ResolveTransaction resolves a transaction. // API group: Transactions ResolveTransaction(context.Context, *connect.Request[v18.ResolveTransactionRequest]) (*connect.Response[v18.ResolveTransactionResponse], error) // VStream streams binlog events from the requested sources. VStream(context.Context, *connect.Request[v18.VStreamRequest], *connect.ServerStream[v18.VStreamResponse]) error // Prepare is used by the MySQL server plugin as part of supporting prepared statements. Prepare(context.Context, *connect.Request[v18.PrepareRequest]) (*connect.Response[v18.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[v18.CloseSessionRequest]) (*connect.Response[v18.CloseSessionResponse], error) }
VitessHandler is an implementation of the vtgateservice.Vitess service.