diff --git a/contrib/andybalholm/brotli/brotli_test.go b/contrib/andybalholm/brotli/brotli_test.go new file mode 100644 index 0000000..879e9f9 --- /dev/null +++ b/contrib/andybalholm/brotli/brotli_test.go @@ -0,0 +1,8 @@ +package brotli_test + +import ( + "github.com/CAFxX/httpcompression" + "github.com/CAFxX/httpcompression/contrib/andybalholm/brotli" +) + +var _ httpcompression.CompressorProvider = &brotli.Compressor{} diff --git a/contrib/andybalholm/brotli/export_test.go b/contrib/andybalholm/brotli/export_test.go new file mode 100644 index 0000000..850ac73 --- /dev/null +++ b/contrib/andybalholm/brotli/export_test.go @@ -0,0 +1,3 @@ +package brotli + +type Compressor = compressor diff --git a/contrib/klauspost/gzip/export_test.go b/contrib/klauspost/gzip/export_test.go new file mode 100644 index 0000000..6f0fd6c --- /dev/null +++ b/contrib/klauspost/gzip/export_test.go @@ -0,0 +1,3 @@ +package gzip + +type Compressor = compressor diff --git a/contrib/klauspost/gzip/gzip_test.go b/contrib/klauspost/gzip/gzip_test.go new file mode 100644 index 0000000..7fe339a --- /dev/null +++ b/contrib/klauspost/gzip/gzip_test.go @@ -0,0 +1,8 @@ +package gzip_test + +import ( + "github.com/CAFxX/httpcompression" + "github.com/CAFxX/httpcompression/contrib/klauspost/gzip" +) + +var _ httpcompression.CompressorProvider = &gzip.Compressor{} diff --git a/contrib/klauspost/pgzip/export_test.go b/contrib/klauspost/pgzip/export_test.go new file mode 100644 index 0000000..2bb1a1b --- /dev/null +++ b/contrib/klauspost/pgzip/export_test.go @@ -0,0 +1,3 @@ +package pgzip + +type Compressor = compressor diff --git a/contrib/klauspost/pgzip/pgzip_test.go b/contrib/klauspost/pgzip/pgzip_test.go new file mode 100644 index 0000000..5aaedf3 --- /dev/null +++ b/contrib/klauspost/pgzip/pgzip_test.go @@ -0,0 +1,8 @@ +package pgzip_test + +import ( + "github.com/CAFxX/httpcompression" + "github.com/CAFxX/httpcompression/contrib/klauspost/pgzip" +) + +var _ httpcompression.CompressorProvider = &pgzip.Compressor{} diff --git a/contrib/klauspost/zstd/export_test.go b/contrib/klauspost/zstd/export_test.go new file mode 100644 index 0000000..25b3caf --- /dev/null +++ b/contrib/klauspost/zstd/export_test.go @@ -0,0 +1,3 @@ +package zstd + +type Compressor = compressor diff --git a/contrib/klauspost/zstd/zstd.go b/contrib/klauspost/zstd/zstd.go index 2ae9a52..226f84f 100644 --- a/contrib/klauspost/zstd/zstd.go +++ b/contrib/klauspost/zstd/zstd.go @@ -9,23 +9,23 @@ import ( const Encoding = "zstd" -type zstdCompressor struct { +type compressor struct { pool sync.Pool opts []zstd.EOption } -func New(opts ...zstd.EOption) (c *zstdCompressor, err error) { +func New(opts ...zstd.EOption) (c *compressor, err error) { opts = append([]zstd.EOption(nil), opts...) gw, err := zstd.NewWriter(nil, opts...) if err != nil { return nil, err } - c = &zstdCompressor{opts: opts} + c = &compressor{opts: opts} c.pool.Put(gw) return c, nil } -func (c *zstdCompressor) Get(w io.Writer) io.WriteCloser { +func (c *compressor) Get(w io.Writer) io.WriteCloser { if gw, ok := c.pool.Get().(*zstdWriter); ok { gw.Reset(w) return gw @@ -42,7 +42,7 @@ func (c *zstdCompressor) Get(w io.Writer) io.WriteCloser { type zstdWriter struct { *zstd.Encoder - c *zstdCompressor + c *compressor } func (w *zstdWriter) Close() error { diff --git a/contrib/klauspost/zstd/zstd_test.go b/contrib/klauspost/zstd/zstd_test.go new file mode 100644 index 0000000..dfd096d --- /dev/null +++ b/contrib/klauspost/zstd/zstd_test.go @@ -0,0 +1,8 @@ +package zstd_test + +import ( + "github.com/CAFxX/httpcompression" + "github.com/CAFxX/httpcompression/contrib/klauspost/zstd" +) + +var _ httpcompression.CompressorProvider = &zstd.Compressor{}