mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-16 21:33:28 +01:00
24 lines
397 B
Go
24 lines
397 B
Go
//go:build static
|
|
// +build static
|
|
|
|
package ctrl
|
|
|
|
import (
|
|
"bytes"
|
|
"compress/gzip"
|
|
)
|
|
|
|
func compressGzip(content []byte, quality int) []byte {
|
|
var buf bytes.Buffer
|
|
gz, err := gzip.NewWriterLevel(&buf, quality)
|
|
if err != nil {
|
|
gz = gzip.NewWriter(&buf)
|
|
}
|
|
_, _ = gz.Write(content)
|
|
gz.Close()
|
|
return buf.Bytes()
|
|
}
|
|
|
|
func compressBr(content []byte, quality int) []byte {
|
|
return []byte("")
|
|
}
|