app

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 17 Imported by: 0

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 New

func New(opts ...Option) (*App, error)

New creates a new application instance with the given options.

func (*App) APIServer

func (a *App) APIServer() *api.Server

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) Run

func (a *App) Run(ctx context.Context) error

Run starts all application components and blocks until shutdown.

func (*App) Shutdown

func (a *App) Shutdown() error

Shutdown gracefully stops all application components.

type Option

type Option func(*App)

Option is a functional option for configuring the App.

func WithAPIPort

func WithAPIPort(port int) Option

WithAPIPort sets the API server port.

func WithConfigPath

func WithConfigPath(path string) Option

WithConfigPath sets the configuration file path.

func WithLayoutPath

func WithLayoutPath(path string) Option

WithLayoutPath sets the layout config file path.

func WithLogger

func WithLogger(logger *slog.Logger) Option

WithLogger sets a custom logger for the application.

func WithPluginsDir

func WithPluginsDir(path string) Option

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.

Jump to

Keyboard shortcuts

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