Documentation
¶
Overview ¶
Package payload renders the payloads in tool responses. Payloads are Temporal's customer application data, such as workflow inputs and results, memos, heartbeat details and failure details. Each target's payload_handling says how a response shows them: omitted, passed through as stored, or decoded by the target's codec server.
A tool adds each payload of a response to one Batch, which returns the Field that stands for the payload in the response, and then renders the Batch once, which fills in every Field with at most one codec request.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
A Batch holds the payloads of one tool response, so that they are rendered together.
func (*Batch) Add ¶
Add adds p to b and returns the Field that stands for it, which stays empty until Render.
func (*Batch) AddAll ¶
AddAll adds each of ps to b and returns the Fields that stand for them, in order; the slice is empty but not nil when ps has no payloads.
func (*Batch) Render ¶
Render fills in the Field of each payload in b as the target's payload_handling says. To decode, it sends every payload to the codec server in one request; each payload it cannot decode is omitted with reason decode_failed and an error that says why, and the cause goes to the log. Render returns an error only when ctx ends before the payloads are decoded.
type Field ¶
type Field struct {
Handling string `json:"handling" jsonschema:"decoded, passthrough or omitted"`
Value any `` /* 164-byte string literal not displayed */
Encoding *string `` /* 297-byte string literal not displayed */
Data *string `` /* 183-byte string literal not displayed */
SizeBytes *int `` /* 140-byte string literal not displayed */
Reason string `` /* 178-byte string literal not displayed */
Error string `` /* 178-byte string literal not displayed */
}
Field is a payload in a tool response. Batch.Render fills it in.
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer renders the payloads of each target's tool responses.
func NewRenderer ¶
NewRenderer returns the Renderer for cfg's targets. logger gets the cause of each payload that is not decoded.
func (*Renderer) CheckCodec ¶
CheckCodec sends the codec server of the named target, which must decode payloads, a decode request with no payloads, and returns why it failed, worded for agents, or "" if it succeeded. The cause of a failure goes to the log.