Documentation ¶
Index ¶
- func NewBonafideGateway(v5Gateway *models.ModelsGateway) *bonafide.Gateway
- func NewBonafideGatewayArray(gatewaysV5 []*models.ModelsGateway) []bonafide.Gateway
- type Menshen
- func (m *Menshen) DoGeolocationLookup() (string, error)
- func (m *Menshen) DoLogin(username, password string) (bool, error)
- func (m *Menshen) FetchAllGateways(transport string) error
- func (m *Menshen) GetBestGateways(transport string) ([]bonafide.Gateway, error)
- func (m *Menshen) GetBestLocation(transport string) (string, error)
- func (m *Menshen) GetGatewayByIP(ip string) (bonafide.Gateway, error)
- func (m *Menshen) GetLocationLabels(transport string) map[string][]string
- func (m *Menshen) GetLocationQualityMap(transport string) map[string]float64
- func (m *Menshen) GetOpenvpnArgs() ([]string, error)
- func (m *Menshen) GetPemCertificate() ([]byte, error)
- func (m *Menshen) GetSnowflakeCh() chan *snowflake.StatusEvent
- func (m *Menshen) IsManualLocation() bool
- func (m *Menshen) IsUDPAvailable() bool
- func (m *Menshen) NeedsCredentials() bool
- func (m *Menshen) SetAutomaticGateway()
- func (m *Menshen) SetManualGateway(location string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBonafideGateway ¶
func NewBonafideGateway(v5Gateway *models.ModelsGateway) *bonafide.Gateway
func NewBonafideGatewayArray ¶
func NewBonafideGatewayArray(gatewaysV5 []*models.ModelsGateway) []bonafide.Gateway
Types ¶
type Menshen ¶
type Menshen struct { // SnowflakeCh chan *snowflake.StatusEvent //TODO: Snowflake support // snowflakeProgress int // snowflake bool Gateways []*models.ModelsGateway // list of gateways offered by menshen // contains filtered or unexported fields }
func (*Menshen) FetchAllGateways ¶
Asks menshen for gateways. The gateways are stored in m.Gateways Currently, there is not CountryCode filtering The vars m.gwLocations and m.gwsByLocation are updated
func (*Menshen) GetBestGateways ¶
Returns a list of gateways that we will connect to. First checks if automatic gateway selection should be used.
func (*Menshen) GetBestLocation ¶
Returns the best location by iterating over m.locationQualityMap and finding the location with the highest quality
func (*Menshen) GetGatewayByIP ¶
Returns a gateway for a given ip address. Use case: We start OpenVPN with multiple --remote arguments, but in the end we don't know to which endpoint we are connected. Using the management interface, OpenVPN tells us the ip we are connected to
func (*Menshen) GetLocationLabels ¶
Returns a map[string][string] with gateway locations and their country code. Only used for the GUI locationLabels["Paris"] = ["Paris", "FR"] locationLabels["Seattle"] = ["Seattle", "US"] This functions gets called quiet often via toJson function in pkg/backend/status.go TODO: use a smarter structure if we get rid of v3 (needs to be cpp compatible)
func (*Menshen) GetLocationQualityMap ¶
func (*Menshen) GetOpenvpnArgs ¶
Asks menshen for OpenVPN arguments Returns a list of arguments that can be passed over as command line arguments There are key-value arguments like "--dev tun" and boolean arguments like "--persisst-key" without additional value Currently, there is no caching implemented
func (*Menshen) GetPemCertificate ¶
Asks menshen for valid client credentials (certificate + key) Currently, there is no caching implemented
func (*Menshen) GetSnowflakeCh ¶
func (m *Menshen) GetSnowflakeCh() chan *snowflake.StatusEvent
func (*Menshen) IsManualLocation ¶
Returns true if the user selected a preferred location to connect with
func (*Menshen) IsUDPAvailable ¶
Returns true if at least one gateway supports udp