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.
Go to file
李光春 803502b68a
- update
1 year ago
geoip - update 1 year ago
ip2region - update 2 years ago
ip2region_v2 - update 2 years ago
ipv6wry - update 2 years ago
qqwry - update 1 year ago
.drone.yml - update 2 years ago
.gitignore - update ip 2 years ago
LICENSE - update v4 2 years ago
README.md - update 2 years ago
analyse.go - update analyse 2 years ago
client.go - update 2 years ago
const.go - update 1 year ago
go.mod - update 1 year ago
go.sum - update 1 year ago
ip.go - update ip 2 years ago
is.go - update 2 years ago
query.go - update 2 years 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()))
}