mac

package
v0.0.0-...-56a2066 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package mac contains Mac-specific pieces of interrogation which are nonetheless testable on arbitrary platforms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DimensionsFromGPUs

func DimensionsFromGPUs(gpuSlice []GPU) []string

DimensionsFromGPUs turns a slice of Mac GPUs into Swarming-style dimensions, e.g. ["8086", "8086:3e9b"]. If there are no GPUs, return ["none"].

Types

type GPU

type GPU struct {
	// Any string field missing from the plist ends up "".
	ID       string `plist:"spdisplays_device-id"`
	VendorID string `plist:"spdisplays_vendor-id"`
	Vendor   string `plist:"spdisplays_vendor"`
	Version  string `plist:"spdisplays_gmux-version"`
	Model    string `plist:"sppci_model"`
}

func GPUsFromSystemProfilerXML

func GPUsFromSystemProfilerXML(xml string) ([]GPU, error)

GPUsFromSystemProfilerXML returns the GPUs found on a Mac by System Profiler, as expressed through its -xml output option. If the output doesn't look valid, returns an error and no GPUs. If there are no GPUs, will return 0 GPUs even if no error occurs.

Jump to

Keyboard shortcuts

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