MCPcopy Create free account
hub / github.com/gavv/httpexpect / WriteText

Method WriteText

websocket.go:467–476  ·  view source on GitHub ↗

WriteText is a shorthand for c.WriteMessage(websocket.TextMessage, []byte(s)).

(s string)

Source from the content-addressed store, hash-verified

465// WriteText is a shorthand for
466// c.WriteMessage(websocket.TextMessage, []byte(s)).
467func (ws *Websocket) WriteText(s string) *Websocket {
468 opChain := ws.chain.enter("WriteText()")
469 defer opChain.leave()
470
471 if ws.checkUnusable(opChain, "WriteText()") {
472 return ws
473 }
474
475 return ws.WriteMessage(websocket.TextMessage, []byte(s))
476}
477
478// WriteJSON writes to the underlying WebSocket connection given object,
479// marshaled using json.Marshal().

Callers 8

TestWebsocket_WriteTextFunction · 0.80
TestWsHandlerTextFunction · 0.80
TestWsFastHandlerTextFunction · 0.80
testWebsocketSessionFunction · 0.80
testWebsocketTimeoutFunction · 0.80
TestE2EWebsocket_ClosedFunction · 0.80

Calls 4

checkUnusableMethod · 0.95
WriteMessageMethod · 0.95
enterMethod · 0.80
leaveMethod · 0.80

Tested by 8

TestWebsocket_WriteTextFunction · 0.64
TestWsHandlerTextFunction · 0.64
TestWsFastHandlerTextFunction · 0.64
testWebsocketSessionFunction · 0.64
testWebsocketTimeoutFunction · 0.64
TestE2EWebsocket_ClosedFunction · 0.64