inject

package
v0.1.210 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 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 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 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

type Output

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

Output contains original context plus injected config

type Settings

type Settings struct {
	ConfigRequired bool `` /* 157-byte string literal not displayed */
}

Jump to

Keyboard shortcuts

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