MCPcopy Create free account
hub / github.com/gobwas/ws / CompileFrame

Function CompileFrame

frame.go:387–392  ·  view source on GitHub ↗

CompileFrame returns byte representation of given frame. In terms of memory consumption it is useful to precompile static frames which are often used.

(f Frame)

Source from the content-addressed store, hash-verified

385// In terms of memory consumption it is useful to precompile static frames
386// which are often used.
387func CompileFrame(f Frame) (bts []byte, err error) {
388 buf := bytes.NewBuffer(make([]byte, 0, 16))
389 err = WriteFrame(buf, f)
390 bts = buf.Bytes()
391 return bts, err
392}
393
394// MustCompileFrame is like CompileFrame but panics if frame can not be
395// encoded.

Callers 1

MustCompileFrameFunction · 0.85

Calls 2

BytesMethod · 0.95
WriteFrameFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…