mirror of
https://github.com/0ceanSlim/grain.git
synced 2024-10-30 09:36:31 +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))
|
||
|
}
|