chore: use gofumpt for code formatting
This commit is contained in:
@@ -7,7 +7,8 @@ import (
|
||||
)
|
||||
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection, ipv6Supported bool) (
|
||||
connection models.Connection, err error) {
|
||||
connection models.Connection, err error,
|
||||
) {
|
||||
defaults := utils.NewConnectionDefaults(443, 1194, 0) //nolint:mnd
|
||||
return utils.GetConnection(p.Name(),
|
||||
p.storage, selection, defaults, ipv6Supported, p.randSource)
|
||||
|
||||
@@ -8,7 +8,8 @@ import (
|
||||
)
|
||||
|
||||
func (p *Provider) OpenVPNConfig(connection models.Connection,
|
||||
settings settings.OpenVPN, ipv6Supported bool) (lines []string) {
|
||||
settings settings.OpenVPN, ipv6Supported bool,
|
||||
) (lines []string) {
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
RemoteCertTLS: true,
|
||||
AuthUserPass: true,
|
||||
|
||||
@@ -14,18 +14,15 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
var (
|
||||
regexPort = regexp.MustCompile(`[1-9][0-9]{0,4}`)
|
||||
)
|
||||
var regexPort = regexp.MustCompile(`[1-9][0-9]{0,4}`)
|
||||
|
||||
var (
|
||||
ErrPortForwardedNotFound = errors.New("port forwarded not found")
|
||||
)
|
||||
var ErrPortForwardedNotFound = errors.New("port forwarded not found")
|
||||
|
||||
// PortForward obtains a VPN server side port forwarded from the PrivateVPN API.
|
||||
// It returns 0 if all ports are to forwarded on a dedicated server IP.
|
||||
func (p *Provider) PortForward(ctx context.Context, objects utils.PortForwardObjects) (
|
||||
ports []uint16, err error) {
|
||||
ports []uint16, err error,
|
||||
) {
|
||||
url := "https://connect.pvdatanet.com/v3/Api/port?ip[]=" + objects.InternalIP.String()
|
||||
request, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
|
||||
if err != nil {
|
||||
@@ -75,7 +72,8 @@ func (p *Provider) PortForward(ctx context.Context, objects utils.PortForwardObj
|
||||
}
|
||||
|
||||
func (p *Provider) KeepPortForward(ctx context.Context,
|
||||
_ utils.PortForwardObjects) (err error) {
|
||||
_ utils.PortForwardObjects,
|
||||
) (err error) {
|
||||
<-ctx.Done()
|
||||
return ctx.Err()
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@ type Provider struct {
|
||||
|
||||
func New(storage common.Storage, randSource rand.Source,
|
||||
unzipper common.Unzipper, updaterWarner common.Warner,
|
||||
parallelResolver common.ParallelResolver) *Provider {
|
||||
parallelResolver common.ParallelResolver,
|
||||
) *Provider {
|
||||
return &Provider{
|
||||
storage: storage,
|
||||
randSource: randSource,
|
||||
|
||||
@@ -3,7 +3,8 @@ package updater
|
||||
import "strings"
|
||||
|
||||
func codeToCountry(countryCode string, countryCodes map[string]string) (
|
||||
country string, warning string) {
|
||||
country string, warning string,
|
||||
) {
|
||||
countryCode = strings.ToLower(countryCode)
|
||||
country, ok := countryCodes[countryCode]
|
||||
if !ok {
|
||||
|
||||
@@ -7,9 +7,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
trailingNumber = regexp.MustCompile(` [0-9]+$`)
|
||||
)
|
||||
var trailingNumber = regexp.MustCompile(` [0-9]+$`)
|
||||
|
||||
var (
|
||||
errBadPrefix = errors.New("bad prefix in file name")
|
||||
|
||||
@@ -14,7 +14,8 @@ import (
|
||||
)
|
||||
|
||||
func (u *Updater) FetchServers(ctx context.Context, minServers int) (
|
||||
servers []models.Server, err error) {
|
||||
servers []models.Server, err error,
|
||||
) {
|
||||
const url = "https://privatevpn.com/client/PrivateVPN-TUN.zip"
|
||||
contents, err := u.unzipper.FetchAndExtract(ctx, url)
|
||||
if err != nil {
|
||||
|
||||
@@ -11,7 +11,8 @@ type Updater struct {
|
||||
}
|
||||
|
||||
func New(unzipper common.Unzipper, warner common.Warner,
|
||||
parallelResolver common.ParallelResolver) *Updater {
|
||||
parallelResolver common.ParallelResolver,
|
||||
) *Updater {
|
||||
return &Updater{
|
||||
unzipper: unzipper,
|
||||
parallelResolver: parallelResolver,
|
||||
|
||||
Reference in New Issue
Block a user