geo

package
v0.0.0-...-b1fd7ae Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// US West is the default:
	DefaultEndpoint = Endpoint{Hostname: conf.DefaultServerHost, SessionPrefix: ""}

	// List of Teleconsole proxy servers.
	Endpoints = []Endpoint{
		DefaultEndpoint,
		{"eu.teleconsole.com", "eu"},
		{"as.teleconsole.com", "as"},
	}
)

Functions

func EndpointForSession

func EndpointForSession(sid string) (string, string)

EndpointForSession deterines which Teleconsole server generated a given session ID It looks at the prefix (first few bytes) of it.

Returns the endpoint (or "" for legacy sessions from teleconsole.com) and also returns the session ID without the prefix

func IsGeobalancedSession

func IsGeobalancedSession(sid string) bool

IsGeobalancedSession returns 'true' if the given session ID starts with a geo prefix

func SesionPrefixFor

func SesionPrefixFor(endpoint string) string

SessionPrefixFor finds a session prefix for a given endpoint

Types

type Endpoint

type Endpoint struct {
	Hostname      string `json:"dns_name"`
	SessionPrefix string `json:"session_prefix"`
}

func FindFastestEndpoint

func FindFastestEndpoint() Endpoint

FindFastestEndpoint returns the Teleconsole server endpoint which was the fastest to respond to HTTP ping/pong

Jump to

Keyboard shortcuts

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