summaryrefslogtreecommitdiff
path: root/exports
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-07-22 17:16:13 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-07-22 17:16:13 +0200
commit0c6233ab691973859b6d636e6d9fdddd2a6acd5e (patch)
treec11697eb3b00ff1d6a073a5f3c6de3337cf5e463 /exports
parent80218da58eca9c95870770f88e477891e8fdb50a (diff)
State + Exports: Implement should show renew button boolean
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 2eb3ab7..76c882a 100644
--- a/exports/exports.go
+++ b/exports/exports.go
@@ -270,6 +270,20 @@ func SetConnected(name *C.char) *C.char {
return C.CString(ErrorToString(setConnectedErr))
}
+//export ShouldRenewButton
+func ShouldRenewButton(name *C.char) C.int {
+ nameStr := C.GoString(name)
+ state, stateErr := GetVPNState(nameStr)
+ if stateErr != nil {
+ return C.int(0)
+ }
+ shouldRenewBool := state.ShouldRenewButton()
+ if shouldRenewBool {
+ return C.int(1)
+ }
+ return C.int(0)
+}
+
//export FreeString
func FreeString(addr *C.char) {
C.free(unsafe.Pointer(addr))