summaryrefslogtreecommitdiff
path: root/exports/exports.go
diff options
context:
space:
mode:
Diffstat (limited to 'exports/exports.go')
-rw-r--r--exports/exports.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/exports/exports.go b/exports/exports.go
index 9be3b66..931bed5 100644
--- a/exports/exports.go
+++ b/exports/exports.go
@@ -634,6 +634,7 @@ func SetSecureLocation(orgID *C.char, cc *C.char) *C.char {
// DiscoServers gets the servers from discovery, returned as `types/discovery/discovery.go Servers` marshalled as JSON
//
// - `c` is the Cookie that needs to be passed. Create a new Cookie using `CookieNew`
+// - `cache` indicates whether or not the cache should only be used, meaning no network call
// - `search` is the search string for filtering the list.
//
// If any of the words in the search query is not contained in any of the display names or keywords, the candidate is filtered.
@@ -677,7 +678,7 @@ func SetSecureLocation(orgID *C.char, cc *C.char) *C.char {
// } , null
//
//export DiscoServers
-func DiscoServers(c C.uintptr_t, search *C.char) (*C.char, *C.char) {
+func DiscoServers(c C.uintptr_t, cache C.int, search *C.char) (*C.char, *C.char) {
state, stateErr := getVPNState()
if stateErr != nil {
return nil, getCError(stateErr)
@@ -686,7 +687,7 @@ func DiscoServers(c C.uintptr_t, search *C.char) (*C.char, *C.char) {
if err != nil {
return nil, getCError(err)
}
- servers, err := state.DiscoServers(ck, goString(search))
+ servers, err := state.DiscoServers(ck, cache != 0, goString(search))
if servers == nil && err != nil {
return nil, getCError(err)
}
@@ -700,6 +701,7 @@ func DiscoServers(c C.uintptr_t, search *C.char) (*C.char, *C.char) {
// DiscoOrganizations gets the organizations from discovery, returned as `types/discovery/discovery.go Organizations` marshalled as JSON.
//
// - `c` is the Cookie that needs to be passed. Create a new Cookie using `CookieNew`
+// - `cache` indicates whether or not the cache should only be used, meaning no network call
// - `search` is the search string for filtering the list.
//
// If any of the words in the `search` query is not contained in any of the display names or keywords, the candidate is filtered.
@@ -752,7 +754,7 @@ func DiscoServers(c C.uintptr_t, search *C.char) (*C.char, *C.char) {
// }, null
//
//export DiscoOrganizations
-func DiscoOrganizations(c C.uintptr_t, search *C.char) (*C.char, *C.char) {
+func DiscoOrganizations(c C.uintptr_t, cache C.int, search *C.char) (*C.char, *C.char) {
state, stateErr := getVPNState()
if stateErr != nil {
return nil, getCError(stateErr)
@@ -761,7 +763,7 @@ func DiscoOrganizations(c C.uintptr_t, search *C.char) (*C.char, *C.char) {
if err != nil {
return nil, getCError(err)
}
- orgs, err := state.DiscoOrganizations(ck, goString(search))
+ orgs, err := state.DiscoOrganizations(ck, cache != 0, goString(search))
if orgs == nil && err != nil {
return nil, getCError(err)
}