feat: rename Client
model to WebsocketClient
🤖
This commit is contained in:
parent
2d2ea6ff78
commit
ebb58a4489
3 changed files with 5 additions and 5 deletions
|
@ -13,13 +13,13 @@ type ClientCommand struct {
|
|||
}
|
||||
|
||||
// Represents a single client
|
||||
type Client struct {
|
||||
type WebsocketClient struct {
|
||||
Conn *websocket.Conn
|
||||
}
|
||||
|
||||
// Sends a message to the websocket.
|
||||
// Automatically locks and unlocks the client mutex, to ensure that only one goroutine can write at a time.
|
||||
func (c *Client) SendMessage(messageType int, data []byte) error {
|
||||
func (c *WebsocketClient) SendMessage(messageType int, data []byte) error {
|
||||
err := c.Conn.WriteMessage(messageType, data)
|
||||
if err != nil {
|
||||
log.Error("Error writing to WebSocket:", "msg", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue