mirror of
https://github.com/0ceanSlim/grain.git
synced 2024-11-23 09:07:12 +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))
|
||
|
}
|