27 lines
498 B
Go
27 lines
498 B
Go
package main
|
|
|
|
type VpnProvider interface {
|
|
ServerList() (error, *map[string]string)
|
|
}
|
|
|
|
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 {
|
|
case "cyberghost":
|
|
list := CyberGhost{}
|
|
err, s.VpnRemotes[provider] = list.ServerList()
|
|
return err
|
|
case "expressvpn":
|
|
list := ExpressVPN{}
|
|
err, s.VpnRemotes[provider] = list.ServerList()
|
|
return err
|
|
}
|
|
return nil
|
|
}
|