mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-19 07:01:02 +01:00
06ac40aafa
This allows removing gzip-related code from lib/httpserver.
21 lines
544 B
Go
21 lines
544 B
Go
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
|
|
}
|