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) OnReconcile(_ context.Context, node v1alpha1.TinyNode) error
- func (c *Component) OnSettings(_ context.Context, msg any) error
- func (c *Component) Ports() []module.Port
- type Config
- type Context
- type Data
- type ErrorOutput
- type Message
- type Output
- type Settings
Constants ¶
View Source
const ( ComponentName = "inject" ConfigPort = "config" MessagePort = "message" OutputPort = "output" ErrorPort = "error" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
Component implements config injection with metadata persistence
func (*Component) GetInfo ¶
func (c *Component) GetInfo() module.ComponentInfo
func (*Component) Handle ¶
Handle dispatches business ports (Config and Message). System ports go through capability methods.
func (*Component) OnReconcile ¶ added in v0.2.0
OnReconcile restores stored config from metadata, unless the config port already provided fresh data.
func (*Component) OnSettings ¶ added in v0.2.0
OnSettings receives Settings from the SettingsPort.
type Config ¶
type Config struct {
Data Data `json:"data" configurable:"true" required:"true" title:"Data" description:"Configuration data to inject into messages"`
}
Config is stored in metadata and injected into messages
type ErrorOutput ¶ added in v0.1.210
type ErrorOutput struct {
Context Context `json:"context" configurable:"true" title:"Context"`
Error string `json:"error" title:"Error"`
}
ErrorOutput is sent when config is required but not set
type Message ¶
type Message struct {
Context Context `json:"context" configurable:"true" title:"Context" description:"Passthrough context for correlation"`
}
Message passes through with config injected
Click to show internal directories.
Click to hide internal directories.