Documentation ¶
Overview ¶
Package cli provides command line interface to interact with vpn and fileshare daemons.
Index ¶
- Constants
- Variables
- func FormatSnapMissingConnsErr(err *snappb.ErrMissingConnections) string
- func FormatSnapMissingConnsExtErr(err *snappb.ErrMissingConnections) string
- func JoinSnapMissingPermissions(err *snappb.ErrMissingConnections) string
- func LoginRespHandler(ctx *cli.Context, resp *pb.LoginResponse) error
- func MeshnetResponseToError(resp *meshpb.MeshnetResponse) error
- func NewApp(version, environment, hash, salt string, pingErr error, conn *grpc.ClientConn, ...) (*cli.App, error)
- func ReadCredentialsFromTerminal() (string, string, error)
- func ReadPlanFromTerminal() (int, error)
- func RetrieveSnapConnsError(err error) *snappb.ErrMissingConnections
- func SetLANDiscoveryErrorCodeToError(code pb.SetErrorCode, flag bool) error
- func SetLANDiscoveryStatusToMessage(code pb.SetLANDiscoveryStatus, flag bool)
- func Status(resp *pb.StatusResponse) string
- type Loader
- type LoaderConfig
- type LoaderInterceptor
- type PortRange
- type SilentLoader
- type TerminalLoader
Constants ¶
const ( AllowlistAddPortUsageText = "Adds port to the allowlist" AllowlistAddPortArgsUsageText = `<port> [protocol <protocol>]` AllowlistAddPortDescription = `` /* 277-byte string literal not displayed */ )
Allowlist add port help text
const ( AllowlistAddPortsUsageText = "Adds port range to the allowlist" AllowlistAddPortsArgsUsageText = `<port_from> <port_to> [protocol <protocol>]` AllowlistAddPortsDescription = `` /* 294-byte string literal not displayed */ )
Allowlist add ports help text
const ( AllowlistAddSubnetUsageText = "Adds subnet to the allowlist" AllowlistAddSubnetArgsUsageText = `<address>` AllowlistAddSubnetDescription = `` /* 138-byte string literal not displayed */ )
Allowlist add subnet help text
const ( AllowlistRemovePortUsageText = "Removes port from the allowlist" AllowlistRemovePortArgsUsageText = `<port> [protocol <protocol>]` AllowlistRemovePortArgsDescription = `` /* 300-byte string literal not displayed */ )
Allowlist remove port help text
const ( AllowlistRemovePortsUsageText = "Removes port range from the allowlist" AllowlistRemovePortsArgsUsageText = `<port_from> <port_to> [protocol <protocol>]` AllowlistRemovePortsArgsDescription = `` /* 315-byte string literal not displayed */ )
Allowlist remove ports help text
const ( AllowlistRemoveSubnetUsageText = "Removes subnet from the allowlist" AllowlistRemoveSubnetArgsUsageText = `<address>` AllowlistRemoveSubnetArgsDescription = `Use this command to remove subnet from the allowlist. Example: 'nordvpn allowlist remove subnet 192.168.1.1/24'` )
Allowlist remove subnet help text
const ( CitiesUsageText = "Shows a list of cities where servers are available" CitiesArgsUsageText = `<country>` )
Cities help text
const ( ConnectUsageText = "Connects you to VPN" ConnectFlagGroupUsageText = "Specify a server group to connect to" ConnectArgsUsageText = "[<country>|<server>|<country_code>|<city>|<group>|<country> <city>]" ConnectDescription = `` /* 708-byte string literal not displayed */ )
Connect help text
const ( LoginUsageText = "Logs you in" LoginDescription = "" /* 169-byte string literal not displayed */ LoginNordAccountUsageText = "This option is no longer available." LoginFlagTokenUsageText = "" // #nosec /* 204-byte string literal not displayed */ LoginCallbackUsageText = "" /* 227-byte string literal not displayed */ )
Login descriptions
const ( RateUsageText = "Rates your last connection quality (1-5)" RateArgsUsageText = `[1-5]` RateDescription = `` /* 192-byte string literal not displayed */ )
Rate help text
const ( SetAutoconnectUsageText = "" /* 130-byte string literal not displayed */ SetAutoConnectArgsUsageText = `<enabled>|<disabled> [<country>|<server>|<country_code>|<city>|<group>|<country> <city>]` SetAutoConnectDescription = `` /* 926-byte string literal not displayed */ )
Set autoconnect help text
const ( SetDNSUsageText = "Sets custom DNS servers" SetDNSArgsUsageText = `<servers>|<disabled>` SetDNSDescription = `` /* 330-byte string literal not displayed */ )
Set DNS help text
const ( SetFirewallUsageText = "Enables or disables use of the firewall." SetFirewallMarkUsageText = "Traffic control filter used in " + "policy-based routing. It allows classifying packets " + "based on a previously set fwmark by iptables." )
const ( SetProtocolUsageText = "Sets the protocol" SetProtocolArgsUsageText = `<protocol>` SetProtocolDescription = `` /* 130-byte string literal not displayed */ )
Set protocol help text
const ( SetTechnologyUsageText = "Sets the technology" SetTechnologyArgsUsageText = `<technology>` SetTechnologyDescription = `Use this command to set the technology. Supported values for <technology>: %s. Example: 'nordvpn set technology OPENVPN'` // Used when NordWhisper technology is disabled SupportedValuesWithoutNordWhisper = "OPENVPN or NORDLYNX" // Used when NordWhisper technology is enabled SupportedValuesWithNordWhisper = "OPENVPN, NORDLYNX or NORDWHISPER" )
Set technology help text
const ( SetThreatProtectionLiteUsageText = "" /* 337-byte string literal not displayed */ SetThreatProtectionLiteArgsUsageText = `<enabled>|<disabled>` SetThreatProtectionLiteDescription = `` /* 647-byte string literal not displayed */ )
Set Threat Protection Lite help text
const ( // MaxLoginAttempts defines maximal login attempts count MaxLoginAttempts = 3 // ConfigDirName defines configuration subdirectory name ConfigDirName = "nordvpn/" // ConfigFilePath defines config file path ConfigFilePath = ConfigDirName + "nordvpn.conf" // AllowlistProtocol defines allowlist commands argument AllowlistProtocol = "protocol" )
const ( ArgumentCountError = "The command you entered has incorrect number of arguments. Enter '%s --help' to see the options." ArgumentParsingError = "The command you entered is not valid. Enter '%s --help' to see the options." ClaimOnlinePurchaseSuccess = `` /* 127-byte string literal not displayed */ ClaimOnlinePurchaseFailure = `Payment failed. We couldn’t process your payment. Please try again.` LoginSuccess = "Welcome to NordVPN! You can now connect to VPN by using '%s connect'." LogoutSuccess = "You are logged out." LogoutTokenSuccess = "You have been logged out. To keep your account secure, we've revoked your current access token. If you want to reuse your next access token despite the potential risks, use the --" + flagPersistToken + " option when logging out." LogoutUsageText = "Logs you out" PersistTokenUsageText = "Keep your current access token valid after logging out." MsgNordVPNGroup = "" /* 202-byte string literal not displayed */ RateNoArgsMessage = "Type [1–5] to rate your previous connection (1 – poor, 5 – great): " RateNoConnectionMade = "It seems you haven’t connected to VPN yet. Please rate your experience after your first session." RateAlreadyRated = "You have already provided a rating for your active/previous connection." RateSuccess = "Thank you for your feedback!" SetReconnect = "You are connected to NordVPN. Please reconnect to enable the setting." MsgNothingToRate = "There was no connection - nothing to rate." // MsgSetSuccess is a generic success message template. MsgSetSuccess = "%s is set to '%s' successfully." // MsgAlreadySet is a generic noop message template. MsgAlreadySet = "%s is already set to '%s'." // MsgInUse is a generic dependency error message template. MsgInUse = "%s is currently used by %s. Disable it first." MsgSetBoolArgsUsage = `<enabled>|<disabled>` MsgSetBoolDescription = `` /* 186-byte string literal not displayed */ ObfuscateOnServerNotObfuscated = "" /* 155-byte string literal not displayed */ ObfuscateOffServerObfuscated = "" /* 169-byte string literal not displayed */ AutoConnectOnNonObfuscatedServerObfuscateOn = "Your selected server doesn’t support obfuscation. Choose a different server or turn off obfuscation." AutoConnectOnObfuscatedServerObfuscateOff = "Turn on obfuscation to connect to obfuscated servers." SetAutoConnectForceOff = "" /* 173-byte string literal not displayed */ SetThreatProtectionLiteDisableDNS = "Disabling DNS." SetThreatProtectionLiteAlreadySet = "Threat Protection Lite already set to %s." SetDefaultsSuccess = "Settings were successfully restored to defaults." FirewallRequired = "Firewall must be enabled to use '%s'." SetNotifySuccess = "Notifications are set to '%s' successfully." SetNotifyNothingToSet = "Notifications are already set to '%s'." SetTraySuccess = "Tray set to '%s' successfully." SetTrayNothingToSet = "Tray is already set to '%s'." SetProtocolAlreadySet = "Protocol is already set to %s" SetTechnologyDepsError = "Missing %s kernel module or configuration utility." SetDNSDisableThreatProtectionLite = "Disabling Threat Protection Lite." SetDNSInvalidAddress = "The provided IP address is invalid." SetDNSTooManyValues = "More than 3 DNS addresses provided." SetDNSAlreadySet = "DNS is already set to %s." SetLANDiscoveryUsage = "Access printers, TVs, and other devices on your local network while connected to a VPN." SetLANDiscoveryAlreadyEnabled = "LAN discovery is already set to %s." SetLANDiscoveryAllowlistReset = "Just a little heads-up: Enabling local network discovery will remove your private subnets from the allowlist." AllowlistAddPortExistsError = "Port %d (%s) is already allowlisted." AllowlistAddPortSuccess = "Port %d (%s) is allowlisted successfully." AllowlistAddPortsExistsError = "Ports %d - %d (%s) are already allowlisted." AllowlistAddPortsSuccess = "Ports %d - %d (%s) are allowlisted successfully." AllowlistAddSubnetExistsError = "Subnet %s is already allowlisted." AllowlistAddSubnetSuccess = "Subnet %s is allowlisted successfully." AllowlistAddSubnetLANDiscovery = "Allowlisting a private subnet is not available while local network discovery is enabled." AllowlistRemovePortExistsError = "Port %d (%s) is not allowlisted." AllowlistRemovePortSuccess = "Port %d (%s) is removed from the allowlist successfully." AllowlistRemovePortsExistsError = "Ports %d - %d (%s) are not allowlisted." AllowlistRemovePortsSuccess = "Ports %d - %d (%s) are removed from the allowlist successfully." AllowlistRemoveSubnetExistsError = "Subnet %s is not allowlisted." AllowlistRemoveSubnetSuccess = "Subnet %s is removed from the allowlist successfully." AllowlistRemoveAllError = "Allowlist elements could not be removed." AllowlistRemoveAllSuccess = "All ports and subnets have been removed from the allowlist successfully." AllowlistPortRangeError = "Port %d value is out of range [%d - %d]." AllowlistPortsRangeError = "Ports %d - %d value is out of range [%d - %d]." AccountCreationSuccess = "Account has been successfully created." // AccountInvalidData is displayed when backend returns bad request (400) AccountInvalidData = "" /* 139-byte string literal not displayed */ // AccountEmailTaken is displayed when backend returns conflict (409) AccountEmailTaken = "User with the specified email address already exists." // AccountInternalError is returned when backend returns internal error (500) AccountInternalError = "It's not you, it's us. We're having trouble with our servers. If the issue persists, please contact our customer support." AccountCantFetchVPNService = "We were not able to fetch your %s service data. If the issue persists, please contact our customer support." UpdateAvailableMessage = "A new version of NordVPN is available!\nPlease update the application." DisconnectNotConnected = "You are not connected to NordVPN." DisconnectConnectionRating = "How would you rate your connection quality on a scale from 1 (poor) to 5 (excellent)? Type '%s rate [1-5]'." CitiesNotFoundError = "Servers by city are not available for this country." CheckYourInternetConnMessage = "Please check your internet connection and try again." ExpiredAccountMessage = "Your account has expired. Renew your subscription now to continue enjoying the ultimate privacy and security with NordVPN. %s" // TODO: update once we get new error message. NoDedicatedIPMessage = "" /* 130-byte string literal not displayed */ NoDedidcatedIPServerMessage = "This server isn't currently included in your dedicated IP subscription." NoPreferredDedicatedIPLocationSelected = "" /* 159-byte string literal not displayed */ NoSuchCommand = "Command '%s' doesn't exist." MsgListIsEmpty = "We couldn’t load the list of %s. Please try again later." TechnologyDisabledMessage = "Unable to connect with the current technology. Please try a different one using the command: nordvpn set technology." // Meshnet MsgSetMeshnetUsage = "Enables or disables Meshnet on this device." MsgSetMeshnetArgsUsage = `<enabled>|<disabled>` MsgSetMeshnetDescription = `` /* 240-byte string literal not displayed */ MsgSetMeshnetSuccess = "Meshnet is set to '%s' successfully." MsgMeshnetAlreadyEnabled = "Meshnet is already enabled." MsgMeshnetAlreadyDisabled = "Meshnet is already disabled." MsgMeshnetNotEnabled = "Meshnet is not enabled. Use the \"nordvpn set meshnet on\" command to enable it." MsgMeshnetNordlynxMustBeEnabled = "NordLynx technology must be set to use this feature." MsgMeshnetVersionNotSupported = "Current application version does not support the Meshnet feature." MsgMeshnetUsage = "" /* 355-byte string literal not displayed */ MsgMeshnetRefreshUsage = "Refreshes the Meshnet in case it was not updated automatically." MsgMeshnetPeerUnknown = "Peer '%s' is unknown." // Invites MsgMeshnetInviteUsage = "Add other users' devices to your Meshnet." MsgMeshnetInviteDescription = MsgMeshnetInviteUsage + "\n" + "Learn more: https://meshnet.nordvpn.com/features/linking-devices-in-meshnet" MsgMeshnetInviteListUsage = "Displays the list of all sent and received Meshnet invitations." MsgMeshnetInviteAcceptUsage = "Accepts an invitation to join inviter's mesh network." MsgMeshnetInviteDenyUsage = "Denies an invitation to join inviter's mesh network." MsgMeshnetInviteRevokeUsage = "Revokes a sent invitation." MsgMeshnetInviteNoInvitationFound = "no invitation from '%s' was found" MsgMeshnetInviteArgsUsage = "[email]" MsgMeshnetInviteAcceptSuccess = "Meshnet invitation from '%s' was accepted." MsgMeshnetInviteAcceptDeviceCount = "Maximum device count reached. Consider removing one or more of your devices." MsgMeshnetInviteSentSuccess = "Meshnet invitation to '%s' was sent." MsgMeshnetInviteDenySuccess = "Meshnet invitation from '%s' was denied." MsgMeshnetInviteRevokeSuccess = "Meshnet invitation to '%s' was revoked." MsgMeshnetInviteSendUsage = "Sends an invitation to join the mesh network." MsgMeshnetInviteSendAlreadyExists = "Meshnet invitation for '%s' already exists." MsgMeshnetInviteSendInvalidEmail = "Invalid email '%s'." MsgMeshnetInviteSendSameAccountEmail = "Email should belong to a different user." MsgMeshnetInviteSendDeviceCount = "The peer you're trying to invite has maximum device count reached." MsgMeshnetInviteWeeklyLimit = "Weekly invitation limit reached." MsgMeshnetInviteAllowIncomingTrafficUsage = "Allow incoming traffic from a peer." MsgMeshnetAllowTrafficRoutingUsage = "Allow the peer to route traffic through this device." MsgMeshnetAllowLocalNetworkUsage = "Allow the peer to access local network when routing traffic through this device." // Meshnet set commands group MsgMeshnetSetUsage = "Set a Meshnet configuration option." MsgMeshnetSetMachineNicknameUsage = "Sets a nickname for this machine within Meshnet." MsgMeshnetSetNicknameArgsUsage = "<new_nickname>" MsgMeshnetSetNicknameSuccessful = "The nickname for this machine is now set to '%s'." // Meshnet remove commands group MsgMeshnetRemoveUsage = "Remove a Meshnet configuration option." MsgMeshnetRemoveMachineNicknameUsage = "Removes the nickname currently set for this machine within Meshnet." MsgMeshnetRemoveNicknameSuccessful = "The nickname for this machine has been removed." // Peers MsgMeshnetPeerListFilters = "" /* 180-byte string literal not displayed */ MsgMeshnetPeerUsage = "Manage Meshnet peers." MsgMeshnetPeerDescription = `` /* 364-byte string literal not displayed */ MsgMeshnetPeerArgsUsage = "<peer_hostname>|<peer_nickname>|<peer_ip>|<peer_pubkey>" MsgMeshnetPeerListUsage = "Lists available peers in a Meshnet." MsgMeshnetPeerRemoveUsage = "Removes a peer from a Meshnet." MsgMeshnetPeerRemoveSuccess = "Peer '%s' has been removed from the Meshnet." MsgMeshnetPeerRoutingUsage = "Allows/denies a peer device to route all traffic through this device." MsgMeshnetPeerRoutingDescription = MsgMeshnetPeerRoutingUsage + "\n" + "Learn more: https://meshnet.nordvpn.com/features/explaining-permissions/traffic-routing-permissions" MsgMeshnetPeerRoutingAllowUsage = "Allows a Meshnet peer to route its' traffic through this device." MsgMeshnetPeerRoutingDenyUsage = "Denies a Meshnet peer to route its' traffic through this device." MsgMeshnetPeerRoutingAlreadyAllowed = "Traffic routing for '%s' is already allowed." MsgMeshnetPeerRoutingAlreadyDenied = "Traffic routing for '%s' is already denied." MsgMeshnetPeerRoutingAllowSuccess = "Traffic routing for '%s' has been allowed." MsgMeshnetPeerRoutingDenySuccess = "Traffic routing for '%s' has been denied." MsgMeshnetPeerIncomingUsage = "Allows/denies a peer device to access this device remotely (incoming connections)." MsgMeshnetPeerIncomingDescription = MsgMeshnetPeerIncomingUsage + "\n" + "Learn more: https://meshnet.nordvpn.com/features/explaining-permissions/remote-access-permissions" MsgMeshnetPeerIncomingAllowUsage = "Allows a Meshnet peer to send traffic to this device." MsgMeshnetPeerIncomingDenyUsage = "Denies a Meshnet peer to send traffic to this device." MsgMeshnetPeerIncomingAlreadyAllowed = "Incoming traffic for '%s' is already allowed." MsgMeshnetPeerIncomingAlreadyDenied = "Incoming traffic for '%s' is already denied." MsgMeshnetPeerIncomingAllowSuccess = "Incoming traffic for '%s' has been allowed." MsgMeshnetPeerIncomingDenySuccess = "Incoming traffic for '%s' has been denied." MsgMeshnetPeerLocalNetworkUsage = "Allows/denies access to your local network when a peer device is routing traffic through this device." MsgMeshnetPeerLocalNetworkDescription = MsgMeshnetPeerLocalNetworkUsage + "\n" + "Learn more: https://meshnet.nordvpn.com/features/explaining-permissions/local-network-permissions" MsgMeshnetPeerLocalNetworkAllowUsage = "Allows a Meshnet peer to access local network when routing traffic through this device." MsgMeshnetPeerLocalNetworkDenyUsage = "Denies a Meshnet peer to access local network when routing traffic through this device." MsgMeshnetPeerLocalNetworkAlreadyAllowed = "Local network access for '%s' is already allowed." MsgMeshnetPeerLocalNetworkAlreadyDenied = "Local network access for '%s' is already denied." MsgMeshnetPeerLocalNetworkAllowSuccess = "Local network access for '%s' has been allowed." MsgMeshnetPeerLocalNetworkDenySuccess = "Local network access for '%s' has been denied." MsgMeshnetPeerConnectUsage = "Treats a peer as a VPN server and connects to it if the peer has allowed traffic routing." MsgMeshnetPeerConnectSuccess = "You are connected to Meshnet exit node '%s'." // TODO: copy review MsgMeshnetPeerConnectCancel = "Connection to Meshnet exit node '%s' canceled." MsgMeshnetPeerDoesNotAllowRouting = "Meshnet peer '%s' does not allow traffic routing." MsgMeshnetPeerAlreadyConnected = "You are already connected." // TODO: copy review MsgMeshnetPeerAlreadyConnecting = "Connection to meshnet peer is already in progress." MsgMeshnetPeerConnectFailed = "Connect to other mesh peer failed - check if peer '%s' is online." MsgMeshnetPeerNicknameUsage = "Sets/removes a peer device nickname within Meshnet." MsgMeshnetPeerSetNicknameUsage = "Sets a nickname for the specified peer device." MsgMeshnetPeerSetNicknameArgsUsage = "<peer_hostname>|<peer_nickname>|<peer_ip>|<peer_pubkey> <new_peer_nickname>" MsgMeshnetPeerRemoveNicknameUsage = "Removes the nickname currently set for the specified peer device." MsgMeshnetPeerRemoveNicknameArgsUsage = "<peer_hostname>|<peer_nickname>|<peer_ip>|<peer_pubkey>" MsgMeshnetPeerSetNicknameSuccessful = "The nickname for the peer '%s' is now set to '%s'." MsgMeshnetNicknameAlreadyEmpty = "The nickname is already removed for this device." MsgMeshnetPeerResetNicknameSuccessful = "The nickname for the peer '%s' has been removed. The default hostname is '%s'." // errors received for meshnet nicknames MsgMeshnetSetSameNickname = "The nickname '%s' is already set for this device." MsgMeshnetNicknameIsDomainName = "The nickname is unavailable: A domain with this name already exists in your system." MsgMeshnetRateLimitReach = "You've reached the weekly limit for nickname changes." MsgMeshnetNicknameTooLong = "This nickname is too long. Nicknames can have up to 25 characters." MsgMeshnetDuplicateNickname = "A device with this nickname already exists." MsgMeshnetContainsForbiddenWord = "This nickname contains a restricted word." MsgMeshnetInvalidPrefixOrSuffix = "This nickname contains a disallowed prefix or suffix." MsgMeshnetNicknameWithDoubleHyphens = "Nicknames can't contain double dashes ('--')." MsgMeshnetContainsInvalidChars = "This nickname contains disallowed characters." // Fileshare MsgTooManyFiles = "Number of files in a transfer cannot exceed 1000. Try archiving the directory." MsgNoFiles = "The directory you’re trying to send is empty. Please choose another one." MsgDirectoryToDeep = "File depth cannot exceed 5 directories. Try archiving the directory." MsgSendingNotAllowed = "This peer does not allow file transfers from you." MsgFileNotInProgress = "This file is not in progress" MsgNotEnoughSpace = "The transfer can't be accepted because there's not enough storage on your device." MsgNoPermissions = "You don’t have write permissions for the download directory %s. To receive the file transfer, choose another download directory using the --" + flagFilesharePath + " parameter." MsgTransferNotCreated = "Can’t send the files. Please check if you have the \"read\" permission for the files you want to send." MsgNoSnapPermissions = "" /* 206-byte string literal not displayed */ MsgNoSnapPermissionsExt = "" /* 263-byte string literal not displayed */ MsgSnapNoSocketPermissions = "" /* 257-byte string literal not displayed */ MsgNoSocketPermissions = "" /* 253-byte string literal not displayed */ MsgSnapPermissionsErrorForTray = "Please grant necessary permissions for the snap using this command:\n\n%s" MsgSetVirtualLocationUsageText = "Enables or disables access to virtual locations. Virtual location servers let you access more locations worldwide." MsgSetVirtualLocationDescription = "Enables or disables access to virtual locations." MsgShowListOfServers = "" /* 307-byte string literal not displayed */ SetTechnologyDisablePQ = "This setting is not compatible with the post-quantum VPN. To use OpenVPN, disable the post-quantum VPN first." SetPqAndMeshnet = "The post-quantum VPN and Meshnet can't run at the same time. Please disable one feature to use the other." SetPqAndMeshnetServer = "" /* 130-byte string literal not displayed */ SetPqUsageText = "" /* 227-byte string literal not displayed */ )
const AccountUsageText = "Shows account information"
AccountUsageText is shown next to account command by nordvpn --help
const AllowlistRemoveAllUsageText = "Removes all ports and subnets from the allowlist"
AllowlistRemoveAllUsageText is shown next to all command by nordvpn allowlist remove --help
const AppHelpTemplate = `` /* 890-byte string literal not displayed */
AppHelpTemplate is the template we use for forming the cli message on no command
const CommandHelpTemplate = `` /* 315-byte string literal not displayed */
CommandHelpTemplate is the template we use to show help
const CommandWithoutArgsHelpTemplate = `` /* 301-byte string literal not displayed */
CommandWithoutArgsHelpTemplate is the template we use to show help
const DisconnectUsageText = "Disconnects you from VPN"
DisconnectUsageText is shown next to disconnect command by nordvpn --help
const GroupsUsageText = "Shows a list of available server groups"
GroupsUsageText is shown next to groups command by nordvpn --help
const (
PeerListDescription = "Press the Tab key to see auto-suggestions for filters."
)
const RegisterUsageText = "Registers a new user account"
RegisterUsageText is shown next to register command by nordvpn --help
const SetAnalyticsUsageText = "Help us improve by sending anonymous " +
"aggregate data: crash reports, OS version, marketing " +
"performance, and feature usage data – nothing that could " +
"identify you."
const SetDefaultsUsageText = "Restores settings to their default values."
SetDefaultsUsageText is shown next to defaults command by nordvpn set --help
const SetIpv6UsageText = "Enables or disables use of the IPv6."
const SetKillSwitchUsageText = "" /* 181-byte string literal not displayed */
SetKillSwitchUsageText is shown next to killswitch command by nordvpn set --help
const SetNotifyUsageText = "Enables or disables notifications"
SetNotifyUsageText is shown next to notify command by nordvpn set --help
const SetObfuscateUsageText = "" /* 173-byte string literal not displayed */
SetObfuscateUsageText is shown next to obfuscate command by nordvpn set --help
const SetRoutingUsageText = "Allows routing traffic through VPN " +
"servers and peer devices in Meshnet. This setting must be " +
"enabled to send your traffic through a VPN server or a peer " +
"device. If the setting is disabled, the app will only " +
"initiate necessary connections to a VPN server or a peer " +
"device but won’t start traffic routing."
const SetTrayUsageText = "" /* 134-byte string literal not displayed */
SetTrayUsageText is shown next to defaults command by nordvpn set --help
const SettingsUsageText = "Shows current settings"
SettingsUsageText is show next to settings command by nordvpn --help
const StatusUsageText = "Shows connection status"
StatusUsageText is shown next to status command by nordvpn --help
const SubcommandHelpTemplate = `` /* 594-byte string literal not displayed */
SubcommandHelpTemplate is the template we use to show subcommand help
const ( // TokenUsageText is shown next to login command by nordvpn --help TokenUsageText = "Show token information" // #nosec )
Variables ¶
var ( ErrInternetConnection = errors.New(CheckYourInternetConnMessage) ErrNoDedicatedIP = errors.New(NoDedicatedIPMessage) ErrUpdateAvailable = errors.New(UpdateAvailableMessage) )
var CitiesDescription = fmt.Sprintf(MsgShowListOfServers, "cities") + "\n\nExample: 'nordvpn cities United_States'\n\nPress the Tab key to see auto-suggestions for countries.'"
var ErrConfig = errors.New(client.ConfigMessage)
Functions ¶
func FormatSnapMissingConnsErr ¶
func FormatSnapMissingConnsErr(err *snappb.ErrMissingConnections) string
func FormatSnapMissingConnsExtErr ¶
func FormatSnapMissingConnsExtErr(err *snappb.ErrMissingConnections) string
func JoinSnapMissingPermissions ¶
func JoinSnapMissingPermissions(err *snappb.ErrMissingConnections) string
Concatenate snap missing connections and returns a string
func LoginRespHandler ¶
func LoginRespHandler(ctx *cli.Context, resp *pb.LoginResponse) error
func MeshnetResponseToError ¶
func MeshnetResponseToError(resp *meshpb.MeshnetResponse) error
MeshnetResponseToError returns a human readable error
func NewApp ¶
func NewApp(version, environment, hash, salt string, pingErr error, conn *grpc.ClientConn, fileshareConn grpc.ClientConnInterface, loaderInterceptor *LoaderInterceptor, ) (*cli.App, error)
func ReadCredentialsFromTerminal ¶
ReadCredentialsFromTerminal reads username and password from terminal this overrides current terminal and restores it upon completion
func ReadPlanFromTerminal ¶
func RetrieveSnapConnsError ¶
func RetrieveSnapConnsError(err error) *snappb.ErrMissingConnections
RetrieveSnapConnsError checks whether ny of the details inside gRPC error is a `SnapPermissionError` and returns pointer to it. Otherwise, returns nil
func SetLANDiscoveryErrorCodeToError ¶
func SetLANDiscoveryErrorCodeToError(code pb.SetErrorCode, flag bool) error
func SetLANDiscoveryStatusToMessage ¶
func SetLANDiscoveryStatusToMessage(code pb.SetLANDiscoveryStatus, flag bool)
func Status ¶
func Status(resp *pb.StatusResponse) string
Status returns ready to print status string.
Types ¶
type LoaderConfig ¶
type LoaderConfig struct {
Prefix string
}
type LoaderInterceptor ¶
type LoaderInterceptor struct {
// contains filtered or unexported fields
}
func (*LoaderInterceptor) StreamInterceptor ¶
func (i *LoaderInterceptor) StreamInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)
func (*LoaderInterceptor) UnaryInterceptor ¶
func (i *LoaderInterceptor) UnaryInterceptor(ctx context.Context, method string, req interface{}, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
type SilentLoader ¶
type SilentLoader struct{}
SilentLoader do not show progress in case of non-terminal output
func (*SilentLoader) Start ¶
func (l *SilentLoader) Start()
func (*SilentLoader) Stop ¶
func (l *SilentLoader) Stop()
type TerminalLoader ¶
type TerminalLoader struct {
// contains filtered or unexported fields
}
TerminalLoader show operation progress to the human user in the terminal
func (*TerminalLoader) Start ¶
func (l *TerminalLoader) Start()
func (*TerminalLoader) Stop ¶
func (l *TerminalLoader) Stop()
Source Files ¶
- cli.go
- cli_account.go
- cli_allowlist_add_port.go
- cli_allowlist_add_ports.go
- cli_allowlist_add_subnet.go
- cli_allowlist_remove_all.go
- cli_allowlist_remove_port.go
- cli_allowlist_remove_ports.go
- cli_allowlist_remove_subnet.go
- cli_cities.go
- cli_click.go
- cli_connect.go
- cli_countries.go
- cli_disconnect.go
- cli_fileshare.go
- cli_fileshare_list.go
- cli_groups.go
- cli_login.go
- cli_logout.go
- cli_mesh_invite.go
- cli_mesh_peers.go
- cli_ping.go
- cli_rate.go
- cli_register.go
- cli_set_analytics.go
- cli_set_autoconnect.go
- cli_set_defaults.go
- cli_set_dns.go
- cli_set_firewall.go
- cli_set_ipv6.go
- cli_set_killswitch.go
- cli_set_lan_discovery.go
- cli_set_mesh.go
- cli_set_notify.go
- cli_set_obfuscate.go
- cli_set_postquantum_vpn.go
- cli_set_protocol.go
- cli_set_routing.go
- cli_set_technology.go
- cli_set_threat_protection_lite.go
- cli_set_tray.go
- cli_set_virtual_location.go
- cli_settings.go
- cli_status.go
- cli_token.go
- cli_user.go
- cli_utils.go
- cli_version.go
- constants.go
- errors.go
- loader.go
- messages.go
- terminal.go
- timespan.go
- uint64.go