Documentation
¶
Index ¶
- type LambdaHandlerFunc
- type LambdaRequest
- type LambdaResponse
- type Restate
- func (r *Restate) Bidirectional(bidi bool) *Restate
- func (r *Restate) Bind(definition restate.ServiceDefinition) *Restate
- func (r *Restate) Handler() (http.HandlerFunc, error)
- func (r *Restate) LambdaHandler() (LambdaHandlerFunc, error)
- func (r *Restate) Start(ctx context.Context, address string) error
- func (r *Restate) WithIdentityV1(keys ...string) *Restate
- func (r *Restate) WithLogger(h slog.Handler, dropReplayLogs bool) *Restate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LambdaHandlerFunc ¶ added in v0.13.1
type LambdaHandlerFunc func(ctx context.Context, event LambdaRequest) (LambdaResponse, error)
type LambdaRequest ¶ added in v0.13.1
type LambdaResponse ¶ added in v0.13.1
type Restate ¶
type Restate struct {
// contains filtered or unexported fields
}
Restate represents a Restate HTTP handler to which services or virtual objects may be attached.
func (*Restate) Bidirectional ¶ added in v0.9.1
Bidirectional is used to change the protocol mode advertised to Restate on discovery In bidirectional mode, Restate will keep the request body open even after we have started to respond, allowing for more work to be done without suspending. This is supported over HTTP2 and, in some cases (where there is no buffering proxy), with HTTP1.1. When serving over a non-bidirectional channel (eg, Cloudflare Workers), use .Bidirectional(false) otherwise your handlers may get stuck.
func (*Restate) Bind ¶
func (r *Restate) Bind(definition restate.ServiceDefinition) *Restate
Bind attaches a Service Definition (a Service or Virtual Object) to this server
func (*Restate) Handler ¶ added in v0.9.1
func (r *Restate) Handler() (http.HandlerFunc, error)
Handler obtains a http.HandlerFunc representing the bound services which can be passed to other types of server. Ensure that .Bidirectional(false) is set when serving over a channel that doesn't support full-duplex request and response.
func (*Restate) LambdaHandler ¶ added in v0.13.1
func (r *Restate) LambdaHandler() (LambdaHandlerFunc, error)
LambdaHandler obtains a Lambda handler function representing the bound services .Bidirectional(false) will be set on your behalf as Lambda only supports request-response communication
func (*Restate) WithIdentityV1 ¶
WithIdentityV1 attaches v1 request identity public keys to this server. All incoming requests will be validated against one of these keys.
func (*Restate) WithLogger ¶
WithLogger overrides the slog handler used by the SDK (which defaults to the slog Default()) You may specify with dropReplayLogs whether to drop logs that originated from handler code while the invocation was replaying. If they are not dropped, you may still determine the replay status in a slog.Handler using github.com/restatedev/sdk-go/rcontext.LogContextFrom