net

package
v0.0.0-...-1ec2636 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Server string = "http://ip.taobao.com/service/getIpInfo.php?ip="

Server 获取ip地址信息的url地址

Variables

This section is empty.

Functions

func GetIntranetIPv4

func GetIntranetIPv4() (ipList []net.IP, e error)

GetIntranetIPv4 获取本机IPv4地址

Types

type IP

type IP struct {
	Country   string `json:"country"`
	CountryID string `json:"country_id"`
	Area      string `json:"area"`
	AreaID    string `json:"area_id"`
	Region    string `json:"region"`
	RegionID  string `json:"region_id"`
	City      string `json:"city"`
	CityID    string `json:"city_id"`
	Isp       string `json:"isp"`
}

IP IP信息

type IPInfo

type IPInfo struct {
	Code int `json:"code"`
	Data IP  `json:"data"`
}

IPInfo IP信息

func TaobaoAPI

func TaobaoAPI(ip string) *IPInfo

TaobaoAPI 淘宝获取IP信息的接口

type TCPConn

type TCPConn struct {
	// contains filtered or unexported fields
}

func Connect

func Connect(ip string, port int) (conn *TCPConn, err error)

func (*TCPConn) ClientIP

func (conn *TCPConn) ClientIP() string

func (*TCPConn) Close

func (conn *TCPConn) Close() (err error)

func (*TCPConn) ReadSafe

func (conn *TCPConn) ReadSafe(data []byte) (err error)

func (*TCPConn) RemoteAddr

func (conn *TCPConn) RemoteAddr() string

func (*TCPConn) SetReadTimeout

func (conn *TCPConn) SetReadTimeout(to uint)

func (*TCPConn) SetTimeout

func (conn *TCPConn) SetTimeout(to uint)

func (*TCPConn) SetWriteTimeout

func (conn *TCPConn) SetWriteTimeout(to uint)

func (*TCPConn) WriteSafe

func (conn *TCPConn) WriteSafe(data []byte) (err error)

type TCPListener

type TCPListener net.TCPListener

func Listen

func Listen(ip string, port int) (listener *TCPListener, err error)

func (*TCPListener) Accept

func (l *TCPListener) Accept() (conn *TCPConn, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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