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