goip

package
v1.0.51 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInsideIp

func GetInsideIp(ctx context.Context) string

GetInsideIp 内网ip

func GetMacAddr added in v1.0.47

func GetMacAddr(ctx context.Context) (arrays []string)

GetMacAddr 获取Mac地址

func GetOutsideIp

func GetOutsideIp(ctx context.Context) (ip string)

GetOutsideIp 外网ip

func Ips

func Ips(ctx context.Context) (map[string]string, error)

Ips 获取全部网卡的全部IP

Types

type AnalyseResult added in v1.0.47

type AnalyseResult struct {
	IP       string `json:"ip,omitempty"`       // 输入的ip地址
	Country  string `json:"country,omitempty"`  // 国家或地区
	Province string `json:"province,omitempty"` // 省份
	City     string `json:"city,omitempty"`     // 城市
	Area     string `json:"area,omitempty"`     // 区域
	Isp      string `json:"isp,omitempty"`      // 运营商
}

type Client added in v1.0.47

type Client struct {
	V4Region ip2region.Ip2Region // IPV4
	V4db     v4.Pointer          // IPV4
	V6db     v6.Pointer          // IPV6
}

func NewIp added in v1.0.47

func NewIp() *Client

NewIp 实例化

func (*Client) Analyse added in v1.0.47

func (c *Client) Analyse(item string) AnalyseResult

func (*Client) CheckIpv4 added in v1.0.47

func (c *Client) CheckIpv4(ips string) bool

CheckIpv4 检查数据是不是IPV4

func (*Client) CheckIpv6 added in v1.0.47

func (c *Client) CheckIpv6(ips string) bool

CheckIpv6 检测是不是IPV6

func (*Client) Ipv4 added in v1.0.47

func (c *Client) Ipv4(ip string) (res v4.Result, resInfo ip2region.IpInfo)

func (*Client) Ipv6 added in v1.0.47

func (c *Client) Ipv6(ip string) (res v6.Result)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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