Files
gluetun/internal/provider/privateinternetaccess/provider.go
Quentin McGaw c73369e11c chore(constants): remove and move constant paths
- Remove unused paths
- Move paths to inline constants if used only once
2022-02-06 19:59:07 +00:00

31 lines
676 B
Go

package privateinternetaccess
import (
"math/rand"
"time"
"github.com/qdm12/gluetun/internal/constants"
"github.com/qdm12/gluetun/internal/models"
)
type PIA struct {
servers []models.PIAServer
randSource rand.Source
timeNow func() time.Time
// Port forwarding
portForwardPath string
authFilePath string
}
func New(servers []models.PIAServer, randSource rand.Source,
timeNow func() time.Time) *PIA {
const jsonPortForwardPath = "/gluetun/piaportforward.json"
return &PIA{
servers: servers,
timeNow: timeNow,
randSource: randSource,
portForwardPath: jsonPortForwardPath,
authFilePath: constants.OpenVPNAuthConf,
}
}