Documentation
¶
Index ¶
- Constants
- type Component
- func (t *Component) GetInfo() module.ComponentInfo
- func (t *Component) Handle(ctx context.Context, handler module.Handler, port string, msg interface{}) module.Result
- func (t *Component) Instance() module.Component
- func (t *Component) OnSettings(_ context.Context, msg any) error
- func (t *Component) Ports() []module.Port
- type Condition
- type Context
- type InMessage
- type OutMessage
- type RouteName
- type Settings
Constants ¶
const ( ComponentName = "router" InPort = "input" DefaultPort = "default" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
func (*Component) GetInfo ¶
func (t *Component) GetInfo() module.ComponentInfo
func (*Component) Handle ¶
func (t *Component) Handle(ctx context.Context, handler module.Handler, port string, msg interface{}) module.Result
Handle routes business-port input to the matching output. The router has no other system port logic — settings/control/reconcile dispatch live in the capability methods.
func (*Component) OnSettings ¶ added in v0.2.0
OnSettings receives Settings from the SettingsPort.
type OutMessage ¶ added in v0.7.18
type OutMessage struct {
Context Context `json:"context" configurable:"true" title:"Context" description:"Passthrough — the routed message, unchanged"`
}
OutMessage is what each out_<route> port emits. The passthrough Context is kept UNDER a `context` key — same shape every other component uses — so a downstream edge reads `$.context.<field>` consistently, instead of `$.field` off a bare root. (Previously the port emitted the raw Context value at root, which meant router branches were the one place you dropped the `.context` segment — a silent mismatch that validated green but resolved null.)
type RouteName ¶
RouteName special type which can carry its value and possible options for enum values
func (*RouteName) JSONSchema ¶
func (r *RouteName) JSONSchema() (jsonschema.Schema, error)
func (*RouteName) MarshalJSON ¶
MarshalJSON treat like underlying Value string
func (*RouteName) UnmarshalJSON ¶
UnmarshalJSON treat like underlying Value string