2026-09-10 14:15:13: merge [main:14224c2de53289839839d51f5885722051e41349];
This commit is contained in:
1 parent
554123722d
commit
5cb3885330
2726 files changed
+779293
-2185
No files matched your search
+28
@@ -0,0 +1,28 @@
|
||||
// Package codec provides abstractions and implementations for payload
|
||||
// encoding and decoding.
|
||||
//
|
||||
// The package defines common interfaces for streaming and byte-based codecs
|
||||
// that can be used by transports such as HTTP, gRPC, and AMQP. It also
|
||||
// provides a reusable Zstandard (zstd) implementation with encoder pooling
|
||||
// for efficient compression.
|
||||
//
|
||||
// Codecs support both streaming APIs (io.Reader/io.Writer) and in-memory
|
||||
// byte slice operations, allowing the same implementation to be reused
|
||||
// across different transports and middleware.
|
||||
//
|
||||
// Example usage:
|
||||
//
|
||||
// codec := codec.Default
|
||||
//
|
||||
// // Encode bytes.
|
||||
// encoded, err := codec.EncodeBytes(data)
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
//
|
||||
// // Decode bytes.
|
||||
// plain, err := codec.DecodeBytes(encoded)
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
package codec
|
||||
Reference in new issue
Block a user