summaryrefslogtreecommitdiff
path: root/pkg/vpn/openvpn.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-03-17 17:15:19 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-05-04 14:58:39 +0200
commit76cacf3d60e3dbfcb6fcb82558d9d79f6d068fb8 (patch)
tree8a9a06e9748836d47a67465be470d70e1a808060 /pkg/vpn/openvpn.go
parent8d616ba53416e5ca6205e9e29a2b3b0fc625f2d1 (diff)
wip: select by city from the gui
Diffstat (limited to 'pkg/vpn/openvpn.go')
-rw-r--r--pkg/vpn/openvpn.go20
1 files changed, 6 insertions, 14 deletions
diff --git a/pkg/vpn/openvpn.go b/pkg/vpn/openvpn.go
index 530f567..1857476 100644
--- a/pkg/vpn/openvpn.go
+++ b/pkg/vpn/openvpn.go
@@ -231,22 +231,14 @@ func (b *Bitmask) VPNCheck() (helpers bool, privilege bool, err error) {
return b.launch.check()
}
-// ListGateways return the labels of the gateways (only for transport=openvpn, at the moment)
-// TODO return other transports too
-func (b *Bitmask) ListGateways(provider string) ([]string, error) {
- gateways, err := b.bonafide.GetAllGateways("openvpn")
- if err != nil {
- return nil, err
- }
- gatewayNames := make([]string, len(gateways))
- for i, gw := range gateways {
- gatewayNames[i] = gw.Label
- }
- return gatewayNames, nil
+func (b *Bitmask) ListGatewaysByCity(transport string) (map[string]string, error) {
+ /* TODO filter by transport */
+ gwForCities, err := b.bonafide.PickGatewayForCities()
+ return gwForCities, err
}
-func (b *Bitmask) GetGatewayDetails(label string) (interface{}, error) {
- gw, err := b.bonafide.GetGatewayDetails(label)
+func (b *Bitmask) GetGatewayDetails(host string) (interface{}, error) {
+ gw, err := b.bonafide.GetGatewayDetails(host)
if err != nil {
return bonafide.Gateway{}, err
}