diff options
| author | Jeroen Wijenbergh <jeroenwijenbergh@protonmail.com> | 2022-03-07 17:34:39 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-05 12:26:13 +0200 |
| commit | e2bcbc5d7fc8846ed189863ab33f0514f5399365 (patch) | |
| tree | 3f20ed0c7f0381bda7535e5baa38fe251e98635b /exports | |
| parent | 56548c511163b4dd22d9a96a2f5ae647f1627a7b (diff) | |
Begin exporting by wrapping state in a singleton
Diffstat (limited to 'exports')
| -rw-r--r-- | exports/exports.go | 14 |
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 |
