distro

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 8 Imported by: 1

README

distro package

This package supports detecting different os families, architectures, distributions and distribution versions.

supportes OS families

The distro package supports these families and detecting their distro (or os) version.

  • aix (does not have distributions)
  • darwin (different os names depending on version)
  • linux (see below)
  • solaris (see below)
  • windows

supported linux distributions

  • Alpine Linux
  • ALT Linux
  • Amazon
  • Arch Linux
  • CentOS (and CentOS Stream, TencentOS)
  • Clear Linux
  • Cumulus Linux
  • Debian
  • Deepin
  • Devuan
  • Gentoo
  • Linux Mint
  • Mandriva
  • OpenWrt
  • Oracle Linux
  • RHEL
  • Slackware
  • SMGL
  • SUSE
  • Ubuntu
  • Uos

supported solaris distributions

  • NexentaOS
  • OmniOS
  • OpenIndiana
  • SmartOS
  • Solaris (= Oracle Solaris)

windows

The windows versioning is the same as the version string provided by the WinVer.exe.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotFound       = errors.New("key not found")
	ErrInvalidFileFormat = errors.New("invalid file format")
)
View Source
var (
	ErrDetectionFailed = errors.New("failed to detect distribution")
)
View Source
var (
	ErrVersionNotFound = errors.New("no version found")
)

Functions

This section is empty.

Types

type Info

type Info struct {
	// linux, windows etc
	Family string `json:"family"`
	// architecture: amd64, arm64, etc.
	Arch string `json:"arch"`
	// ubuntu, alpine, server (windows server)
	Distribution string `json:"distribution"`
	// 11.1.1
	Version string `json:"version"`
}

Info is the struct that contains the os information It i snot suposed to be used on its own but it is returned by the Detect() function.

func Detect

func Detect() (*Info, error)

Jump to

Keyboard shortcuts

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