signal

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentName        = "signal"
	OutPort       string = "out"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

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

func (*Component) GetInfo

func (t *Component) GetInfo() module.ComponentInfo

func (*Component) Handle

func (t *Component) Handle(_ context.Context, _ module.Handler, port string, _ any) module.Result

Handle is unreachable: OutPort is source-only, no business input.

func (*Component) Instance

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

func (*Component) OnControl added in v0.2.0

func (t *Component) OnControl(ctx context.Context, msg any) error

OnControl handles the Send button. It emits the payload once on Out and returns — no state, no Reset. The Out emit is a request/reply to the downstream pod; nothing here waits on or can stop it, so it runs detached on a background context.

func (*Component) OnSettings added in v0.2.0

func (t *Component) OnSettings(ctx context.Context, msg any) error

OnSettings receives Settings from the SettingsPort, resolving any `{{secret:<name>/<key>}}` placeholders in Context against Kubernetes Secrets in the module pod's namespace (requires the module installed with secrets.enabled=true). Skipped if the K8s client hasn't arrived yet; the next settings message after OnClient re-resolves.

func (*Component) Ports

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

type Context

type Context any

type Control

type Control struct {
	Context Context `json:"context" required:"true" title:"Context"`
	Send    bool    `json:"send" format:"button" title:"Send" required:"true"`
}

Control is the _control port schema: a single Send button. Signal is a fire-and-forget trigger — there is no "running" state and no Reset, because the distributed runtime can't stop downstream work by cancelling a context (see [[distributed-control-plane]]). To stop something a Signal started, wire a Stop-capable component downstream (e.g. http_server's Stop port).

type Settings

type Settings struct {
	Context Context `json:"context" required:"true" configurable:"true" title:"Context" description:"Arbitrary message to send"`
}

Jump to

Keyboard shortcuts

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