Files
gluetun/internal/configuration/vyprvpn.go

34 lines
770 B
Go
Raw Normal View History

2021-02-06 11:05:50 -05:00
package configuration
import (
"fmt"
2021-02-06 11:05:50 -05:00
"github.com/qdm12/gluetun/internal/constants"
)
func (settings *Provider) vyprvpnLines() (lines []string) {
if len(settings.ServerSelection.Regions) > 0 {
lines = append(lines, lastIndent+"Regions: "+commaJoin(settings.ServerSelection.Regions))
}
lines = append(lines, settings.ServerSelection.OpenVPN.lines()...)
2021-02-06 11:05:50 -05:00
return lines
}
func (settings *Provider) readVyprvpn(r reader) (err error) {
settings.Name = constants.Vyprvpn
settings.ServerSelection.TargetIP, err = readTargetIP(r.env)
if err != nil {
return err
}
settings.ServerSelection.Regions, err = r.env.CSVInside("REGION", constants.VyprvpnRegionChoices())
if err != nil {
return fmt.Errorf("environment variable REGION: %w", err)
2021-02-06 11:05:50 -05:00
}
return nil
}