Documentation
¶
Index ¶
- Constants
- Variables
- func DNSAddresses() ([]string, error)
- func Dup2(oldfd, newfd int) (err error)
- func HandleExitError(err error)
- func IsBeingRosettaTranslated() bool
- func LimaUser(ctx context.Context, limaVersion string, warn bool) *user.User
- func ProxySettings() (map[string]string, error)
- func SignalName(sig os.Signal) string
- func SysKill(pid int, sig Signal) error
- func Sysctl(ctx context.Context, name string) (string, error)
- type Group
- type Signal
- type Stat
- type User
Constants ¶
View Source
const SigInt = Signal(syscall.SIGINT)
SigInt is the value of SIGINT.
View Source
const SigKill = Signal(syscall.SIGKILL)
SigKill is the value of SIGKILL.
View Source
const UnixPathMax = 104
UnixPathMax is the value of UNIX_PATH_MAX.
Variables ¶
View Source
var MachineID = sync.OnceValue(func() string { x, err := machineID(context.Background()) if err == nil && x != "" { return x } logrus.WithError(err).Debug("failed to get machine ID, falling back to use hostname instead") hostname, err := os.Hostname() if err != nil { panic(fmt.Errorf("failed to get hostname: %w", err)) } return hostname })
View Source
var ProductVersion = sync.OnceValues(func() (*semver.Version, error) { cmd := exec.Command("sw_vers", "-productVersion") b, err := cmd.Output() if err != nil { return nil, fmt.Errorf("failed to execute %v: %w", cmd.Args, err) } verTrimmed := strings.TrimSpace(string(b)) for strings.Count(verTrimmed, ".") < 2 { verTrimmed += ".0" } verSem, err := semver.NewVersion(verTrimmed) if err != nil { return nil, fmt.Errorf("failed to parse macOS version %q: %w", verTrimmed, err) } return verSem, nil })
ProductVersion returns the macOS product version like "12.3.1".
Functions ¶
func DNSAddresses ¶
func HandleExitError ¶
func HandleExitError(err error)
HandleExitError calls os.Exit immediately without printing an error, only if the error is an *exec.ExitError (non-nil).
The function does not call os.Exit if the error is of any other type, even if it wraps an *exec.ExitError, so that the caller can print the error message.
func IsBeingRosettaTranslated ¶
func IsBeingRosettaTranslated() bool
func ProxySettings ¶
func SignalName ¶
Types ¶
type Group ¶
func LookupGroup ¶
Click to show internal directories.
Click to hide internal directories.