Help us shape the future of Go! Take the 2026 Go Developer Survey

emulation

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeAuto  = "auto"
	ModeQEMU  = "qemu"
	ModeFEX   = "fex"
	ModeBox64 = "box64"
)

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() string

ConfigPath returns the persistent emulation preference path.

func NormalizeMode

func NormalizeMode(mode string) (string, bool)

NormalizeMode canonicalizes user input.

func PreferredMode

func PreferredMode() string

PreferredMode returns the effective user preference. Env wins over disk.

func Save

func Save(cfg *Config) error

Save persists the emulation configuration with private permissions.

func SelectBest

func SelectBest(results []Result) string

SelectBest chooses a safe default for this host from detection results.

Types

type Config

type Config struct {
	Preferred string    `json:"preferred"`
	Selected  string    `json:"selected,omitempty"`
	UpdatedAt time.Time `json:"updated_at"`
	Results   []Result  `json:"results,omitempty"`
}

Config stores the user's preferred cross-architecture emulator.

func Load

func Load() (*Config, error)

Load reads the saved emulation configuration. Missing config returns auto.

type Result

type Result struct {
	Name      string `json:"name"`
	Path      string `json:"path,omitempty"`
	Available bool   `json:"available"`
	Version   string `json:"version,omitempty"`
	Error     string `json:"error,omitempty"`
}

Result describes one detected emulator backend.

func Detect

func Detect(ctx context.Context) []Result

Detect checks available QEMU/FEX/Box64 backends using PATH.

Jump to

Keyboard shortcuts

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