Files
gluetun/internal/provider/utils/pick.go
Quentin McGaw (desktop) 3d8e61900b 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
2021-08-19 14:09:41 +00:00

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
}