root

package
v1.19.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultComponentInitTimeout = time.Second * 5

DefaultComponentInitTimeout is the init deadline applied to a component whose spec does not set a valid InitTimeout. It is exported so the processor's inline (test) init path applies the same default.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	CompStore *compstore.ComponentStore

	// Categories maps a category to its category loop. The root looks up by
	// category prefix on the component's Spec.Type.
	Categories map[components.Category]loop.Interface[loops.EventCategory]

	// PubSubCategory is the pubsub category loop. Subscription resource
	// events are routed there.
	PubSubCategory loop.Interface[loops.EventCategory]

	// Secret resolves references on incoming resources.
	Secret SecretProcessor

	// KubernetesMode is true when running in Kubernetes mode. Used by
	// MCPServer security validation to reject configurations that are unsafe
	// in a cluster.
	KubernetesMode bool

	// RegisterMCPServer registers any in-process workflows backing an MCP
	// server. nil-safe: if no workflow registrar has been installed yet, the
	// callback is a no-op. Called from inside the root loop's Handle.
	RegisterMCPServer func(ctx context.Context, s mcpserverapi.MCPServer) error

	// UnregisterMCPServer is the inverse of RegisterMCPServer.
	UnregisterMCPServer func(name string)
}

Options configures the root loop.

type Root

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

Root is the processor's root loop handler.

func New

func New(opts Options) *Root

func (*Root) Handle

func (r *Root) Handle(ctx context.Context, e loops.EventRoot) error

Handle dispatches every event the root loop receives. The bodies of the per-resource cases live in sibling files (component.go, httpendpoint.go, mcpserver.go).

func (*Root) Loop

func (r *Root) Loop() loop.Interface[loops.EventRoot]

Loop returns the underlying root loop. External callers enqueue events through it.

func (*Root) Run

func (r *Root) Run(ctx context.Context) error

Run starts the root loop. Returns when the loop is closed.

type SecretProcessor

type SecretProcessor interface {
	ProcessResource(ctx context.Context, r meta.Resource) (bool, string)
}

SecretProcessor resolves secret references on a resource. The root uses it to (a) preprocess incoming components for unresolved secret-store dependencies and (b) resolve secrets on HTTPEndpoint and MCPServer resources.

Jump to

Keyboard shortcuts

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