summaryrefslogtreecommitdiff
path: root/internal/discovery
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-11-28 12:50:23 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-11-28 12:50:23 +0100
commit7bab6c76599fdfd34ea9bb064d871ed2be01d4c8 (patch)
tree8200ead8926c0c5f11f750698760a0bcd93c230c /internal/discovery
parent7339e77c6eda5b96874dfc099d5c58da8ed53629 (diff)
Lint: Run godot fix
Full command: golangci-lint run --disable-all -E godot --fix
Diffstat (limited to 'internal/discovery')
-rw-r--r--internal/discovery/discovery.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/internal/discovery/discovery.go b/internal/discovery/discovery.go
index d7fb273..17d5b08 100644
--- a/internal/discovery/discovery.go
+++ b/internal/discovery/discovery.go
@@ -12,7 +12,7 @@ import (
)
-// Discovery is the main structure used for this package
+// Discovery is the main structure used for this package.
type Discovery struct {
// organizations represents the organizations that are returned by the discovery server
organizations types.DiscoveryOrganizations
@@ -22,7 +22,7 @@ type Discovery struct {
}
// discoFile is a helper function that gets a disco JSON and fills the structure with it
-// If it was unsuccessful it returns an error
+// If it was unsuccessful it returns an 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
@@ -79,7 +79,7 @@ func (discovery *Discovery) DetermineOrganizationsUpdate() bool {
return discovery.organizations.Timestamp.IsZero()
}
-// SecureLocationList returns a slice of all the available locations
+// SecureLocationList returns a slice of all the available locations.
func (discovery *Discovery) SecureLocationList() []string {
var locations []string
for _, currentServer := range discovery.servers.List {
@@ -91,7 +91,7 @@ func (discovery *Discovery) SecureLocationList() []string {
}
// ServerByURL returns the discovery server by the base URL and the according type ("secure_internet", "institute_access")
-// An error is returned if and only if nil is returned for the server
+// An error is returned if and only if nil is returned for the server.
func (discovery *Discovery) ServerByURL(
baseURL string,
serverType string,
@@ -108,7 +108,7 @@ func (discovery *Discovery) ServerByURL(
}
// ServerByCountryCode returns the discovery server by the country code and the according type ("secure_internet", "institute_access")
-// An error is returned if and only if nil is returned for the server
+// An error is returned if and only if nil is returned for the server.
func (discovery *Discovery) ServerByCountryCode(
countryCode string,
serverType string,
@@ -125,7 +125,7 @@ func (discovery *Discovery) ServerByCountryCode(
}
// orgByID returns the discovery organization by the organization ID
-// An error is returned if and only if nil is returned for the organization
+// An error is returned if and only if nil is returned for the organization.
func (discovery *Discovery) orgByID(orgID string) (*types.DiscoveryOrganization, error) {
for _, organization := range discovery.organizations.List {
if organization.OrgID == orgID {
@@ -141,7 +141,7 @@ func (discovery *Discovery) orgByID(orgID string) (*types.DiscoveryOrganization,
// SecureHomeArgs returns the secure internet home server arguments:
// - The organization it belongs to
// - The secure internet server itself
-// An error is returned if and only if nil is returned for the organization
+// An error is returned if and only if nil is returned for the organization.
func (discovery *Discovery) SecureHomeArgs(
orgID string,
) (*types.DiscoveryOrganization, *types.DiscoveryServer, error) {
@@ -179,7 +179,7 @@ func (discovery *Discovery) DetermineServersUpdate() bool {
}
// Organizations returns the discovery organizations
-// If there was an error, a cached copy is returned if available
+// If there was an error, a cached copy is returned if available.
func (discovery *Discovery) Organizations() (*types.DiscoveryOrganizations, error) {
if !discovery.DetermineOrganizationsUpdate() {
return &discovery.organizations, nil
@@ -198,7 +198,7 @@ func (discovery *Discovery) Organizations() (*types.DiscoveryOrganizations, erro
}
// Servers returns the discovery servers
-// If there was an error, a cached copy is returned if available
+// If there was an error, a cached copy is returned if available.
func (discovery *Discovery) Servers() (*types.DiscoveryServers, error) {
if !discovery.DetermineServersUpdate() {
return &discovery.servers, nil