Documentation
¶
Index ¶
- type App
- func (a *App) BringUpGlobals(ctx context.Context) error
- func (a *App) GetClient() *client.Client
- func (a *App) GetHomeDir() string
- func (a *App) Initialize(ctx context.Context) error
- func (a *App) IsDockerAvailable(ctx context.Context) error
- func (a *App) Provider(ctx context.Context) docker.ProviderInfo
- func (a *App) ResetInfrastructure(ctx context.Context) error
- func (a *App) SetupFilesystem() error
- func (a *App) Shutdown(ctx context.Context) error
- func (a *App) WipeLabelled(ctx context.Context) error
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 (*App) BringUpGlobals ¶
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) GetHomeDir ¶
func (*App) Initialize ¶
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 ¶
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 ¶
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 (*App) WipeLabelled ¶
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.