2021-05-11 17:10:51 +00:00
|
|
|
package utils
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"math/rand"
|
|
|
|
|
|
|
|
|
|
"github.com/qdm12/gluetun/internal/models"
|
|
|
|
|
)
|
|
|
|
|
|
2021-08-17 14:08:53 +00:00
|
|
|
func PickRandomOpenVPNConnection(connections []models.OpenVPNConnection,
|
2021-05-11 17:10:51 +00:00
|
|
|
source rand.Source) models.OpenVPNConnection {
|
|
|
|
|
return connections[rand.New(source).Intn(len(connections))] //nolint:gosec
|
|
|
|
|
}
|