inject

package
v0.1.201 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentName = "inject"
	ConfigPort    = "config"
	MessagePort   = "message"
	OutputPort    = "output"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	// contains filtered or unexported fields
}

Component implements config injection with metadata persistence

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 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 Context added in v0.1.197

type Context any

type Data added in v0.1.198

type Data any

type Message

type Message struct {
	Context Context `json:"context,omitempty" configurable:"true" title:"Context" description:"Passthrough context for correlation"`
}

Message passes through with config injected

type Output

type Output struct {
	Context Context `json:"context,omitempty" configurable:"true" title:"Context"`
	Config  Data    `json:"config,omitempty" title:"Config" description:"Injected configuration from metadata"`
}

Output contains original context plus injected config

Jump to

Keyboard shortcuts

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