MCPcopy
hub / github.com/tailscale/tailscale / zstdFrame

Function zstdFrame

control/tsp/map_test.go:295–303  ·  view source on GitHub ↗

zstdFrame returns a zstd-compressed frame of b.

(t testing.TB, b []byte)

Source from the content-addressed store, hash-verified

293
294// zstdFrame returns a zstd-compressed frame of b.
295func zstdFrame(t testing.TB, b []byte) []byte {
296 t.Helper()
297 enc, err := zstd.NewWriter(io.Discard, zstd.WithEncoderConcurrency(1))
298 if err != nil {
299 t.Fatalf("zstd.NewWriter: %v", err)
300 }
301 defer enc.Close()
302 return enc.EncodeAll(b, nil)
303}
304
305// wireFrame writes a 4-byte little-endian length prefix plus payload to buf.
306func wireFrame(buf *bytes.Buffer, payload []byte) {

Callers 2

Calls 3

HelperMethod · 0.65
FatalfMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…