ftlv1connect

package
v0.150.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VerbServiceName is the fully-qualified name of the VerbService service.
	VerbServiceName = "xyz.block.ftl.v1.VerbService"
	// ControllerServiceName is the fully-qualified name of the ControllerService service.
	ControllerServiceName = "xyz.block.ftl.v1.ControllerService"
	// RunnerServiceName is the fully-qualified name of the RunnerService service.
	RunnerServiceName = "xyz.block.ftl.v1.RunnerService"
)
View Source
const (
	// VerbServicePingProcedure is the fully-qualified name of the VerbService's Ping RPC.
	VerbServicePingProcedure = "/xyz.block.ftl.v1.VerbService/Ping"
	// VerbServiceCallProcedure is the fully-qualified name of the VerbService's Call RPC.
	VerbServiceCallProcedure = "/xyz.block.ftl.v1.VerbService/Call"
	// ControllerServicePingProcedure is the fully-qualified name of the ControllerService's Ping RPC.
	ControllerServicePingProcedure = "/xyz.block.ftl.v1.ControllerService/Ping"
	// ControllerServiceProcessListProcedure is the fully-qualified name of the ControllerService's
	// ProcessList RPC.
	ControllerServiceProcessListProcedure = "/xyz.block.ftl.v1.ControllerService/ProcessList"
	// ControllerServiceStatusProcedure is the fully-qualified name of the ControllerService's Status
	// RPC.
	ControllerServiceStatusProcedure = "/xyz.block.ftl.v1.ControllerService/Status"
	// ControllerServiceGetArtefactDiffsProcedure is the fully-qualified name of the ControllerService's
	// GetArtefactDiffs RPC.
	ControllerServiceGetArtefactDiffsProcedure = "/xyz.block.ftl.v1.ControllerService/GetArtefactDiffs"
	// ControllerServiceUploadArtefactProcedure is the fully-qualified name of the ControllerService's
	// UploadArtefact RPC.
	ControllerServiceUploadArtefactProcedure = "/xyz.block.ftl.v1.ControllerService/UploadArtefact"
	// ControllerServiceCreateDeploymentProcedure is the fully-qualified name of the ControllerService's
	// CreateDeployment RPC.
	ControllerServiceCreateDeploymentProcedure = "/xyz.block.ftl.v1.ControllerService/CreateDeployment"
	// ControllerServiceGetDeploymentProcedure is the fully-qualified name of the ControllerService's
	// GetDeployment RPC.
	ControllerServiceGetDeploymentProcedure = "/xyz.block.ftl.v1.ControllerService/GetDeployment"
	// ControllerServiceGetDeploymentArtefactsProcedure is the fully-qualified name of the
	// ControllerService's GetDeploymentArtefacts RPC.
	ControllerServiceGetDeploymentArtefactsProcedure = "/xyz.block.ftl.v1.ControllerService/GetDeploymentArtefacts"
	// ControllerServiceRegisterRunnerProcedure is the fully-qualified name of the ControllerService's
	// RegisterRunner RPC.
	ControllerServiceRegisterRunnerProcedure = "/xyz.block.ftl.v1.ControllerService/RegisterRunner"
	// ControllerServiceUpdateDeployProcedure is the fully-qualified name of the ControllerService's
	// UpdateDeploy RPC.
	ControllerServiceUpdateDeployProcedure = "/xyz.block.ftl.v1.ControllerService/UpdateDeploy"
	// ControllerServiceReplaceDeployProcedure is the fully-qualified name of the ControllerService's
	// ReplaceDeploy RPC.
	ControllerServiceReplaceDeployProcedure = "/xyz.block.ftl.v1.ControllerService/ReplaceDeploy"
	// ControllerServiceStreamDeploymentLogsProcedure is the fully-qualified name of the
	// ControllerService's StreamDeploymentLogs RPC.
	ControllerServiceStreamDeploymentLogsProcedure = "/xyz.block.ftl.v1.ControllerService/StreamDeploymentLogs"
	// ControllerServiceGetSchemaProcedure is the fully-qualified name of the ControllerService's
	// GetSchema RPC.
	ControllerServiceGetSchemaProcedure = "/xyz.block.ftl.v1.ControllerService/GetSchema"
	// ControllerServicePullSchemaProcedure is the fully-qualified name of the ControllerService's
	// PullSchema RPC.
	ControllerServicePullSchemaProcedure = "/xyz.block.ftl.v1.ControllerService/PullSchema"
	// RunnerServicePingProcedure is the fully-qualified name of the RunnerService's Ping RPC.
	RunnerServicePingProcedure = "/xyz.block.ftl.v1.RunnerService/Ping"
	// RunnerServiceReserveProcedure is the fully-qualified name of the RunnerService's Reserve RPC.
	RunnerServiceReserveProcedure = "/xyz.block.ftl.v1.RunnerService/Reserve"
	// RunnerServiceDeployProcedure is the fully-qualified name of the RunnerService's Deploy RPC.
	RunnerServiceDeployProcedure = "/xyz.block.ftl.v1.RunnerService/Deploy"
	// RunnerServiceTerminateProcedure is the fully-qualified name of the RunnerService's Terminate RPC.
	RunnerServiceTerminateProcedure = "/xyz.block.ftl.v1.RunnerService/Terminate"
)

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.

Variables

This section is empty.

Functions

func NewControllerServiceHandler

func NewControllerServiceHandler(svc ControllerServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewControllerServiceHandler 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.

func NewRunnerServiceHandler

func NewRunnerServiceHandler(svc RunnerServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewRunnerServiceHandler 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.

func NewVerbServiceHandler

func NewVerbServiceHandler(svc VerbServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewVerbServiceHandler 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 ControllerServiceClient

type ControllerServiceClient interface {
	// Ping service for readiness.
	Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error)
	// List "processes" running on the cluster.
	ProcessList(context.Context, *connect.Request[v1.ProcessListRequest]) (*connect.Response[v1.ProcessListResponse], error)
	Status(context.Context, *connect.Request[v1.StatusRequest]) (*connect.Response[v1.StatusResponse], error)
	// Get list of artefacts that differ between the server and client.
	GetArtefactDiffs(context.Context, *connect.Request[v1.GetArtefactDiffsRequest]) (*connect.Response[v1.GetArtefactDiffsResponse], error)
	// Upload an artefact to the server.
	UploadArtefact(context.Context, *connect.Request[v1.UploadArtefactRequest]) (*connect.Response[v1.UploadArtefactResponse], error)
	// Create a deployment.
	CreateDeployment(context.Context, *connect.Request[v1.CreateDeploymentRequest]) (*connect.Response[v1.CreateDeploymentResponse], error)
	// Get the schema and artefact metadata for a deployment.
	GetDeployment(context.Context, *connect.Request[v1.GetDeploymentRequest]) (*connect.Response[v1.GetDeploymentResponse], error)
	// Stream deployment artefacts from the server.
	//
	// Each artefact is streamed one after the other as a sequence of max 1MB
	// chunks.
	GetDeploymentArtefacts(context.Context, *connect.Request[v1.GetDeploymentArtefactsRequest]) (*connect.ServerStreamForClient[v1.GetDeploymentArtefactsResponse], error)
	// Register a Runner with the Controller.
	//
	// Each runner issue a RegisterRunnerRequest to the ControllerService
	// every 10 seconds to maintain its heartbeat.
	RegisterRunner(context.Context) *connect.ClientStreamForClient[v1.RegisterRunnerRequest, v1.RegisterRunnerResponse]
	// Update an existing deployment.
	UpdateDeploy(context.Context, *connect.Request[v1.UpdateDeployRequest]) (*connect.Response[v1.UpdateDeployResponse], error)
	// Gradually replace an existing deployment with a new one.
	//
	// If a deployment already exists for the module of the new deployment,
	// it will be scaled down and replaced by the new one.
	ReplaceDeploy(context.Context, *connect.Request[v1.ReplaceDeployRequest]) (*connect.Response[v1.ReplaceDeployResponse], error)
	// Stream logs from a deployment
	StreamDeploymentLogs(context.Context) *connect.ClientStreamForClient[v1.StreamDeploymentLogsRequest, v1.StreamDeploymentLogsResponse]
	// Get the full schema.
	GetSchema(context.Context, *connect.Request[v1.GetSchemaRequest]) (*connect.Response[v1.GetSchemaResponse], error)
	// Pull schema changes from the Controller.
	//
	// Note that if there are no deployments this will block indefinitely, making it unsuitable for
	// just retrieving the schema. Use GetSchema for that.
	PullSchema(context.Context, *connect.Request[v1.PullSchemaRequest]) (*connect.ServerStreamForClient[v1.PullSchemaResponse], error)
}

ControllerServiceClient is a client for the xyz.block.ftl.v1.ControllerService service.

func NewControllerServiceClient

func NewControllerServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ControllerServiceClient

NewControllerServiceClient constructs a client for the xyz.block.ftl.v1.ControllerService 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 ControllerServiceHandler

type ControllerServiceHandler interface {
	// Ping service for readiness.
	Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error)
	// List "processes" running on the cluster.
	ProcessList(context.Context, *connect.Request[v1.ProcessListRequest]) (*connect.Response[v1.ProcessListResponse], error)
	Status(context.Context, *connect.Request[v1.StatusRequest]) (*connect.Response[v1.StatusResponse], error)
	// Get list of artefacts that differ between the server and client.
	GetArtefactDiffs(context.Context, *connect.Request[v1.GetArtefactDiffsRequest]) (*connect.Response[v1.GetArtefactDiffsResponse], error)
	// Upload an artefact to the server.
	UploadArtefact(context.Context, *connect.Request[v1.UploadArtefactRequest]) (*connect.Response[v1.UploadArtefactResponse], error)
	// Create a deployment.
	CreateDeployment(context.Context, *connect.Request[v1.CreateDeploymentRequest]) (*connect.Response[v1.CreateDeploymentResponse], error)
	// Get the schema and artefact metadata for a deployment.
	GetDeployment(context.Context, *connect.Request[v1.GetDeploymentRequest]) (*connect.Response[v1.GetDeploymentResponse], error)
	// Stream deployment artefacts from the server.
	//
	// Each artefact is streamed one after the other as a sequence of max 1MB
	// chunks.
	GetDeploymentArtefacts(context.Context, *connect.Request[v1.GetDeploymentArtefactsRequest], *connect.ServerStream[v1.GetDeploymentArtefactsResponse]) error
	// Register a Runner with the Controller.
	//
	// Each runner issue a RegisterRunnerRequest to the ControllerService
	// every 10 seconds to maintain its heartbeat.
	RegisterRunner(context.Context, *connect.ClientStream[v1.RegisterRunnerRequest]) (*connect.Response[v1.RegisterRunnerResponse], error)
	// Update an existing deployment.
	UpdateDeploy(context.Context, *connect.Request[v1.UpdateDeployRequest]) (*connect.Response[v1.UpdateDeployResponse], error)
	// Gradually replace an existing deployment with a new one.
	//
	// If a deployment already exists for the module of the new deployment,
	// it will be scaled down and replaced by the new one.
	ReplaceDeploy(context.Context, *connect.Request[v1.ReplaceDeployRequest]) (*connect.Response[v1.ReplaceDeployResponse], error)
	// Stream logs from a deployment
	StreamDeploymentLogs(context.Context, *connect.ClientStream[v1.StreamDeploymentLogsRequest]) (*connect.Response[v1.StreamDeploymentLogsResponse], error)
	// Get the full schema.
	GetSchema(context.Context, *connect.Request[v1.GetSchemaRequest]) (*connect.Response[v1.GetSchemaResponse], error)
	// Pull schema changes from the Controller.
	//
	// Note that if there are no deployments this will block indefinitely, making it unsuitable for
	// just retrieving the schema. Use GetSchema for that.
	PullSchema(context.Context, *connect.Request[v1.PullSchemaRequest], *connect.ServerStream[v1.PullSchemaResponse]) error
}

ControllerServiceHandler is an implementation of the xyz.block.ftl.v1.ControllerService service.

type RunnerServiceClient

type RunnerServiceClient interface {
	Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error)
	// Reserve synchronously reserves a Runner for a deployment but does nothing else.
	Reserve(context.Context, *connect.Request[v1.ReserveRequest]) (*connect.Response[v1.ReserveResponse], error)
	// Initiate a deployment on this Runner.
	Deploy(context.Context, *connect.Request[v1.DeployRequest]) (*connect.Response[v1.DeployResponse], error)
	// Terminate the deployment on this Runner.
	Terminate(context.Context, *connect.Request[v1.TerminateRequest]) (*connect.Response[v1.RegisterRunnerRequest], error)
}

RunnerServiceClient is a client for the xyz.block.ftl.v1.RunnerService service.

func NewRunnerServiceClient

func NewRunnerServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RunnerServiceClient

NewRunnerServiceClient constructs a client for the xyz.block.ftl.v1.RunnerService 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 RunnerServiceHandler

type RunnerServiceHandler interface {
	Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error)
	// Reserve synchronously reserves a Runner for a deployment but does nothing else.
	Reserve(context.Context, *connect.Request[v1.ReserveRequest]) (*connect.Response[v1.ReserveResponse], error)
	// Initiate a deployment on this Runner.
	Deploy(context.Context, *connect.Request[v1.DeployRequest]) (*connect.Response[v1.DeployResponse], error)
	// Terminate the deployment on this Runner.
	Terminate(context.Context, *connect.Request[v1.TerminateRequest]) (*connect.Response[v1.RegisterRunnerRequest], error)
}

RunnerServiceHandler is an implementation of the xyz.block.ftl.v1.RunnerService service.

type UnimplementedControllerServiceHandler

type UnimplementedControllerServiceHandler struct{}

UnimplementedControllerServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedControllerServiceHandler) Ping

func (UnimplementedControllerServiceHandler) Status

type UnimplementedRunnerServiceHandler

type UnimplementedRunnerServiceHandler struct{}

UnimplementedRunnerServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedRunnerServiceHandler) Ping

type UnimplementedVerbServiceHandler

type UnimplementedVerbServiceHandler struct{}

UnimplementedVerbServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedVerbServiceHandler) Call

func (UnimplementedVerbServiceHandler) Ping

type VerbServiceClient

type VerbServiceClient interface {
	// Ping service for readiness.
	Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error)
	// Issue a synchronous call to a Verb.
	Call(context.Context, *connect.Request[v1.CallRequest]) (*connect.Response[v1.CallResponse], error)
}

VerbServiceClient is a client for the xyz.block.ftl.v1.VerbService service.

func NewVerbServiceClient

func NewVerbServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) VerbServiceClient

NewVerbServiceClient constructs a client for the xyz.block.ftl.v1.VerbService 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 VerbServiceHandler

type VerbServiceHandler interface {
	// Ping service for readiness.
	Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error)
	// Issue a synchronous call to a Verb.
	Call(context.Context, *connect.Request[v1.CallRequest]) (*connect.Response[v1.CallResponse], error)
}

VerbServiceHandler is an implementation of the xyz.block.ftl.v1.VerbService service.

Jump to

Keyboard shortcuts

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