system

package
v0.0.0-...-4ddf654 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package system provides the functionality necessary for interacting with the macOS system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Product

type Product struct {
	Release
	Version semver.Version
}

Product identifies a macOS release and product version (e.g. Big Sur 11.x).

func (Product) String

func (p Product) String() string

type Release

type Release uint8

Release is used to define macOS releases in an enumerated constant (e.g. Mojave, Catalina, BigSur)

const (
	Unknown Release = iota
	Mojave
	Catalina
	BigSur
	Monterey
	Ventura
	Sonoma
	CompatMode
)

func (Release) String

func (r Release) String() string

type System

type System struct {
	// contains filtered or unexported fields
}

System correlates VersionInfo with a Product.

func Scan

func Scan() (*System, error)

Scan reads the VersionInfo and creates a new System struct from that and the associated Product.

func (*System) Product

func (sys *System) Product() *Product

type VersionInfo

type VersionInfo struct {
	ProductBuildVersion       string `plist:"ProductBuildVersion"`
	ProductCopyright          string `plist:"ProductCopyright"`
	ProductName               string `plist:"ProductName"`
	ProductUserVisibleVersion string `plist:"ProductUserVisibleVersion"`
	ProductVersion            string `plist:"ProductVersion"`
	IOSSupportVersion         string `plist:"iOSSupportVersion"`
}

VersionInfo mirrors the raw data found in the SystemVersion plist file.

func (*VersionInfo) Product

func (v *VersionInfo) Product() (*Product, error)

Product determines the specific product that the VersionInfo.ProductVersion is associated with.

Jump to

Keyboard shortcuts

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