shared

package
v2.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: GPL-3.0 Imports: 21 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	LauncherKodiLocalVideo = "KodiLocalVideo"
	LauncherKodiLocalAudio = "KodiLocalAudio"
	LauncherKodiMovie      = "KodiMovie"
	LauncherKodiTVEpisode  = "KodiTVEpisode"
	LauncherKodiTVShow     = "KodiTVShow"
	LauncherKodiSong       = "KodiSong"
	LauncherKodiAlbum      = "KodiAlbum"
	LauncherKodiArtist     = "KodiArtist"
)

Kodi launcher IDs

View Source
const (
	LauncherJellyfinMovie     = "JellyfinMovie"
	LauncherJellyfinTVEpisode = "JellyfinTVEpisode"
	LauncherJellyfinTVShow    = "JellyfinTVShow"
	LauncherJellyfinSong      = "JellyfinSong"
	LauncherJellyfinAlbum     = "JellyfinAlbum"
	LauncherJellyfinArtist    = "JellyfinArtist"
)

Jellyfin launcher IDs

View Source
const (
	LauncherPlexMovie     = "PlexMovie"
	LauncherPlexTVEpisode = "PlexTVEpisode"
	LauncherPlexTVShow    = "PlexTVShow"
	LauncherPlexSong      = "PlexSong"
	LauncherPlexAlbum     = "PlexAlbum"
	LauncherPlexArtist    = "PlexArtist"
)

Plex launcher IDs

View Source
const (
	LauncherGroupNative            = "Native"
	LauncherGroupEmuDeck           = "EmuDeck"
	LauncherGroupRetroDECK         = "RetroDECK"
	LauncherGroupRetroAchievements = "RetroAchievements"
	LauncherGroupKodi              = "Kodi"
	LauncherGroupKodiTV            = "KodiTV"
	LauncherGroupKodiMusic         = "KodiMusic"
	LauncherGroupJellyfin          = "Jellyfin"
	LauncherGroupPlex              = "Plex"
)

Launcher groups used as stable configuration references.

View Source
const (
	LauncherGroupDB9      = "DB9"
	LauncherGroupLLAPI    = "LLAPI"
	LauncherGroupDualRAM  = "DualRAM"
	LauncherGroupSinden   = "Sinden"
	LauncherGroupPWM      = "PWM"
	LauncherGroupUnstable = "Unstable"
)

MiSTer alt-core launcher groups. Each name matches a family of cores published by a distinct MiSTer downloader database, so a user can prefer a whole family at once with a single [launchers] preference entry.

View Source
const (
	SchemeSteam      = "steam"
	SchemeFlashpoint = "flashpoint"
	SchemeLaunchBox  = "launchbox"
	SchemeScummVM    = "scummvm"
	SchemeLutris     = "lutris"
	SchemeHeroic     = "heroic"
	SchemeBottles    = "bottles"
	SchemeFaugus     = "faugus"
	SchemeGOG        = "gog"
	SchemePopper     = "popper"
	SchemePlaynite   = "playnite"
	SchemeAndroid    = "android"
	SchemeRomM       = "romm"
)

Custom URI scheme constants for Zaparoo virtual paths. These schemes are used to create virtual paths for media that doesn't have traditional file paths (e.g., Steam games, Kodi media, LaunchBox collections, etc.).

View Source
const (
	SchemeKodiMovie   = "kodi-movie"
	SchemeKodiEpisode = "kodi-episode"
	SchemeKodiSong    = "kodi-song"
	SchemeKodiAlbum   = "kodi-album"
	SchemeKodiArtist  = "kodi-artist"
	SchemeKodiShow    = "kodi-show"
)

Kodi URI scheme constants for Kodi media library items.

View Source
const (
	SchemeJellyfinMovie   = "jellyfin-movie"
	SchemeJellyfinEpisode = "jellyfin-episode"
	SchemeJellyfinShow    = "jellyfin-show"
	SchemeJellyfinSong    = "jellyfin-song"
	SchemeJellyfinAlbum   = "jellyfin-album"
	SchemeJellyfinArtist  = "jellyfin-artist"
)

Jellyfin URI scheme constants for Jellyfin server library items.

View Source
const (
	SchemePlexMovie   = "plex-movie"
	SchemePlexEpisode = "plex-episode"
	SchemePlexShow    = "plex-show"
	SchemePlexSong    = "plex-song"
	SchemePlexAlbum   = "plex-album"
	SchemePlexArtist  = "plex-artist"
)

Plex URI scheme constants for Plex server library items.

View Source
const (
	SchemeHTTP  = "http"
	SchemeHTTPS = "https"
)

Standard URI schemes that should have URL decoding applied.

View Source
const DefaultInputDelay = 40 * time.Millisecond

DefaultInputDelay is the pause held between the down and up of a single press, to avoid overloading the OS or user applications.

View Source
const DefaultInterKeyDelay = 100 * time.Millisecond

DefaultInterKeyDelay is the default pause between consecutive key presses in a sequence. Matches the inter-key delay used by the per-key fallback loop.

View Source
const SchemeSource = platforms.SourceScheme

SchemeSource is media in a folder a host application granted to Core. Its paths are multi-segment virtual paths; see platforms.SourceScheme.

Variables

View Source
var ErrGamepadDisabled = errors.New("virtual gamepad is disabled")

ErrGamepadDisabled reports that virtual gamepad support is switched off.

View Source
var ErrInputUnsupported = errors.New("virtual input is not supported on this platform")

ErrInputUnsupported is returned by InitDevices on platforms with no virtual input backend.

View Source
var ErrTooManyKeyboardHolds = errors.New("too many held key combinations")

ErrTooManyKeyboardHolds is returned when a session asks to hold a key combination past maxSessionKeyboardHolds.

Functions

func BMPFileComplete added in v2.11.0

func BMPFileComplete(path string) (bool, error)

BMPFileComplete checks the file size against the total size declared at bytes 2-5 of the BMP header (little-endian uint32).

func IsCustomScheme

func IsCustomScheme(scheme string) bool

IsCustomScheme checks if the given scheme is a registered Zaparoo custom URI scheme

func IsFileBackedScheme added in v2.19.0

func IsFileBackedScheme(scheme string) bool

IsFileBackedScheme reports whether a custom scheme's paths end in a file name with an extension rather than a title.

func IsStandardSchemeForDecoding

func IsStandardSchemeForDecoding(scheme string) bool

IsStandardSchemeForDecoding checks if the given scheme is a standard URI scheme that should have URL decoding

func PNGFileComplete added in v2.11.0

func PNGFileComplete(path string) (bool, error)

func SameOriginRedirect added in v2.23.0

func SameOriginRedirect(req *http.Request, via []*http.Request) error

SameOriginRedirect is an http.Client CheckRedirect for clients that send a media server token in a header. Go forwards custom headers on every redirect, and Authorization to the same host even over plain http, so a redirect may only stay on the original scheme, host and port, or upgrade http to https on the same host.

func SchemeIDTest added in v2.18.0

func SchemeIDTest(scheme string) func(*config.Instance, string) bool

SchemeIDTest builds a Launcher.Test that accepts only paths carrying a usable ID for this scheme.

A launcher that declares Schemes and no Test is selected for anything with the right prefix, and DoLaunch stops the running media as soon as a launcher is chosen. Without this, a malformed path takes down whatever is playing and only then fails inside Launch. Every scheme launcher whose Launch parses an ID out of the path wants this; those that hand the whole path to an external opener (the browser launchers) reject nothing and so need nothing.

func ScreenshotFileComplete added in v2.11.0

func ScreenshotFileComplete(path, ext string) (bool, error)

ScreenshotFileComplete avoids reading a partial file when inotify fires before the writer has flushed and closed.

func ShouldDecodeURIScheme

func ShouldDecodeURIScheme(scheme string) bool

ShouldDecodeURIScheme checks if the given scheme should have URL decoding applied Returns true for Zaparoo custom schemes and standard web schemes (http/https)

func StandardSchemesForDecoding

func StandardSchemesForDecoding() []string

StandardSchemesForDecoding returns a slice of standard URI schemes that should have URL decoding

func ValidCustomSchemes

func ValidCustomSchemes() []string

ValidCustomSchemes returns a slice of all registered Zaparoo custom URI schemes

Types

type GamepadDevice added in v2.18.0

type GamepadDevice interface {
	ButtonDown(code int) error
	ButtonUp(code int) error
	Close() error
}

GamepadDevice is a virtual gamepad backend. Codes are raw evdev button codes from gamepadmap.

type InputManager added in v2.18.0

type InputManager struct {
	NewKeyboard func() (KeyboardDevice, error)
	NewGamepad  func() (GamepadDevice, error)
	// contains filtered or unexported fields
}

InputManager owns the virtual keyboard and gamepad devices and the input held on them. Embed it in platform implementations that support input.

The backend constructors default to the platform's native implementation and exist so tests can inject recording devices.

func (*InputManager) CloseDevices added in v2.18.0

func (l *InputManager) CloseDevices()

CloseDevices releases all held input before closing keyboard and gamepad devices.

func (*InputManager) GamepadPress added in v2.18.0

func (l *InputManager) GamepadPress(name string) error

GamepadPress sends a gamepad button press.

func (*InputManager) GamepadPressSequence added in v2.18.0

func (l *InputManager) GamepadPressSequence(args []string, interKeyDelay time.Duration) error

GamepadPressSequence sends a request-scoped gamepad sequence. Explicit press tokens are always released before this method returns.

func (*InputManager) InitDevices added in v2.18.0

func (l *InputManager) InitDevices(cfg *config.Instance, gamepadEnabledByDefault bool) error

InitDevices initializes keyboard and optionally gamepad based on config. gamepadEnabledByDefault controls the default when config doesn't specify.

func (*InputManager) KeyboardPress added in v2.18.0

func (l *InputManager) KeyboardPress(arg string) error

KeyboardPress sends a keyboard key press.

func (*InputManager) KeyboardPressSequence added in v2.18.0

func (l *InputManager) KeyboardPressSequence(args []string, interKeyDelay time.Duration) error

KeyboardPressSequence sends a request-scoped key sequence. Explicit press tokens are always released before this method returns.

func (*InputManager) NewInputSession added in v2.18.0

func (l *InputManager) NewInputSession() platforms.InputSession

NewInputSession creates an isolated owner for input held across API requests.

type KeyboardDevice added in v2.18.0

type KeyboardDevice interface {
	KeyDown(code int) error
	KeyUp(code int) error
	Close() error
}

KeyboardDevice is a virtual keyboard backend. Codes are raw evdev keycodes from keyboardmap; backends translate them to whatever their own API expects.

type LaunchExit added in v2.23.0

type LaunchExit struct {
	// contains filtered or unexported fields
}

LaunchExit holds the MediaExited callback of a launcher's latest launch. Launchers that play on a remote player have no process for Core to watch, so their stop control reports the exit through it once the player accepts the stop. A callback from an older launch is harmless: Core ignores it once that media is no longer active.

func (*LaunchExit) Capture added in v2.23.0

func (e *LaunchExit) Capture() func()

Capture binds a report to the launch recorded now. A stop captures before it sends its command, so a launch that records its own callback while the command is in flight is not reported as exited. Calling the returned function reports the captured launch's exit, at most once per launch.

func (*LaunchExit) Set added in v2.23.0

func (e *LaunchExit) Set(opts *platforms.LaunchOptions)

Set records the exit callback from a launch's options.

Directories

Path Synopsis
Package esapi provides types and helpers for reading EmulationStation gamelist.xml files.
Package esapi provides types and helpers for reading EmulationStation gamelist.xml files.
Package esbase is the shared platform for systems whose EmulationStation is Batocera's fork, which runs games and reports them through an HTTP API on localhost:1234.
Package esbase is the shared platform for systems whose EmulationStation is Batocera's fork, which runs games and reports them through an HTTP API on localhost:1234.
Package esde provides shared utilities for EmulationStation Desktop Edition based platforms including ES-DE, Batocera ES, and RetroBat.
Package esde provides shared utilities for EmulationStation Desktop Edition based platforms including ES-DE, Batocera ES, and RetroBat.
Package esmedia resolves local EmulationStation-style media folders and paths.
Package esmedia resolves local EmulationStation-style media folders and paths.
Package gamehandoff tells when a launched game has been handed to the emulator or core that runs it.
Package gamehandoff tells when a launched game has been handed to the emulator or core that runs it.
Package jellyfin indexes a Jellyfin server's library and plays its items on a player the server can remote control.
Package jellyfin indexes a Jellyfin server's library and plays its items on a player the server can remote control.
gamescope
Package gamescope makes externally launched windows visible and focused in gamescope Gaming Mode sessions.
Package gamescope makes externally launched windows visible and focused in gamescope Gaming Mode sessions.
procscanner
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.
proctracker
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+.
Package linuxemu provides reusable emulator discovery and launchers for Linux-family platforms.
Package linuxemu provides reusable emulator discovery and launchers for Linux-family platforms.
Zaparoo Core Copyright (c) 2026 The Zaparoo Project Contributors.
Zaparoo Core Copyright (c) 2026 The Zaparoo Project Contributors.
Package playnite integrates the Playnite game library manager.
Package playnite integrates the Playnite game library manager.
Package retroarch provides reusable RetroArch CLI launchers.
Package retroarch provides reusable RetroArch CLI launchers.
Package romm reads a self-hosted RomM server: its platforms and ROMs become indexed media, and a ROM is downloaded onto the device when launched.
Package romm reads a self-hosted RomM server: its platforms and ROMs become indexed media, and a ROM is downloaded onto the device when launched.
Package standalone holds the operating-system independent parts of the built-in standalone emulator launchers: argument builders, launcher target files and the Windows emulator table and install discovery.
Package standalone holds the operating-system independent parts of the built-in standalone emulator launchers: argument builders, launcher target files and the Windows emulator table and install discovery.
steamtracker
Package steamtracker provides Steam game lifecycle tracking on Linux.
Package steamtracker provides Steam game lifecycle tracking on Linux.
Package winebackup holds the backup policy for game saves inside Wine and Proton prefixes, shared by every Linux platform that runs Windows games.
Package winebackup holds the backup policy for game saves inside Wine and Proton prefixes, shared by every Linux platform that runs Windows games.

Jump to

Keyboard shortcuts

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