platform

package
v0.0.0-...-02c76fb Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Overview

Package platform queries the underlying operating system

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Platform

type Platform struct {
	Build             string
	OS                string
	LinuxDistribution string
	LinuxLSBLike      []string
	Name              string
	PrettyName        string
	Version           string
}

Platform is a struct containing version information for the underlying operating system

func DefaultPlatform

func DefaultPlatform() (*Platform, error)

DefaultPlatform Queries the runtime and then attempts to discover version information from the underlying operating system

func (*Platform) LinuxLSB

func (platform *Platform) LinuxLSB() error

LinuxLSB finds Linux LSB files and parses them Most modern :inux distributions have standardized on /etc/os-release

func (*Platform) OSXVers

func (platform *Platform) OSXVers() error

OSXVers runs /usr/bin/sw_vers to get OSX version information

func (*Platform) ParseLSBContent

func (platform *Platform) ParseLSBContent(content string)

ParseLSBContent populates a Platform struct with /etc/os-release data

func (*Platform) ParseOSXVersion

func (platform *Platform) ParseOSXVersion(versionData string)

ParseOSXVersion Takes output from /usr/bin/sw_vers and stores in a Platform

Jump to

Keyboard shortcuts

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