Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateResultsFromJSON ¶
Types ¶
type Client ¶
type Client struct { Hub *Hub // The websocket connection. Conn *websocket.Conn // Buffered channel of outbound messages. Send chan []byte }
Client is a middleman between the websocket connection and the hub.
type Hub ¶
type Hub struct { // Registered clients. Clients map[*Client]bool // Inbound messages from the clients. Broadcast chan []byte // Register requests from the clients. Register chan *Client // Unregister requests from clients. Unregister chan *Client }
Hub maintains the set of active clients and broadcasts messages to the clients.
type Message ¶
type Message struct { ID string `json:"id"` Type string `json:"type"` Content string `json:"content"` Data interface{} `json:"data"` Timestamp time.Time `json:"timestamp"` }
func NewErrorMessage ¶
func NewErrorMessage() Message
func NewInvalidFormatErrorMessage ¶
func NewInvalidFormatErrorMessage() Message
func NewIvalidTypeErrorMessage ¶
func NewIvalidTypeErrorMessage() Message
func NewMarshalJSONErrorMessage ¶
func NewMarshalJSONErrorMessage() Message
func NewMessage ¶
func NewMessage() Message
func (Message) JSONMarshal ¶
Click to show internal directories.
Click to hide internal directories.