diff options
author | Ruben Pollan <meskio@sindominio.net> | 2018-06-14 11:29:26 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2018-06-20 12:18:17 +0200 |
commit | 2439d744ac42e7c77e4848de50dd432f7d9b12bc (patch) | |
tree | 43cd32185b96a2353f6bbbea407494d8644d8801 /bitmask_go/vpn.go | |
parent | 37413f5eb2b8d4719c959db03874cc9bcc362ddc (diff) |
[feat] sort gateways by timezone
And let us select gateways.
- Resolves: #42
Diffstat (limited to 'bitmask_go/vpn.go')
-rw-r--r-- | bitmask_go/vpn.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/bitmask_go/vpn.go b/bitmask_go/vpn.go index 041a8e4..c62e27c 100644 --- a/bitmask_go/vpn.go +++ b/bitmask_go/vpn.go @@ -81,13 +81,20 @@ func (b *Bitmask) VPNCheck() (helpers bool, priviledge bool, err error) { // ListGateways return the names of the gateways func (b *Bitmask) ListGateways(provider string) ([]string, error) { - // TODO - return []string{}, nil + gateways, err := b.bonafide.getGateways() + if err != nil { + return nil, err + } + gatewayNames := make([]string, len(gateways)) + for i, gw := range gateways { + gatewayNames[i] = gw.Location + } + return gatewayNames, nil } // UseGateway selects name as the default gateway func (b *Bitmask) UseGateway(name string) error { - // TODO + b.bonafide.setDefaultGateway(name) return nil } |