MCPcopy
hub / github.com/mattermost/mattermost / Encode

Method Encode

server/public/model/websocket_message.go:381–393  ·  view source on GitHub ↗

Encode encodes the event to the given encoder.

(enc *json.Encoder, buf io.Writer)

Source from the content-addressed store, hash-verified

379
380// Encode encodes the event to the given encoder.
381func (ev *WebSocketEvent) Encode(enc *json.Encoder, buf io.Writer) error {
382 if ev.precomputedJSON != nil {
383 _, err := buf.Write(ev.precomputedJSONBuf())
384 return err
385 }
386
387 return enc.Encode(webSocketEventJSON{
388 ev.event,
389 ev.data,
390 ev.broadcast,
391 ev.sequence,
392 })
393}
394
395// We write optimal code here sacrificing readability for
396// performance.

Callers 15

extractCmdFFunction · 0.80
JSONMarshalFunction · 0.80
TestClient4CreatePostFunction · 0.80
TestClient4SetTokenFunction · 0.80
ToFormValuesMethod · 0.80
EncodeJSONMethod · 0.80
EncodeJSONMethod · 0.80
encryptPostActionCookieFunction · 0.80
ApplyToURLMethod · 0.80

Calls 2

precomputedJSONBufMethod · 0.95
WriteMethod · 0.65