Documentation ¶
Index ¶
- type IProviderVPN
- type Mullvad
- func (m Mullvad) CheckVPNStatus(expectedCountryCode string) ([]string, error)
- func (m Mullvad) ConnectVPN() error
- func (m Mullvad) ExtractIPAddresses(status string) (ipv4, ipv6 string)
- func (m Mullvad) ListVPN() map[string][]string
- func (m Mullvad) SetCustomDNSResolver(ip string) error
- func (m Mullvad) SetDefaultDNSResolver() error
- func (m Mullvad) SetLocationVPN(countryCode string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IProviderVPN ¶
type IProviderVPN interface { ConnectVPN() error ListVPN() map[string][]string SetLocationVPN(countryCode string) ([]string, error) SetCustomDNSResolver(ip string) error SetDefaultDNSResolver() error CheckVPNStatus(expectedCountryCode string) ([]string, error) ExtractIPAddresses(status string) (ipv4, ipv6 string) }
type Mullvad ¶
type Mullvad struct{}
func (Mullvad) CheckVPNStatus ¶
func (Mullvad) ConnectVPN ¶
func (m Mullvad) ListVPN() map[string][]string { cmd := exec.Command("mullvad", "relay", "list") var out bytes.Buffer cmd.Stdout = &out err := cmd.Run() if err != nil { log.Printf("Error executing command: %v\n", err) return nil } relays := parseOutput(out.String()) // Print the parsed relays //for countryCode, names := range relays { // for _, name := range names { // fmt.Printf("Country Code: %s, Name: %s\n", countryCode, name) // } //} return relays }
func (Mullvad) ExtractIPAddresses ¶
func (Mullvad) SetCustomDNSResolver ¶
func (Mullvad) SetDefaultDNSResolver ¶
Click to show internal directories.
Click to hide internal directories.