Documentation ¶
Overview ¶
Package com_net provide function about net
Index ¶
Examples ¶
Constants ¶
View Source
const (
En0 = "en0"
)
Variables ¶
This section is empty.
Functions ¶
func GetOutboundIP ¶
GetOutboundIP need network Get preferred outbound ip of this machine
Example ¶
package main import ( "fmt" "github.com/zhangxiaofeng05/com/com_net" ) func main() { ip, err := com_net.GetOutboundIP() if err != nil { panic(err) } fmt.Println(ip.String()) // 192.168.31.147 }
Output:
func GetPhysicalAddress ¶
Example ¶
package main import ( "fmt" "github.com/zhangxiaofeng05/com/com_net" ) func main() { physicalAddress, err := com_net.GetPhysicalAddress() if err != nil { panic(err) } fmt.Printf("physicalAddress: %v", physicalAddress) // mac: b1:bd:84:51:1c:bc }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.