Skip to content

Commit

Permalink
feat: init compressor type (#309)
Browse files Browse the repository at this point in the history
* init compressor type
  • Loading branch information
luky116 authored Oct 15, 2022
1 parent ee274c5 commit 31b5219
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/compressor/7z_compress.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package compressor
1 change: 1 addition & 0 deletions pkg/compressor/bzip2_compress.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package compressor
20 changes: 20 additions & 0 deletions pkg/compressor/compressor.go
Original file line number Diff line number Diff line change
@@ -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
}
1 change: 1 addition & 0 deletions pkg/compressor/deflater_compress.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package compressor
1 change: 1 addition & 0 deletions pkg/compressor/gzip_compress.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package compressor
1 change: 1 addition & 0 deletions pkg/compressor/lz4_compress.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package compressor
1 change: 1 addition & 0 deletions pkg/compressor/zip_compress.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package compressor
1 change: 1 addition & 0 deletions pkg/compressor/zstd_compress.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package compressor

0 comments on commit 31b5219

Please sign in to comment.