2021-09-05 22:54:10 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
import "net"
|
|
|
|
|
|
|
|
|
|
type IPInfoData struct {
|
2022-06-12 00:09:01 +00:00
|
|
|
IP net.IP `json:"ip,omitempty"`
|
2021-09-05 22:54:10 +00:00
|
|
|
Region string `json:"region,omitempty"`
|
|
|
|
|
Country string `json:"country,omitempty"`
|
|
|
|
|
City string `json:"city,omitempty"`
|
|
|
|
|
Hostname string `json:"hostname,omitempty"`
|
|
|
|
|
Loc string `json:"loc,omitempty"`
|
|
|
|
|
Org string `json:"org,omitempty"`
|
|
|
|
|
Postal string `json:"postal,omitempty"`
|
|
|
|
|
Timezone string `json:"timezone,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (i IPInfoData) Copy() (copied IPInfoData) {
|
|
|
|
|
copied = i
|
|
|
|
|
copied.IP = make(net.IP, len(i.IP))
|
|
|
|
|
copy(copied.IP, i.IP)
|
|
|
|
|
return copied
|
|
|
|
|
}
|