Documentation ¶
Index ¶
- Variables
- func FastLocate(defaultLabels *pb.LabelSet) ([]*pb.NetworkLocation, error)
- func FindBest(input *BestInput) ([]*pb.NetworkLocation, error)
- func FindBestLive(ctx context.Context, input *BestInput, locs chan *pb.NetworkLocation) error
- func Locate(defaultLabels *pb.LabelSet) ([]*pb.NetworkLocation, error)
- type BestInput
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 ¶
Given 2 sets of network locations, return the best N (count) ones that local should use to connect to remote
Types ¶
type BestInput ¶
type BestInput struct { Count int Local []*pb.NetworkLocation Remote []*pb.NetworkLocation PublicOnly bool Latency func(addr string) error }
Click to show internal directories.
Click to hide internal directories.