Files
gluetun/internal/provider/privateinternetaccess/provider.go
Quentin McGaw (desktop) 21f4cf7ab5 Maint: do not mock os functions
- Use filepaths with /tmp for tests instead
- Only mock functions where filepath can't be specified such as user.Lookup
2021-07-23 16:06:19 +00:00

31 lines
658 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
activeServer models.PIAServer
// Port forwarding
portForwardPath string
authFilePath string
}
func New(servers []models.PIAServer, randSource rand.Source,
timeNow func() time.Time) *PIA {
return &PIA{
servers: servers,
timeNow: timeNow,
randSource: randSource,
portForwardPath: constants.PIAPortForward,
authFilePath: constants.OpenVPNAuthConf,
}
}