MCPcopy
hub / github.com/daptin/daptin / sendJSON

Function sendJSON

websocket_test.go:94–99  ·  view source on GitHub ↗

sendJSON sends a JSON payload over the websocket.

(t testing.TB, ws *websocket.Conn, v interface{})

Source from the content-addressed store, hash-verified

92
93// sendJSON sends a JSON payload over the websocket.
94func sendJSON(t testing.TB, ws *websocket.Conn, v interface{}) {
95 t.Helper()
96 if err := websocket.JSON.Send(ws, v); err != nil {
97 t.Fatalf("websocket send: %v", err)
98 }
99}
100
101// recvJSON reads a JSON message with a timeout.
102func recvJSON(t testing.TB, ws *websocket.Conn, timeout time.Duration) resource.WsOutMessage {

Calls

no outgoing calls

Tested by

no test coverage detected