system

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package system 系统工具类

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentDirectory

func CurrentDirectory() string

CurrentDirectory 获取当前执行程序目录

func GetPid

func GetPid() int

GetPid 获取PID

func GetTime

func GetTime() string

GetTime 获取当前时间,格式:2006-01-02 15:04:05

func GetTimestamp

func GetTimestamp() int64

GetTimestamp 获取当前时间戳(秒)

func GetTimestampMilli

func GetTimestampMilli() int64

GetTimestampMilli 获取当前时间戳(毫秒)

func GetWd

func GetWd() string

GetWd 获取工作目录

func LookupGid

func LookupGid(name string) int

LookupGid 根据组名称获取组ID 获取失败返回-1

func LookupUIDAndGID

func LookupUIDAndGID(name string) (int, int)

LookupUIDAndGID 根据用户名获取指定用户的uid和gid 获取失败返回-1

func NumGoroutine

func NumGoroutine() int

NumGoroutine 获取协程数量

func ParentDirectory

func ParentDirectory(directory string) string

ParentDirectory 获取父级目录

func UIDAndGID

func UIDAndGID() (int, int)

UIDAndGID 获取当前进程用户ID和组ID

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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