Documentation
¶
Index ¶
- Constants
- func NewDatabaseServiceHandler(svc DatabaseServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type DatabaseServiceClient
- type DatabaseServiceHandler
- type UnimplementedDatabaseServiceHandler
- func (UnimplementedDatabaseServiceHandler) DataSourceNames(context.Context, *connect.Request[v1.DataSourceNamesRequest]) (*connect.Response[v1.DataSourceNamesResponse], error)
- func (UnimplementedDatabaseServiceHandler) Download(context.Context, *connect.Request[v1.DownloadRequest], ...) error
- func (UnimplementedDatabaseServiceHandler) LatestSnapshot(context.Context, *connect.Request[v1.LatestSnapshotRequest], ...) error
- func (UnimplementedDatabaseServiceHandler) Query(context.Context, *connect.BidiStream[v1.QueryRequest, v1.QueryResponse]) error
- func (UnimplementedDatabaseServiceHandler) ReplicationIDs(context.Context, *connect.Request[v1.ReplicationIDsRequest]) (*connect.Response[v1.ReplicationIDsResponse], error)
Constants ¶
const ( // DatabaseServiceQueryProcedure is the fully-qualified name of the DatabaseService's Query RPC. DatabaseServiceQueryProcedure = "/sql.v1.DatabaseService/Query" // DatabaseServiceDataSourceNamesProcedure is the fully-qualified name of the DatabaseService's // DataSourceNames RPC. DatabaseServiceDataSourceNamesProcedure = "/sql.v1.DatabaseService/DataSourceNames" // DatabaseServiceDownloadProcedure is the fully-qualified name of the DatabaseService's Download // RPC. DatabaseServiceDownloadProcedure = "/sql.v1.DatabaseService/Download" // DatabaseServiceLatestSnapshotProcedure is the fully-qualified name of the DatabaseService's // LatestSnapshot RPC. DatabaseServiceLatestSnapshotProcedure = "/sql.v1.DatabaseService/LatestSnapshot" // DatabaseServiceReplicationIDsProcedure is the fully-qualified name of the DatabaseService's // ReplicationIDs RPC. DatabaseServiceReplicationIDsProcedure = "/sql.v1.DatabaseService/ReplicationIDs" )
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 (
// DatabaseServiceName is the fully-qualified name of the DatabaseService service.
DatabaseServiceName = "sql.v1.DatabaseService"
)
Variables ¶
This section is empty.
Functions ¶
func NewDatabaseServiceHandler ¶
func NewDatabaseServiceHandler(svc DatabaseServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewDatabaseServiceHandler 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 DatabaseServiceClient ¶
type DatabaseServiceClient interface {
Query(context.Context) *connect.BidiStreamForClient[v1.QueryRequest, v1.QueryResponse]
DataSourceNames(context.Context, *connect.Request[v1.DataSourceNamesRequest]) (*connect.Response[v1.DataSourceNamesResponse], error)
Download(context.Context, *connect.Request[v1.DownloadRequest]) (*connect.ServerStreamForClient[v1.DownloadResponse], error)
LatestSnapshot(context.Context, *connect.Request[v1.LatestSnapshotRequest]) (*connect.ServerStreamForClient[v1.LatestSnapshotResponse], error)
ReplicationIDs(context.Context, *connect.Request[v1.ReplicationIDsRequest]) (*connect.Response[v1.ReplicationIDsResponse], error)
}
DatabaseServiceClient is a client for the sql.v1.DatabaseService service.
func NewDatabaseServiceClient ¶
func NewDatabaseServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) DatabaseServiceClient
NewDatabaseServiceClient constructs a client for the sql.v1.DatabaseService 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 DatabaseServiceHandler ¶
type DatabaseServiceHandler interface {
Query(context.Context, *connect.BidiStream[v1.QueryRequest, v1.QueryResponse]) error
DataSourceNames(context.Context, *connect.Request[v1.DataSourceNamesRequest]) (*connect.Response[v1.DataSourceNamesResponse], error)
Download(context.Context, *connect.Request[v1.DownloadRequest], *connect.ServerStream[v1.DownloadResponse]) error
LatestSnapshot(context.Context, *connect.Request[v1.LatestSnapshotRequest], *connect.ServerStream[v1.LatestSnapshotResponse]) error
ReplicationIDs(context.Context, *connect.Request[v1.ReplicationIDsRequest]) (*connect.Response[v1.ReplicationIDsResponse], error)
}
DatabaseServiceHandler is an implementation of the sql.v1.DatabaseService service.
type UnimplementedDatabaseServiceHandler ¶
type UnimplementedDatabaseServiceHandler struct{}
UnimplementedDatabaseServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedDatabaseServiceHandler) DataSourceNames ¶
func (UnimplementedDatabaseServiceHandler) DataSourceNames(context.Context, *connect.Request[v1.DataSourceNamesRequest]) (*connect.Response[v1.DataSourceNamesResponse], error)
func (UnimplementedDatabaseServiceHandler) Download ¶
func (UnimplementedDatabaseServiceHandler) Download(context.Context, *connect.Request[v1.DownloadRequest], *connect.ServerStream[v1.DownloadResponse]) error
func (UnimplementedDatabaseServiceHandler) LatestSnapshot ¶
func (UnimplementedDatabaseServiceHandler) LatestSnapshot(context.Context, *connect.Request[v1.LatestSnapshotRequest], *connect.ServerStream[v1.LatestSnapshotResponse]) error
func (UnimplementedDatabaseServiceHandler) Query ¶
func (UnimplementedDatabaseServiceHandler) Query(context.Context, *connect.BidiStream[v1.QueryRequest, v1.QueryResponse]) error
func (UnimplementedDatabaseServiceHandler) ReplicationIDs ¶
func (UnimplementedDatabaseServiceHandler) ReplicationIDs(context.Context, *connect.Request[v1.ReplicationIDsRequest]) (*connect.Response[v1.ReplicationIDsResponse], error)