arrayget

package
v0.1.217 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func (c *Component) Handle(ctx context.Context, handler module.Handler, port string, msg any) any

func (*Component) Instance

func (c *Component) Instance() module.Component

func (*Component) Ports

func (c *Component) Ports() []module.Port

type Context

type Context any

Context type alias for schema generation

type Error

type Error struct {
	Context Context `json:"context,omitempty" configurable:"true" title:"Context"`
	Error   string  `json:"error" title:"Error"`
}

Error output

type Item

type Item any

Item type alias for schema generation

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

type Settings

type Settings struct {
	EnableErrorPort bool `json:"enableErrorPort" title:"Enable Error Port" description:"Output errors to error port instead of failing"`
}

Settings configures the component

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL