MCPcopy
hub / github.com/tinode/chat / Write

Method Write

server/http.go:189–201  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

187}
188
189func (w *errorResponseWriter) Write(p []byte) (n int, err error) {
190 if w.status >= http.StatusBadRequest {
191 p, _ = json.Marshal(
192 &ServerComMessage{
193 Ctrl: &MsgServerCtrl{
194 Timestamp: time.Now().UTC().Round(time.Millisecond),
195 Code: w.status,
196 Text: http.StatusText(w.status),
197 },
198 })
199 }
200 return w.ResponseWriter.Write(p)
201}
202
203// httpErrorHandler to respond with JSON_formatted error message for static content.
204func httpErrorHandler(h http.Handler) http.Handler {

Callers 15

writeOnceMethod · 0.80
lpWriteFunction · 0.80
checkAPIKeyFunction · 0.80
LargeFileReceiveMethod · 0.80
etagFromPathFunction · 0.80
AuthenticateMethod · 0.80
GenSecretMethod · 0.80
TestSignatureFunction · 0.80
NewFunction · 0.80
AddMethod · 0.80
sendMailMethod · 0.80
sendMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestSignatureFunction · 0.64