Documentation ¶
Index ¶
- Variables
- func HandleGatewayClientDisconnect(r *Router, g *Gateway, remoteID string) error
- func HandleMetricsClientConnect(router *Router) error
- func HandleRouterClientDisconnect(r *Router, g *Gateway, remoteID string) error
- func HandleRouterOpen(router *Router)
- func RequestCall(adapter *Adapter, dstID, channelID string) (bool, string, error)
- func SetAdapterCA(adapter *Adapter, caPEM []byte)
- func SetSwitchCA(sw *Switch, caPEM []byte)
- type Adapter
- func (a *Adapter) ProvisionRoute(ctx context.Context, routeID string, channelID string, raddr string, ...) error
- func (a *Adapter) RequestCall(ctx context.Context, srcID, srcEmail, routeID, channelID string) (bool, error)
- func (a *Adapter) TestLatency(ctx context.Context, timeout time.Duration, addrs []string, ...) ([]time.Duration, error)
- func (a *Adapter) TestThroughput(ctx context.Context, timeout time.Duration, addrs []string, ...) ([]ThroughputResult, error)
- func (a *Adapter) UnprovisionRoute(ctx context.Context, routeID string) error
- type AdapterMetadata
- type AdapterRemote
- type CertPair
- type Gateway
- func (g *Gateway) HangupCall(ctx context.Context, token string, routeID string) error
- func (g *Gateway) Open(ctx context.Context) error
- func (g *Gateway) RegisterAdapter(ctx context.Context, token string) ([]byte, error)
- func (g *Gateway) RequestCall(ctx context.Context, token string, dstID, channelID string) (RequestCallResult, error)
- func (g *Gateway) ResolveEmailToID(ctx context.Context, token string, email string) (string, error)
- type GatewayRemote
- type Metrics
- type MetricsRemote
- type RequestCallResult
- type Router
- type RouterRemote
- type Switch
- func (s *Switch) GetPublicIP(ctx context.Context) (string, error)
- func (s *Switch) ProvisionRoute(ctx context.Context, routeID string, raddr string, ...) ([]string, error)
- func (s *Switch) TestLatency(ctx context.Context, timeout time.Duration, addrs []string, ...) ([]time.Duration, error)
- func (s *Switch) TestThroughput(ctx context.Context, timeout time.Duration, addrs []string, ...) ([]ThroughputResult, error)
- func (s *Switch) UnprovisionRoute(ctx context.Context, routeID string) error
- type SwitchConfiguration
- type SwitchMetadata
- type SwitchRemote
- type ThroughputResult
- type Visualizer
- type VisualizerRemote
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLatencyTestResultLength = errors.New("received invalid length of latency test results") ErrInvalidThroughputTestResultLength = errors.New("received invalid length of throughput test results") ErrSrcNotFound = errors.New("could not find source") ErrAdapterNotFound = errors.New("could not find adapter") )
View Source
var ( ErrSwitchAlreadyRegistered = errors.New("could not register switch: A switch with this remote ID is already registered") ErrAdapterAlreadyRegistered = errors.New("could not register adapter: An adapter with this remote ID is already registered") ErrDstNotFound = errors.New("could not find destination") ErrDstIsSrc = errors.New("could not find route when dst and src are the same") ErrRouteNotFound = errors.New("could not find route") ErrSwitchNotFound = errors.New("could not find switch") ErrInvalidPortsCount = errors.New("could not proceed with invalid ports count") )
View Source
var ( ErrUnauthenticatedRole = errors.New("unauthenticated role") ErrUnauthenticatedRoute = errors.New("unauthenticated route") )
View Source
var (
ErrNoPeersFound = errors.New("could not find any peers")
)
Functions ¶
func HandleRouterOpen ¶
func HandleRouterOpen(router *Router)
func RequestCall ¶
func SetAdapterCA ¶
func SetSwitchCA ¶
Types ¶
type Adapter ¶
type Adapter struct { Peers func() map[string]GatewayRemote // contains filtered or unexported fields }
func NewAdapter ¶
func NewAdapter( verbose bool, ahost string, onRequestCall func(ctx context.Context, srcID, srcEmail, routeID, channelID string) (bool, error), onCallDisconnected func(ctx context.Context, routeID, channelID string) error, onHandleCall func(ctx context.Context, routeID, channelID, raddr string) error, getIDToken func() (string, error), ) *Adapter
func (*Adapter) ProvisionRoute ¶
func (*Adapter) RequestCall ¶
func (*Adapter) TestLatency ¶
func (*Adapter) TestThroughput ¶
type AdapterMetadata ¶
type AdapterRemote ¶
type AdapterRemote struct { RequestCall func(ctx context.Context, srcID, srcEmail, routeID, channelID string) (bool, error) TestLatency func(ctx context.Context, timeout time.Duration, addrs []string, benchmarkClientCert CertPair) ([]time.Duration, error) TestThroughput func(ctx context.Context, timeout time.Duration, addrs []string, benchmarkClientCert CertPair, benchmarkLimit int64) ([]ThroughputResult, error) UnprovisionRoute func(ctx context.Context, routeID string) error ProvisionRoute func( ctx context.Context, routeID, channelID, raddr string, cert CertPair, ) error }
type Gateway ¶
type Gateway struct { Router *Router Peers func() map[string]AdapterRemote // contains filtered or unexported fields }
func NewGateway ¶
func (*Gateway) HangupCall ¶
func (*Gateway) RegisterAdapter ¶
func (*Gateway) RequestCall ¶
type GatewayRemote ¶
type GatewayRemote struct { RegisterAdapter func(ctx context.Context, token string) ([]byte, error) RequestCall func(ctx context.Context, token string, dstID, channelID string) (RequestCallResult, error) HangupCall func(ctx context.Context, token string, routeID string) error ResolveEmailToID func(ctx context.Context, token string, email string) (string, error) }
type Metrics ¶
type Metrics struct { Peers func() map[string]VisualizerRemote // contains filtered or unexported fields }
func NewMetrics ¶
type MetricsRemote ¶
type MetricsRemote struct{}
type RequestCallResult ¶
type Router ¶
type Router struct { Metrics *Metrics Gateway *Gateway Peers func() map[string]SwitchRemote // contains filtered or unexported fields }
func NewRouter ¶
func NewRouter( verbose bool, testInterval time.Duration, testTimeout time.Duration, oidcIssuer, oidcClientID, oidcAudience string, caCfg *x509.Certificate, caPEM []byte, caPrivKey *rsa.PrivateKey, callCertValidity time.Duration, benchmarkListenCertValidity time.Duration, benchmarkClientCertValidity time.Duration, rsaBits int, benchmarkLimit int64, ) *Router
func (*Router) RegisterSwitch ¶
type RouterRemote ¶
type Switch ¶
type Switch struct { Peers func() map[string]RouterRemote // contains filtered or unexported fields }
func (*Switch) ProvisionRoute ¶
func (*Switch) TestLatency ¶
func (*Switch) TestThroughput ¶
type SwitchConfiguration ¶
type SwitchMetadata ¶
type SwitchRemote ¶
type SwitchRemote struct { TestLatency func(ctx context.Context, timeout time.Duration, addrs []string, benchmarkClientCert CertPair) ([]time.Duration, error) TestThroughput func(ctx context.Context, timeout time.Duration, addrs []string, benchmarkClientCert CertPair, benchmarkLimit int64) ([]ThroughputResult, error) UnprovisionRoute func(ctx context.Context, routeID string) error GetPublicIP func(ctx context.Context) (string, error) ProvisionRoute func( ctx context.Context, routeID string, raddr string, switchListenCert, switchClientCert, adapterListenCert CertPair, ) ([]string, error) }
type Visualizer ¶
type Visualizer struct { Peers func() map[string]MetricsRemote // contains filtered or unexported fields }
func NewVisualizer ¶
func (*Visualizer) RenderNetworkVisualization ¶
func (v *Visualizer) RenderNetworkVisualization( ctx context.Context, switches map[string]SwitchMetadata, adapters map[string]AdapterMetadata, ) error
func (*Visualizer) RenderRoutesVisualization ¶
type VisualizerRemote ¶
type VisualizerRemote struct { Attest func( ctx context.Context, ) (string, error) RenderNetworkVisualization func( ctx context.Context, switches map[string]SwitchMetadata, adapters map[string]AdapterMetadata, ) error RenderRoutesVisualization func( ctx context.Context, routes map[string][]string, ) error }
Click to show internal directories.
Click to hide internal directories.