system

package
v1.5.3-0...-e9feef0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentDirectory

func GetCurrentDirectory() string

func GetMacAddrs

func GetMacAddrs() (macAddrs []string)

获取本机mac地址

func GetPlatform

func GetPlatform() string

func GetRealIP

func GetRealIP() string

获取真实IP

func GetVersion

func GetVersion() string

Types

type IP

type IP struct {
	IPv4 []string
	IPv6 []string
}

func GetIP

func GetIP() IP

获取所有IP

type OS

type OS struct {
	// 主机名
	HostName string `json:"hostName"`
	// 真实使用的IP 地址
	RealIP string `json:"ip"`
	// MAC地址
	MAC string `json:"mac"`
	// IPv4 IP地址
	IPv4 string `json:"ipV4"`
	// IPv6 ip地址
	IPv6 string `json:"ipV6"`
	// 系统内核, linux / windows
	Kernel string `json:"kernel"`
	// 系统位数 32/64
	KernelBit int `json:"kernelBit"`
	// 系统版本,  如: 3.3.0-3.58.24-Rel-2019-05-16_11-57-14-122 / 3.3.0-3.58.22-WIN-Rel-2019-05-15_09-53-18-102
	KernelVersion string `json:"kernelVersion"`
	// 平台名,如: CentOS release 6.4 (Final) / Windows Server 2008 R2 Enterprise Service Pack 1 (build 7601)
	Platform string `json:"platform"`
}

func GetSystemInfo

func GetSystemInfo() *OS

func (*OS) String

func (os *OS) String() string

Jump to

Keyboard shortcuts

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