runtime

package
v1.10.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package runtime owns the plugin-lifecycle composition root for the daemon binary. Holds the coreapi.ServiceRegistry, constructs the daemon-side adapters that satisfy plugin Deps (Streams, EventBus, Identity, Polo), and registers/starts/stops L11 services.

Lives outside pkg/daemon (L7) so daemon stays free of pkg/coreapi (L10) imports — that's T7.1 in docs/architecture/04-EXTRACTION.md. Imports both pkg/daemon and pkg/coreapi (downward edges, allowed).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsDaemonPolicyManager

func AsDaemonPolicyManager(pm coreapi.PolicyManager) daemon.PolicyManager

AsDaemonPolicyManager adapts a coreapi.PolicyManager (returned by plugins/policy.Service.Manager()) to daemon.PolicyManager. The two interfaces have identical method shapes; the adapter does the PolicyRunner element-type conversion on All() and Get().

Types

type Runtime

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

Runtime owns the plugin-side glue for a single daemon. cmd/daemon constructs one, registers L11 services, then calls StartPlugins after Daemon.Start (so regConn etc. are wired) and StopPlugins before Daemon.Stop.

func New

func New(d *daemon.Daemon) *Runtime

New returns a Runtime bound to the given daemon. Safe to call before d.Start.

func (*Runtime) Daemon

func (r *Runtime) Daemon() *daemon.Daemon

Daemon returns the underlying daemon (test access).

func (*Runtime) Register

func (r *Runtime) Register(s coreapi.Service) error

Register adds a service to the registry. Mirrors the old daemon.RegisterPlugin. Must be called before StartPlugins.

func (*Runtime) StartPlugins

func (r *Runtime) StartPlugins(ctx context.Context) error

StartPlugins starts every registered service in Order order. Plugins receive a Deps bundle covering Streams, Identity, Events, Trust.

func (*Runtime) StopPlugins

func (r *Runtime) StopPlugins(ctx context.Context) error

StopPlugins stops every started service in reverse-registration order. Each service has its own Stop ctx (caller-supplied here).

Jump to

Keyboard shortcuts

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