Documentation
¶
Index ¶
- Variables
- func ClangFormat(src, filename string, color bool) string
- func CodeSign(filePath, signature string) error
- func CodeSignAdHoc(filePath string) error
- func CodeSignWithEntitlements(filePath, entitlementsPath, signature string) error
- func CodesignShow(path string) (string, error)
- func CodesignVerify(path string) (string, error)
- func Compare(v, w string) int
- func ConvertStrToInt(intStr string) (uint64, error)
- func Copy(src, dst string) error
- func CopyWithMode(src, dst string, mode os.FileMode) error
- func Cp(src, dst string) error
- func CreateCompressedDMG(appPath, diskimagePath string) error
- func CreateInstaller(distPath, targetVol string) error
- func CreateSparseDiskImage(volumeName, diskPath string) (string, error)
- func DiffVersion(v, w string) (string, error)
- func Difference[T comparable](l1 []T, l2 []T) (diff []T)
- func DisplayImageInTerminal(r io.Reader, width, height int) error
- func Dumper(w io.Writer, vaddr uint) io.WriteCloser
- func ExtractFromDMG(ipswPath, dmgPath, destPath string, pattern *regexp.Regexp) ([]string, error)
- func FilterStrFromSlice(slice []string, filter string) []string
- func FilterStrSlice(slice []string, filter string) []string
- func GetKernelCollectionPath() (string, error)
- func GetKernelPath() (string, error)
- func GetXCodePath() (string, error)
- func GitClone(repo, dst string) (string, error)
- func GitDiff(src, dst string, conf *GitDiffConfig) (string, error)
- func GitRefresh(repoPath string) (string, error)
- func GrepStrings(data []byte, searchStr string) []string
- func HexDump(data []byte, vaddr uint64) string
- func Indent(f func(s string), level int) func(string)
- func InstallKDK(path string) error
- func InstallXCodeSimRuntime(path string) error
- func IsASCII(s string) bool
- func IsAlnum(c byte) bool
- func IsAlreadyMounted(image, mountPoint string) (string, bool, error)
- func IsDeveloperImageMounted(udid string) error
- func IsDeveloperModeEnabled(udid string) (bool, error)
- func IsHex(c rune) bool
- func IsLetter(c byte) bool
- func IsPunctuation(c byte) bool
- func IsSpace(c byte) bool
- func KmutilCreate(conf *KMUConfig) (err error)
- func Mount(image, mountPoint string) error
- func MountDMG(image string) (string, bool, error)
- func Pad(length int) string
- func PickDevice() (*lockdownd.DeviceValues, error)
- func PickDevices() ([]*lockdownd.DeviceValues, error)
- func PkgUtilExpand(src, dst string) (string, error)
- func PrintAsn1Data(data []byte)
- func PrintCMSData(data []byte)
- func RandomAgent() string
- func RemoveStrFromSlice(s []string, r string) []string
- func Retry(attempts int, sleep time.Duration, f func() error) (err error)
- func Reverse[T any](input []T)
- func ReverseBytes(a []byte) []byte
- func SearchFileName(name string, files []os.FileInfo) (os.FileInfo, error)
- func SearchZip(files []*zip.File, pattern *regexp.Regexp, folder string, flat, progress bool) ([]string, error)
- func Slugify(s string) string
- func SortDevices(devices []string) []string
- func SortFileNameAscend(files []os.FileInfo)
- func SortFileNameDescend(files []os.FileInfo)
- func SortMachoVersions(list []MachoVersion)
- func SortVersions(list []string)
- func StrContainsStrSliceItem(item string, slice []string) bool
- func StrSliceAddSuffix(slice []string, suffix string) []string
- func StrSliceContains(slice []string, item string) bool
- func StrSliceHas(slice []string, item string) bool
- func TrimPrefixStrSlice(slice []string, prefix string) []string
- func Uint64SliceContains(slice []uint64, item uint64) bool
- func UnTarGz(tarfile, destPath string) error
- func UnicodeSanitize(s string) string
- func Unique[T comparable](s []T) []T
- func UniqueAppend[T comparable](slice []T, i T) []T
- func UniqueConcat[T comparable](slice []T, in []T) []T
- func Unmount(mountPoint string, force bool) error
- func Unzip(src, dest string, filter func(f *zip.File) bool) ([]string, error)
- func Verify(sha1sum, name string) (bool, error)
- type BuildInfo
- type ByMachoVersion
- type ByVersion
- type Device
- type DeviceID
- type Devices
- type GitDiffConfig
- type HdiUtilInfo
- type IORegistryEntryChild
- type KMUConfig
- type MachoVersion
- type Pair
Constants ¶
This section is empty.
Variables ¶
var ErrMountResourceBusy = errors.New("hdiutil: mount failed - Resource busy")
Functions ¶
func ClangFormat ¶
func CodeSignAdHoc ¶
CodeSignAdHoc codesigns a given binary with ad-hoc signature
func CodeSignWithEntitlements ¶
CodeSignWithEntitlements codesigns a given binary with given entitlements
func CodesignShow ¶
func CodesignVerify ¶
func Compare ¶
Compare returns an integer comparing two versions according to semantic version precedence. The result will be 0 if v == w, -1 if v < w, or +1 if v > w.
An invalid semantic version string is considered less than a valid one. All invalid semantic version strings compare equal to each other.
func ConvertStrToInt ¶
ConvertStrToInt converts an input string to uint64
func Copy ¶
Copy recursively copies src into dst with src's file modes. CREDIT: https://github.com/goreleaser/goreleaser/blob/main/internal/gio/copy.go
func CopyWithMode ¶
CopyWithMode recursively copies src into dst with the given mode. The given mode applies only to files. Their parent dirs will have the same mode as their src counterparts.
func CreateCompressedDMG ¶
CreateCompressedDMG creates a compressed r/o disk image containing Install macOS.app
func CreateInstaller ¶
CreateInstaller creates an macOS installer
func CreateSparseDiskImage ¶
CreateSparseDiskImage creates a sparse disk image and returns it's path
func DiffVersion ¶
func Difference ¶
func Difference[T comparable](l1 []T, l2 []T) (diff []T)
func DisplayImageInTerminal ¶
DisplayImageInTerminal displays an image in the terminal (supported in iTerm2 and VSCode)
func Dumper ¶
func Dumper(w io.Writer, vaddr uint) io.WriteCloser
Dumper returns a WriteCloser that writes a hex dump of all written data to w. The format of the dump matches the output of `hexdump -C` on the command line.
func ExtractFromDMG ¶
func FilterStrFromSlice ¶
FilterStrFromSlice removes all the strings that contain the filter from a string slice
func FilterStrSlice ¶
FilterStrSlice removes all the strings that do NOT contain the filter from a string slice
func GetKernelCollectionPath ¶
func GetKernelPath ¶
func GetXCodePath ¶
func GrepStrings ¶
GrepStrings returns all matching strings in []byte
func HexDump ¶
HexDump returns a string that contains a hex dump of the given data. The format of the hex dump matches the output of `hexdump -C` on the command line.
func InstallKDK ¶
func InstallXCodeSimRuntime ¶
func IsDeveloperImageMounted ¶
func IsDeveloperModeEnabled ¶
func IsPunctuation ¶
func KmutilCreate ¶
func PickDevice ¶
func PickDevice() (*lockdownd.DeviceValues, error)
func PickDevices ¶
func PickDevices() ([]*lockdownd.DeviceValues, error)
func PkgUtilExpand ¶
func PrintAsn1Data ¶
func PrintAsn1Data(data []byte)
func PrintCMSData ¶
func PrintCMSData(data []byte)
func RandomAgent ¶
func RandomAgent() string
func RemoveStrFromSlice ¶
RemoveStrFromSlice removes a single string from a string slice
func SearchZip ¶
func SearchZip(files []*zip.File, pattern *regexp.Regexp, folder string, flat, progress bool) ([]string, error)
SearchZip searches for files in a zip.Reader
func SortDevices ¶
SortDevices sorts a list of device names
func SortFileNameAscend ¶
func SortFileNameDescend ¶
func SortMachoVersions ¶
func SortMachoVersions(list []MachoVersion)
func SortVersions ¶
func SortVersions(list []string)
SortVersions sorts a list of semantic version strings using ByVersion.
func StrContainsStrSliceItem ¶
StrContainsStrSliceItem returns true if given string contains any item in the string slice
func StrSliceAddSuffix ¶
func StrSliceContains ¶
StrSliceContains returns true if string slice contains given string
func StrSliceHas ¶
StrSliceHas returns true if string slice has an exact given string
func TrimPrefixStrSlice ¶
TrimPrefixStrSlice trims the prefix from all strings in string slice
func Uint64SliceContains ¶
Uint64SliceContains returns true if uint64 slice contains given uint64
func UnTarGz ¶
UnTarGz - https://stackoverflow.com/a/57640231
func UnicodeSanitize ¶
UnicodeSanitize sanitizes string to be used in Hugo URL's, allowing only a predefined set of special Unicode characters. If RemovePathAccents configuration flag is enabled, Unicode accents are also removed. Hyphens in the original input are maintained. Spaces will be replaced with a single hyphen, and sequential replacement hyphens will be reduced to one.
func UniqueAppend ¶
func UniqueAppend[T comparable](slice []T, i T) []T
func UniqueConcat ¶
func UniqueConcat[T comparable](slice []T, in []T) []T
Types ¶
type BuildInfo ¶
func GetBuildInfo ¶
GetBuildInfo returns the current device OS build info
type ByMachoVersion ¶
type ByMachoVersion []MachoVersion
func (ByMachoVersion) Len ¶
func (vs ByMachoVersion) Len() int
func (ByMachoVersion) Less ¶
func (vs ByMachoVersion) Less(i, j int) bool
func (ByMachoVersion) Swap ¶
func (vs ByMachoVersion) Swap(i, j int)
type ByVersion ¶
type ByVersion []string
ByVersion implements sort.Interface for sorting semantic version strings.
type DeviceID ¶
type DeviceID struct { IOObjectClass string IOObjectRetainCount int IORegistryEntryChildren []IORegistryEntryChild IORegistryEntryID int IORegistryEntryName string }
func GetDeviceID ¶
GetDeviceID returns the ioreg IOPlatformExpertDevice of the current device
type GitDiffConfig ¶
type HdiUtilInfo ¶
type HdiUtilInfo struct { Framework string `plist:"framework,omitempty" xml:"framework,omitempty"` Revision string `plist:"revision,omitempty" xml:"revision,omitempty"` Vendor string `plist:"vendor,omitempty" xml:"vendor,omitempty"` Images []image `plist:"images,omitempty" xml:"images,omitempty"` }
func MountInfo ¶
func MountInfo() (*HdiUtilInfo, error)
func (HdiUtilInfo) Mount ¶
func (i HdiUtilInfo) Mount(mount string) *image
type IORegistryEntryChild ¶
type IORegistryEntryChild struct { IOBusyInterest string IOConsoleSecurityInterest string IOInterruptControllers []string IOInterruptSpecifiers [][]byte IOObjectClass string IOObjectRetainCount int IOPlatformSerialNumber string IOPlatformSystemSleepPolicy []byte IOPlatformUUID string IOPolledInterface string IORegistryEntryID int IORegistryEntryName string IOServiceBusyState int IOServiceBusyTime int IOServiceState int BoardID []byte `plist:"board-id,omitempty"` BridgeModel []byte `plist:"bridge-model,omitempty"` ClockFrequency []byte `plist:"clock-frequency,omitempty"` Compatible []byte `plist:"compatible,omitempty"` Manufacturer []byte `plist:"manufacturer,omitempty"` Model []byte `plist:"model,omitempty"` Name []byte `plist:"name,omitempty"` PlatformFeature []byte `plist:"platform-feature,omitempty"` ProductName []byte `plist:"product-name,omitempty"` SerialNumber []byte `plist:"serial-number,omitempty"` SystemType []byte `plist:"system-type,omitempty"` TargetType []byte `plist:"target-type,omitempty"` Version []byte `plist:"version,omitempty"` }
func (IORegistryEntryChild) String ¶
func (e IORegistryEntryChild) String() string