VictoriaMetrics/vendor/github.com/klauspost/compress/gzhttp/writer/interface.go
Aliaksandr Valialkin 06ac40aafa
lib/httpserver: use github.com/klauspost/compress/gzhttp for compressing http responses
This allows removing gzip-related code from lib/httpserver.
2023-02-27 10:35:26 -08:00

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
}