Documentation
¶
Index ¶
- Constants
- func NewHostServiceHandler(svc HostServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- func NewWorkloadServiceHandler(svc WorkloadServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type HostServiceClient
- type HostServiceHandler
- type UnimplementedHostServiceHandler
- type UnimplementedWorkloadServiceHandler
- func (UnimplementedWorkloadServiceHandler) WorkloadStart(context.Context, *connect.Request[v2.WorkloadStartRequest]) (*connect.Response[v2.WorkloadStartResponse], error)
- func (UnimplementedWorkloadServiceHandler) WorkloadStatus(context.Context, *connect.Request[v2.WorkloadStatusRequest]) (*connect.Response[v2.WorkloadStatusResponse], error)
- func (UnimplementedWorkloadServiceHandler) WorkloadStop(context.Context, *connect.Request[v2.WorkloadStopRequest]) (*connect.Response[v2.WorkloadStopResponse], error)
- type WorkloadServiceClient
- type WorkloadServiceHandler
Constants ¶
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.
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.
const (
// HostServiceName is the fully-qualified name of the HostService service.
HostServiceName = "wasmcloud.runtime.v2.HostService"
)
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.
type UnimplementedWorkloadServiceHandler ¶
type UnimplementedWorkloadServiceHandler struct{}
UnimplementedWorkloadServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedWorkloadServiceHandler) WorkloadStart ¶
func (UnimplementedWorkloadServiceHandler) WorkloadStart(context.Context, *connect.Request[v2.WorkloadStartRequest]) (*connect.Response[v2.WorkloadStartResponse], error)
func (UnimplementedWorkloadServiceHandler) WorkloadStatus ¶
func (UnimplementedWorkloadServiceHandler) WorkloadStatus(context.Context, *connect.Request[v2.WorkloadStatusRequest]) (*connect.Response[v2.WorkloadStatusResponse], error)
func (UnimplementedWorkloadServiceHandler) WorkloadStop ¶
func (UnimplementedWorkloadServiceHandler) WorkloadStop(context.Context, *connect.Request[v2.WorkloadStopRequest]) (*connect.Response[v2.WorkloadStopResponse], error)
type WorkloadServiceClient ¶
type WorkloadServiceClient interface {
WorkloadStart(context.Context, *connect.Request[v2.WorkloadStartRequest]) (*connect.Response[v2.WorkloadStartResponse], error)
WorkloadStatus(context.Context, *connect.Request[v2.WorkloadStatusRequest]) (*connect.Response[v2.WorkloadStatusResponse], error)
WorkloadStop(context.Context, *connect.Request[v2.WorkloadStopRequest]) (*connect.Response[v2.WorkloadStopResponse], error)
}
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 ¶
type WorkloadServiceHandler interface {
WorkloadStart(context.Context, *connect.Request[v2.WorkloadStartRequest]) (*connect.Response[v2.WorkloadStartResponse], error)
WorkloadStatus(context.Context, *connect.Request[v2.WorkloadStatusRequest]) (*connect.Response[v2.WorkloadStatusResponse], error)
WorkloadStop(context.Context, *connect.Request[v2.WorkloadStopRequest]) (*connect.Response[v2.WorkloadStopResponse], error)
}
WorkloadServiceHandler is an implementation of the wasmcloud.runtime.v2.WorkloadService service.
Source Files
¶
- host_service.connect.go
- workload_service.connect.go