MCPcopy Create free account
hub / github.com/datastax/cql-proxy / Decode

Method Decode

proxy/proxy_test.go:508–517  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

506}
507
508func (l lz4Compressor) Decode(data []byte) ([]byte, error) {
509 if len(data) < sizeOfUint32 {
510 return nil, fmt.Errorf("unable to read compressed data length; expected at least %d bytes, got %d",
511 sizeOfUint32, len(data))
512 }
513 decompressedLen := binary.BigEndian.Uint32(data)
514 decompressed := make([]byte, decompressedLen)
515 _, err := lz4.UncompressBlock(data[sizeOfUint32:], decompressed)
516 return decompressed, err
517}
518
519func connectTestClient(t *testing.T, ctx context.Context, proxyContactPoint string) *proxycore.ClientConn {
520 cl, err := proxycore.ConnectClient(ctx, proxycore.NewEndpoint(proxyContactPoint), proxycore.ClientConnConfig{})

Callers 2

TestLoadBundleZipFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected