mirror of
https://github.com/0ceanSlim/grain.git
synced 2024-11-22 16:47:13 +00:00
14 lines
290 B
Go
14 lines
290 B
Go
package response
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"golang.org/x/net/websocket"
|
|
)
|
|
|
|
func SendClosed(ws *websocket.Conn, subID string, message string) {
|
|
closeMsg := []interface{}{"CLOSED", subID, message}
|
|
closeBytes, _ := json.Marshal(closeMsg)
|
|
websocket.Message.Send(ws, string(closeBytes))
|
|
}
|