inject

package
v0.1.150 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

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

Component implements config injection

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 any `json:"data" configurable:"true" required:"true" title:"Data" description:"Configuration data to inject into messages"`
}

Config is stored and injected into messages

type Error

type Error struct {
	Context any     `json:"context,omitempty" title:"Context"`
	Error   string  `json:"error" title:"Error"`
	Message Message `json:"message" title:"Message"`
}

Error output

type Message

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

Message passes through with config injected

type Output

type Output struct {
	Context any `json:"context,omitempty" title:"Context"`
	Data    any `json:"data,omitempty" title:"Data" description:"Original message data"`
	Config  any `json:"config,omitempty" title:"Config" description:"Injected configuration"`
}

Output contains original message plus injected config

type Settings

type Settings struct {
	EnableErrorPort bool `json:"enableErrorPort" title:"Enable Error Port" description:"Output errors to error port instead of failing"`
}

Settings - only port flags

Jump to

Keyboard shortcuts

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