openvpn-mgt/vpnproviders.go

27 lines
498 B
Go
Raw Normal View History

2019-08-16 15:23:19 +00:00
package main
type VpnProvider interface {
ServerList() (error, *map[string]string)
2019-08-16 15:23:19 +00:00
}
func (s *OpenVpnMgt) getServerList(provider string) error {
var err error
s.Lock()
defer s.Unlock()
if _, ok := s.VpnRemotes[provider]; ok {
return nil
}
switch provider {
2021-03-16 16:22:51 +00:00
case "cyberghost":
list := CyberGhost{}
err, s.VpnRemotes[provider] = list.ServerList()
return err
2019-08-16 15:23:19 +00:00
case "expressvpn":
list := ExpressVPN{}
err, s.VpnRemotes[provider] = list.ServerList()
return err
}
return nil
}