Files
gluetun/internal/configuration/fastestvpn.go

29 lines
756 B
Go
Raw Normal View History

2021-03-05 23:12:19 -05:00
package configuration
import (
"fmt"
2021-03-05 23:12:19 -05:00
"github.com/qdm12/gluetun/internal/constants"
)
func (settings *Provider) readFastestvpn(r reader) (err error) {
settings.Name = constants.Fastestvpn
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
if err != nil {
return err
}
settings.ServerSelection.Hostnames, err = r.env.CSVInside("SERVER_HOSTNAME", constants.FastestvpnHostnameChoices())
if err != nil {
return fmt.Errorf("environment variable SERVER_HOSTNAME: %w", err)
2021-03-05 23:12:19 -05:00
}
settings.ServerSelection.Countries, err = r.env.CSVInside("COUNTRY", constants.FastestvpnCountriesChoices())
if err != nil {
return fmt.Errorf("environment variable COUNTRY: %w", err)
2021-03-05 23:12:19 -05:00
}
return settings.ServerSelection.OpenVPN.readProtocolOnly(r.env)
2021-03-05 23:12:19 -05:00
}