Documentation ¶
Index ¶
- Constants
- type Client
- func (c Client) AccountInfo() (*pb.AccountResponse, error)
- func (c Client) Cities(country string) (*pb.CitiesResponse, error)
- func (c Client) Connect(req *pb.ConnectRequest) (pb.Daemon_ConnectClient, error)
- func (c Client) Countries() (*pb.CountriesResponse, error)
- func (c Client) Disconnect() error
- func (c Client) FrontendCountries() (*pb.FrontendCountriesResponse, error)
- func (c Client) Groups(req *pb.GroupsRequest) (*pb.GroupsResponse, error)
- func (c Client) IsLoggedIn() (*pb.IsLoggedInResponse, error)
- func (c Client) Login(req *pb.LoginRequest) error
- func (c Client) LoginOAuth2() (*pb.LoginOAuth2Response, error)
- func (c Client) Logout() error
- func (c Client) Ping() error
- func (c Client) Plans() (*pb.PlansResponse, error)
- func (c Client) RateConnection(req *pb.RateConnectionRequest) error
- func (c Client) SetAutoConnect(req *pb.SetAutoConnectRequest) (*pb.Payload, error)
- func (c Client) SetCyberSec(enabled bool) error
- func (c Client) SetDefaults() error
- func (c Client) SetDns(req *pb.SetDNSRequest) error
- func (c Client) SetFirewall(enabled bool) error
- func (c Client) SetIpv6(enabled bool) error
- func (c Client) SetKillSwitch(enabled bool) error
- func (c Client) SetNotify(enabled bool) error
- func (c Client) SetObfuscate(enabled bool) error
- func (c Client) SetProtocol(protocol pb.ProtocolEnum) error
- func (c Client) SetTechnology(technology pb.TechnologyEnum) error
- func (c Client) SetWhitelist(req *pb.SetWhitelistRequest) error
- func (c Client) Settings() (*pb.SettingsResponse, error)
- func (c Client) SettingsProtocols() (*pb.ProtocolsResponse, error)
- func (c Client) SettingsTechnologies() (*pb.TechnologyResponse, error)
- func (c Client) Status() (*pb.StatusResponse, error)
Constants ¶
const ( SocketPath = "/run/nordvpn/nordvpnd.sock" SocketAddress = "unix://" + SocketPath RequestTimeout = 5 * time.Second ErrOk = 1000 StatusOk = 1000 StatusConnecting = 1001 StatusConnected = 1002 StatusGenericError = 2000 StatusAlreadyRated = 3019 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the public stub for of communicating with the NordVPN daemon.
func NewOpenNordClient ¶
NewOpenNordClient creates a client for interacting with the NordVPN daemon.
func (Client) AccountInfo ¶
func (c Client) AccountInfo() (*pb.AccountResponse, error)
AccountInfo calls the AccountInfo RPC and returns an AccountResponse.
func (Client) Cities ¶
func (c Client) Cities(country string) (*pb.CitiesResponse, error)
Cities calls the Cities RPC and returns a CitiesResponse.
func (Client) Connect ¶
func (c Client) Connect(req *pb.ConnectRequest) (pb.Daemon_ConnectClient, error)
Connect calls the Connect RPC and returns a stream of ConnectResponse.
func (Client) Countries ¶
func (c Client) Countries() (*pb.CountriesResponse, error)
Countries calls the Countries RPC and returns a CountriesResponse.
func (Client) Disconnect ¶
Disconnect calls the Disconnect RPC and terminates the current VPN session.
func (Client) FrontendCountries ¶
func (c Client) FrontendCountries() (*pb.FrontendCountriesResponse, error)
FrontendCountries calls the FrontendCountries RPC and returns a CountriesResponse.
func (Client) Groups ¶
func (c Client) Groups(req *pb.GroupsRequest) (*pb.GroupsResponse, error)
Groups calls the Groups RPC and returns a GroupsResponse.
func (Client) IsLoggedIn ¶
func (c Client) IsLoggedIn() (*pb.IsLoggedInResponse, error)
IsLoggedIn calls the IsLoggedIn RPC and returns a IsLoggedInResponse.
func (Client) LoginOAuth2 ¶
func (c Client) LoginOAuth2() (*pb.LoginOAuth2Response, error)
LoginOAuth2 calls the LoginOAuth2 RPC.
func (Client) Ping ¶
Ping checks that the daemon is alive via the Ping RPC. If the value returned is nil, the ping succeeded.
func (Client) RateConnection ¶
func (c Client) RateConnection(req *pb.RateConnectionRequest) error
RateConnection calls the RateConnection RPC.
func (Client) SetAutoConnect ¶
SetAutoConnect calls the SetAutoConnect RPC.
func (Client) SetCyberSec ¶
SetCyberSec calls the SetCyberSec RPC.
func (Client) SetDefaults ¶
SetDefaults calls the SetDefaults RPC.
func (Client) SetDns ¶
func (c Client) SetDns(req *pb.SetDNSRequest) error
SetDns calls the SetDns RPC.
func (Client) SetFirewall ¶
SetFirewall calls the SetFirewall RPC.
func (Client) SetKillSwitch ¶
SetKillSwitch calls the SetKilLSwitch RPC.
func (Client) SetObfuscate ¶
SetObfuscate calls the SetObfuscate RPC.
func (Client) SetProtocol ¶
func (c Client) SetProtocol(protocol pb.ProtocolEnum) error
SetProtocol calls the SetProtocol RPC.
func (Client) SetTechnology ¶
func (c Client) SetTechnology(technology pb.TechnologyEnum) error
SetTechnology calls the SetTechnology RPC.
func (Client) SetWhitelist ¶
func (c Client) SetWhitelist(req *pb.SetWhitelistRequest) error
SetWhitelist calls the SetWhitelist RPC.
func (Client) Settings ¶
func (c Client) Settings() (*pb.SettingsResponse, error)
Settings calls the Settings RPC.
func (Client) SettingsProtocols ¶
func (c Client) SettingsProtocols() (*pb.ProtocolsResponse, error)
SettingsProtocols calls the SettingsProtocols RPC.
func (Client) SettingsTechnologies ¶
func (c Client) SettingsTechnologies() (*pb.TechnologyResponse, error)
SettingsTechnologies calls the SettingsTechnologies RPC.