Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a middleperson between the websocket connection and the hub.
type ClientReport ¶
type ClientReport struct {
Topic string `json:"topic"`
CanRead bool `json:"canRead"`
CanWrite bool `json:"canWrite"`
Connected string `json:"connected"`
RemoteAddr string `json:"remoteAddr"`
UserAgent string `json:"userAgent"`
Stats RxTx `json:"stats"`
}
ClientReport represents statistics on a client, and omits non-serialisable internal references
type Config ¶
type Config struct {
// Listen is the listening port
Listen int
// Audience must match the host in token
Audience string
// Secret is used to validating statsTokens
Secret string
// ExchangeCode swaps a code for the associated Token
CodeStore *ttlcode.CodeStore
}
Config represents configuration of the relay & lets configuration be passed as argument to permit testing
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
NewDefaultConfig returns a pointer to a new, default, Config
func (*Config) WithAudience ¶
WithAudience sets the audience in the Config
func (*Config) WithCodeStoreTTL ¶
WithCodeStoreTTL sets the TTL of the codestore
func (*Config) WithListen ¶
WithListen sets the listening port in the Config
type ConnectionAction ¶
type ConnectionAction struct {
Action string `json:"action"`
URI string `json:"uri"`
UUID string `json:"uuid"`
}
ConnectionAction represents an action happening on a connection
type ConnectionType ¶
type ConnectionType int
ConnectionType represents whether the connection is for Session, Shell or Unsupported
const ( Session ConnectionType = iota Shell Unsupported )
Enumerated connection types
type Frames ¶
type Frames struct {
// contains filtered or unexported fields
}
Frames represents statistics for (video) frames
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub maintains the set of active clients and broadcasts messages to the clients.
type ReportStats ¶
type ReportStats struct {
Last string `json:"last"` //how many seconds ago...
Size float64 `json:"size"`
Fps float64 `json:"fps"`
}
ReportStats represents statistics to be reported on a connection
type RxTx ¶
type RxTx struct {
Tx ReportStats `json:"tx"`
Rx ReportStats `json:"rx"`
}
RxTx represents statistics for both receive and transmit
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Stats represents statistics for (video) frames received and transmitted
type StatsCommand ¶
type StatsCommand struct {
Command string `json:"cmd"`
}
StatsCommand represents a command relating to collection of statistics