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.
李光春 803502b68a - update 23 minutes ago
geoip - update 23 minutes ago
ip2region - update 3 months ago
ip2region_v2 - update 3 months ago
ipv6wry - update 3 months ago
qqwry - update 23 minutes ago
.drone.yml - update 6 months ago
.gitignore - update ip 2 months ago
LICENSE - update v4 4 months ago
README.md - update 4 months ago
analyse.go - update analyse 2 months ago
client.go - update 3 months ago
const.go - update 23 minutes ago
go.mod - update 23 minutes ago
go.sum - update 23 minutes ago
ip.go - update ip 2 months ago
is.go - update 2 months ago
query.go - update 3 months 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()))
}