diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-02-12 19:18:05 +0100 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2024-02-19 14:15:07 +0100 |
| commit | 74e36f0ead717105f26087c2cab08b41ba5a7ce8 (patch) | |
| tree | 1eb2b7516bea705c9b5a50ce0965e170414ed880 /internal/discovery/discovery.go | |
| parent | 682d70091af2044ff6d8b350da9dff13163232e2 (diff) | |
All: Document everything to pass revive lint
Diffstat (limited to 'internal/discovery/discovery.go')
| -rw-r--r-- | internal/discovery/discovery.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/discovery/discovery.go b/internal/discovery/discovery.go index 88a37d9..6db9425 100644 --- a/internal/discovery/discovery.go +++ b/internal/discovery/discovery.go @@ -27,6 +27,7 @@ type Discovery struct { ServerList discotypes.Servers `json:"servers"` } +// DiscoURL is the URL used for fetching the discovery files and signatures var DiscoURL = "https://disco.eduvpn.org/v2/" // file is a helper function that gets a disco JSON and fills the structure with it @@ -123,11 +124,12 @@ func (discovery *Discovery) ServerByURL( return nil, fmt.Errorf("no server of type '%s' at URL '%s'", srvType, baseURL) } -type CountryNotFoundError struct { +// ErrCountryNotFound is used when the secure internet country cannot be found +type ErrCountryNotFound struct { CountryCode string } -func (cnf *CountryNotFoundError) Error() string { +func (cnf *ErrCountryNotFound) Error() string { return fmt.Sprintf("no secure internet server with country code: '%s'", cnf.CountryCode) } @@ -139,7 +141,7 @@ func (discovery *Discovery) ServerByCountryCode(countryCode string) (*discotypes return &srv, nil } } - return nil, &CountryNotFoundError{CountryCode: countryCode} + return nil, &ErrCountryNotFound{CountryCode: countryCode} } // orgByID returns the discovery organization by the organization ID |
