app

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package app is Console's composition root. It wires the configured storage backend, the flag and status engines, and the LLM provider into a single App value that the server, CLI, and onboarding flows depend on. Nothing here contains business logic — it only assembles the pieces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRecorder added in v0.8.0

func DefaultRecorder(cfg config.Config) obs.Recorder

DefaultRecorder is the default Recorder factory: obs.Nop when cfg.Metrics is false, otherwise an in-memory registry with the Go runtime and build_info collector attached.

Types

type App

type App struct {
	Config config.Config
	Store  store.Store
	Flags  *flags.Engine
	Status *status.Engine
	// LLM is the AI-Assisted onboarding provider. It is nil when no provider is
	// configured; callers must treat AI-Assisted mode as unavailable in that
	// case and fall back to Human mode.
	LLM llm.Provider
	// Notify fans status transitions and flag changes out to registered sinks.
	// Always non-nil; sinks are out-of-process notifier plugins (e.g. Slack).
	Notify *notify.Dispatcher
	// Obs is the instrumentation Recorder. Always non-nil: obs.Nop when
	// cfg.Metrics is false, otherwise an in-memory registry (*obs.Memory).
	Obs obs.Recorder
	// Auth authenticates API requests. Nil when auth is not enabled (no tokens
	// configured, or CONSOLE_AUTH=disabled); the server then runs open.
	Auth auth.Authenticator
	// contains filtered or unexported fields
}

App holds the assembled, ready-to-use Console subsystems.

func New

func New(ctx context.Context, cfg config.Config, opts ...Option) (*App, error)

New assembles an App from cfg. It opens the storage backend, constructs the flag and status engines (registering the built-in HTTP status provider), loads notifier and status-provider plugins, and selects the LLM provider when one is configured (all out-of-process). The caller owns Close.

func (*App) Close

func (a *App) Close() error

Close releases the App's resources: it stops any loaded plugin subprocesses (notifiers) and closes the store (which, for a store plugin, stops that subprocess too).

type Option added in v0.8.0

type Option func(*options)

Option customizes New.

func WithRecorder added in v0.8.0

func WithRecorder(f func(cfg config.Config) obs.Recorder) Option

WithRecorder overrides the Recorder factory. A nil factory is ignored.

Jump to

Keyboard shortcuts

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