static

package
v0.14.11 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package static contains static information for the locate service.

Index

Constants

View Source
const (
	IssuerLocate               = "locate"
	AudienceLocate             = "locate"
	IssuerMonitoring           = "monitoring"
	SubjectMonitoring          = "monitoring"
	WebsocketBufferSize        = 1 << 10 // 1024 bytes.
	WebsocketReadDeadline      = 30 * time.Second
	BackoffInitialInterval     = time.Second
	BackoffRandomizationFactor = 0.5
	BackoffMultiplier          = 2
	BackoffMaxInterval         = 5 * time.Minute
	BackoffMaxElapsedTime      = 0
	HeartbeatPeriod            = 10 * time.Second
	MemorystoreExportPeriod    = 10 * time.Second
	PrometheusCheckPeriod      = time.Minute
	RedisKeyExpirySecs         = 30
	EarthHalfCircumferenceKm   = 20038
)

Constants used by the locate service, clients, and target servers accepting access tokens issued by the locate service.

Variables

View Source
var Configs = map[string]Ports{
	"ndt/ndt7": {
		URL("ws", "", "/ndt/v7/upload"),
		URL("ws", "", "/ndt/v7/download"),
		URL("wss", "", "/ndt/v7/upload"),
		URL("wss", "", "/ndt/v7/download"),
	},
	"ndt/ndt5": {

		URL("ws", ":3001", "/ndt_protocol"),
		URL("wss", ":3010", "/ndt_protocol"),
	},
	"neubot/dash": {
		URL("https", "", "/negotiate/dash"),
	},
	"wehe/replay": {
		URL("wss", ":4443", "/v0/envelope/access"),
	},
	"iperf3/test": {
		URL("wss", "", "/v0/envelope/access"),
	},
}

Configs is a temporary, static mapping of service names and their set of associated ports. Ultimately, this will be discovered dynamically as service heartbeats register with the locate service.

View Source
var Countries = map[string]string{}/* 244 elements not displayed */

Countries contains a static mapping of two-letter country codes to their geographic center. Source: https://developers.google.com/public-data/docs/canonical/countries_csv

View Source
var LegacyServices = map[string]string{
	"neubot/dash": "neubot",
	"wehe/replay": "wehe",
	"iperf3/test": "ndt7",
	"ndt/ndt5":    "ndt_ssl",
	"ndt/ndt7":    "ndt7",
}

LegacyServices associates legacy mlab-ns experiment target names with their v2 equivalent.

View Source
var Regions = map[string]string{}/* 4416 elements not displayed */

Regions contains a static mapping of ISO 3166-2 region codes. Each key is additionally prefixed with the two-letter country code because not all region codes are unique.

View Source
var SiteProbability = map[string]float64{
	"ams10": 0.2,
	"bom01": 0.1,
	"bom02": 0.1,
	"bru06": 0.2,
	"cgk01": 0.2,
	"chs01": 0.2,
	"cmh01": 0.2,
	"del03": 0.2,
	"dfw09": 0.2,
	"fra07": 1.0,
	"gru01": 0.1,
	"gru02": 0.1,
	"gru03": 0.1,
	"gru04": 0.1,
	"hel01": 0.2,
	"hkg04": 0.2,
	"hnd02": 0.1,
	"hnd03": 0.1,
	"hnd04": 0.1,
	"hnd05": 0.1,
	"iad07": 0.2,
	"icn01": 0.2,
	"kix01": 0.2,
	"las01": 0.2,
	"lax07": 0.2,
	"lga1t": 0.5,
	"lhr09": 0.2,
	"lis01": 0.5,
	"lju01": 0.5,
	"mad07": 0.2,
	"mel01": 0.2,
	"mil08": 0.2,
	"oma01": 0.2,
	"ord07": 0.2,

	"prg02": 0.3,
	"prg03": 0.3,
	"prg04": 0.3,
	"prg05": 0.3,
	"prg06": 0.3,

	"par08": 0.2,
	"pdx01": 0.2,
	"scl05": 0.2,
	"sea09": 0.2,
	"sin02": 0.2,
	"slc01": 0.2,
	"syd07": 0.2,
	"tpe02": 0.2,
	"tun01": 0.5,
	"vie01": 0.5,
	"waw01": 1.0,
	"yqm01": 0.5,
	"yul02": 0.2,
	"yul07": 0.2,
	"yvr01": 0.1,
	"ywg01": 0.5,
	"yyc02": 0.5,
	"yyz02": 0.2,
	"yyz07": 0.2,
	"zrh01": 0.2,
}

SiteProbability defines explicit probabilites for sites that cannot handle the current number of requests. The default value is 1.0. TODO(github.com/m-lab/locate/issues/92): Make this dynamic.

Functions

func URL

func URL(scheme, port, path string) url.URL

URL creates inline url.URLs.

Types

type Ports

type Ports []url.URL

Ports maps names to URLs.

Jump to

Keyboard shortcuts

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