diff --git a/pkg/compressor/7z_compress.go b/pkg/compressor/7z_compress.go new file mode 100644 index 000000000..dd33f8075 --- /dev/null +++ b/pkg/compressor/7z_compress.go @@ -0,0 +1 @@ +package compressor diff --git a/pkg/compressor/bzip2_compress.go b/pkg/compressor/bzip2_compress.go new file mode 100644 index 000000000..dd33f8075 --- /dev/null +++ b/pkg/compressor/bzip2_compress.go @@ -0,0 +1 @@ +package compressor diff --git a/pkg/compressor/compressor.go b/pkg/compressor/compressor.go new file mode 100644 index 000000000..3dba9440c --- /dev/null +++ b/pkg/compressor/compressor.go @@ -0,0 +1,20 @@ +package compressor + +type CompressorType int8 + +const ( + None CompressorType = 0 + Gzip CompressorType = 1 + Zip CompressorType = 2 + Sevenz CompressorType = 3 + Bzip2 CompressorType = 4 + Lz4 CompressorType = 5 + Default CompressorType = 6 + Zstd CompressorType = 7 +) + +type Compressor interface { + Compress([]byte) ([]byte, error) + Decompress([]byte) ([]byte, error) + GetCompressorType() CompressorType +} diff --git a/pkg/compressor/deflater_compress.go b/pkg/compressor/deflater_compress.go new file mode 100644 index 000000000..dd33f8075 --- /dev/null +++ b/pkg/compressor/deflater_compress.go @@ -0,0 +1 @@ +package compressor diff --git a/pkg/compressor/gzip_compress.go b/pkg/compressor/gzip_compress.go new file mode 100644 index 000000000..dd33f8075 --- /dev/null +++ b/pkg/compressor/gzip_compress.go @@ -0,0 +1 @@ +package compressor diff --git a/pkg/compressor/lz4_compress.go b/pkg/compressor/lz4_compress.go new file mode 100644 index 000000000..dd33f8075 --- /dev/null +++ b/pkg/compressor/lz4_compress.go @@ -0,0 +1 @@ +package compressor diff --git a/pkg/compressor/zip_compress.go b/pkg/compressor/zip_compress.go new file mode 100644 index 000000000..dd33f8075 --- /dev/null +++ b/pkg/compressor/zip_compress.go @@ -0,0 +1 @@ +package compressor diff --git a/pkg/compressor/zstd_compress.go b/pkg/compressor/zstd_compress.go new file mode 100644 index 000000000..dd33f8075 --- /dev/null +++ b/pkg/compressor/zstd_compress.go @@ -0,0 +1 @@ +package compressor