diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-11-28 14:09:28 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-11-28 14:12:48 +0100 |
| commit | 59e6ccd051452162fab852a25deb4f0f8a9e22b2 (patch) | |
| tree | f4d8168b5b696f0eae26dbfc0e6cae514cbe65e7 /internal/server/secureinternet.go | |
| parent | 279c0de75629de5868c3ac1b3272a2850e6b62f7 (diff) | |
Refactor: Fix revive linter errors by deleting redundant prefixes
Diffstat (limited to 'internal/server/secureinternet.go')
| -rw-r--r-- | internal/server/secureinternet.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/internal/server/secureinternet.go b/internal/server/secureinternet.go index c6a353b..fa4c9c9 100644 --- a/internal/server/secureinternet.go +++ b/internal/server/secureinternet.go @@ -16,7 +16,7 @@ type SecureInternetHomeServer struct { DisplayName map[string]string `json:"display_name"` // The home server has a list of info for each configured server location - BaseMap map[string]*ServerBase `json:"base_map"` + BaseMap map[string]*Base `json:"base_map"` // We have the authorization URL template, the home organization ID and the current location AuthorizationTemplate string `json:"authorization_template"` @@ -64,12 +64,12 @@ func (server *SecureInternetHomeServer) TemplateAuth() func(string) string { } } -func (server *SecureInternetHomeServer) Base() (*ServerBase, error) { +func (server *SecureInternetHomeServer) Base() (*Base, error) { errorMessage := "failed getting current secure internet home base" if server.BaseMap == nil { return nil, types.NewWrappedError( errorMessage, - &ServerSecureInternetMapNotFoundError{}, + &SecureInternetMapNotFoundError{}, ) } @@ -78,7 +78,7 @@ func (server *SecureInternetHomeServer) Base() (*ServerBase, error) { if !exists { return nil, types.NewWrappedError( errorMessage, - &ServerSecureInternetBaseNotFoundError{Current: server.CurrentLocation}, + &SecureInternetBaseNotFoundError{Current: server.CurrentLocation}, ) } return base, nil @@ -94,11 +94,11 @@ func (servers *Servers) HasSecureLocation() bool { func (server *SecureInternetHomeServer) addLocation( locationServer *types.DiscoveryServer, -) (*ServerBase, error) { +) (*Base, error) { errorMessage := "failed adding a location" // Initialize the base map if it is non-nil if server.BaseMap == nil { - server.BaseMap = make(map[string]*ServerBase) + server.BaseMap = make(map[string]*Base) } // Add the location to the base map @@ -106,7 +106,7 @@ func (server *SecureInternetHomeServer) addLocation( if !exists || base == nil { // Create the base to be added to the map - base = &ServerBase{} + base = &Base{} base.URL = locationServer.BaseURL base.DisplayName = server.DisplayName base.SupportContact = locationServer.SupportContact @@ -152,22 +152,22 @@ func (server *SecureInternetHomeServer) init( return nil } -type ServerGetSecureInternetHomeError struct{} +type SecureInternetHomeNotFoundError struct{} -func (e *ServerGetSecureInternetHomeError) Error() string { +func (e *SecureInternetHomeNotFoundError) Error() string { return "failed to get secure internet home server, not found" } -type ServerSecureInternetMapNotFoundError struct{} +type SecureInternetMapNotFoundError struct{} -func (e *ServerSecureInternetMapNotFoundError) Error() string { +func (e *SecureInternetMapNotFoundError) Error() string { return "secure internet map not found" } -type ServerSecureInternetBaseNotFoundError struct { +type SecureInternetBaseNotFoundError struct { Current string } -func (e *ServerSecureInternetBaseNotFoundError) Error() string { +func (e *SecureInternetBaseNotFoundError) Error() string { return fmt.Sprintf("secure internet base not found with current location: %s", e.Current) } |
