Documentation ¶
Index ¶
- Constants
- type APIError
- type APIErrorResponse
- type APIResponse
- type AntitrackerInfo
- type ConfigInfo
- type DNSInfo
- type GeoLookupResponse
- type InfoAPI
- type OpenvpnServerInfo
- type ServersInfoResponse
- type ServiceStatusAPIResp
- type SessionDeleteRequest
- type SessionNewErrorLimitResponse
- type SessionNewRequest
- type SessionNewResponse
- type SessionStatusRequest
- type SessionStatusResponse
- type SessionWireGuardKeySetRequest
- type SessionsWireGuardResponse
- type WireGuardServerHostInfo
- type WireGuardServerInfo
Constants ¶
const ( // CodeSuccess - success CodeSuccess int = 200 Unauthorized int = 401 // WGPublicKeyNotFound - WireGuard Public Key not found WGPublicKeyNotFound int = 424 // SessionNotFound - Session not found Session not found SessionNotFound int = 601 // CodeSessionsLimitReached - You've reached the session limit, log out from other device CodeSessionsLimitReached int = 602 // AccountNotActive - account should be purchased AccountNotActive int = 702 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
APIError - error, user not logged in into account
func CreateAPIError ¶
CreateAPIError creates new API error object
type APIErrorResponse ¶
type APIErrorResponse struct { APIResponse Message string `json:"message,omitempty"` // Text description of the message }
APIErrorResponse generic IVPN API error
type APIResponse ¶
type APIResponse struct {
Status int `json:"status"` // status code
}
APIResponse - generic API response
type AntitrackerInfo ¶
AntitrackerInfo all info about antitracker DNSs
type ConfigInfo ¶
type ConfigInfo struct { Antitracker AntitrackerInfo `json:"antitracker"` API InfoAPI `json:"api"` }
ConfigInfo contains different configuration info (Antitracker, API ...)
type GeoLookupResponse ¶
type GeoLookupResponse struct { Latitude float32 `json:"latitude"` Longitude float32 `json:"longitude"` }
GeoLookupResponse geolocation info
type InfoAPI ¶
type InfoAPI struct {
IPAddresses []string `json:"ips"`
}
InfoAPI contains API IP adresses
type OpenvpnServerInfo ¶
type OpenvpnServerInfo struct { Gateway string `json:"gateway"` CountryCode string `json:"country_code"` Country string `json:"country"` City string `json:"city"` Latitude float32 `json:"latitude"` Longitude float32 `json:"longitude"` IPAddresses []string `json:"ip_addresses"` }
OpenvpnServerInfo contains all info about OpenVPN server
type ServersInfoResponse ¶
type ServersInfoResponse struct { WireguardServers []WireGuardServerInfo `json:"wireguard"` OpenvpnServers []OpenvpnServerInfo `json:"openvpn"` Config ConfigInfo `json:"config"` }
ServersInfoResponse all info from servers.json
type ServiceStatusAPIResp ¶
type ServiceStatusAPIResp struct { Active bool `json:"is_active"` ActiveUntil int64 `json:"active_until"` CurrentPlan string `json:"current_plan"` PaymentMethod string `json:"payment_method"` IsRenewable bool `json:"is_renewable"` WillAutoRebill bool `json:"will_auto_rebill"` IsFreeTrial bool `json:"is_on_free_trial"` Capabilities []string `json:"capabilities"` Upgradable bool `json:"upgradable"` UpgradeToPlan string `json:"upgrade_to_plan"` UpgradeToURL string `json:"upgrade_to_url"` Limit int `json:"limit"` // applicable for 'session limit' error }
ServiceStatusAPIResp account info
type SessionDeleteRequest ¶
type SessionDeleteRequest struct {
Session string `json:"session_token"`
}
SessionDeleteRequest request to delete session
type SessionNewErrorLimitResponse ¶
type SessionNewErrorLimitResponse struct { APIErrorResponse SessionLimitData ServiceStatusAPIResp `json:"data"` }
SessionNewErrorLimitResponse information about session limit error
type SessionNewRequest ¶
type SessionNewRequest struct { AccountID string `json:"username"` PublicKey string `json:"wg_public_key"` ForceLogin bool `json:"force"` CaptchaID string `json:"captcha_id,omitempty"` Captcha string `json:"captcha,omitempty"` Confirmation2FA string `json:"confirmation,omitempty"` }
SessionNewRequest request to create new session
type SessionNewResponse ¶
type SessionNewResponse struct { APIErrorResponse Token string `json:"token"` VpnUsername string `json:"vpn_username"` VpnPassword string `json:"vpn_password"` CaptchaID string `json:"captcha_id"` CaptchaImage string `json:"captcha_image"` ServiceStatus ServiceStatusAPIResp `json:"service_status"` WireGuard struct { Status int `json:"status"` Message string `json:"message,omitempty"` IPAddress string `json:"ip_address,omitempty"` } `json:"wireguard"` }
SessionNewResponse information about created session
type SessionStatusRequest ¶
type SessionStatusRequest struct {
Session string `json:"session_token"`
}
SessionStatusRequest request to get session status
type SessionStatusResponse ¶
type SessionStatusResponse struct { APIErrorResponse ServiceStatus ServiceStatusAPIResp `json:"service_status"` }
SessionStatusResponse session status response
type SessionWireGuardKeySetRequest ¶
type SessionWireGuardKeySetRequest struct { Session string `json:"session_token"` PublicKey string `json:"public_key"` ConnectedPublicKey string `json:"connected_public_key"` }
SessionWireGuardKeySetRequest request to set new WK key for a session
type SessionsWireGuardResponse ¶
type SessionsWireGuardResponse struct { APIErrorResponse IPAddress string `json:"ip_address,omitempty"` }
SessionsWireGuardResponse Sessions WireGuard response
type WireGuardServerHostInfo ¶
type WireGuardServerHostInfo struct { Hostname string `json:"hostname"` Host string `json:"host"` PublicKey string `json:"public_key"` LocalIP string `json:"local_ip"` }
WireGuardServerHostInfo contains info about WG server host
type WireGuardServerInfo ¶
type WireGuardServerInfo struct { Gateway string `json:"gateway"` CountryCode string `json:"country_code"` Country string `json:"country"` City string `json:"city"` Latitude float32 `json:"latitude"` Longitude float32 `json:"longitude"` Hosts []WireGuardServerHostInfo `json:"hosts"` }
WireGuardServerInfo contains all info about WG server