wizard

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 18 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 is the Wails-bound backend. Public methods on this type are callable from the frontend JS as `window.go.wizard.App.<Method>(...)`.

func NewApp

func NewApp() *App

NewApp constructs the app with config loaded from the baked-in defaults plus an optional sidecar next to the binary. On startup it tries to fetch the live POP list from ingest; on any failure the baked-in list is used. Config errors are logged to stderr and the app falls back to defaults so the wizard never fails to launch.

func NewAppWithConfigAndLivePOPs

func NewAppWithConfigAndLivePOPs(cfg *config.Config, popsURL string, timeout time.Duration) *App

NewAppWithConfigAndLivePOPs is the full-featured constructor used by tests and by NewApp. If popsURL is non-empty, it fetches the live list and, on success, replaces cfg.POPs. Any failure keeps cfg.POPs as the baked-in list.

func (*App) ApplyUpdate

func (a *App) ApplyUpdate() error

ApplyUpdate spawns the detached helper and quits so the swap can complete. Refused while a tech check is running, or if nothing has been downloaded.

func (*App) CanSelfUpdate

func (a *App) CanSelfUpdate() bool

CanSelfUpdate reports whether an in-place update can be performed: the binary is laid out as an installed app and its directory is writable. When false the frontend keeps the browser-download fallback.

func (*App) Cancel

func (a *App) Cancel()

Cancel aborts an in-progress run.

func (*App) CheckForUpdate

func (a *App) CheckForUpdate() updater.Status

CheckForUpdate queries the ingest server for the latest published version of this app. A 3-second timeout keeps the UI responsive; any error is swallowed and returns a zero Status (UI shows no banner). Bound to the Wails frontend.

func (*App) DownloadUpdate

func (a *App) DownloadUpdate() error

DownloadUpdate fetches and verifies the latest artifact in the background and stages it next to the install target. Progress and outcome are reported via the "update_progress" / "update_ready" / "update_error" events. Returns immediately; an error here means the download could not even be started.

func (*App) ITContactEmail

func (a *App) ITContactEmail() string

ITContactEmail is shown on the fallback screen. Configured value.

func (*App) IngestURL

func (a *App) IngestURL() string

IngestURL is shown on the consent screen.

func (*App) LastUploadInfo

func (a *App) LastUploadInfo() map[string]string

LastUploadInfo returns id/received_at/share_url from the most recent successful upload, or zero values if nothing has been uploaded yet. share_url is the candidate-facing result link (empty when the server didn't send one).

func (*App) LocalReportPath

func (a *App) LocalReportPath() string

LocalReportPath returns the path written on the most recent run, or "".

func (*App) POPs

func (a *App) POPs() []config.POP

POPs returns the effective POP list (live if the startup fetch succeeded, otherwise baked-in). Exposed for testing and for the frontend status screen.

func (*App) SavedIdentity

func (a *App) SavedIdentity() map[string]string

SavedIdentity returns the name + email persisted from a previous run, or empty strings if none is saved. Used by the identify screen to pre-fill.

func (*App) SendReport

func (a *App) SendReport() error

SendReport uploads the most recent report to the ingest server. Called from the result screen's Send button and, if that fails, the Retry button. The server dedupes on run_id so repeated calls are safe.

func (*App) SetRunningForTest

func (a *App) SetRunningForTest(v bool)

SetRunningForTest toggles the run-in-progress flag. Test-only seam.

func (*App) StartRun

func (a *App) StartRun(fullName, email string) error

StartRun kicks off sysinfo → nettest → local write → upload. Returns immediately; the frontend listens for "progress" and "complete" events.

func (*App) Startup

func (a *App) Startup(ctx context.Context)

Startup is called by Wails once the runtime context is available.

func (*App) ValidateIdentity

func (a *App) ValidateIdentity(fullName, email string) (bool, error)

ValidateIdentity is called by the Identify screen before StartRun. Non-empty name + parsable email is the minimum bar.

Jump to

Keyboard shortcuts

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