os

package
v0.0.0-...-b0bff92 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

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 HostOSTypeName

func HostOSTypeName() (osTypeName string)

HostOSTypeName returns the name of the host OS.

func IsValidOSTypeName

func IsValidOSTypeName(osType string) bool

IsValidOSTypeName returns true if osType is a valid os type name.

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
	Kubernetes
)

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