Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Compress = defaultInstance.Compress Decompress = defaultInstance.Decompress )
Functions ¶
This section is empty.
Types ¶
type Compressor ¶
type Compressor interface { Compress(dst io.Writer, src []byte) (err error) Decompress(dst io.Writer, src []byte) (err error) }
Compressor represents compress interface
type CompressorProvider ¶
type CompressorProvider interface { // AcquireGzipWriter Returns a *gzip.Writer which needs to be released later. // Before using it, call Reset(). AcquireGzipWriter() *gzip.Writer // ReleaseGzipWriter Releases an acquired *gzip.Writer. ReleaseGzipWriter(w *gzip.Writer) // AcquireGzipReader Returns a *gzip.Reader which needs to be released later. AcquireGzipReader() *gzip.Reader // ReleaseGzipReader Releases an acquired *gzip.Reader. ReleaseGzipReader(r *gzip.Reader) }
CompressorProvider describes a component that can provider compressors for the std methods.
func NewSyncPoolCompressors ¶
func NewSyncPoolCompressors() CompressorProvider
type GzipCompressor ¶
type GzipCompressor struct {
// contains filtered or unexported fields
}
func New ¶ added in v1.1.8
func New() *GzipCompressor
func (*GzipCompressor) Compress ¶
func (c *GzipCompressor) Compress(dst io.Writer, src []byte) (err error)
func (*GzipCompressor) Decompress ¶
func (c *GzipCompressor) Decompress(dst io.Writer, src []byte) (err error)
type SyncPoolCompressors ¶
type SyncPoolCompressors struct {
// contains filtered or unexported fields
}
func (*SyncPoolCompressors) AcquireGzipReader ¶
func (s *SyncPoolCompressors) AcquireGzipReader() *gzip.Reader
func (*SyncPoolCompressors) AcquireGzipWriter ¶
func (s *SyncPoolCompressors) AcquireGzipWriter() *gzip.Writer
func (*SyncPoolCompressors) ReleaseGzipReader ¶
func (s *SyncPoolCompressors) ReleaseGzipReader(r *gzip.Reader)
func (*SyncPoolCompressors) ReleaseGzipWriter ¶
func (s *SyncPoolCompressors) ReleaseGzipWriter(w *gzip.Writer)
Click to show internal directories.
Click to hide internal directories.