summaryrefslogtreecommitdiff
path: root/internal/discovery/discovery.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-07-20 16:07:13 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-07-20 16:07:13 +0200
commit0c9a300a58d9dacce7b84ff93222eed35eab5721 (patch)
tree423d1f05024f5c050e09f8d239f15b2e8681e640 /internal/discovery/discovery.go
parenta1939a105dc4ddab27489b1bac3b22f674536e41 (diff)
Refactor: Do not log in internal packages
The reason behind this is that we then do not have to pass a lot to each function. Logging inside internal packages is less useful as we want to let them return errors and only log in the 'public' facing API or let the client decide
Diffstat (limited to 'internal/discovery/discovery.go')
-rw-r--r--internal/discovery/discovery.go12
1 files changed, 1 insertions, 11 deletions
diff --git a/internal/discovery/discovery.go b/internal/discovery/discovery.go
index b4163a8..24ed01c 100644
--- a/internal/discovery/discovery.go
+++ b/internal/discovery/discovery.go
@@ -4,19 +4,15 @@ import (
"encoding/json"
"fmt"
- "github.com/jwijenbergh/eduvpn-common/internal/fsm"
"github.com/jwijenbergh/eduvpn-common/internal/http"
- "github.com/jwijenbergh/eduvpn-common/internal/log"
- "github.com/jwijenbergh/eduvpn-common/internal/types"
"github.com/jwijenbergh/eduvpn-common/internal/util"
+ "github.com/jwijenbergh/eduvpn-common/internal/types"
"github.com/jwijenbergh/eduvpn-common/internal/verify"
)
type Discovery struct {
Organizations types.DiscoveryOrganizations
Servers types.DiscoveryServers
- FSM *fsm.FSM
- Logger *log.FileLogger
}
// Helper function that gets a disco json
@@ -59,11 +55,6 @@ func getDiscoFile(jsonFile string, previousVersion uint64, structure interface{}
return string(fileBody), nil
}
-func (discovery *Discovery) Init(fsm *fsm.FSM, logger *log.FileLogger) {
- discovery.FSM = fsm
- discovery.Logger = logger
-}
-
// FIXME: Implement based on
// https://github.com/eduvpn/documentation/blob/v3/SERVER_DISCOVERY.md
// - [IMPLEMENTED] on "first launch" when offering the search for "Institute Access" and "Organizations";
@@ -150,7 +141,6 @@ func (discovery *Discovery) DetermineServersUpdate() bool {
if now >= should_update_time {
return true
}
- discovery.Logger.Log(log.LOG_INFO, "No update needed for servers, 1h is not passed yet")
return false
}