Help us shape the future of Go! Take the 2026 Go Developer Survey

app

package
v0.2.47 Latest Latest
Warning

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

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

Documentation

Overview

Package app wires Ether's components into one running server: the Plex front end and the owner UI on one port, and the background services (catalogue sync, plex.tv registration, prefetch, LAN discovery) behind it.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnresponsive = errors.New("app: server unresponsive to local health probes")

ErrUnresponsive is returned by App.Run when the server stopped answering its own local health probe. The process then exits non-zero so the service manager restarts it.

Functions

func Serve added in v0.2.4

func Serve(ctx context.Context, opts Options) error

Serve owns the complete application lifetime. A UI cluster transition first stops HTTP and every background writer and closes SQLite, then migrates and starts a fresh App. It works in the foreground and under every OS supervisor.

Types

type App

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

App is a running Ether server.

func New

func New(ctx context.Context, opts Options) (*App, error)

New builds every component. Nothing listens until Run.

func (*App) Close

func (a *App) Close()

Close releases every component in reverse order of construction.

func (*App) Config

func (a *App) Config() *config.Store

Config is the settings store.

func (*App) Handler

func (a *App) Handler() http.Handler

Handler is the combined Plex + owner UI handler (tests).

func (*App) Run

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

Run serves until ctx is cancelled.

func (*App) WatchNotifications added in v0.2.4

func (a *App) WatchNotifications(executable string) (func(bool) error, error)

WatchNotifications is enabled by the executable, never by embedded/test apps.

type Options

type Options struct {

	// NotificationExecutable enables the independent crash watcher for executable runs.
	NotificationExecutable string
	DataDir                string
	Version                string
	// Logger receives everything; the admin log ring is teed onto it.
	Logger *slog.Logger
	// Spike forces spike mode (local files, no Usenet) on top of config.
	Spike bool
	// SpikeFiles are extra local files for spike mode.
	SpikeFiles []string
	// DBRetryMin / DBRetryMax bound the backoff while a clustered node
	// waits at startup for an unreachable PostgreSQL server (1s / 30s).
	DBRetryMin, DBRetryMax time.Duration
	// contains filtered or unexported fields
}

Options configure a run.

Jump to

Keyboard shortcuts

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