summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2023-03-20 13:59:06 +0100
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2023-09-25 09:43:37 +0200
commit3618f2337bf0099d1fe8e4782cda3677ea4175be (patch)
tree638fa68f28c20178a729ef991e470d8d8aa9ee64 /client
parent8ccb4486cdb03cd3b10606b4bd77b7bcb4107e6d (diff)
Types: Split discovery into its own package
Diffstat (limited to 'client')
-rw-r--r--client/client.go5
-rw-r--r--client/server.go5
2 files changed, 6 insertions, 4 deletions
diff --git a/client/client.go b/client/client.go
index c788cb2..78b451d 100644
--- a/client/client.go
+++ b/client/client.go
@@ -15,6 +15,7 @@ import (
"github.com/eduvpn/eduvpn-common/internal/oauth"
"github.com/eduvpn/eduvpn-common/internal/server"
"github.com/eduvpn/eduvpn-common/types"
+ discotypes "github.com/eduvpn/eduvpn-common/types/discovery"
"github.com/eduvpn/eduvpn-common/types/protocol"
"github.com/go-errors/errors"
)
@@ -238,7 +239,7 @@ func (c *Client) askProfile(srv server.Server) error {
// If the list cannot be retrieved an error is returned.
// If this is the case then a previous version of the list is returned if there is any.
// This takes into account the frequency of updates, see: https://github.com/eduvpn/documentation/blob/v3/SERVER_DISCOVERY.md#organization-list.
-func (c *Client) DiscoOrganizations() (orgs *types.DiscoveryOrganizations, err error) {
+func (c *Client) DiscoOrganizations() (orgs *discotypes.Organizations, err error) {
defer func() {
if err != nil {
c.logError(err)
@@ -262,7 +263,7 @@ func (c *Client) DiscoOrganizations() (orgs *types.DiscoveryOrganizations, err e
// If the list cannot be retrieved an error is returned.
// If this is the case then a previous version of the list is returned if there is any.
// This takes into account the frequency of updates, see: https://github.com/eduvpn/documentation/blob/v3/SERVER_DISCOVERY.md#server-list.
-func (c *Client) DiscoServers() (dss *types.DiscoveryServers, err error) {
+func (c *Client) DiscoServers() (dss *discotypes.Servers, err error) {
defer func() {
if err != nil {
c.logError(err)
diff --git a/client/server.go b/client/server.go
index a0de9f3..74caff1 100644
--- a/client/server.go
+++ b/client/server.go
@@ -9,6 +9,7 @@ import (
"github.com/eduvpn/eduvpn-common/internal/oauth"
"github.com/eduvpn/eduvpn-common/internal/server"
"github.com/eduvpn/eduvpn-common/types"
+ discotypes "github.com/eduvpn/eduvpn-common/types/discovery"
"github.com/eduvpn/eduvpn-common/types/protocol"
"github.com/go-errors/errors"
)
@@ -265,7 +266,7 @@ func (c *Client) AddInstituteServer(url string) (err error) {
// FIXME: Do nothing with discovery here as the client already has it
// So pass a server as the parameter
- var dSrv *types.DiscoveryServer
+ var dSrv *discotypes.Server
dSrv, err = c.Discovery.ServerByURL(url, "institute_access")
if err != nil {
c.goBackInternal()
@@ -378,7 +379,7 @@ func (c *Client) AddCustomServer(url string) (err error) {
// Indicate that we're loading the server
c.FSM.GoTransition(StateLoadingServer)
- customServer := &types.DiscoveryServer{
+ customServer := &discotypes.Server{
BaseURL: url,
DisplayName: map[string]string{"en": url},
Type: "custom_server",