os

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package os defines OSDetector for several sources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AptSourcesOSDetector

type AptSourcesOSDetector struct{}

AptSourcesOSDetector implements OSDetector and detects the OS from the /etc/apt/sources.list file.

func (*AptSourcesOSDetector) Detect

func (detector *AptSourcesOSDetector) Detect(data map[string][]byte) (OS, version string)

Detect tries to detect OS/Version using /etc/apt/sources.list Necessary to determine precise Debian version when it is an unstable version for instance

func (*AptSourcesOSDetector) GetRequiredFiles

func (detector *AptSourcesOSDetector) GetRequiredFiles() []string

GetRequiredFiles returns the list of files that are required for Detect()

type LsbReleaseOSDetector

type LsbReleaseOSDetector struct{}

AptSourcesOSDetector implements OSDetector and detects the OS from the /etc/lsb-release file.

func (*LsbReleaseOSDetector) Detect

func (detector *LsbReleaseOSDetector) Detect(data map[string][]byte) (OS, version string)

Detect tries to detect OS/Version using "/etc/lsb-release" Necessary for Ubuntu Precise for instance

func (*LsbReleaseOSDetector) GetRequiredFiles

func (detector *LsbReleaseOSDetector) GetRequiredFiles() []string

GetRequiredFiles returns the list of files that are required for Detect()

type OsReleaseOSDetector

type OsReleaseOSDetector struct{}

OsReleaseOSDetector implements OSDetector and detects the OS from the /etc/os-release and usr/lib/os-release files.

func (*OsReleaseOSDetector) Detect

func (detector *OsReleaseOSDetector) Detect(data map[string][]byte) (OS, version string)

Detect tries to detect OS/Version using "/etc/os-release" and "/usr/lib/os-release" Typically for Debian / Ubuntu /etc/debian_version can't be used, it does not make any difference between testing and unstable, it returns stretch/sid

func (*OsReleaseOSDetector) GetRequiredFiles

func (detector *OsReleaseOSDetector) GetRequiredFiles() []string

GetRequiredFiles returns the list of files that are required for Detect()

type RedhatReleaseOSDetector

type RedhatReleaseOSDetector struct{}

RedhatReleaseOSDetector implements OSDetector and detects the OS from the /etc/centos-release, /etc/redhat-release and /etc/system-release files.

func (*RedhatReleaseOSDetector) Detect

func (detector *RedhatReleaseOSDetector) Detect(data map[string][]byte) (OS, version string)

Detect tries to detect OS/Version using "/etc/centos-release", "/etc/redhat-release" and "/etc/system-release" Typically for CentOS and Red-Hat like systems eg. CentOS release 5.11 (Final) eg. CentOS release 6.6 (Final) eg. CentOS Linux release 7.1.1503 (Core)

func (*RedhatReleaseOSDetector) GetRequiredFiles

func (detector *RedhatReleaseOSDetector) GetRequiredFiles() []string

GetRequiredFiles returns the list of files that are required for Detect()

Jump to

Keyboard shortcuts

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