Documentation
¶
Overview ¶
Crossbar is a websocket relay Copyright (C) 2019 Timothy Drysdale <timothy.d.drysdale@gmail.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func HandleClients ¶
func HandleConnections ¶
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"` Broadcaster bool `json:"broadcaster"` Connected string `json:"connected"` RemoteAddr string `json:"remoteAddr"` UserAgent string `json:"userAgent"` Stats RxTx `json:"stats"` }
Client report omits non-serialisable internal references
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 RxTx ¶
type RxTx struct { Tx ReportStats `json:"tx"` Rx ReportStats `json:"rx"` }