instance

package
v1.19.0-rc.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapInitFailure

func WrapInitFailure(comp compapi.Component, err error) error

WrapInitFailure formats Init errors in the legacy shape so callers (and tests) see the same string they did before the refactor.

Types

type Instance

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

Instance is the per-named-component loop handler.

func New

func New(opts Options) *Instance

func (*Instance) Handle

func (i *Instance) Handle(ctx context.Context, e loops.EventInstance) error

Handle is the loop handler.

func (*Instance) Loop

Loop returns the underlying loop interface. Callers enqueue instance events through it.

type Manager

type Manager interface {
	Init(ctx context.Context, comp compapi.Component) error
	Close(comp compapi.Component) error
}

Manager performs Init/Close on a single named component. Per-category sub-processors (binding, pubsub, state, secret, ...) satisfy this interface.

type Options

type Options struct {
	Manager   Manager
	CompStore *compstore.ComponentStore
	Reporter  registry.Reporter
	Security  security.Handler
	// AlsoStartInput is set when Init for this category should also start the
	// input pipe (bindings: true when readingBindings is set when Init runs).
	AlsoStartInput bool
}

type PostInit

type PostInit interface {
	StartInput(ctx context.Context, comp compapi.Component) error
	StopInput(comp compapi.Component)
}

PostInit is an optional capability for managers that need to run additional per-instance work after Init succeeds (e.g. bindings starting their input pipe when the category is reading). The Instance dispatches StartInput / StopInput events to managers implementing this interface.

Jump to

Keyboard shortcuts

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