collect

package
v0.9.31 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentName = "collect"

	ItemPort     = "item"
	ResponsePort = "response"
	ErrorPort    = "error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	module.Base
	// contains filtered or unexported fields
}

Component buffers fanned-out items per group key in the node's State (survives restarts; multi-replica safe — same backing as kv) and emits the reassembled array once all items of a group have arrived.

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) module.Result

func (*Component) Instance

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

func (*Component) OnReconcile

func (c *Component) OnReconcile(_ context.Context, _ v1alpha1.TinyNode) error

OnReconcile is a no-op: the State backend handles cache freshness.

func (*Component) OnSettings

func (c *Component) OnSettings(_ context.Context, msg any) error

OnSettings receives Settings from the SettingsPort.

func (*Component) Ports

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

type Context

type Context any

Context is the passthrough payload. The group's Response carries the context of the LAST item to arrive for that group.

type ErrorMessage

type ErrorMessage struct {
	Context  Context `json:"context,omitempty" title:"Context" description:"Context of the group's last arriving item."`
	GroupKey string  `json:"groupKey" title:"Group Key"`
	Received int     `json:"received" title:"Received"`
	Total    int     `json:"total" title:"Total"`
	Error    string  `json:"error" title:"Error"`
}

ErrorMessage reports a group that timed out before completing.

type InMessage

type InMessage struct {
	Context  Context `` /* 163-byte string literal not displayed */
	GroupKey string  `` /* 243-byte string literal not displayed */
	Index    int     `` /* 180-byte string literal not displayed */
	Total    int     `` /* 175-byte string literal not displayed */
	Item     any     `json:"item" title:"Item" description:"The per-item payload to reassemble."`
}

InMessage is one fanned-out item to buffer.

type OutMessage

type OutMessage struct {
	Context Context `json:"context,omitempty" title:"Context" description:"Context of the group's last arriving item."`
	Items   []any   `json:"items" title:"Items" description:"All items of the group, ordered by index."`
}

OutMessage is the reassembled group.

type Settings

type Settings struct {
	EnableErrorPort bool `` /* 219-byte string literal not displayed */
	TimeoutSeconds  int  `` /* 260-byte string literal not displayed */
	MaxGroups       int  `` /* 156-byte string literal not displayed */
}

Settings configures the collector.

Jump to

Keyboard shortcuts

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