From e2bcbc5d7fc8846ed189863ab33f0514f5399365 Mon Sep 17 00:00:00 2001 From: Jeroen Wijenbergh Date: Mon, 7 Mar 2022 17:34:39 +0100 Subject: Begin exporting by wrapping state in a singleton --- exports/exports.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'exports') 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 -- cgit v1.2.3