1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
package writer
import "io"
// GzipWriter implements the functions needed for compressing content.
type GzipWriter interface {
Write(p []byte) (int, error)
Close() error
Flush() error
}
// GzipWriterFactory contains the information needed for custom gzip implementations.
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
}
|