Documentation
¶
Index ¶
- Constants
- func Settings() platforms.Settings
- func SupportedReaders(cfg *config.Instance, p platforms.Platform) []readers.Reader
- type Base
- func (*Base) ConsoleManager() platforms.ConsoleManager
- func (*Base) ForwardCmd(_ *platforms.CmdEnv) (platforms.CmdResult, error)
- func (*Base) GamepadPress(_ string) error
- func (b *Base) ID() string
- func (*Base) KeyboardPress(_ string) error
- func (b *Base) LaunchMedia(cfg *config.Instance, path string, launcher *platforms.Launcher, ...) error
- func (*Base) LaunchSystem(_ *config.Instance, _ string) error
- func (*Base) LookupMapping(_ *tokens.Token) (string, bool)
- func (*Base) ReturnToMenu() error
- func (*Base) RootDirs(cfg *config.Instance) []string
- func (*Base) ScanHook(_ *tokens.Token) error
- func (b *Base) SetClock(clock clockwork.Clock)
- func (b *Base) SetTrackedProcess(proc *os.Process)
- func (*Base) ShowLoader(_ *config.Instance, _ widgetmodels.NoticeArgs) (func() error, error)
- func (*Base) ShowNotice(_ *config.Instance, _ widgetmodels.NoticeArgs) (func() error, time.Duration, error)
- func (*Base) ShowPicker(_ *config.Instance, _ widgetmodels.PickerArgs) error
- func (b *Base) StartPost(_ *config.Instance, launcherManager platforms.LauncherContextManager, ...) error
- func (*Base) StartPre(_ *config.Instance) error
- func (*Base) Stop() error
- func (b *Base) StopActiveLauncher(_ platforms.StopIntent) error
Constants ¶
const ( // SIGTERMTimeout is how long to wait for graceful SIGTERM shutdown. SIGTERMTimeout = 3 * time.Second // SIGKILLTimeout is how long to wait after SIGKILL before proceeding. SIGKILLTimeout = 500 * time.Millisecond )
Timeout constants for process termination.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base provides common functionality for all Linux-family platforms. Platforms embed this struct and override methods as needed.
func (*Base) ConsoleManager ¶
func (*Base) ConsoleManager() platforms.ConsoleManager
ConsoleManager returns a no-op console manager.
func (*Base) ForwardCmd ¶
ForwardCmd returns an empty result (no command forwarding on Linux platforms).
func (*Base) GamepadPress ¶
GamepadPress is a no-op for Linux platforms.
func (*Base) KeyboardPress ¶
KeyboardPress is a no-op for Linux platforms.
func (*Base) LaunchMedia ¶
func (b *Base) LaunchMedia( cfg *config.Instance, path string, launcher *platforms.Launcher, db *database.Database, opts *platforms.LaunchOptions, p platforms.Platform, ) error
LaunchMedia launches media using the appropriate launcher. The platform parameter is required to access the platform's Launchers method (struct embedding means Base cannot call methods defined on the outer type).
func (*Base) LaunchSystem ¶
LaunchSystem returns an error as launching systems is not supported.
func (*Base) LookupMapping ¶
LookupMapping returns false (no token mappings on Linux platforms).
func (*Base) ReturnToMenu ¶
ReturnToMenu is a no-op for the base Linux implementation. Platforms with a menu concept (like SteamOS) should override this method.
func (*Base) SetTrackedProcess ¶
SetTrackedProcess stores a process handle, killing any existing tracked process.
func (*Base) ShowLoader ¶
func (*Base) ShowLoader( _ *config.Instance, _ widgetmodels.NoticeArgs, ) (func() error, error)
ShowLoader returns ErrNotSupported (no UI widgets on Linux platforms).
func (*Base) ShowNotice ¶
func (*Base) ShowNotice( _ *config.Instance, _ widgetmodels.NoticeArgs, ) (func() error, time.Duration, error)
ShowNotice returns ErrNotSupported (no UI widgets on Linux platforms).
func (*Base) ShowPicker ¶
func (*Base) ShowPicker( _ *config.Instance, _ widgetmodels.PickerArgs, ) error
ShowPicker returns ErrNotSupported (no UI widgets on Linux platforms).
func (*Base) StartPost ¶
func (b *Base) StartPost( _ *config.Instance, launcherManager platforms.LauncherContextManager, activeMedia func() *models.ActiveMedia, setActiveMedia func(*models.ActiveMedia), _ *database.Database, ) error
StartPost initializes the platform after service startup.
func (*Base) StopActiveLauncher ¶
func (b *Base) StopActiveLauncher(_ platforms.StopIntent) error
StopActiveLauncher kills tracked process and all its children, then clears active media. Uses SIGTERM first for graceful shutdown, then SIGKILL after timeout.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package procscanner provides a shared process scanner for monitoring multiple types of processes with a single /proc scan.
|
Package procscanner provides a shared process scanner for monitoring multiple types of processes with a single /proc scan. |
|
Package proctracker provides process exit tracking using pidfd_open on Linux 5.3+.
|
Package proctracker provides process exit tracking using pidfd_open on Linux 5.3+. |