os

package
v0.0.0-...-9d78121 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: LGPL-3.0 Imports: 4 Imported by: 124

Documentation

Overview

Package os provides access to operating system related configuration.

Index

Constants

This section is empty.

Variables

View Source
var HostOS = hostOS // for monkey patching

Functions

func ReadOSRelease

func ReadOSRelease(f string) (map[string]string, error)

ReadOSRelease parses the information in the os-release file.

See http://www.freedesktop.org/software/systemd/man/os-release.html.

Types

type OSType

type OSType int
const (
	Unknown OSType = iota
	Ubuntu
	Windows
	OSX
	CentOS
	GenericLinux
	OpenSUSE
)

func (OSType) EquivalentTo

func (t OSType) EquivalentTo(t2 OSType) bool

EquivalentTo returns true if the OS type is equivalent to another OS type.

func (OSType) IsLinux

func (t OSType) IsLinux() bool

IsLinux returns true if the OS type is a Linux variant.

func (OSType) String

func (t OSType) String() string

Jump to

Keyboard shortcuts

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