summaryrefslogtreecommitdiff
path: root/internal/openvpn.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-05-03 14:10:40 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-05-03 14:10:40 +0200
commit43604f7ffcbbf5b06ae481d2af7e66f6423f183f (patch)
tree6eb74ed54929edcfac61e5ca55078ab6670e0081 /internal/openvpn.go
parent466450f0c47bdc614e66326d90e5fc6fb56ae732 (diff)
Refactor: Secure internet into a different type but with interface
Diffstat (limited to 'internal/openvpn.go')
-rw-r--r--internal/openvpn.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/internal/openvpn.go b/internal/openvpn.go
index ed31fe2..45beb51 100644
--- a/internal/openvpn.go
+++ b/internal/openvpn.go
@@ -2,9 +2,14 @@ package internal
import "fmt"
-func (server *Server) OpenVPNGetConfig() (string, error) {
- profile_id := server.Profiles.Current
- configOpenVPN, _, configErr := server.APIConnectOpenVPN(profile_id)
+func OpenVPNGetConfig(server Server) (string, error) {
+ base, baseErr := server.GetBase()
+
+ if baseErr != nil {
+ return "", &OpenVPNGetConfigError{Err: baseErr}
+ }
+ profile_id := base.Profiles.Current
+ configOpenVPN, _, configErr := APIConnectOpenVPN(server, profile_id)
if configErr != nil {
return "", &OpenVPNGetConfigError{Err: configErr}