Documentation ¶
Index ¶
- Variables
- type BaseReader
- type BaseWriter
- type BrotliReader
- type BrotliWriter
- type ContentEncoding
- type DeflateReader
- type DeflateWriter
- type GzipReader
- type GzipWriter
- type Reader
- type ReaderPool
- type Writer
- func NewBrotliWriter(writer io.Writer, level int) (Writer, error)
- func NewDeflateWriter(writer io.Writer, level int) (Writer, error)
- func NewGzipWriter(writer io.Writer, level int) (Writer, error)
- func NewWriter(writer io.Writer, compressType serverconfigs.HTTPCompressionType, level int) (Writer, error)
- func NewZSTDWriter(writer io.Writer, level int) (Writer, error)
- type WriterPool
- type ZSTDReader
- type ZSTDWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotSupportedContentEncoding = errors.New("not supported content encoding")
Functions ¶
This section is empty.
Types ¶
type BaseReader ¶
type BaseReader struct {
// contains filtered or unexported fields
}
func (*BaseReader) Finish ¶
func (this *BaseReader) Finish(obj Reader) error
func (*BaseReader) ResetFinish ¶
func (this *BaseReader) ResetFinish()
func (*BaseReader) SetPool ¶
func (this *BaseReader) SetPool(pool *ReaderPool)
type BaseWriter ¶
type BaseWriter struct {
// contains filtered or unexported fields
}
func (*BaseWriter) Finish ¶
func (this *BaseWriter) Finish(obj Writer) error
func (*BaseWriter) ResetFinish ¶
func (this *BaseWriter) ResetFinish()
func (*BaseWriter) SetPool ¶
func (this *BaseWriter) SetPool(pool *WriterPool)
type BrotliReader ¶
type BrotliReader struct { BaseReader // contains filtered or unexported fields }
func (*BrotliReader) Close ¶
func (this *BrotliReader) Close() error
func (*BrotliReader) RawClose ¶
func (this *BrotliReader) RawClose() error
type BrotliWriter ¶
type BrotliWriter struct { BaseWriter // contains filtered or unexported fields }
func (*BrotliWriter) Close ¶
func (this *BrotliWriter) Close() error
func (*BrotliWriter) Flush ¶
func (this *BrotliWriter) Flush() error
func (*BrotliWriter) Level ¶
func (this *BrotliWriter) Level() int
func (*BrotliWriter) RawClose ¶
func (this *BrotliWriter) RawClose() error
func (*BrotliWriter) Reset ¶
func (this *BrotliWriter) Reset(newWriter io.Writer)
type ContentEncoding ¶
type ContentEncoding = string
const ( ContentEncodingBr ContentEncoding = "br" ContentEncodingGzip ContentEncoding = "gzip" ContentEncodingDeflate ContentEncoding = "deflate" ContentEncodingZSTD ContentEncoding = "zstd" )
type DeflateReader ¶
type DeflateReader struct { BaseReader // contains filtered or unexported fields }
func (*DeflateReader) Close ¶
func (this *DeflateReader) Close() error
func (*DeflateReader) RawClose ¶
func (this *DeflateReader) RawClose() error
type DeflateWriter ¶
type DeflateWriter struct { BaseWriter // contains filtered or unexported fields }
func (*DeflateWriter) Close ¶
func (this *DeflateWriter) Close() error
func (*DeflateWriter) Flush ¶
func (this *DeflateWriter) Flush() error
func (*DeflateWriter) Level ¶
func (this *DeflateWriter) Level() int
func (*DeflateWriter) RawClose ¶
func (this *DeflateWriter) RawClose() error
func (*DeflateWriter) Reset ¶
func (this *DeflateWriter) Reset(writer io.Writer)
type GzipReader ¶
type GzipReader struct { BaseReader // contains filtered or unexported fields }
func (*GzipReader) Close ¶
func (this *GzipReader) Close() error
func (*GzipReader) RawClose ¶
func (this *GzipReader) RawClose() error
type GzipWriter ¶
type GzipWriter struct { BaseWriter // contains filtered or unexported fields }
func (*GzipWriter) Close ¶
func (this *GzipWriter) Close() error
func (*GzipWriter) Flush ¶
func (this *GzipWriter) Flush() error
func (*GzipWriter) Level ¶
func (this *GzipWriter) Level() int
func (*GzipWriter) RawClose ¶
func (this *GzipWriter) RawClose() error
func (*GzipWriter) Reset ¶
func (this *GzipWriter) Reset(writer io.Writer)
type Reader ¶
type Reader interface { Read(p []byte) (n int, err error) Reset(reader io.Reader) error RawClose() error Close() error SetPool(pool *ReaderPool) ResetFinish() }
type ReaderPool ¶
type ReaderPool struct {
// contains filtered or unexported fields
}
func NewReaderPool ¶
func (*ReaderPool) Put ¶
func (this *ReaderPool) Put(reader Reader)
type Writer ¶
type Writer interface { Write(p []byte) (int, error) Flush() error Reset(writer io.Writer) RawClose() error Close() error Level() int SetPool(pool *WriterPool) ResetFinish() }
func NewWriter ¶
func NewWriter(writer io.Writer, compressType serverconfigs.HTTPCompressionType, level int) (Writer, error)
NewWriter 获取Writer
type WriterPool ¶
type WriterPool struct {
// contains filtered or unexported fields
}
func NewWriterPool ¶
func (*WriterPool) Put ¶
func (this *WriterPool) Put(writer Writer)
type ZSTDReader ¶ added in v0.4.9
type ZSTDReader struct { BaseReader // contains filtered or unexported fields }
func (*ZSTDReader) Close ¶ added in v0.4.9
func (this *ZSTDReader) Close() error
func (*ZSTDReader) RawClose ¶ added in v0.4.9
func (this *ZSTDReader) RawClose() error
type ZSTDWriter ¶ added in v0.4.9
type ZSTDWriter struct { BaseWriter // contains filtered or unexported fields }
func (*ZSTDWriter) Close ¶ added in v0.4.9
func (this *ZSTDWriter) Close() error
func (*ZSTDWriter) Flush ¶ added in v0.4.9
func (this *ZSTDWriter) Flush() error
func (*ZSTDWriter) Level ¶ added in v0.4.9
func (this *ZSTDWriter) Level() int
func (*ZSTDWriter) RawClose ¶ added in v0.4.9
func (this *ZSTDWriter) RawClose() error
func (*ZSTDWriter) Reset ¶ added in v0.4.9
func (this *ZSTDWriter) Reset(writer io.Writer)
Source Files ¶
- reader.go
- reader_base.go
- reader_brotli.go
- reader_deflate.go
- reader_gzip.go
- reader_pool.go
- reader_pool_brotli.go
- reader_pool_deflate.go
- reader_pool_gzip.go
- reader_pool_zstd.go
- reader_zstd.go
- utils.go
- writer.go
- writer_base.go
- writer_brotli.go
- writer_deflate.go
- writer_gzip.go
- writer_pool.go
- writer_pool_brotli.go
- writer_pool_deflate.go
- writer_pool_gzip.go
- writer_pool_zstd.go
- writer_zstd.go
Click to show internal directories.
Click to hide internal directories.