getip

package
v0.0.0-...-f2cb11c Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package getip 获取 ip 信息包

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrParseIP 解析ip地址错误
	ErrParseIP = errors.New("parse ip error")
)

Functions

func IPInfo

func IPInfo(https bool) (ipAddr string, err error)

IPInfo 从ipify获取IP地址

func IPInfoByClient

func IPInfoByClient(c *requester.HTTPClient) (ipAddr string, err error)

IPInfoByClient 给定client获取ip地址

func IPInfoFromNetease

func IPInfoFromNetease() (ipAddr string, err error)

IPInfoFromNetease 从网易服务器获取ip

func IPInfoFromNeteaseByClient

func IPInfoFromNeteaseByClient(c *requester.HTTPClient) (ipAddr string, err error)

func IPInfoFromTechainBaidu

func IPInfoFromTechainBaidu() (ipAddr string, err error)

IPInfoFromTechainBaidu 从 techain.baidu.com 获取ip

func IPInfoFromTechainBaiduByClient

func IPInfoFromTechainBaiduByClient(c *requester.HTTPClient) (ipAddr string, err error)

Types

type IPResNetease

type IPResNetease struct {
	Result  string `json:"result"`
	Code    int    `json:"code"`
	Message string `json:"message"`
}

IPResNetease 网易服务器获取ip返回的结果

Jump to

Keyboard shortcuts

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