Golang Ip库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
李光春 db75469df6 - update 2 weeks ago
geoip - update 3 weeks ago
ip2region - update 3 weeks ago
ip2region_v2 - update 3 weeks ago
ipv6wry - update 3 weeks ago
qqwry - update 3 weeks ago
.drone.yml - update 4 months ago
.gitignore - update ip 2 weeks ago
LICENSE - update v4 2 months ago
README.md - update 2 months ago
analyse.go - update analyse 2 weeks ago
client.go - update 3 weeks ago
const.go - update 2 weeks ago
go.mod - update is 2 weeks ago
go.sum - update is 2 weeks ago
ip.go - update ip 2 weeks ago
is.go - update 2 weeks ago
query.go - update 3 weeks ago

README.md

Golang Ip

📦 Golang Ip

godoc goproxy.cn goreportcard.com deps.dev

安装

go get -v -u go.dtapp.net/goip

使用

package main

import (
	"context"
	"go.dtapp.net/goip"
	"testing"
)

func TestGoIp(t *testing.T) {
	// 获取Mac地址
	t.Log(goip.GetMacAddr(context.Background()))
	// 内网ip
	t.Log(goip.GetInsideIp(context.Background()))
	// 外网ip
	t.Log(goip.GetOutsideIp(context.Background()))
}