chore: simplify provider GetConnection

This commit is contained in:
Quentin McGaw
2022-04-19 14:28:57 +00:00
parent 306d8494d6
commit 0c0f1663b1
36 changed files with 243 additions and 707 deletions

View File

@@ -6,14 +6,14 @@ import (
"github.com/qdm12/gluetun/internal/constants/vpn"
)
func GetProtocol(selection settings.ServerSelection) (protocol string) {
func getProtocol(selection settings.ServerSelection) (protocol string) {
if selection.VPN == vpn.OpenVPN && *selection.OpenVPN.TCP {
return constants.TCP
}
return constants.UDP
}
func FilterByProtocol(selection settings.ServerSelection,
func filterByProtocol(selection settings.ServerSelection,
serverTCP, serverUDP bool) (filtered bool) {
switch selection.VPN {
case vpn.Wireguard: