summaryrefslogtreecommitdiff
path: root/internal/server/custom.go
blob: 52a0094c9545a94bdf3b31f102ee7daa0c963dbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)
}