Documentation
¶
Index ¶
- type Supervisor
- func (s *Supervisor) Restart(sess state.Session) error
- func (s *Supervisor) SetAgentsRoot(root string)
- func (s *Supervisor) SetBridgeEnv(kv []string)
- func (s *Supervisor) SetLogger(l *slog.Logger)
- func (s *Supervisor) SetMetrics(m *metrics.Registry)
- func (s *Supervisor) Start(sess state.Session) error
- func (s *Supervisor) Stop(name string) error
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.