-
-
Notifications
You must be signed in to change notification settings - Fork 327
/
publicip.go
32 lines (29 loc) · 894 Bytes
/
publicip.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package models
import (
"net/netip"
)
type PublicIP struct {
IP netip.Addr `json:"public_ip,omitempty"`
Region string `json:"region,omitempty"`
Country string `json:"country,omitempty"`
City string `json:"city,omitempty"`
Hostname string `json:"hostname,omitempty"`
Location string `json:"location,omitempty"`
Organization string `json:"organization,omitempty"`
PostalCode string `json:"postal_code,omitempty"`
Timezone string `json:"timezone,omitempty"`
}
func (p *PublicIP) Copy() (publicIPCopy PublicIP) {
publicIPCopy = PublicIP{
IP: p.IP,
Region: p.Region,
Country: p.Country,
City: p.City,
Hostname: p.Hostname,
Location: p.Location,
Organization: p.Organization,
PostalCode: p.PostalCode,
Timezone: p.Timezone,
}
return publicIPCopy
}