new server
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m19s
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m19s
This commit is contained in:
14
controllers/msg.go
Normal file
14
controllers/msg.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"server/models"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
)
|
||||
|
||||
func (h *Hub) ErrorMsg(msg string, conn *websocket.Conn) {
|
||||
wr := models.Writer{}
|
||||
wr.WriteString(msg)
|
||||
errMsg := &models.Message{Type: 9, Version: 1, Payload: wr.Bytes()}
|
||||
conn.WriteMessage(websocket.BinaryMessage, errMsg.Encode())
|
||||
}
|
||||
Reference in New Issue
Block a user