summaryrefslogtreecommitdiff
path: root/internal/discovery
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-11-28 11:52:04 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-11-28 12:03:16 +0100
commit7339e77c6eda5b96874dfc099d5c58da8ed53629 (patch)
treeb602159b0c397cbaa4f8983aea987274163fe357 /internal/discovery
parente9f8db8ee8fccf60e58deb1d72766f94a053bb16 (diff)
Refactor: Remove most get prefixes for receiver functions
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 7df209c..d7fb273 100644
--- a/internal/discovery/discovery.go
+++ b/internal/discovery/discovery.go
@@ -21,9 +21,9 @@ type Discovery struct {
servers types.DiscoveryServers
}
-// getDiscoFile is a helper function that gets a disco json and fills the structure with it
+// discoFile is a helper function that gets a disco JSON and fills the structure with it
// If it was unsuccessful it returns an error
-func getDiscoFile(jsonFile string, previousVersion uint64, structure interface{}) error {
+func discoFile(jsonFile string, previousVersion uint64, structure interface{}) error {
errorMessage := fmt.Sprintf("failed getting file: %s from the Discovery server", jsonFile)
// Get json data
discoURL := "https://disco.eduvpn.org/v2/"
@@ -185,7 +185,7 @@ func (discovery *Discovery) Organizations() (*types.DiscoveryOrganizations, erro
return &discovery.organizations, nil
}
file := "organization_list.json"
- bodyErr := getDiscoFile(file, discovery.organizations.Version, &discovery.organizations)
+ bodyErr := discoFile(file, discovery.organizations.Version, &discovery.organizations)
if bodyErr != nil {
// Return previous with an error
return &discovery.organizations, types.NewWrappedError(
@@ -204,7 +204,7 @@ func (discovery *Discovery) Servers() (*types.DiscoveryServers, error) {
return &discovery.servers, nil
}
file := "server_list.json"
- bodyErr := getDiscoFile(file, discovery.servers.Version, &discovery.servers)
+ bodyErr := discoFile(file, discovery.servers.Version, &discovery.servers)
if bodyErr != nil {
// Return previous with an error
return &discovery.servers, types.NewWrappedError(