Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Default alias GzipInstance Default = GzipInstance Compress = Default().Compress Decompress = Default().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 CurrentCompressorProvider ¶
func CurrentCompressorProvider() CompressorProvider
CurrentCompressorProvider returns the current CompressorProvider. It is initialized using a SyncPoolCompressors.
type GzipCompressor ¶
type GzipCompressor struct {
// contains filtered or unexported fields
}
func GzipInstance ¶
func GzipInstance() *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 NewSyncPoolCompressors ¶
func NewSyncPoolCompressors() *SyncPoolCompressors
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.