bonafide

package
v0.0.0-...-e3c9231 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bonafide

type Bonafide struct {
	// contains filtered or unexported fields
}

func New

func New() *Bonafide

New Bonafide: Initializes a Bonafide object. By default, no Credentials are passed.

func (*Bonafide) DoGeolocationLookup

func (b *Bonafide) DoGeolocationLookup() (string, error)

func (*Bonafide) DoLogin

func (b *Bonafide) DoLogin(username, password string) (bool, error)

func (*Bonafide) FetchAllGateways

func (b *Bonafide) FetchAllGateways(transport string) error

FetchGateways only filters gateways by transport. if "any" is provided it will return all gateways for all transports

func (*Bonafide) GetBestGateways

func (b *Bonafide) GetBestGateways(transport string) ([]Gateway, error)

GetBestGateways filters by transport, and will return the maximum number defined in bonafide.maxGateways, or the maximum by default (3).

func (*Bonafide) GetBestLocation

func (b *Bonafide) GetBestLocation(transport string) (string, error)

This function is part of the apiInterface In the v5 implementation, some errors can happen In this case we always return nil as error

func (*Bonafide) GetGatewayByIP

func (b *Bonafide) GetGatewayByIP(ip string) (Gateway, error)

func (*Bonafide) GetLocationLabels

func (b *Bonafide) GetLocationLabels(transport string) map[string][]string

func (*Bonafide) GetLocationQualityMap

func (b *Bonafide) GetLocationQualityMap(transport string) map[string]float64

func (*Bonafide) GetOpenvpnArgs

func (b *Bonafide) GetOpenvpnArgs() ([]string, error)

func (*Bonafide) GetPemCertificate

func (b *Bonafide) GetPemCertificate() ([]byte, error)

func (*Bonafide) GetSnowflakeCh

func (b *Bonafide) GetSnowflakeCh() chan *snowflake.StatusEvent

func (*Bonafide) IsManualLocation

func (b *Bonafide) IsManualLocation() bool

func (*Bonafide) IsUDPAvailable

func (b *Bonafide) IsUDPAvailable() bool

func (*Bonafide) NeedsCredentials

func (b *Bonafide) NeedsCredentials() bool

NeedsCredentials signals if we have to ask user for credentials. If false, it can be that we have a cached token

func (*Bonafide) SetAutomaticGateway

func (b *Bonafide) SetAutomaticGateway()

func (*Bonafide) SetManualGateway

func (b *Bonafide) SetManualGateway(label string)

type Gateway

type Gateway struct {
	Host         string
	IPAddress    string
	Location     string
	LocationName string
	CountryCode  string
	Ports        []string
	Protocols    []string
	Options      map[string]string
	Transport    string
}

A Gateway is a representation of gateways that is independent of the api version. If a given physical location offers different transports, they will appear as separate gateways, so make sure to filter them.

type Load

type Load struct {
	Fullness float64
	Overload bool
	// contains filtered or unexported fields
}

Load reflects the fullness metric that menshen returns, if available.

type Location

type Location struct {
	CountryCode string `json:"country_code"`
	Hemisphere  string
	Name        string
	Timezone    string
}

Jump to

Keyboard shortcuts

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