File: interface.go

package info (click to toggle)
golang-github-klauspost-compress 1.15.12%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports, bookworm-proposed-updates, sid
  • size: 42,896 kB
  • sloc: asm: 20,118; sh: 15; makefile: 11
file content (20 lines) | stat: -rw-r--r-- 544 bytes parent folder | download
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
}