Documentation
¶
Index ¶
- Constants
- type Component
- func (c *Component) GetInfo() module.ComponentInfo
- func (c *Component) Handle(ctx context.Context, _ module.Handler, port string, msg any) module.Result
- func (c *Component) Instance() module.Component
- func (c *Component) OnControl(ctx context.Context, msg any) error
- func (c *Component) OnSettings(_ context.Context, msg any) error
- func (c *Component) Ports() []module.Port
- type Context
- type Reply
- type Request
- type Settings
Constants ¶
View Source
const ( ComponentName = "ask" RequestPort = "request" OutPort = "out" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
func (*Component) GetInfo ¶
func (c *Component) GetInfo() module.ComponentInfo
func (*Component) Handle ¶
func (c *Component) Handle(ctx context.Context, _ module.Handler, port string, msg any) module.Result
Handle opens the gate. It returns immediately: the run does not stay parked waiting for a human. Continuity lives in this node's published form, and the answer arrives later as a separate control message that starts the downstream hop itself.
type Context ¶
type Context any
Context is the passthrough payload — whatever the flow was carrying when it reached the gate. It rides through the human's decision unchanged so the downstream action knows what it is acting on.
type Reply ¶
type Reply struct {
Values map[string]interface{} `json:"values" title:"Values" description:"What the human submitted, keyed by the form's field names."`
Context Context `json:"context,omitempty" title:"Context" description:"The request payload, unchanged."`
}
Reply is emitted once a human submits the form.
type Request ¶
type Request struct {
Context Context `` /* 152-byte string literal not displayed */
}
Request is what the flow sends to open the gate. The form is fixed by Settings; this carries the thing being decided on.
type Settings ¶
type Settings struct {
// Form is a JSON Schema rendered as the question put to the human. It is
// authored here rather than derived from a Go type, which is the whole
// point: the same component asks "approve this restart?" or "how many
// replicas?" depending on what is written here.
Form string `` /* 234-byte string literal not displayed */
}
Click to show internal directories.
Click to hide internal directories.