Maint: make VPN connection not specific to OpenVPN
- Add VPN field to ServerSelection struct - Set VPN type to server selection at start using VPN_TYPE - Change OpenVPNConnection to Connection with Type field - Rename Provider GetOpenVPNConnection to GetConnection - Rename GetTargetIPOpenVPNConnection to GetTargetIPConnection - Rename PickRandomOpenVPNConnection to PickRandomConnection - Add 'OpenVPN' prefix to OpenVPN specific methods on connection
This commit is contained in:
@@ -17,7 +17,7 @@ var (
|
||||
|
||||
// extractConnectionFromLines always takes the first remote line only.
|
||||
func extractConnectionFromLines(lines []string) (
|
||||
connection models.OpenVPNConnection, err error) {
|
||||
connection models.Connection, err error) {
|
||||
for i, line := range lines {
|
||||
newConnectionData, err := extractConnectionFromLine(line)
|
||||
if err != nil {
|
||||
@@ -54,7 +54,7 @@ var (
|
||||
)
|
||||
|
||||
func extractConnectionFromLine(line string) (
|
||||
connection models.OpenVPNConnection, err error) {
|
||||
connection models.Connection, err error) {
|
||||
switch {
|
||||
case strings.HasPrefix(line, "proto "):
|
||||
connection.Protocol, err = extractProto(line)
|
||||
|
||||
Reference in New Issue
Block a user