distro

package
v0.1.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IDMapping = map[string]Type{
	"debian":        Debian,
	"ubuntu":        Ubuntu,
	"rhel":          RedHat,
	"centos":        CentOS,
	"fedora":        Fedora,
	"alpine":        Alpine,
	"busybox":       Busybox,
	"amzn":          AmazonLinux,
	"ol":            OracleLinux,
	"arch":          ArchLinux,
	"opensuse-leap": OpenSuseLeap,
}

IDMapping connects a distro ID like "ubuntu" to a Distro type

Functions

This section is empty.

Types

type Distro

type Distro struct {
	Type       Type
	Version    *hashiVer.Version
	RawVersion string
}

func Identify

func Identify(resolver scope.Resolver) Distro

Identify parses distro-specific files to determine distro metadata like version and release.

func NewDistro

func NewDistro(t Type, ver string) (Distro, error)

func NewUnknownDistro

func NewUnknownDistro() Distro

NewUnknownDistro creates a standardized Distro object for unidentifiable distros

func (Distro) FullVersion

func (d Distro) FullVersion() string

func (Distro) MajorVersion

func (d Distro) MajorVersion() string

func (Distro) Name

func (d Distro) Name() string

Name provides a string repr of the distro

func (Distro) String

func (d Distro) String() string

type Type

type Type int
const (
	UnknownDistroType Type = iota
	Debian
	Ubuntu
	RedHat
	CentOS
	Fedora
	Alpine
	Busybox
	AmazonLinux
	OracleLinux
	ArchLinux
	OpenSuseLeap
)

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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