mkdir gnalloy-app && cd gnalloy-app
go mod init example.com/gnalloy-app
go get gnalloy.org/codec-compression@dev
go doc gnalloy.org/codec-compressionThe current source tree exposes these package import paths:
gnalloy.org/codec-compressiongnalloy.org/codec-compression/brotlignalloy.org/codec-compression/bzip2gnalloy.org/codec-compression/fastlzgnalloy.org/codec-compression/internal/streamgnalloy.org/codec-compression/internal/testutilgnalloy.org/codec-compression/lz4gnalloy.org/codec-compression/lzfgnalloy.org/codec-compression/lzmagnalloy.org/codec-compression/snappygnalloy.org/codec-compression/zstd
Use go doc against the package that matches the behavior you need:
go doc gnalloy.org/codec-compression
go doc gnalloy.org/codec-compression/brotli
go doc gnalloy.org/codec-compression/bzip2
go doc gnalloy.org/codec-compression/fastlz
go doc gnalloy.org/codec-compression/internal/stream
go doc gnalloy.org/codec-compression/internal/testutil
go doc gnalloy.org/codec-compression/lz4
go doc gnalloy.org/codec-compression/lzfSelected current exported entry points:
const DefaultMaxDecodedBytes = 32 << 20const DefaultStreamChunkSize = 16 * 1024var ErrInvalidConfig = errors.New("gnalloy/codec/compression: invalid config") ...type ChunkedEncoderConfig struct{ ... }type CompressingChunkedInput struct{ ... }type Decoder struct{ ... }const BestSpeed = nativebrotli.BestSpeed ...type Decoder struct{ ... }type Encoder struct{ ... }const BestSpeed = nativebzip2.BestSpeed ...type Decoder struct{ ... }type Encoder struct{ ... }var ErrCorruptFrame = errors.New("gnalloy/codec/compression/fastlz: corrupt frame") ...type Config struct{ ... }type Decoder struct{ ... }type Encoder struct{ ... }type Level uint8func ByteBufFromBytes(alloc buffer.Allocator, data []byte) (buffer.ByteBuf, error)
Repository tests are executable examples of supported behavior. Start with the selected names below, then read the matching _test.go files for complete setup and assertions. See Testing and Performance for the complete discovered list.
GOWORK=off GOTOOLCHAIN=local go test ./... -run Test -count=1Selected current test, benchmark, fuzz, and example entry points:
BenchmarkGzipDecoderBenchmarkGzipEncoderCompositeBenchmarkZlibDecoderBenchmarkZlibEncoderCompositeTestAlgorithmRoundTripSamplesTestCompressingChunkedInputStreamsGzipTestDecoderAccumulatesPartialFramesTestDecoderEnforcesMaxDecodedBytesTestDecoderRejectsBadMagicTestDecoderRejectsChecksumMismatchTestEncoderRejectsInvalidLevelTestEncoderWritesNettyFastLZHeaderTestEncoderWritesNettyLZFHeaderTestFrameDecoderEnforcesMaxDecodedBytesTestFrameDecoderRejectsReservedUnskippableChunkTestFrameDecoderSkipsSkippableChunkTestFrameEncoderDecoderRoundTripTestFrameEncoderWritesNettyUncompressedChunk
Direct Gnalloy dependencies for this module:
gnalloy.org/gnalloy
Assembly guidance:
- Use this codec above a byte-oriented or datagram transport and below application handlers.
- The codec converts bytes or Gnalloy messages into protocol objects and converts outbound protocol objects back to bytes.
- It does not open sockets, own EventLoops, or define application lifecycle.
For sustained load, wire this module into a scenario under gnalloy.org/benchmarks or a runnable client under gnalloy.org/examples when the module participates in network traffic. Record host, OS, CPU, Go version, protocol, payload, concurrency, warmup, repetitions, throughput, and p99 latency in the report.