Documentation
¶
Index ¶
- Constants
- func NewDispatchServiceHandler(svc DispatchServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- func NewFunctionServiceHandler(svc FunctionServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type DispatchServiceClient
- type DispatchServiceHandler
- type FunctionServiceClient
- type FunctionServiceHandler
- type UnimplementedDispatchServiceHandler
- type UnimplementedFunctionServiceHandler
Constants ¶
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.
const (
// DispatchServiceName is the fully-qualified name of the DispatchService service.
DispatchServiceName = "dispatch.sdk.v1.DispatchService"
)
const (
// FunctionServiceName is the fully-qualified name of the FunctionService service.
FunctionServiceName = "dispatch.sdk.v1.FunctionService"
)
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 ¶
func (UnimplementedDispatchServiceHandler) Dispatch(context.Context, *connect.Request[v1.DispatchRequest]) (*connect.Response[v1.DispatchResponse], error)
type UnimplementedFunctionServiceHandler ¶
type UnimplementedFunctionServiceHandler struct{}
UnimplementedFunctionServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedFunctionServiceHandler) Run ¶
func (UnimplementedFunctionServiceHandler) Run(context.Context, *connect.Request[v1.RunRequest]) (*connect.Response[v1.RunResponse], error)