Skip to content

Commit 30da20d

Browse files
authored
add capabilities enum (#507)
1 parent 25fe7d3 commit 30da20d

File tree

1 file changed

+42
-7
lines changed

1 file changed

+42
-7
lines changed

regions.go

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,54 @@ import (
99
"github.com/go-resty/resty/v2"
1010
)
1111

12+
// This is an enumeration of Capabilities Linode offers that can be referenced
13+
// through the user-facing parts of the application.
14+
// Defined as strings rather than a custom type to avoid breaking change.
15+
// Can be changed in the potential v2 version.
16+
const (
17+
Linodes string = "Linodes"
18+
NodeBalancers string = "NodeBalancers"
19+
BlockStorage string = "Block Storage"
20+
ObjectStorage string = "Object Storage"
21+
ObjectStorageRegions string = "Object Storage Access Key Regions"
22+
LKE string = "Kubernetes"
23+
LkeHaControlPlanes string = "LKE HA Control Planes"
24+
CloudFirewall string = "Cloud Firewall"
25+
GPU string = "GPU Linodes"
26+
Vlans string = "Vlans"
27+
VPCs string = "VPCs"
28+
VPCsExtra string = "VPCs Extra"
29+
MachineImages string = "Machine Images"
30+
BareMetal string = "Bare Metal"
31+
DBAAS string = "Managed Databases"
32+
BlockStorageMigrations string = "Block Storage Migrations"
33+
Metadata string = "Metadata"
34+
PremiumPlans string = "Premium Plans"
35+
EdgePlans string = "Edge Plans"
36+
LKEControlPlaneACL string = "LKE Network Access Control List (IP ACL)"
37+
ACLB string = "Akamai Cloud Load Balancer"
38+
SupportTicketSeverity string = "Support Ticket Severity"
39+
Backups string = "Backups"
40+
PlacementGroup string = "Placement Group"
41+
DiskEncryption string = "Disk Encryption"
42+
)
43+
1244
// Region-related endpoints have a custom expiry time as the
1345
// `status` field may update for database outages.
1446
var cacheExpiryTime = time.Minute
1547

1648
// Region represents a linode region object
1749
type Region struct {
18-
ID string `json:"id"`
19-
Country string `json:"country"`
20-
Capabilities []string `json:"capabilities"`
21-
Status string `json:"status"`
22-
Resolvers RegionResolvers `json:"resolvers"`
23-
Label string `json:"label"`
24-
SiteType string `json:"site_type"`
50+
ID string `json:"id"`
51+
Country string `json:"country"`
52+
53+
// A List of enums from the above constants
54+
Capabilities []string `json:"capabilities"`
55+
56+
Status string `json:"status"`
57+
Resolvers RegionResolvers `json:"resolvers"`
58+
Label string `json:"label"`
59+
SiteType string `json:"site_type"`
2560
}
2661

2762
// RegionResolvers contains the DNS resolvers of a region

0 commit comments

Comments
 (0)