2022-06-12 00:53:39 +00:00
|
|
|
package ipinfo
|
2021-09-05 22:54:10 +00:00
|
|
|
|
|
|
|
|
import "net"
|
|
|
|
|
|
2022-06-12 00:53:39 +00:00
|
|
|
type Response 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"`
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-12 00:53:39 +00:00
|
|
|
func (r Response) Copy() (copied Response) {
|
|
|
|
|
copied = r
|
|
|
|
|
copied.IP = make(net.IP, len(r.IP))
|
|
|
|
|
copy(copied.IP, r.IP)
|
2021-09-05 22:54:10 +00:00
|
|
|
return copied
|
|
|
|
|
}
|