Documentation
¶
Index ¶
- Constants
- func ExitCodeFor(err error) int
- func HandleInstall(component string) error
- func HandleUninstall(component string) error
- func RunApp(pl platforms.Platform, cfg *config.Instance, daemonMode bool) (returnErr error)
- func Setup(pl platforms.Platform, defaultConfig config.Values, writers []io.Writer) *config.Instance
- func StartAndOpenBrowser(cfg *config.Instance) error
- type DefaultInstaller
- func (DefaultInstaller) InstallApplication() error
- func (DefaultInstaller) InstallDesktop() error
- func (DefaultInstaller) InstallHardware() error
- func (DefaultInstaller) InstallService() error
- func (DefaultInstaller) UninstallApplication() error
- func (DefaultInstaller) UninstallDesktop() error
- func (DefaultInstaller) UninstallHardware() error
- func (DefaultInstaller) UninstallService() error
- type Flags
- type Installer
Constants ¶
const ExitUnrecoverable = 78
ExitUnrecoverable is the exit status for a startup failure that starting again cannot fix.
The service units set RestartPreventExitStatus to it. Without that, a supervisor retries every few seconds forever: each attempt reopens the databases, fails in the same place, and writes the same error, so the one line explaining the problem is buried under repetitions of itself and the device looks like it is doing something about it. Stopping at a failed unit with the reason still visible is the more useful answer.
78 is EX_CONFIG from sysexits.h, which is close enough to what this is: the state on disk is not something this build can work with.
Variables ¶
This section is empty.
Functions ¶
func ExitCodeFor ¶
ExitCodeFor maps a startup error to the process exit status to leave behind.
Only conditions a person has to resolve qualify. Anything transient — a missing network, a busy file, a database that can be recovered — stays 1 so the supervisor keeps trying, because those do come good on their own.
func HandleInstall ¶ added in v2.8.0
HandleInstall handles the -install flag for all Linux platforms.
func HandleUninstall ¶ added in v2.8.0
HandleUninstall handles the -uninstall flag for all Linux platforms.
func RunApp ¶ added in v2.8.0
RunApp runs the main application in either daemon or TUI mode. It handles signal handling, service lifecycle, and graceful shutdown.
func Setup ¶
func Setup( pl platforms.Platform, defaultConfig config.Values, writers []io.Writer, ) *config.Instance
Setup initializes the user config and logging. Returns a user config object.
func StartAndOpenBrowser ¶ added in v2.8.0
StartAndOpenBrowser starts the service via systemd and opens the web UI in the browser.
Types ¶
type DefaultInstaller ¶ added in v2.8.0
type DefaultInstaller struct{}
DefaultInstaller implements Installer using the real installer package.
func (DefaultInstaller) InstallApplication ¶ added in v2.8.0
func (DefaultInstaller) InstallApplication() error
func (DefaultInstaller) InstallDesktop ¶ added in v2.8.0
func (DefaultInstaller) InstallDesktop() error
func (DefaultInstaller) InstallHardware ¶ added in v2.8.0
func (DefaultInstaller) InstallHardware() error
func (DefaultInstaller) InstallService ¶ added in v2.8.0
func (DefaultInstaller) InstallService() error
func (DefaultInstaller) UninstallApplication ¶ added in v2.8.0
func (DefaultInstaller) UninstallApplication() error
func (DefaultInstaller) UninstallDesktop ¶ added in v2.8.0
func (DefaultInstaller) UninstallDesktop() error
func (DefaultInstaller) UninstallHardware ¶ added in v2.8.0
func (DefaultInstaller) UninstallHardware() error
func (DefaultInstaller) UninstallService ¶ added in v2.8.0
func (DefaultInstaller) UninstallService() error
type Flags ¶
type Flags struct {
Write *string
Read *bool
Run *string
Launch *string
API *string
Version *bool
ShowLoader *string
ShowPicker *string
Reload *bool
Pair *bool
Update *bool
Backup *bool
Backups *bool
Restore *string
Profiles *bool
ProfileResetPIN *string
ProfileResetSwitchID *string
}
func SetupFlags ¶
func SetupFlags() *Flags
SetupFlags defines all common CLI flags between platforms.
type Installer ¶ added in v2.8.0
type Installer interface {
InstallApplication() error
InstallDesktop() error
InstallService() error
InstallHardware() error
UninstallApplication() error
UninstallDesktop() error
UninstallService() error
UninstallHardware() error
}
Installer defines the interface for install/uninstall operations. This allows mocking in tests to avoid side effects.