sdkv1connect

package
v1.15.0-20240227184845... Latest Latest
Warning

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

Go to latest
Published: unknown License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DispatchServiceDispatchProcedure is the fully-qualified name of the DispatchService's Dispatch
	// RPC.
	DispatchServiceDispatchProcedure = "/dispatch.sdk.v1.DispatchService/Dispatch"
)

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 (
	// DispatchServiceName is the fully-qualified name of the DispatchService service.
	DispatchServiceName = "dispatch.sdk.v1.DispatchService"
)
View Source
const (
	// FunctionServiceName is the fully-qualified name of the FunctionService service.
	FunctionServiceName = "dispatch.sdk.v1.FunctionService"
)
View Source
const (
	// FunctionServiceRunProcedure is the fully-qualified name of the FunctionService's Run RPC.
	FunctionServiceRunProcedure = "/dispatch.sdk.v1.FunctionService/Run"
)

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 NewDispatchServiceHandler

func NewDispatchServiceHandler(svc DispatchServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewDispatchServiceHandler 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 NewFunctionServiceHandler

func NewFunctionServiceHandler(svc FunctionServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewFunctionServiceHandler 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 DispatchServiceClient

type DispatchServiceClient interface {
	// Dispatch submits a list of asynchronous function calls to the service.
	//
	// The method does not wait for executions to complete before returning,
	// it only ensures that the creation was persisted, and returns unique
	// identifiers to represent the executions.
	//
	// The request contains a list of executions to be triggered; the method is
	// atomic, either all executions are recorded, or none and an error is
	// returned to explain the reason for the failure.
	Dispatch(context.Context, *connect.Request[v1.DispatchRequest]) (*connect.Response[v1.DispatchResponse], error)
}

DispatchServiceClient is a client for the dispatch.sdk.v1.DispatchService service.

func NewDispatchServiceClient

func NewDispatchServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) DispatchServiceClient

NewDispatchServiceClient constructs a client for the dispatch.sdk.v1.DispatchService 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 DispatchServiceHandler

type DispatchServiceHandler interface {
	// Dispatch submits a list of asynchronous function calls to the service.
	//
	// The method does not wait for executions to complete before returning,
	// it only ensures that the creation was persisted, and returns unique
	// identifiers to represent the executions.
	//
	// The request contains a list of executions to be triggered; the method is
	// atomic, either all executions are recorded, or none and an error is
	// returned to explain the reason for the failure.
	Dispatch(context.Context, *connect.Request[v1.DispatchRequest]) (*connect.Response[v1.DispatchResponse], error)
}

DispatchServiceHandler is an implementation of the dispatch.sdk.v1.DispatchService service.

type FunctionServiceClient

type FunctionServiceClient interface {
	// Run runs the function identified by the request, and returns a response
	// that either contains a result when the function completed, or a poll
	// directive and the associated coroutine state if the function was suspended.
	Run(context.Context, *connect.Request[v1.RunRequest]) (*connect.Response[v1.RunResponse], error)
}

FunctionServiceClient is a client for the dispatch.sdk.v1.FunctionService service.

func NewFunctionServiceClient

func NewFunctionServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) FunctionServiceClient

NewFunctionServiceClient constructs a client for the dispatch.sdk.v1.FunctionService 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 FunctionServiceHandler

type FunctionServiceHandler interface {
	// Run runs the function identified by the request, and returns a response
	// that either contains a result when the function completed, or a poll
	// directive and the associated coroutine state if the function was suspended.
	Run(context.Context, *connect.Request[v1.RunRequest]) (*connect.Response[v1.RunResponse], error)
}

FunctionServiceHandler is an implementation of the dispatch.sdk.v1.FunctionService service.

type UnimplementedDispatchServiceHandler

type UnimplementedDispatchServiceHandler struct{}

UnimplementedDispatchServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedDispatchServiceHandler) Dispatch

type UnimplementedFunctionServiceHandler

type UnimplementedFunctionServiceHandler struct{}

UnimplementedFunctionServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedFunctionServiceHandler) Run

Jump to

Keyboard shortcuts

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