protonvpn

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const StatusDown = 0
View Source
const StautsUp = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type Feature

type Feature int
const (
	FeatureP2P     Feature = 1
	FeatureS2C     Feature = 2
	FeatureTOR     Feature = 4
	FeatureUNKNOWN Feature = 0
)

func ParseFeatureFromString

func ParseFeatureFromString(str string) (Feature, error)

type FilterOptions

type FilterOptions struct {
	Tier     OptionalIntField
	Status   OptionalIntField
	Features OptionalIntField

	ExcludedCountries []string
	EntryCountry      string
	ExitCountry       string
}

type LogicalServer

type LogicalServer struct {
	Name         string
	EntryCountry string
	ExitCountry  string
	Domain       string
	Tier         int
	Features     Feature
	Region       string
	City         string
	Score        float64
	HostCountry  string
	ID           string
	Location     LogicalServerLocation
	Status       int
	Servers      []ServerInfo
	Load         int
}

type LogicalServerLocation

type LogicalServerLocation struct {
	Lat  float64
	Long float64
}

type LogicalServers

type LogicalServers []LogicalServer

func FilterServers

func FilterServers(logicalServers LogicalServers, filterOptions *FilterOptions) LogicalServers

*

  • Filters the servers based on various metrics

func (LogicalServers) FilterServers

func (logicals LogicalServers) FilterServers(filterOptions FilterOptions) LogicalServers

func (LogicalServers) GetLogicalServerByDomain

func (logicals LogicalServers) GetLogicalServerByDomain(domain string) *LogicalServer

func (LogicalServers) GetLogicalServerByName

func (logicals LogicalServers) GetLogicalServerByName(name string) *LogicalServer

type LogicalsResponse

type LogicalsResponse struct {
	Code           int
	LogicalServers LogicalServers
	FetchedOffline bool `json:"-"`
}

func GetLogicals

func GetLogicals(fetchOffline bool) (*LogicalsResponse, error)

type OptionalIntField

type OptionalIntField struct {
	Value  int
	Exists bool
}

func CreateOptionalIntField

func CreateOptionalIntField(val int) OptionalIntField

type ServerInfo

type ServerInfo struct {
	EntryIP           string
	ExitIP            string
	Domain            string
	ID                string
	Generation        int
	Status            int
	ServiceDownReason string
	Label             string
}

type Status

type Status int

type Tier

type Tier int
const (
	TierFree      Tier = 0
	TierBasic     Tier = 1
	TierPlus      Tier = 2
	TierVisionary Tier = 3
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL