diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-07-22 17:16:13 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-07-22 17:16:13 +0200 |
| commit | 0c6233ab691973859b6d636e6d9fdddd2a6acd5e (patch) | |
| tree | c11697eb3b00ff1d6a073a5f3c6de3337cf5e463 /exports | |
| parent | 80218da58eca9c95870770f88e477891e8fdb50a (diff) | |
State + Exports: Implement should show renew button boolean
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 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)) |
