bonafide

package
Version: v0.0.0-...-6a359b1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: GPL-3.0 Imports: 20 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 {
	SnowflakeCh chan *snowflake.StatusEvent
	// contains filtered or unexported fields
}

func New

func New() *Bonafide

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

func (*Bonafide) DoLogin

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

func (*Bonafide) GetAllGateways

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

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

func (*Bonafide) GetBestLocation

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

func (*Bonafide) GetGatewayByIP

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

func (*Bonafide) GetGateways

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

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

func (*Bonafide) GetOpenvpnArgs

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

func (*Bonafide) GetPemCertificate

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

func (*Bonafide) GetPemCertificateNoDNS

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

func (*Bonafide) IsManualLocation

func (b *Bonafide) IsManualLocation() bool

func (*Bonafide) IsUDPAvailable

func (b *Bonafide) IsUDPAvailable() bool

func (*Bonafide) ListLocationFullness

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

func (*Bonafide) ListLocationLabels

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

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