summaryrefslogtreecommitdiff
path: root/pkg/backend/actions.go
blob: 6e143f9e49370039567b907af3f0a53fff8722e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package backend

import (
	"log"
)

func startVPN() {
	setError("")
	err := ctx.bm.StartVPN(ctx.Provider)
	if err != nil {
		log.Println("ERROR: ", err)
		setError(err.Error())
	}
}

func stopVPN() {
	err := ctx.bm.StopVPN()
	if err != nil {
		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)
	}
}