Documentation
¶
Overview ¶
Package launchables defines shared IDs and URI helpers for platform-owned virtual launch targets.
Index ¶
- Constants
- Variables
- func Available(cfg *config.Instance, pl platforms.Platform) ([]VirtualSystem, []VirtualMedia)
- func DecodeID(s string) (uuid.UUID, error)
- func EncodeID(id uuid.UUID) string
- func IsURI(s string) bool
- func Launchers(cfg *config.Instance, pl platforms.Platform) []platforms.Launcher
- func LaunchersFor(systems []VirtualSystem, media []VirtualMedia) []platforms.Launcher
- func ParseURI(rawURI string) (uuid.UUID, bool, error)
- type LaunchFunc
- type Launchable
- type Provider
- type VirtualMedia
- type VirtualSystem
Constants ¶
const Scheme = "zaparoo"
Variables ¶
var ( MisterOtherChess = uuid.MustParse("cc7bb790-cc2c-47d2-aecc-fdd192e9d1e1") MisterOtherDonut = uuid.MustParse("65fc7c57-559b-4114-82db-7e96d1164cd6") MisterOtherEpochGalaxyII = uuid.MustParse("d6443fe6-1c01-48f7-aa1d-30aca8fdc967") MisterOtherFlappyBird = uuid.MustParse("2b1c5f98-3a74-450e-8984-347e31c4a602") MisterOtherGameOfLife = uuid.MustParse("cc28721f-9239-4931-b10f-2a5c6180d26f") MisterOtherGBMidi = uuid.MustParse("565a41bc-7c9e-43a4-afcf-781659efe338") MisterOtherGenMidi = uuid.MustParse("91fafc5c-25d1-4356-b5b5-3628573d77b3") MisterOtherSlugCross = uuid.MustParse("e05893a4-59ee-4919-a3cd-47ff8c5e518d") MisterOtherTomyScramble = uuid.MustParse("349dfee7-bc32-4004-b377-ff8fe8083836") MisterArcadeThirdStrike = uuid.MustParse("618433aa-0e8b-4230-800e-ec33758affb7") MisterConsoleAY38500 = uuid.MustParse("8229ba4f-722c-5758-bea7-e87cf1189249") MisterConsoleBBCBridgeCompanion = uuid.MustParse("7c10204b-487a-5fc5-b581-a02e5cace541") MisterConsoleMyVision = uuid.MustParse("8aabe6fa-663f-5042-9bbc-5854203ecb8a") MisterConsoleSuperVision8000 = uuid.MustParse("c5749c4c-ed8f-5dbf-95aa-ae9050d6444a") MisterComputerAltair8800 = uuid.MustParse("9f8c3edf-d3e1-5318-ae32-239ba7b525e3") MisterComputerArchie = uuid.MustParse("7c4b3326-1eff-5d0d-90f4-a38647d5e59a") MisterComputerAtariST = uuid.MustParse("db259c65-6377-5d97-8739-86b3c2ca3722") MisterComputerC128 = uuid.MustParse("e67fea5e-c9aa-52b9-a3d0-e618802f399a") MisterComputerCoCo3 = uuid.MustParse("9994a8bf-c544-577c-870f-af46cace1ce5") MisterComputerColecoAdam = uuid.MustParse("a519cc51-beca-59d0-943d-0b0ad4b6096c") MisterComputerEG2000 = uuid.MustParse("b248cffd-830b-5512-8ff1-ac8b03237954") MisterComputerEnterprise = uuid.MustParse("58d5a253-2b6e-5487-92af-3dedb2420e7a") MisterComputerHomelab = uuid.MustParse("78754749-7d52-5cf2-a244-403fe1a8f83f") MisterComputerIQ151 = uuid.MustParse("5a5481eb-7ba5-5555-bbd2-74617735a40f") MisterComputerMacLC = uuid.MustParse("0f44cfc2-9841-57ab-8ce6-29385abf0a2e") MisterComputerOndraSPO186 = uuid.MustParse("3ed6d7a9-cfca-5611-a286-9715453d04de") MisterComputerPC88 = uuid.MustParse("8423a436-b5d0-5b14-8708-fd07bd20e506") MisterComputerPCjr = uuid.MustParse("66593d3c-aeab-57cd-aa0c-74b3b7e11d5b") MisterComputerSharpMZ = uuid.MustParse("fe290bd4-beb2-5aa3-a8c1-d2397180a25e") MisterComputerTK2000 = uuid.MustParse("30780a8e-2a6b-5d9d-aa33-589fb427d5c3") MisterComputerTandy1000 = uuid.MustParse("1aae818d-8a80-5bca-9ed7-36078f499689") MisterComputerVT52 = uuid.MustParse("ffa35024-0bbf-57fc-a0c4-7712498c1d7a") )
Define stable launchable UUIDs here, then import them from the platform package that owns the actual launch behavior.
Functions ¶
func Available ¶
func Available(cfg *config.Instance, pl platforms.Platform) ([]VirtualSystem, []VirtualMedia)
Available returns available virtual systems and media defined by this platform.
func LaunchersFor ¶
func LaunchersFor(systems []VirtualSystem, media []VirtualMedia) []platforms.Launcher
LaunchersFor returns scheme launchers for already-filtered launchables.
Types ¶
type LaunchFunc ¶
LaunchFunc executes a platform-defined virtual target. The path argument is the zaparoo:// URI that selected this launchable.
type Launchable ¶
type Launchable interface {
// contains filtered or unexported methods
}
Launchable is implemented by all platform-defined virtual launch targets.
func Launchables ¶
func Launchables(cfg *config.Instance, pl platforms.Platform) []Launchable
Launchables returns validated launchables defined by a platform.
type Provider ¶
type Provider interface {
Launchables(*config.Instance) []Launchable
}
Provider is optionally implemented by platforms with launchable targets.
type VirtualMedia ¶
type VirtualMedia struct {
Launch LaunchFunc
// Test reports whether the launchable is available. Nil means always available.
Test func(*config.Instance) bool
SystemID string
Name string
ID uuid.UUID
}
VirtualMedia is a single launch-only media-shaped entry attached to a real Zaparoo system and indexed into MediaDB as a virtual URI path.
func Media ¶
func Media(cfg *config.Instance, pl platforms.Platform) []VirtualMedia
Media returns virtual media defined by this platform.
func MediaForSystem ¶
MediaForSystem returns virtual media for a real Zaparoo system ID.
func (*VirtualMedia) ZapScript ¶
func (m *VirtualMedia) ZapScript() string
ZapScript returns the generated zaparoo URI for a virtual media item.
type VirtualSystem ¶
type VirtualSystem struct {
Launch LaunchFunc
// Test reports whether the launchable is available. Nil means always available.
Test func(*config.Instance) bool
Name string
Category string
ID uuid.UUID
}
VirtualSystem is a launch-only entry returned from the systems endpoint. ID is encoded into zaparoo:// URIs and must be globally unique.
func Systems ¶
func Systems(cfg *config.Instance, pl platforms.Platform) []VirtualSystem
Systems returns virtual systems defined by this platform.
func (*VirtualSystem) ZapScript ¶
func (s *VirtualSystem) ZapScript() string
ZapScript returns the generated zaparoo URI for a virtual system.