Documentation ¶
Overview ¶
Restate built-in services. This package contains the definition of Restate built-in services. To invoke them, check out the documentation: https://docs.restate.dev/services/invocation
Index ¶
- Constants
- func NewAwakeablesHandler(svc AwakeablesHandler, opts ...connect.HandlerOption) (string, http.Handler)
- func NewIngressHandler(svc IngressHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type AwakeablesClient
- type AwakeablesHandler
- type IngressClient
- type IngressHandler
- type UnimplementedAwakeablesHandler
- func (UnimplementedAwakeablesHandler) Reject(context.Context, *connect.Request[restate.RejectAwakeableRequest]) (*connect.Response[emptypb.Empty], error)
- func (UnimplementedAwakeablesHandler) Resolve(context.Context, *connect.Request[restate.ResolveAwakeableRequest]) (*connect.Response[emptypb.Empty], error)
- type UnimplementedIngressHandler
Constants ¶
const ( // IngressName is the fully-qualified name of the Ingress service. IngressName = "dev.restate.Ingress" // AwakeablesName is the fully-qualified name of the Awakeables service. AwakeablesName = "dev.restate.Awakeables" )
const ( // IngressInvokeProcedure is the fully-qualified name of the Ingress's Invoke RPC. IngressInvokeProcedure = "/dev.restate.Ingress/Invoke" // AwakeablesResolveProcedure is the fully-qualified name of the Awakeables's Resolve RPC. AwakeablesResolveProcedure = "/dev.restate.Awakeables/Resolve" // AwakeablesRejectProcedure is the fully-qualified name of the Awakeables's Reject RPC. AwakeablesRejectProcedure = "/dev.restate.Awakeables/Reject" )
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 NewAwakeablesHandler ¶
func NewAwakeablesHandler(svc AwakeablesHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewAwakeablesHandler 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 NewIngressHandler ¶
func NewIngressHandler(svc IngressHandler, opts ...connect.HandlerOption) (string, http.Handler)
NewIngressHandler 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 AwakeablesClient ¶
type AwakeablesClient interface { // Resolve an Awakeable with a result value. Resolve(context.Context, *connect.Request[restate.ResolveAwakeableRequest]) (*connect.Response[emptypb.Empty], error) // Reject an Awakeable with a reason. Reject(context.Context, *connect.Request[restate.RejectAwakeableRequest]) (*connect.Response[emptypb.Empty], error) }
AwakeablesClient is a client for the dev.restate.Awakeables service.
func NewAwakeablesClient ¶
func NewAwakeablesClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AwakeablesClient
NewAwakeablesClient constructs a client for the dev.restate.Awakeables 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 AwakeablesHandler ¶
type AwakeablesHandler interface { // Resolve an Awakeable with a result value. Resolve(context.Context, *connect.Request[restate.ResolveAwakeableRequest]) (*connect.Response[emptypb.Empty], error) // Reject an Awakeable with a reason. Reject(context.Context, *connect.Request[restate.RejectAwakeableRequest]) (*connect.Response[emptypb.Empty], error) }
AwakeablesHandler is an implementation of the dev.restate.Awakeables service.
type IngressClient ¶
type IngressClient interface { // Invoke a service and don't wait for the response. // It is guaranteed that the service will be invoked after this method returns. Invoke(context.Context, *connect.Request[restate.InvokeRequest]) (*connect.Response[restate.InvokeResponse], error) }
IngressClient is a client for the dev.restate.Ingress service.
func NewIngressClient ¶
func NewIngressClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) IngressClient
NewIngressClient constructs a client for the dev.restate.Ingress 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 IngressHandler ¶
type IngressHandler interface { // Invoke a service and don't wait for the response. // It is guaranteed that the service will be invoked after this method returns. Invoke(context.Context, *connect.Request[restate.InvokeRequest]) (*connect.Response[restate.InvokeResponse], error) }
IngressHandler is an implementation of the dev.restate.Ingress service.
type UnimplementedAwakeablesHandler ¶
type UnimplementedAwakeablesHandler struct{}
UnimplementedAwakeablesHandler returns CodeUnimplemented from all methods.
func (UnimplementedAwakeablesHandler) Reject ¶
type UnimplementedIngressHandler ¶
type UnimplementedIngressHandler struct{}
UnimplementedIngressHandler returns CodeUnimplemented from all methods.
func (UnimplementedIngressHandler) Invoke ¶
func (UnimplementedIngressHandler) Invoke(context.Context, *connect.Request[restate.InvokeRequest]) (*connect.Response[restate.InvokeResponse], error)