runtime

package
v0.0.66 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package runtime manages the lifecycle of all long-running services based on the persisted GlobalConfig. Each service is independently startable and stoppable; the Manager diffs old vs new config and applies changes surgically.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	Ingestor         *ingestor.Service
	Publisher        *publisher.Service
	Coordinator      *coordinator.Coordinator
	Transcoder       *transcoder.Service
	StreamMgr        *manager.Service
	HooksSvc         *hooks.Service
	SessionsSvc      *sessions.Service
	APISrv           *api.Server
	Bus              events.Bus
	StreamRepo       store.StreamRepository
	GlobalConfigRepo store.GlobalConfigRepository
}

Deps holds all service references needed by the Manager. Populated by main.go from the DI injector.

type Manager

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

Manager owns the lifecycle of all long-running services. It reads GlobalConfig from the store and starts/stops services accordingly.

func New

func New(ctx context.Context, deps Deps) *Manager

New creates a Manager. Call Bootstrap() to load config and start services.

func (*Manager) Apply

func (m *Manager) Apply(ctx context.Context, newCfg *domain.GlobalConfig) error

Apply saves a new GlobalConfig to the store and diffs against the current config to start/stop services as needed.

func (*Manager) Bootstrap

func (m *Manager) Bootstrap() error

Bootstrap loads GlobalConfig from the store (seeding defaults on first boot), then starts all configured services.

func (*Manager) BootstrapWith

func (m *Manager) BootstrapWith(gcfg *domain.GlobalConfig)

BootstrapWith starts all configured services using the provided GlobalConfig. Use this when main.go has already loaded/seeded the config from the store.

func (*Manager) CurrentConfig

func (m *Manager) CurrentConfig() *domain.GlobalConfig

CurrentConfig returns a copy of the active GlobalConfig.

func (*Manager) WaitAll

func (m *Manager) WaitAll()

WaitAll blocks until all running services have exited.

Jump to

Keyboard shortcuts

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