v2connect

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// WorkloadServiceWorkloadStartProcedure is the fully-qualified name of the WorkloadService's
	// WorkloadStart RPC.
	WorkloadServiceWorkloadStartProcedure = "/wasmcloud.runtime.v2.WorkloadService/WorkloadStart"
	// WorkloadServiceWorkloadStatusProcedure is the fully-qualified name of the WorkloadService's
	// WorkloadStatus RPC.
	WorkloadServiceWorkloadStatusProcedure = "/wasmcloud.runtime.v2.WorkloadService/WorkloadStatus"
	// WorkloadServiceWorkloadStopProcedure is the fully-qualified name of the WorkloadService's
	// WorkloadStop RPC.
	WorkloadServiceWorkloadStopProcedure = "/wasmcloud.runtime.v2.WorkloadService/WorkloadStop"
)

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 (
	// HostServiceHostHeartbeatProcedure is the fully-qualified name of the HostService's HostHeartbeat
	// RPC.
	HostServiceHostHeartbeatProcedure = "/wasmcloud.runtime.v2.HostService/HostHeartbeat"
)

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 (
	// HostServiceName is the fully-qualified name of the HostService service.
	HostServiceName = "wasmcloud.runtime.v2.HostService"
)
View Source
const (
	// WorkloadServiceName is the fully-qualified name of the WorkloadService service.
	WorkloadServiceName = "wasmcloud.runtime.v2.WorkloadService"
)

Variables

This section is empty.

Functions

func NewHostServiceHandler

func NewHostServiceHandler(svc HostServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewHostServiceHandler 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 NewWorkloadServiceHandler

func NewWorkloadServiceHandler(svc WorkloadServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewWorkloadServiceHandler 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 HostServiceClient

type HostServiceClient interface {
	// Periodic heartbeat
	// This information is used by the Runtime Operator to monitor the health of the Wasm Host & make placement decisions.
	HostHeartbeat(context.Context, *connect.Request[v2.HostHeartbeatRequest]) (*connect.Response[emptypb.Empty], error)
}

HostServiceClient is a client for the wasmcloud.runtime.v2.HostService service.

func NewHostServiceClient

func NewHostServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) HostServiceClient

NewHostServiceClient constructs a client for the wasmcloud.runtime.v2.HostService 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 HostServiceHandler

type HostServiceHandler interface {
	// Periodic heartbeat
	// This information is used by the Runtime Operator to monitor the health of the Wasm Host & make placement decisions.
	HostHeartbeat(context.Context, *connect.Request[v2.HostHeartbeatRequest]) (*connect.Response[emptypb.Empty], error)
}

HostServiceHandler is an implementation of the wasmcloud.runtime.v2.HostService service.

type UnimplementedHostServiceHandler

type UnimplementedHostServiceHandler struct{}

UnimplementedHostServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedHostServiceHandler) HostHeartbeat

type UnimplementedWorkloadServiceHandler

type UnimplementedWorkloadServiceHandler struct{}

UnimplementedWorkloadServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedWorkloadServiceHandler) WorkloadStart

func (UnimplementedWorkloadServiceHandler) WorkloadStatus

func (UnimplementedWorkloadServiceHandler) WorkloadStop

type WorkloadServiceClient

WorkloadServiceClient is a client for the wasmcloud.runtime.v2.WorkloadService service.

func NewWorkloadServiceClient

func NewWorkloadServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) WorkloadServiceClient

NewWorkloadServiceClient constructs a client for the wasmcloud.runtime.v2.WorkloadService 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 WorkloadServiceHandler

WorkloadServiceHandler is an implementation of the wasmcloud.runtime.v2.WorkloadService service.

Source Files

  • host_service.connect.go
  • workload_service.connect.go

Jump to

Keyboard shortcuts

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