diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-03-17 17:15:19 +0100 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-05-04 14:58:39 +0200 |
commit | 76cacf3d60e3dbfcb6fcb82558d9d79f6d068fb8 (patch) | |
tree | 8a9a06e9748836d47a67465be470d70e1a808060 /pkg/vpn/openvpn.go | |
parent | 8d616ba53416e5ca6205e9e29a2b3b0fc625f2d1 (diff) |
wip: select by city from the gui
Diffstat (limited to 'pkg/vpn/openvpn.go')
-rw-r--r-- | pkg/vpn/openvpn.go | 20 |
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 } |