Documentation
¶
Overview ¶
Package app provides the main application orchestration and dependency injection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the main application container that holds all dependencies. It follows the dependency injection pattern to manage component lifecycle.
func (*App) APIServer ¶
APIServer returns the underlying API server, used by callers that need to wire channels (e.g. the tray manager listening for window-closed signals).
func (*App) Ready ¶ added in v0.3.8
func (a *App) Ready() <-chan struct{}
Ready returns a channel that is closed once all components (API server, zone sampler, render loop) have started. Callers can block on it instead of polling the health endpoint.
type DeviceFactory ¶ added in v0.3.8
DeviceFactory constructs and connects a device using the given context.
type Option ¶
type Option func(*App)
Option is a functional option for configuring the App.
func WithConfigPath ¶
WithConfigPath sets the configuration file path.
func WithDeviceFactory ¶ added in v0.3.8
func WithDeviceFactory(f DeviceFactory) Option
WithDeviceFactory sets a custom device constructor. The factory is called during initialization with the app context and must return a connected device. Use this in tests to inject a mock without relying on NEXUS_MOCK_DEVICE.
func WithLayoutPath ¶
WithLayoutPath sets the layout config file path.
func WithLogger ¶
WithLogger sets a custom logger for the application.
func WithPluginsDir ¶
WithPluginsDir sets the directory where exec: plugin binaries are found. Defaults to a sibling plugins/ directory next to the running executable, or ~/.local/lib/nexus-open/plugins when running from a system install.