Documentation
¶
Index ¶
- type Restate
- func (r *Restate) Bidirectional(bidi bool) *Restate
- func (r *Restate) Bind(router restate.Router) *Restate
- func (r *Restate) Handler() (http.HandlerFunc, 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 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, Lambda), use .WithBidirectional(false) otherwise your handlers may get stuck.
func (*Restate) Handler ¶ added in v0.9.1
func (r *Restate) Handler() (http.HandlerFunc, error)
Handler obtains a http.HandlerFunc representing the bound routers 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) 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