supervisor

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Supervisor

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

Supervisor manages one child `herrscher bridge` process per session.

func NewSupervisor

func NewSupervisor(ctx context.Context, selfBin string) *Supervisor

NewSupervisor builds a Supervisor bound to ctx. It logs through a quiet default until SetLogger installs the daemon's operator logger.

func (*Supervisor) Restart

func (s *Supervisor) Restart(sess state.Session) error

Restart synchronously replaces only sess.Name. The old process loop is fully stopped before the replacement is launched with sess's current Cmd/Vendor.

func (*Supervisor) SetAgentsRoot

func (s *Supervisor) SetAgentsRoot(root string)

SetAgentsRoot records the agent-home directory threaded to each spawned bridge as --agents-root, so a bridge's delegation roster is read from the same store the daemon manages even under a non-default --state path.

func (*Supervisor) SetBridgeEnv added in v0.3.4

func (s *Supervisor) SetBridgeEnv(kv []string)

SetBridgeEnv records extra KEY=VALUE entries handed to every bridge child on top of the inherited environment. The composition root passes the captured gateway credentials here (see host.GatewayEnvPairs), which the daemon removed from its own environment so no vendor CLI can read them.

func (*Supervisor) SetLogger

func (s *Supervisor) SetLogger(l *slog.Logger)

SetLogger installs the operator logger the supervisor logs restart events through (component=supervisor is attached for filtering).

func (*Supervisor) SetMetrics

func (s *Supervisor) SetMetrics(m *metrics.Registry)

SetMetrics installs the registry the supervisor records bridge restarts into.

func (*Supervisor) Start

func (s *Supervisor) Start(sess state.Session) error

Start launches a supervised bridge for sess (idempotent per name).

func (*Supervisor) Stop

func (s *Supervisor) Stop(name string) error

Stop terminates the bridge for name and waits until its supervised loop has returned. Callers may safely remove the bridge's working directory after Stop.

Jump to

Keyboard shortcuts

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