summaryrefslogtreecommitdiff
path: root/internal/server/instituteaccess.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-10-11 10:19:56 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-10-11 12:42:11 +0200
commit565237c14a303a46d62d240b35c6f0082424256a (patch)
tree522f2aeb441a3eb22b6d5e05e66ef348241b2e66 /internal/server/instituteaccess.go
parent17e261dd224bc67f031b80930490768ea54353db (diff)
Client: Refactor out adding a Server from getting a config
Diffstat (limited to 'internal/server/instituteaccess.go')
-rw-r--r--internal/server/instituteaccess.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/server/instituteaccess.go b/internal/server/instituteaccess.go
index c5b58ef..f2669b8 100644
--- a/internal/server/instituteaccess.go
+++ b/internal/server/instituteaccess.go
@@ -21,6 +21,13 @@ type InstituteAccessServers struct {
CurrentURL string `json:"current_url"`
}
+func (servers *Servers) GetInstituteAccess(url string) (*InstituteAccessServer, error) {
+ if server, ok := servers.InstituteServers.Map[url]; ok {
+ return server, nil
+ }
+ return nil, &types.WrappedErrorMessage{Message: "failed to get institute access server", Err: fmt.Errorf("No institute access server with URL: %s", url)}
+}
+
func (servers *Servers) RemoveInstituteAccess(url string) {
servers.InstituteServers.Remove(url)
}