riseupvpn

package
v3.21.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package riseupvpn contains the RiseupVPN network experiment.

See https://github.com/ooni/spec/blob/master/nettests/ts-026-riseupvpn.md

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExperimentMeasurer

func NewExperimentMeasurer(config Config) model.ExperimentMeasurer

NewExperimentMeasurer creates a new ExperimentMeasurer.

Types

type CapabilitiesV3 added in v3.19.0

type CapabilitiesV3 struct {
	Transport []TransportV3
}

CapabilitiesV3 is a list of transports a gateway supports

type Config

type Config struct {
	urlgetter.Config
}

Config contains the riseupvpn experiment config.

type EIPServiceV3 added in v3.19.0

type EIPServiceV3 struct {
	Gateways []GatewayV3
}

EIPServiceV3 is the main JSON object returned by eip-service.json.

func DecodeEIPServiceV3 added in v3.19.0

func DecodeEIPServiceV3(body string) (*EIPServiceV3, error)

DecodeEIPServiceV3 decodes eip-service.json version 3

type GatewayConnection

type GatewayConnection struct {
	IP            string `json:"ip"`
	Port          int    `json:"port"`
	TransportType string `json:"transport_type"`
}

GatewayConnection describes the connection to a riseupvpn gateway.

type GatewayV3

type GatewayV3 struct {
	Capabilities CapabilitiesV3
	Host         string
	IPAddress    string `json:"ip_address"`
}

GatewayV3 describes a gateway.

type Measurer

type Measurer struct {
	// Config contains the experiment settings. If empty we
	// will be using default settings.
	Config Config

	// Getter is an optional getter to be used for testing.
	Getter urlgetter.MultiGetter
}

Measurer performs the measurement.

func (Measurer) ExperimentName

func (m Measurer) ExperimentName() string

ExperimentName implements ExperimentMeasurer.ExperimentName.

func (Measurer) ExperimentVersion

func (m Measurer) ExperimentVersion() string

ExperimentVersion implements ExperimentMeasurer.ExperimentVersion.

func (Measurer) Run

func (m Measurer) Run(ctx context.Context, args *model.ExperimentArgs) error

Run implements ExperimentMeasurer.Run.

type TestKeys

type TestKeys struct {
	urlgetter.TestKeys
	APIFailures  []string `json:"api_failures"`
	CACertStatus bool     `json:"ca_cert_status"`
}

TestKeys contains riseupvpn test keys.

func NewTestKeys

func NewTestKeys() *TestKeys

NewTestKeys creates new riseupvpn TestKeys.

func (*TestKeys) AddCACertFetchTestKeys

func (tk *TestKeys) AddCACertFetchTestKeys(testKeys urlgetter.TestKeys)

AddCACertFetchTestKeys adds generic urlgetter.Get() testKeys to riseupvpn specific test keys

func (*TestKeys) AddGatewayConnectTestKeys

func (tk *TestKeys) AddGatewayConnectTestKeys(v urlgetter.MultiOutput, transportType string)

AddGatewayConnectTestKeys updates the TestKeys using the given MultiOutput result of gateway connectivity testing. Sets TransportStatus to "ok" if any successful TCP connection could be made

func (*TestKeys) UpdateProviderAPITestKeys

func (tk *TestKeys) UpdateProviderAPITestKeys(v urlgetter.MultiOutput)

UpdateProviderAPITestKeys updates the TestKeys using the given MultiOutput result.

type TransportV3

type TransportV3 struct {
	Type      string
	Protocols []string
	Ports     []string
	Options   map[string]string
}

TransportV3 describes a transport.

Jump to

Keyboard shortcuts

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