Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultCompression = gzip.DefaultCompression
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compressor ¶
type Compressor interface {
// Compress compresses the given data.
Compress(data []byte) ([]byte, error)
// Decompress decompresses the given data.
Decompress(data []byte) ([]byte, error)
}
Compressor handles compression and decompression of data. Implementations must be thread-safe.
type GzipCompressor ¶
type GzipCompressor struct {
Level int
}
GzipCompressor implements the Compressor interface using gzip.
func NewGzipCompressor ¶
func NewGzipCompressor(level int) *GzipCompressor
NewGzipCompressor creates a new GzipCompressor. Default level is gzip.DefaultCompression.
func (*GzipCompressor) Compress ¶
func (c *GzipCompressor) Compress(data []byte) ([]byte, error)
Compress compresses the given data using gzip.
func (*GzipCompressor) Decompress ¶
func (c *GzipCompressor) Decompress(data []byte) ([]byte, error)
Decompress decompresses the given data using gzip.
Click to show internal directories.
Click to hide internal directories.