2019-08-16 15:23:19 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
type VpnProvider interface {
|
2019-08-17 18:11:00 +00:00
|
|
|
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 {
|
2019-08-17 18:11:00 +00:00
|
|
|
case "dailymotion":
|
|
|
|
list := DailymotionVPN{}
|
|
|
|
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
|
|
|
|
}
|