summaryrefslogtreecommitdiff
path: root/internal/discovery
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2023-01-03 12:37:00 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2023-01-03 12:37:00 +0100
commit8e7a25eacf715d7d83a8f10c84b03c68ea04a871 (patch)
tree06b760a15b873e935be726bd324daa2e06e32d18 /internal/discovery
parentf654160956728bc0ce92ed420540388869405513 (diff)
Discovery: Remove server type from getting by country code
It's always secure internet, no need to pass it as an argument
Diffstat (limited to 'internal/discovery')
-rw-r--r--internal/discovery/discovery.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/discovery/discovery.go b/internal/discovery/discovery.go
index 7109bc9..b2a90cd 100644
--- a/internal/discovery/discovery.go
+++ b/internal/discovery/discovery.go
@@ -101,15 +101,15 @@ func (discovery *Discovery) ServerByURL(
return nil, errors.Errorf("no server of type '%s' at URL '%s'", srvType, baseURL)
}
-// ServerByCountryCode returns the discovery server by the country code and the according type ("secure_internet", "institute_access")
+// ServerByCountryCode returns the discovery server by the country code
// An error is returned if and only if nil is returned for the server.
-func (discovery *Discovery) ServerByCountryCode(countryCode string, srvType string) (*types.DiscoveryServer, error) {
+func (discovery *Discovery) ServerByCountryCode(countryCode string) (*types.DiscoveryServer, error) {
for _, srv := range discovery.servers.List {
- if srv.CountryCode == countryCode && srv.Type == srvType {
+ if srv.CountryCode == countryCode && srv.Type == "secure_internet" {
return &srv, nil
}
}
- return nil, errors.Errorf("no server of type '%s' with country code '%s'", srvType, countryCode)
+ return nil, errors.Errorf("no server of type 'secure_internet' with country code '%s'", countryCode)
}
// orgByID returns the discovery organization by the organization ID