summaryrefslogtreecommitdiff
path: root/internal/server/custom.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/custom.go
parent17e261dd224bc67f031b80930490768ea54353db (diff)
Client: Refactor out adding a Server from getting a config
Diffstat (limited to 'internal/server/custom.go')
-rw-r--r--internal/server/custom.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/server/custom.go b/internal/server/custom.go
index a93242d..52a0094 100644
--- a/internal/server/custom.go
+++ b/internal/server/custom.go
@@ -1,5 +1,17 @@
package server
+import (
+ "fmt"
+ "github.com/eduvpn/eduvpn-common/types"
+)
+
+func (servers *Servers) GetCustomServer(url string) (*InstituteAccessServer, error) {
+ if server, ok := servers.CustomServers.Map[url]; ok {
+ return server, nil
+ }
+ return nil, &types.WrappedErrorMessage{Message: "failed to get institute access server", Err: fmt.Errorf("No custom server with URL: %s", url)}
+}
+
func (servers *Servers) RemoveCustomServer(url string) {
servers.CustomServers.Remove(url)
}