Documentation ¶
Index ¶
- Constants
- func ClientToAll(clientMessage Message, conn *websocket.Conn)
- func GetDateTime() string
- type Client
- func (client *Client) CheckServerMessage() (Message, error)
- func (client *Client) CloseConn() error
- func (client *Client) Connect() error
- func (client *Client) Handshake() error
- func (client *Client) ListClients() error
- func (client *Client) Run() error
- func (client *Client) Send2All(content string) error
- func (client *Client) SendMessageStruct() error
- func (client *Client) SendMsgOrCmd(content string) error
- type ClientError
- type Message
Constants ¶
View Source
const ( C2A = "client-to-all" C2S = "client-to-server" S2C = "server-to-client" // Server to single client broadcast S2A = "server-to-all" // Global client broadcast )
Variables ¶
This section is empty.
Functions ¶
func ClientToAll ¶
Types ¶
type Client ¶
type Client struct { UrlAddr string ConnStatus bool Conn *websocket.Conn Username string Message Message }
func (*Client) CheckServerMessage ¶
func (*Client) Handshake ¶
The first interchange of messages between the client and the server Or the handshake Used to setup the username and other config info
func (*Client) ListClients ¶
Lists the clients online Only server-side for now
func (*Client) SendMessageStruct ¶
Send method to make the code a bit cleaner
func (*Client) SendMsgOrCmd ¶
Sends the Message struct to the Server Checks if command or message and sends appropriate config setup If command, content begins with ':'
type ClientError ¶
ClientError.Simple => Simple description of the error
func (*ClientError) Error ¶
func (ce *ClientError) Error() string
Click to show internal directories.
Click to hide internal directories.