iptool

package
v0.0.0-...-1253343 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientIP

func GetClientIP(r *http.Request) string

func GetLocationByIP

func GetLocationByIP(ip string) string

func IPDataCloudGetLocation

func IPDataCloudGetLocation(ctx context.Context, url, ip, key, lang string) (*model.Location, error)

func IsPrivateIP

func IsPrivateIP(ip net.IP) bool

Types

type Data

type Data struct {
	Location model.Location `json:"location"`
}

type LocationInfoRes

type LocationInfoRes struct {
	Code int    `json:"code"`
	Data Data   `json:"data"`
	Msg  string `json:"msg"`
}

Jump to

Keyboard shortcuts

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