config

package
v0.0.0-...-6f6a9a1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const ActiveGameFile = TempFolder + "/ACTIVEGAME"
View Source
const ArcadeCoresFolder = "/media/fat/_Arcade/cores"

TODO: this can't be hardcoded if we want dynamic arcade folders

View Source
const ArcadeDBFile = MrextConfigFolder + "/ArcadeDatabase.csv"
View Source
const ArcadeDBUrl = "https://api.github.com/repositories/521644036/contents/ArcadeDatabase_CSV"
View Source
const CifsFolder = SdFolder + "/cifs"
View Source
const CmdInterface = "/dev/MiSTer_cmd"
View Source
const CoreConfigFolder = SdFolder + "/config"
View Source
const CoreNameFile = TempFolder + "/CORENAME"
View Source
const CoresRecentFile = CoreConfigFolder + "/cores_recent.cfg"
View Source
const CurrentPathFile = TempFolder + "/CURRENTPATH"
View Source
const DownloaderLastRun = ScriptsFolder + "/.config/downloader/downloader.last_successful_run"
View Source
const FontFolder = SdFolder + "/font"
View Source
const FullPathFile = TempFolder + "/FULLPATH"
View Source
const GamesDb = ScriptsConfigFolder + "/mrext/games.db"
View Source
const LinuxFolder = SdFolder + "/linux"
View Source
const LogFileTemplate = TempFolder + "/%s.log"
View Source
const MenuConfigFile = CoreConfigFolder + "/MENU.CFG"
View Source
const MenuCore = "MENU"
View Source
const MisterIniFile = SdFolder + "/MiSTer.ini"
View Source
const MisterIniFileAlt1 = SdFolder + "/MiSTer_alt_1.ini"
View Source
const MisterIniFileAlt2 = SdFolder + "/MiSTer_alt_2.ini"
View Source
const MisterIniFileAlt3 = SdFolder + "/MiSTer_alt_3.ini"
View Source
const MrextConfigFolder = ScriptsConfigFolder + "/mrext"
View Source
const NfcDatabaseFile = SdFolder + "/nfc.csv"
View Source
const NfcLastScanFile = TempFolder + "/NFCSCAN"
View Source
const PidFileTemplate = TempFolder + "/%s.pid"
View Source
const PlayLogDbFile = SdFolder + "/playlog.db"
View Source
const SSHConfigFolder = "/root/.ssh"
View Source
const SSHKeysFile = SSHConfigFolder + "/authorized_keys"
View Source
const ScriptsConfigFolder = ScriptsFolder + "/.config"
View Source
const ScriptsFolder = SdFolder + "/Scripts"
View Source
const SdFolder = "/media/fat"

TODO: should this be hardcoded? how common is usb0 setup?

View Source
const SearchDbFile = SdFolder + "/search.db"
View Source
const StartPathFile = TempFolder + "/STARTPATH"
View Source
const StartupFile = LinuxFolder + "/user-startup.sh"
View Source
const TempFolder = "/tmp"
View Source
const UBootConfigFile = LinuxFolder + "/u-boot.txt"
View Source
const UserAppPathEnv = "MREXT_APP_PATH"
View Source
const UserConfigEnv = "MREXT_CONFIG"
View Source
const UserSSHKeysFile = LinuxFolder + "/authorized_keys"

Variables

View Source
var GamesFolders = []string{
	"/media/usb0/games",
	"/media/usb0",
	"/media/usb1/games",
	"/media/usb1",
	"/media/usb2/games",
	"/media/usb2",
	"/media/usb3/games",
	"/media/usb3",
	"/media/usb4/games",
	"/media/usb4",
	"/media/usb5/games",
	"/media/usb5",
	"/media/fat/cifs/games",
	"/media/fat/cifs",
	"/media/fat/games",
	"/media/fat",
}

TODO: not the order mister actually checks, it does games folders second, but this is simpler for checking prefix

Functions

This section is empty.

Types

type LastPlayedConfig

type LastPlayedConfig struct {
	Name                string `ini:"name,omitempty"`
	LastPlayedName      string `ini:"last_played_name,omitempty"`
	DisableLastPlayed   bool   `ini:"disable_last_played,omitempty"`
	RecentFolderName    string `ini:"recent_folder_name,omitempty"`
	DisableRecentFolder bool   `ini:"disable_recent_folder,omitempty"`
}

type LaunchSyncConfig

type LaunchSyncConfig struct{}

type NfcConfig

type NfcConfig struct {
	ConnectionString string `ini:"connection_string,omitempty"`
	AllowCommands    bool   `ini:"allow_commands,omitempty"`
	DisableSounds    bool   `ini:"disable_sounds,omitempty"`
	ProbeDevice      bool   `ini:"probe_device,omitempty"`
}

type PlayLogConfig

type PlayLogConfig struct {
	SaveEvery   int    `ini:"save_every,omitempty"`
	OnCoreStart string `ini:"on_core_start,omitempty"`
	OnCoreStop  string `ini:"on_core_stop,omitempty"`
	OnGameStart string `ini:"on_game_start,omitempty"`
	OnGameStop  string `ini:"on_game_stop,omitempty"`
}

type RandomConfig

type RandomConfig struct{}

type RemoteConfig

type RemoteConfig struct {
	MdnsService     bool   `ini:"mdns_service,omitempty"`
	SyncSSHKeys     bool   `ini:"sync_ssh_keys,omitempty"`
	AnnounceGameUrl string `ini:"announce_game_url,omitempty"`
}

type SearchConfig

type SearchConfig struct {
	Filter []string `ini:"filter,omitempty" delim:","`
	Sort   string   `ini:"sort,omitempty"`
}

type SystemsConfig

type SystemsConfig struct {
	GamesFolder []string `ini:"games_folder,omitempty,allowshadow"`
	SetCore     []string `ini:"set_core,omitempty,allowshadow"`
}

type UserConfig

type UserConfig struct {
	AppPath    string
	IniPath    string
	LaunchSync LaunchSyncConfig `ini:"launchsync,omitempty"`
	PlayLog    PlayLogConfig    `ini:"playlog,omitempty"`
	Random     RandomConfig     `ini:"random,omitempty"`
	Search     SearchConfig     `ini:"search,omitempty"`
	LastPlayed LastPlayedConfig `ini:"lastplayed,omitempty"`
	Remote     RemoteConfig     `ini:"remote,omitempty"`
	Nfc        NfcConfig        `ini:"nfc,omitempty"`
	Systems    SystemsConfig    `ini:"systems,omitempty"`
}

func LoadUserConfig

func LoadUserConfig(name string, defaultConfig *UserConfig) (*UserConfig, error)

Jump to

Keyboard shortcuts

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