sysutil

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package sysutil is common system utils for Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvOr added in v0.2.0

func EnvOr(key, def string) string

EnvOr retrieves the value of the environment variable named by the key. If the variable is present in the environment the value (which may be empty) is returned. Otherwise, the default value will be returned.

func FQDN

func FQDN() (string, error)

FQDN returns the FQDN of current node.

func GetProcessByPid

func GetProcessByPid(pid int) string

GetProcessByPid Get process with the given PID

func HomeDir

func HomeDir() (home string)

HomeDir returns home directory of current user.

func IsBigEndian

func IsBigEndian() bool

IsBigEndian reports whether current os byte order is big endian.

func IsLinux

func IsLinux() bool

IsLinux reports whether the current os is Linux.

func IsWindows

func IsWindows() bool

IsWindows reports whether the current os is Windows.

func Kill

func Kill(pid int) error

Kill kills process by pid

func PID

func PID() int

PID get process ID

func Pwd

func Pwd() (home string)

Pwd returns the path of the current process.

func TmpDir

func TmpDir() string

TmpDir Alias for os.TempDir.

func User

func User() *user.User

User returns the current user.

Types

This section is empty.

Jump to

Keyboard shortcuts

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