infra

package
v0.0.0-...-cfb18d5 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source

Variables

This section is empty.

Functions

func GatewayIP

func GatewayIP(netCard string) (string, error)

func GenerateUUID

func GenerateUUID() string

func HandlerError

func HandlerError(err error)

func LanIP

func LanIP() string

LanIP 局域网ip地址

Types

type NetInformation

type NetInformation struct {
	Name         string // 网卡名
	HardwareAddr net.HardwareAddr
	Mac          string
	IP           string
	Mask         string
	GatewayIP    string
}

NetInformation 网络信息

func GetNetInformation

func GetNetInformation() (*NetInformation, error)

GetNetInformation 通过网卡获得 MAC IP IPMask GatewayIP

type Network

type Network struct {
	Name         string // net card name
	HardwareAddr net.HardwareAddr
	IPNet        *net.IPNet
}

func ActiveNetwork

func ActiveNetwork() (*Network, error)

Jump to

Keyboard shortcuts

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