app

package
v0.0.0-...-c2515dd Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

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 owns process-wide initialisation: filesystem layout, Docker readiness, global containers, and router lifecycle.

func New

func New(configFiles embed.FS, d *docker.Docker, homeDir string, rtr router.Router) *App

func (*App) BringUpGlobals

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

BringUpGlobals creates the global network, brings up mail + adminer, and (re)starts the router with the canonical service routes pre- registered. Used at the end of Initialize and from SiteManager.ResetInfrastructure.

Each step propagates the underlying error verbatim. The router itself returns sentinels (router.ErrPortInUse) the UI can branch on.

func (*App) GetClient

func (a *App) GetClient() *client.Client

func (*App) GetHomeDir

func (a *App) GetHomeDir() string

func (*App) Initialize

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

Initialize runs the startup sequence: filesystem, cleanup, networks, global services, router. Returns the first error encountered so the UI can surface it.

func (*App) IsDockerAvailable

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

IsDockerAvailable checks if Docker is available and running.

func (*App) Provider

func (a *App) Provider(ctx context.Context) docker.ProviderInfo

Provider returns the cached Docker daemon identification. If Initialize has not yet run (or the ProviderInfo call failed), the returned ProviderInfo carries the engine-side default values plus an empty Name — callers should treat that as "unknown" and not branch on specifics.

func (*App) ResetInfrastructure

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

ResetInfrastructure wipes every Locorum-owned container and network, then re-runs the global startup sequence (network + mail + adminer + router). Volumes are preserved — site DB data is untouched. Per-site containers are removed and the caller is expected to reconcile the "started" state in storage.

User-facing flow: Settings → Diagnostics → "Reset Locorum Infrastructure" with a confirmation modal. Idempotent and safe to retry; failures bubble up verbatim so the UI banner shows what went wrong.

func (*App) SetupFilesystem

func (a *App) SetupFilesystem() error

func (*App) Shutdown

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

func (*App) WipeLabelled

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

WipeLabelled removes every Locorum-owned container and network. Used at startup (to clear state from a crashed previous session) and from SiteManager.ResetInfrastructure (to give the user a one-click recovery path). Volumes are deliberately preserved — site DB data persists across both flows.

Idempotent: safe to call when nothing is running.

Jump to

Keyboard shortcuts

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