A Go-based file compression utility that supports various file types and compression algorithms.
- PDF compression
- Image compression
- Multiple compression algorithms
- MIME type detection
- Service locator pattern for extensibility
- Easy-to-use CLI interface
# Clone the repository
git clone https://github.com/jdecool/file-compressor.git
cd file-compressor
# Build the project
go build -o file-compressor# Basic usage
./file-compressor input.pdf output.pdf
# Help
./file-compressor --helpinternal/- Internal package containing core functionalityapp/- Application logicapp.go- Main application interfaceapp_test.go- Application tests
compressor/- Core compression logiccompressor.go- Main compression interfacecompressor_test.go- Compression testsimage_compressor.go- Image-specific compressionimage_compressor_test.go- Image compression testspdf_compressor.go- PDF-specific compressionpdf_compressor_test.go- PDF compression tests
mime/- MIME type detectiondetector.go- MIME type detection logicdetector_test.go- MIME detection teststestdata/- Test files for MIME detection
servicelocator/- Service locator pattern implementationservicelocator.go- Service registration and locationservicelocator_test.go- Service locator tests
main.go- CLI entry pointMakefile- Build automationgo.mod- Go module definitiongo.sum- Go dependency checksums
# Run all tests
go test ./...
# Run specific test
go test ./compressor