summaryrefslogtreecommitdiff
path: root/internal/server/custom.go
diff options
context:
space:
mode:
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)
}