Documentation
¶
Overview ¶
Package writer provides interfaces for pluggable compression implementations used by gzhttp. Custom gzip and zstd encoders can be provided by implementing the GzipWriter/ZstdWriter interfaces and corresponding factory types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GzipWriter ¶
GzipWriter implements the functions needed for compressing content.
type GzipWriterExt ¶ added in v1.16.1
type GzipWriterExt interface {
GzipWriter
// SetHeader will populate header fields with non-nil values in h.
SetHeader(h Header)
}
GzipWriterExt implements the functions needed for compressing content and optional extensions.
type GzipWriterFactory ¶
type GzipWriterFactory struct {
// Must return the minimum and maximum supported level.
Levels func() (min, max int)
// New must return a new GzipWriter.
// level will always be within the return limits above.
New func(writer io.Writer, level int) GzipWriter
}
GzipWriterFactory contains the information needed for custom gzip implementations.
type Header ¶ added in v1.16.1
type Header struct {
Comment string // comment
Extra []byte // "extra data"
ModTime time.Time // modification time
Name string // file name
OS byte // operating system type
}
Header is a gzip header.
type ZstdWriter ¶ added in v1.18.4
ZstdWriter implements the functions needed for zstd compression.
type ZstdWriterFactory ¶ added in v1.18.4
type ZstdWriterFactory struct {
// Must return the minimum and maximum supported level.
Levels func() (min, max int)
// New must return a new ZstdWriter.
// level will always be within the return limits above.
New func(writer io.Writer, level int) ZstdWriter
}
ZstdWriterFactory contains the information needed for custom zstd implementations.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package gzkp provides gzip compression through github.com/klauspost/compress/gzip.
|
Package gzkp provides gzip compression through github.com/klauspost/compress/gzip. |
|
Package zstdkp provides zstd compression through github.com/klauspost/compress/zstd.
|
Package zstdkp provides zstd compression through github.com/klauspost/compress/zstd. |