ipinfo

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Overview

@Title @Description $ @Author 55 @Date 2022/5/12

@Title @Description $ @Author 55 @Date 2022/5/16

@Title @Description $ @Author 55 @Date 2022/5/12

@Title @Description $ @Author 55 @Date 2022/5/15

@Title @Description $ @Author 55 @Date 2022/6/23

@Title @Description $ @Author 55 @Date 2022/5/12

@Title @Description $ @Author 55 @Date 2022/6/23

@Title @Description $ @Author 55 @Date 2022/5/15

@Title @Description $ @Author 55 @Date 2022/5/12

@Title @Description $ @Author 55 @Date 2022/5/16

Index

Constants

View Source
const (
	InfoTypeFail      = 0 // 获取失败
	InfoTypeNotRegion = 1 // 无省份信息
	InfoTypeNotCity   = 2 // 无城市信息
	InfoTypeSuccess   = 3 // 获取成功
)

Variables

This section is empty.

Functions

func Init

func Init(third []interface{})

输入生效的第三方库及调用顺序

Types

type BaiDu

type BaiDu struct {
	Url  string
	Free bool
}

func (*BaiDu) CanFree added in v1.1.1

func (s *BaiDu) CanFree() bool

func (*BaiDu) Init added in v1.1.1

func (s *BaiDu) Init(cfg interface{}) bool

func (*BaiDu) IpInfo

func (s *BaiDu) IpInfo(ip string) (info *IpInfo)

百度接口 无国家显示

type Base

type Base interface {
	Init(cfg interface{}) bool
	IpInfo(ip string) *IpInfo
	CanFree() bool
}

type Ip138 added in v1.1.1

type Ip138 struct {
	Url   string
	Free  bool
	Token string
}

func (*Ip138) CanFree added in v1.1.1

func (s *Ip138) CanFree() bool

func (*Ip138) Init added in v1.1.1

func (s *Ip138) Init(cfg interface{}) bool

func (*Ip138) IpInfo added in v1.1.1

func (s *Ip138) IpInfo(ip string) (info *IpInfo)

type IpApi

type IpApi struct {
	Url  string
	Free bool
}

func (*IpApi) CanFree added in v1.1.1

func (s *IpApi) CanFree() bool

func (*IpApi) Init added in v1.1.1

func (s *IpApi) Init(cfg interface{}) bool

func (*IpApi) IpInfo

func (s *IpApi) IpInfo(ip string) (info *IpInfo)

通过ip-api.com获取ip地理位置信息 由于ip-api.com是国外的网站,对国内市级ip位置有一定误差

type IpInfo

type IpInfo struct {
	Status  string `json:"status,omitempty"`
	Type    string `json:"type,omitempty"`
	Country string `json:"country,omitempty"`
	Region  string `json:"region,omitempty"`
	City    string `json:"city,omitempty"`
	Isp     string `json:"isp,omitempty"`
	Query   string `json:"query,omitempty"`
	Param   string `json:"param,omitempty"`
}

func GetIpInfo

func GetIpInfo(ip string) (err error, info *IpInfo)

func GetIpInfoFree added in v1.1.2

func GetIpInfoFree(ip string, free bool) (err error, info *IpInfo)

type PcOnline

type PcOnline struct {
	Url  string
	Free bool
}

func (*PcOnline) CanFree added in v1.1.1

func (s *PcOnline) CanFree() bool

func (*PcOnline) Init added in v1.1.1

func (s *PcOnline) Init(cfg interface{}) bool

func (*PcOnline) IpInfo

func (s *PcOnline) IpInfo(ip string) (info *IpInfo)

太平洋电脑网接口 无国家显示

type TaoBao

type TaoBao struct {
	Url  string
	Free bool
}

func (*TaoBao) CanFree added in v1.1.1

func (s *TaoBao) CanFree() bool

func (*TaoBao) Init added in v1.1.1

func (s *TaoBao) Init(cfg interface{}) bool

func (*TaoBao) IpInfo

func (s *TaoBao) IpInfo(ip string) (info *IpInfo)

淘宝ip地址库 限制频率:每个用户的访问频率需大于1qps

type UserAgentInfo

type UserAgentInfo struct {
	Url  string
	Free bool
}

func (*UserAgentInfo) CanFree added in v1.1.1

func (s *UserAgentInfo) CanFree() bool

func (*UserAgentInfo) Init added in v1.1.1

func (s *UserAgentInfo) Init(cfg interface{}) bool

func (*UserAgentInfo) IpInfo

func (s *UserAgentInfo) IpInfo(ip string) (info *IpInfo)

ip.useragentinfo.com 直接调用即可【没有频率限制】

type ZipInfo added in v1.1.1

type ZipInfo struct {
	Url   string
	Free  bool
	User  string
	Token string
}

func (*ZipInfo) CanFree added in v1.1.1

func (s *ZipInfo) CanFree() bool

func (*ZipInfo) Init added in v1.1.1

func (s *ZipInfo) Init(cfg interface{}) bool

func (*ZipInfo) IpInfo added in v1.1.1

func (s *ZipInfo) IpInfo(ip string) (info *IpInfo)

Jump to

Keyboard shortcuts

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