Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- type ClientGoneAway
- type Context
- func (c *Context) After(d time.Duration) *futures.After
- func (c *Context) Awakeable(opts ...options.AwakeableOption) DecodingAwakeable
- func (c *Context) Clear(key string)
- func (c *Context) ClearAll()
- func (c *Context) Get(key string, output any, opts ...options.GetOption) (bool, error)
- func (c *Context) Key() string
- func (c *Context) Keys() ([]string, error)
- func (c *Context) Log() *slog.Logger
- func (c *Context) Object(service, key, method string, opts ...options.ClientOption) *Client
- func (c *Context) Promise(key string, opts ...options.PromiseOption) DecodingPromise
- func (c *Context) Rand() *rand.Rand
- func (c *Context) RejectAwakeable(id string, reason error)
- func (c *Context) Request() *Request
- func (c *Context) ResolveAwakeable(id string, value any, opts ...options.ResolveAwakeableOption)
- func (c *Context) Run(fn func(ctx RunContext) (any, error), output any, opts ...options.RunOption) error
- func (c *Context) Select(futs ...futures.Selectable) *selector
- func (c *Context) Service(service, method string, opts ...options.ClientOption) *Client
- func (c *Context) Set(key string, value any, opts ...options.SetOption)
- func (c *Context) Sleep(d time.Duration) error
- func (c *Context) Workflow(service, workflowID, method string, opts ...options.ClientOption) *Client
- type DecodingAwakeable
- type DecodingPromise
- type DecodingResponseFuture
- type Handler
- type Machine
- type Request
- type RunContext
Constants ¶
View Source
const (
Version = 1
)
Variables ¶
View Source
var (
ErrInvalidVersion = fmt.Errorf("invalid version number")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.11.0
type Client struct {
// contains filtered or unexported fields
}
func (*Client) RequestFuture ¶ added in v0.11.0
func (c *Client) RequestFuture(input any, opts ...options.RequestOption) DecodingResponseFuture
RequestFuture makes a call and returns a handle on the response
type ClientGoneAway ¶ added in v0.11.0
type ClientGoneAway struct {
// contains filtered or unexported fields
}
type Context ¶
func (*Context) Awakeable ¶
func (c *Context) Awakeable(opts ...options.AwakeableOption) DecodingAwakeable
func (*Context) Object ¶
func (c *Context) Object(service, key, method string, opts ...options.ClientOption) *Client
func (*Context) Promise ¶ added in v0.12.0
func (c *Context) Promise(key string, opts ...options.PromiseOption) DecodingPromise
func (*Context) RejectAwakeable ¶
func (*Context) ResolveAwakeable ¶
func (c *Context) ResolveAwakeable(id string, value any, opts ...options.ResolveAwakeableOption)
func (*Context) Select ¶
func (c *Context) Select(futs ...futures.Selectable) *selector
type DecodingAwakeable ¶ added in v0.11.0
func (DecodingAwakeable) Id ¶ added in v0.11.0
func (d DecodingAwakeable) Id() string
func (DecodingAwakeable) Result ¶ added in v0.11.0
func (d DecodingAwakeable) Result(output any) (err error)
type DecodingPromise ¶ added in v0.12.0
func (DecodingPromise) Peek ¶ added in v0.12.0
func (d DecodingPromise) Peek(output any) (ok bool, err error)
func (DecodingPromise) Reject ¶ added in v0.12.0
func (d DecodingPromise) Reject(reason error) error
func (DecodingPromise) Resolve ¶ added in v0.12.0
func (d DecodingPromise) Resolve(value any) error
func (DecodingPromise) Result ¶ added in v0.12.0
func (d DecodingPromise) Result(output any) (err error)
type DecodingResponseFuture ¶ added in v0.11.0
type DecodingResponseFuture struct {
*futures.ResponseFuture
// contains filtered or unexported fields
}
func (DecodingResponseFuture) Response ¶ added in v0.11.0
func (d DecodingResponseFuture) Response(output any) (err error)
type Handler ¶ added in v0.11.0
type Handler interface {
GetOptions() *options.HandlerOptions
InputPayload() *encoding.InputPayload
OutputPayload() *encoding.OutputPayload
HandlerType() *internal.ServiceHandlerType
Call(ctx *Context, request []byte) (output []byte, err error)
}
Handler is implemented by all Restate handlers
type Request ¶ added in v0.11.0
type Request struct {
// The unique id that identifies the current function invocation. This id is guaranteed to be
// unique across invocations, but constant across reties and suspensions.
ID []byte
// Request headers - the following headers capture the original invocation headers, as provided to
// the ingress.
Headers map[string]string
// Attempt headers - the following headers are sent by the restate runtime.
// These headers are attempt specific, generated by the restate runtime uniquely for each attempt.
// These headers might contain information such as the W3C trace context, and attempt specific information.
AttemptHeaders map[string][]string
// Raw unparsed request body
Body []byte
}
type RunContext ¶ added in v0.11.0
func (RunContext) Log ¶ added in v0.11.0
func (r RunContext) Log() *slog.Logger
func (RunContext) Request ¶ added in v0.11.0
func (r RunContext) Request() *Request
Click to show internal directories.
Click to hide internal directories.