Maint: migrate Cyberghost REGION to COUNTRY

This commit is contained in:
Quentin McGaw (desktop)
2021-09-23 13:28:32 +00:00
parent 1c0a3ed1a4
commit 625de1c834
13 changed files with 1349 additions and 1663 deletions

View File

@@ -18,7 +18,7 @@ func markdownTableHeading(legendFields ...string) (markdown string) {
}
func (s *CyberghostServers) ToMarkdown() (markdown string) {
markdown = markdownTableHeading("Region", "Group", "Hostname")
markdown = markdownTableHeading("Country", "Group", "Hostname")
for _, server := range s.Servers {
markdown += server.ToMarkdown() + "\n"
}
@@ -26,7 +26,7 @@ func (s *CyberghostServers) ToMarkdown() (markdown string) {
}
func (s CyberghostServer) ToMarkdown() (markdown string) {
return fmt.Sprintf("| %s | %s | `%s` |", s.Region, s.Group, s.Hostname)
return fmt.Sprintf("| %s | %s | `%s` |", s.Country, s.Group, s.Hostname)
}
func (s *FastestvpnServers) ToMarkdown() (markdown string) {

View File

@@ -11,13 +11,13 @@ func Test_CyberghostServers_ToMarkdown(t *testing.T) {
servers := CyberghostServers{
Servers: []CyberghostServer{
{Region: "a", Group: "A", Hostname: "xa"},
{Region: "b", Group: "A", Hostname: "xb"},
{Country: "a", Group: "A", Hostname: "xa"},
{Country: "b", Group: "A", Hostname: "xb"},
},
}
markdown := servers.ToMarkdown()
const expected = "| Region | Group | Hostname |\n" +
const expected = "| Country | Group | Hostname |\n" +
"| --- | --- | --- |\n" +
"| a | A | `xa` |\n" +
"| b | A | `xb` |\n"

View File

@@ -5,7 +5,7 @@ import (
)
type CyberghostServer struct {
Region string `json:"region"`
Country string `json:"country"`
Group string `json:"group"`
Hostname string `json:"hostname"`
IPs []net.IP `json:"ips"`