sysinfo

package module
v0.0.0-...-0582d42 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

README

sysinfo

Go package for detecting the current system's information (e.g. OS, arch, etc.)

This package is especially required by the ActiveState-CLI tool.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchInfo

type ArchInfo int

ArchInfo represents an architecture returned by Architecture().

const (
	// I386 represents the Intel x86 (32-bit) architecture.
	I386 ArchInfo = iota
	// Amd64 represents the x86_64 (64-bit) architecture.
	Amd64
	// Arm represents the ARM architecture.
	Arm
	// UnknownArch represents an unknown architecture.
	UnknownArch
)

func Architecture

func Architecture() ArchInfo

Architecture returns the system's architecture.

func (ArchInfo) String

func (i ArchInfo) String() string

type CompilerInfo

type CompilerInfo struct {
	Name  CompilerNameInfo // C compiler name
	Major int              // major version number
	Minor int              // minor version number
}

CompilerInfo represents a compiler toolchain returned by Compiler().

func Compilers

func Compilers() ([]*CompilerInfo, error)

Compilers returns the system's available compilers.

type CompilerNameInfo

type CompilerNameInfo int

CompilerNameInfo reprents a compiler toolchain name.

const (
	// Gcc represents the GNU C Compiler toolchain.
	Gcc CompilerNameInfo = iota
	// Msvc represents the Microsoft Visual C++ toolchain.
	Msvc
	// Mingw represents the Minimalist GNU for Windows toolchain.
	Mingw
	// Clang represents the LLVM/Clang toolchain.
	Clang
)

func (CompilerNameInfo) String

func (i CompilerNameInfo) String() string

type LibcInfo

type LibcInfo struct {
	Name  LibcNameInfo // C library name
	Major int          // major version number
	Minor int          // minor version number
}

LibcInfo represents a LibC returned by Libc().

func Libc

func Libc() (*LibcInfo, error)

Libc returns the system's C library.

type LibcNameInfo

type LibcNameInfo int

LibcNameInfo represents a C library name.

const (
	// Glibc represents the GNU C library.
	Glibc LibcNameInfo = iota
	// Msvcrt represents the Microsoft Visual C++ runtime library.
	Msvcrt
	// BsdLibc represents the BSD C library.
	BsdLibc
	// UnknownLibc represents an unknown C library.
	UnknownLibc
)

func (LibcNameInfo) String

func (i LibcNameInfo) String() string

type OSVersionInfo

type OSVersionInfo struct {
	Version string // raw version string
	Major   int    // major version number
	Minor   int    // minor version number
	Micro   int    // micro version number
	Name    string // free-form name string (varies by OS)
}

OSVersionInfo represents an OS version returned by OSVersion().

func OSVersion

func OSVersion() (*OSVersionInfo, error)

OSVersion returns the system's OS version.

type OsInfo

type OsInfo int

OsInfo represents an OS returned by OS().

const (
	// Linux represents the Linux operating system.
	Linux OsInfo = iota
	// Windows represents the Windows operating system.
	Windows
	// Mac represents the Macintosh operating system.
	Mac
	// UnknownOs represents an unknown operating system.
	UnknownOs
)

func OS

func OS() OsInfo

OS returns the system's OS

func (OsInfo) String

func (i OsInfo) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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