summaryrefslogtreecommitdiff
path: root/pkg/backend/actions.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-09-02 21:38:13 +0200
committerkali kaneko (leap communications) <kali@leap.se>2021-05-04 14:58:39 +0200
commit335bb742b957370bbf40ae77a661559805ab307f (patch)
tree3d8b9a8023b1bcca2b531bf57b1fd846916f4a8e /pkg/backend/actions.go
parent68f566cf7fddbe9e5eb08c4c07a76375148b682b (diff)
[feat] expose gateway selection in webapi
Diffstat (limited to 'pkg/backend/actions.go')
-rw-r--r--pkg/backend/actions.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/pkg/backend/actions.go b/pkg/backend/actions.go
index e45b026..6e143f9 100644
--- a/pkg/backend/actions.go
+++ b/pkg/backend/actions.go
@@ -19,3 +19,23 @@ func stopVPN() {
log.Println(err)
}
}
+
+// TODO return bool?
+func useGateway(label string) {
+ err := ctx.bm.UseGateway(label)
+ if err != nil {
+ log.Println(err)
+ }
+}
+
+func getGateway() string {
+ return ctx.bm.GetCurrentGateway()
+}
+
+// TODO return bool?
+func useTransport(transport string) {
+ err := ctx.bm.UseTransport(transport)
+ if err != nil {
+ log.Println(err)
+ }
+}