Documentation ¶
Index ¶
- func DesktopDir() (string, error)
- func ForbiddenCentOs5x() error
- func GetAllUsedPercent(duration time.Duration) ([]float64, error)
- func GetAppBinFolder(name string) string
- func GetAppLogFolder(name string) string
- func GetCombinedUsedPercent(duration time.Duration) (float64, error)
- func GetCpuCount() int
- func GetEnv(key string) string
- func GetGoPath() (string, error)
- func GetGoRoot() (string, error)
- func GetHomeDir() (string, error)
- func GetSerialNumber() (string, error)
- func GetSharedUserDir() (string, error)
- func GetSocketLimit() uint32
- func GetSystemLang()
- func GetSystemProxy() (string, bool, error)
- func GetTimeWaitRecycle() bool
- func GetTimeWaitReuse() bool
- func SetEnv(key, value string) error
- func SetSocketLimit(size uint32)
- func SetSystemLang()
- func SetSystemProxy(defaultServer string, enabled bool) error
- func SetTimeWaitRecycle(onoff bool)
- func SetTimeWaitReuse(onoff bool)
- func SysRootDir() (string, error)
- func UpDuration() (time.Duration, error)
- func UpTime() (time.Time, error)
- type DyncSleep
- type SysVer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DesktopDir ¶
func GetAllUsedPercent ¶
获取所有CPU的使用百分比,以数组返回
func GetAppBinFolder ¶
func GetAppLogFolder ¶
Windows: Linux: MacOS: ~/Library/items/<App>
func GetCombinedUsedPercent ¶
获取所有CPU的使用百分比,组合成总百分比后返回
func GetCpuCount ¶
func GetCpuCount() int
func GetHomeDir ¶
Home returns the home directory for the executing user.
This uses an OS-specific method for discovering the home directory. An error is returned if a home directory cannot be detected.
func GetSharedUserDir ¶
func GetSocketLimit ¶
func GetSocketLimit() uint32
func GetSystemLang ¶
func GetSystemLang()
func GetSystemProxy ¶
func GetTimeWaitRecycle ¶
func GetTimeWaitRecycle() bool
func GetTimeWaitReuse ¶
func GetTimeWaitReuse() bool
func SetSocketLimit ¶
func SetSocketLimit(size uint32)
func SetSystemLang ¶
func SetSystemLang()
func SetSystemProxy ¶
func SetTimeWaitRecycle ¶
func SetTimeWaitRecycle(onoff bool)
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle
func SetTimeWaitReuse ¶
func SetTimeWaitReuse(onoff bool)
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse
func SysRootDir ¶
Types ¶
type DyncSleep ¶
type DyncSleep struct {
// contains filtered or unexported fields
}
控制CPU使用率,动态调整sleep时间
func NewDyncSleep ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.