chore(internal/provider): rename all structs to Provider
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *PIA) GetConnection(selection settings.ServerSelection) (
|
||||
func (p *Provider) GetConnection(selection settings.ServerSelection) (
|
||||
connection models.Connection, err error) {
|
||||
// Set port defaults depending on encryption preset.
|
||||
var defaults utils.ConnectionDefaults
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
func (p *PIA) BuildConf(connection models.Connection,
|
||||
func (p *Provider) BuildConf(connection models.Connection,
|
||||
settings settings.OpenVPN) (lines []string) {
|
||||
providerSettings := utils.OpenVPNProviderSettings{
|
||||
RemoteCertTLS: true,
|
||||
|
||||
@@ -26,7 +26,7 @@ var (
|
||||
)
|
||||
|
||||
// PortForward obtains a VPN server side port forwarded from PIA.
|
||||
func (p *PIA) PortForward(ctx context.Context, client *http.Client,
|
||||
func (p *Provider) PortForward(ctx context.Context, client *http.Client,
|
||||
logger utils.Logger, gateway net.IP, serverName string) (
|
||||
port uint16, err error) {
|
||||
var server models.Server
|
||||
@@ -90,7 +90,7 @@ var (
|
||||
ErrPortForwardedExpired = errors.New("port forwarded data expired")
|
||||
)
|
||||
|
||||
func (p *PIA) KeepPortForward(ctx context.Context, client *http.Client,
|
||||
func (p *Provider) KeepPortForward(ctx context.Context, client *http.Client,
|
||||
port uint16, gateway net.IP, serverName string) (err error) {
|
||||
privateIPClient := newHTTPClient(serverName)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
type PIA struct {
|
||||
type Provider struct {
|
||||
servers []models.Server
|
||||
randSource rand.Source
|
||||
timeNow func() time.Time
|
||||
@@ -18,9 +18,9 @@ type PIA struct {
|
||||
}
|
||||
|
||||
func New(servers []models.Server, randSource rand.Source,
|
||||
timeNow func() time.Time) *PIA {
|
||||
timeNow func() time.Time) *Provider {
|
||||
const jsonPortForwardPath = "/gluetun/piaportforward.json"
|
||||
return &PIA{
|
||||
return &Provider{
|
||||
servers: servers,
|
||||
timeNow: timeNow,
|
||||
randSource: randSource,
|
||||
|
||||
Reference in New Issue
Block a user