Documentation
¶
Index ¶
- type Client
- func (c *Client) Close()
- func (c *Client) Errors() <-chan error
- func (c *Client) NextMessage() <-chan Message
- func (c *Client) ReadLoop()
- func (c *Client) Send(m Message) error
- func (c *Client) SendJoin(name string) error
- func (c *Client) SendStart(text string, countdown int) error
- func (c *Client) SendUpdate(name string, wpm int, progress float64, completed bool) error
- type DisconnectPayload
- type JoinPayload
- type Message
- type MessageType
- type Server
- type StartPayload
- type UpdatePayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) NextMessage ¶
type DisconnectPayload ¶
type DisconnectPayload struct {
PlayerName string `json:"player_name"`
}
type JoinPayload ¶
type JoinPayload struct {
PlayerName string `json:"player_name"`
}
type Message ¶
type Message struct {
Type MessageType `json:"type"`
Payload json.RawMessage `json:"payload"`
}
type MessageType ¶
type MessageType string
const ( MsgJoin MessageType = "join" MsgStart MessageType = "start" MsgUpdate MessageType = "update" MsgBye MessageType = "bye" )
type Server ¶
func (*Server) HandleJoin ¶
type StartPayload ¶
Click to show internal directories.
Click to hide internal directories.