- 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
13 lines
263 B
Go
13 lines
263 B
Go
package utils
|
|
|
|
import (
|
|
"math/rand"
|
|
|
|
"github.com/qdm12/gluetun/internal/models"
|
|
)
|
|
|
|
func PickRandomConnection(connections []models.Connection,
|
|
source rand.Source) models.Connection {
|
|
return connections[rand.New(source).Intn(len(connections))] //nolint:gosec
|
|
}
|