Documentation
¶
Index ¶
- Constants
- type Component
- func (c *Component) GetInfo() module.ComponentInfo
- func (c *Component) Handle(ctx context.Context, handler module.Handler, port string, msg any) any
- func (c *Component) Instance() module.Component
- func (c *Component) OnSettings(_ context.Context, msg any) error
- func (c *Component) Ports() []module.Port
- type Context
- type Error
- type Item
- type Request
- type Result
- type Settings
Constants ¶
View Source
const ( ComponentName = "array_get" RequestPort = "request" ResultPort = "result" ErrorPort = "error" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
Component implements the array element accessor
func (*Component) GetInfo ¶
func (c *Component) GetInfo() module.ComponentInfo
func (*Component) Handle ¶
Handle dispatches business-port messages. System ports are routed via the capability interfaces above.
func (*Component) OnSettings ¶ added in v0.2.0
OnSettings receives Settings from the SettingsPort.
type Error ¶
type Error struct {
Context Context `json:"context,omitempty" configurable:"true" title:"Context"`
Error string `json:"error" title:"Error"`
}
Error output
type Request ¶
type Request struct {
Context Context `json:"context,omitempty" configurable:"true" title:"Context" description:"Arbitrary context to pass through"`
Array []Item `json:"array" required:"true" configurable:"true" title:"Array" description:"Array to get element from"`
Index int `json:"index" required:"true" title:"Index" description:"1-based item number"`
}
Request is the input to get an array element
type Result ¶
type Result struct {
Context Context `json:"context,omitempty" configurable:"true" title:"Context"`
Item Item `json:"item" configurable:"true" title:"Item"`
Index int `json:"index" title:"Index" description:"1-based index of the returned item"`
}
Result is the output with the resolved element
Click to show internal directories.
Click to hide internal directories.