Documentation
¶
Index ¶
Constants ¶
View Source
const ( //HardwareDT hardware data type HardwareDT = "SPHardwareDataType" //AudioDT audio data type AudioDT = "SPAudioDataType" //MemoryDT memory data type MemoryDT = "SPMemoryDataType" //DisplaysDT displays data type DisplaysDT = "SPDisplaysDataType" )
View Source
const ( //OSDT Operating system overview data type OSDT = "SPSoftwareDataType" //ApplicationsDT Installed apps ApplicationsDT = "SPApplicationsDataType" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationsStruct ¶
type ApplicationsStruct struct {
Name string `mapstructure:"_name"`
ArchKind string `mapstructure:"arch_kind"`
LastModified time.Time `mapstructure:"lastModified"`
ObtainedFrom string `mapstructure:"obtained_from"`
Path string `mapstructure:"path"`
Version string `mapstructure:"version"`
SignedBy []string `mapstructure:"signed_by"`
}
ApplicationsStruct infor about installed Apps
func Applications ¶
func Applications() ([]ApplicationsStruct, error)
Applications get installed apps on the system
type AudioStruct ¶
type AudioStruct struct {
Items []struct {
Name string `mapstructure:"_name"`
OutputDevice int `mapstructure:"coreaudio_device_output"`
} `mapstructure:"_items"`
}
AudioStruct data about system audio devices
type DisplaysStruct ¶
type DisplaysStruct struct {
Model string `mapstructure:"sppci_model"`
Vendor string `mapstructure:"spdisplays_vendor"`
VRAM string `mapstructure:"_spdisplays_vram"`
Monitors []MonitorsStruct `mapstructure:"spdisplays_ndrvs"`
}
DisplaysStruct data about system displays
func Displays ¶
func Displays() ([]DisplaysStruct, error)
Displays get information about system displays
type HardwareStruct ¶
type HardwareStruct struct {
BootRomVersion string `mapstructure:"boot_rom_version"`
CPUType string `mapstructure:"cpu_type"`
CPUSpeed string `mapstructure:"current_processor_speed"`
CPUCores string `mapstructure:"number_processors"`
CPUNumber string `mapstructure:"packages"`
ChipType string `mapstructure:"chip_type"`
L2CacheCore string `mapstructure:"l2_cache_core"`
L3Cache string `mapstructure:"l3_cache"`
MachineModel string `mapstructure:"machine_model"`
MachineName string `mapstructure:"machine_name"`
PhysicalMemory string `mapstructure:"physical_memory"`
PlatformUUID string `mapstructure:"platform_UUID"`
Serial string `mapstructure:"serial_number"`
}
HardwareStruct hardware overview
type MainStruct ¶
type MainStruct struct {
Hardware []HardwareStruct `json:"SPHardwareDataType"`
Displays []DisplaysStruct `json:"SPDisplaysDataType"`
Audio []AudioStruct `json:"SPAudioDataType"`
Memory []MemoryStruct `json:"SPMemoryDataType"`
OS []OSStruct `json:"SPSoftwareDataType"`
Applications []ApplicationsStruct `json:"SPApplicationsDataType"`
}
MainStruct data about the whole system
func Exec ¶
func Exec(dataType ...string) (MainStruct, error)
Exec get information about MacOs system using system_profiler command
type MemoryStruct ¶
type MemoryStruct struct {
Items []struct {
Name string `mapstructure:"_name"`
Manufacturer string `mapstructure:"dimm_manufacturer"`
PartNumber string `mapstructure:"dimm_part_number"`
SerialNumber string `mapstructure:"dimm_serial_number"`
Size string `mapstructure:"dimm_size"`
Speed string `mapstructure:"dimm_speed"`
Status string `mapstructure:"dimm_status"`
Type string `mapstructure:"dimm_type"`
} `mapstructure:"_items"`
}
MemoryStruct data about system memory
type MonitorsStruct ¶
type MonitorsStruct struct {
Name string `mapstructure:"_name"`
Resolution string `mapstructure:"spdisplays_resolution"`
SerialNumber string `mapstructure:"spdisplays_display-serial-number"`
}
MonitorsStruct data about system monitors
type OSStruct ¶
type OSStruct struct {
BootMode string `mapstructure:"boot_mode"`
BootVolume string `mapstructure:"boot_volume"`
KernelVersion string `mapstructure:"kernel_version"`
HostName string `mapstructure:"local_host_name"`
Version string `mapstructure:"os_version"`
SecureVM string `mapstructure:"secure_vm"`
SystemIntegrity string `mapstructure:"system_integrity"`
Uptime string `mapstructure:"uptime"`
Username string `mapstructure:"user_name"`
}
OSStruct Operating system overview data
type RawStruct ¶ added in v0.3.0
type RawStruct struct {
DataType string `plist:"_dataType"`
Items []interface{} `plist:"_items"`
}
RawStruct data about the whole system
Click to show internal directories.
Click to hide internal directories.