summaryrefslogtreecommitdiff
path: root/exports
diff options
context:
space:
mode:
authorJeroen Wijenbergh <jeroenwijenbergh@protonmail.com>2022-03-07 17:34:39 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-04-05 12:26:13 +0200
commite2bcbc5d7fc8846ed189863ab33f0514f5399365 (patch)
tree3f20ed0c7f0381bda7535e5baa38fe251e98635b /exports
parent56548c511163b4dd22d9a96a2f5ae647f1627a7b (diff)
Begin exporting by wrapping state in a singleton
Diffstat (limited to 'exports')
-rw-r--r--exports/exports.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/exports/exports.go b/exports/exports.go
index 3efc820..fea638a 100644
--- a/exports/exports.go
+++ b/exports/exports.go
@@ -20,6 +20,20 @@ func GetOrganizationsList() (*C.char, int8) {
return C.CString(body), 0
}
+//export Register
+func Register(name *C.char, url *C.char) {
+ eduvpn.Register(eduvpn.GetVPNState(), C.GoString(name), C.GoString(url))
+}
+
+//export InitializeOAuth
+func InitializeOAuth() (*C.char) {
+ url, err := eduvpn.InitializeOAuth(eduvpn.GetVPNState())
+ if err != nil {
+ panic(err)
+ }
+ return C.CString(url)
+}
+
// GetServersList gets the list of servers from the disco server.
// Returns the json data as a string and an error code. This is used as key for looking up data.
//export GetServersList