netloc

package
v0.0.0-...-af321b4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LookupURL = "https://ifconfig.co/json"

URL that will return a json document with ip, asn, asn_org, country_iso, latittude, longitude for the ip in question.

Functions

func FastLocate

func FastLocate(defaultLabels *pb.LabelSet) ([]*pb.NetworkLocation, error)

func FindBest

func FindBest(input *BestInput) ([]*pb.NetworkLocation, error)

Given 2 sets of network locations, return the best N (count) ones that local should use to connect to remote

func FindBestLive

func FindBestLive(ctx context.Context, input *BestInput, locs chan *pb.NetworkLocation) error

Given 2 sets of network locations, return the best N (count) ones that local should use to connect to remote

func Locate

func Locate(defaultLabels *pb.LabelSet) ([]*pb.NetworkLocation, error)

Types

type BestInput

type BestInput struct {
	Count      int
	Local      []*pb.NetworkLocation
	Remote     []*pb.NetworkLocation
	PublicOnly bool

	Latency func(addr string) error
}

Jump to

Keyboard shortcuts

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