v0connect

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RuntimeLoadProcedure is the fully-qualified name of the Runtime's Load RPC.
	RuntimeLoadProcedure = "/codefly.services.runtime.v0.Runtime/Load"
	// RuntimeInitProcedure is the fully-qualified name of the Runtime's Init RPC.
	RuntimeInitProcedure = "/codefly.services.runtime.v0.Runtime/Init"
	// RuntimeStartProcedure is the fully-qualified name of the Runtime's Start RPC.
	RuntimeStartProcedure = "/codefly.services.runtime.v0.Runtime/Start"
	// RuntimeStopProcedure is the fully-qualified name of the Runtime's Stop RPC.
	RuntimeStopProcedure = "/codefly.services.runtime.v0.Runtime/Stop"
	// RuntimeDestroyProcedure is the fully-qualified name of the Runtime's Destroy RPC.
	RuntimeDestroyProcedure = "/codefly.services.runtime.v0.Runtime/Destroy"
	// RuntimeBuildProcedure is the fully-qualified name of the Runtime's Build RPC.
	RuntimeBuildProcedure = "/codefly.services.runtime.v0.Runtime/Build"
	// RuntimeTestProcedure is the fully-qualified name of the Runtime's Test RPC.
	RuntimeTestProcedure = "/codefly.services.runtime.v0.Runtime/Test"
	// RuntimeLintProcedure is the fully-qualified name of the Runtime's Lint RPC.
	RuntimeLintProcedure = "/codefly.services.runtime.v0.Runtime/Lint"
	// RuntimeInformationProcedure is the fully-qualified name of the Runtime's Information RPC.
	RuntimeInformationProcedure = "/codefly.services.runtime.v0.Runtime/Information"
	// RuntimeCommunicateProcedure is the fully-qualified name of the Runtime's Communicate RPC.
	RuntimeCommunicateProcedure = "/codefly.services.runtime.v0.Runtime/Communicate"
)

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 (
	// RuntimeName is the fully-qualified name of the Runtime service.
	RuntimeName = "codefly.services.runtime.v0.Runtime"
)

Variables

This section is empty.

Functions

func NewRuntimeHandler

func NewRuntimeHandler(svc RuntimeHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewRuntimeHandler 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 RuntimeClient

type RuntimeClient interface {
	// Load discovers service metadata before any runtime resources are allocated.
	Load(context.Context, *connect.Request[v0.LoadRequest]) (*connect.Response[v0.LoadResponse], error)
	// Init resolves configuration, dependency endpoints, and concrete network mappings.
	Init(context.Context, *connect.Request[v0.InitRequest]) (*connect.Response[v0.InitResponse], error)
	// Start launches the service process and returns once it is ready or failed.
	Start(context.Context, *connect.Request[v0.StartRequest]) (*connect.Response[v0.StartResponse], error)
	// Stop terminates the running service process.
	Stop(context.Context, *connect.Request[v0.StopRequest]) (*connect.Response[v0.StopResponse], error)
	// Destroy releases runtime resources such as containers, sockets, or temp state.
	Destroy(context.Context, *connect.Request[v0.DestroyRequest]) (*connect.Response[v0.DestroyResponse], error)
	// Build runs the service's native build or compile check.
	Build(context.Context, *connect.Request[v0.BuildRequest]) (*connect.Response[v0.BuildResponse], error)
	// Test runs the service's native test command and returns structured results.
	Test(context.Context, *connect.Request[v0.TestRequest]) (*connect.Response[v0.TestResponse], error)
	// Lint runs the service's native linter.
	Lint(context.Context, *connect.Request[v0.LintRequest]) (*connect.Response[v0.LintResponse], error)
	// Information returns the latest lifecycle statuses known by the agent.
	Information(context.Context, *connect.Request[v0.InformationRequest]) (*connect.Response[v0.InformationResponse], error)
	// Bidirectional streaming for interactive Q&A.
	// Plugin streams Questions, CLI streams Answers.
	Communicate(context.Context) *connect.BidiStreamForClient[v01.Answer, v01.Question]
}

RuntimeClient is a client for the codefly.services.runtime.v0.Runtime service.

func NewRuntimeClient

func NewRuntimeClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RuntimeClient

NewRuntimeClient constructs a client for the codefly.services.runtime.v0.Runtime 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 RuntimeHandler

type RuntimeHandler interface {
	// Load discovers service metadata before any runtime resources are allocated.
	Load(context.Context, *connect.Request[v0.LoadRequest]) (*connect.Response[v0.LoadResponse], error)
	// Init resolves configuration, dependency endpoints, and concrete network mappings.
	Init(context.Context, *connect.Request[v0.InitRequest]) (*connect.Response[v0.InitResponse], error)
	// Start launches the service process and returns once it is ready or failed.
	Start(context.Context, *connect.Request[v0.StartRequest]) (*connect.Response[v0.StartResponse], error)
	// Stop terminates the running service process.
	Stop(context.Context, *connect.Request[v0.StopRequest]) (*connect.Response[v0.StopResponse], error)
	// Destroy releases runtime resources such as containers, sockets, or temp state.
	Destroy(context.Context, *connect.Request[v0.DestroyRequest]) (*connect.Response[v0.DestroyResponse], error)
	// Build runs the service's native build or compile check.
	Build(context.Context, *connect.Request[v0.BuildRequest]) (*connect.Response[v0.BuildResponse], error)
	// Test runs the service's native test command and returns structured results.
	Test(context.Context, *connect.Request[v0.TestRequest]) (*connect.Response[v0.TestResponse], error)
	// Lint runs the service's native linter.
	Lint(context.Context, *connect.Request[v0.LintRequest]) (*connect.Response[v0.LintResponse], error)
	// Information returns the latest lifecycle statuses known by the agent.
	Information(context.Context, *connect.Request[v0.InformationRequest]) (*connect.Response[v0.InformationResponse], error)
	// Bidirectional streaming for interactive Q&A.
	// Plugin streams Questions, CLI streams Answers.
	Communicate(context.Context, *connect.BidiStream[v01.Answer, v01.Question]) error
}

RuntimeHandler is an implementation of the codefly.services.runtime.v0.Runtime service.

type UnimplementedRuntimeHandler

type UnimplementedRuntimeHandler struct{}

UnimplementedRuntimeHandler returns CodeUnimplemented from all methods.

func (UnimplementedRuntimeHandler) Communicate

Jump to

Keyboard shortcuts

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