chore(constants): internal/constants/providers
- New package to avoid package import cycles
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/qdm12/gluetun/internal/configuration/settings"
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
)
|
||||
|
||||
func (r *Reader) readProvider(vpnType string) (provider settings.Provider, err error) {
|
||||
@@ -35,11 +36,11 @@ func (r *Reader) readVPNServiceProvider(vpnType string) (vpnProviderPtr *string)
|
||||
switch {
|
||||
case vpnType != constants.Wireguard &&
|
||||
os.Getenv("OPENVPN_CUSTOM_CONFIG") != "": // retro compatibility
|
||||
return stringPtr(constants.Custom)
|
||||
return stringPtr(providers.Custom)
|
||||
case s == "":
|
||||
return nil
|
||||
case s == "pia": // retro compatibility
|
||||
return stringPtr(constants.PrivateInternetAccess)
|
||||
return stringPtr(providers.PrivateInternetAccess)
|
||||
}
|
||||
return stringPtr(s)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user