Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Time allowed to write a message to the peer. WriteWait = 10 * time.Second // Time allowed to read the next pong message from the peer. PongWait = 30 * time.Second // Send pings to peer with this period. Must be less than pongWait. PingPeriod = (PongWait * 9) / 10 // Maximum message size allowed from peer. MaxMessageSize = 4096 )
Variables ¶
This section is empty.
Functions ¶
func NewClientHelper ¶
Types ¶
type ContextProvider ¶
type ContextProvider struct { // The websocket ContextProvider Conn *websocket.Conn // Buffered channel of outbound messages Send chan []byte Host string Port string Path string Close chan bool }
func NewContextProvider ¶
func NewContextProvider( Host string, Port string, Path string, ) *ContextProvider
func (*ContextProvider) Run ¶
func (cp *ContextProvider) Run() error
func (*ContextProvider) StartRX ¶
func (cp *ContextProvider) StartRX() error
func (*ContextProvider) StartTX ¶
func (cp *ContextProvider) StartTX() error
type Hub ¶
type Hub struct { /* A central hub will receive all incoming messages and broadcast them to all registered "Subscriber"s (i.e. the Subscriber structures in the clients map) */ Clients map[Subscriber]bool Broadcast chan Message Register chan Subscriber Unregister chan Subscriber // contains filtered or unexported fields }
type Message ¶
type Message struct { Type message.ExoWSMsgType `json:"type"` SerialData string `json:"serialData"` ReBroadcast bool `json:"reBroadcast"` }
type Subscriber ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.