I am developing web server in Go and I wish to have all static files in ZIP file. It looks like I have to implement http.FileSystem interface that will read from ZIP.
Is there such implementation?
I have made one based on Golang serve static files from memory But these article claims it to be buggy
I found following references that there was work (and commits) to add ZipFileSystem to Golang https://codereview.appspot.com/4750047
I am wondering if there is good marture implementation of Zip http.FileSystem in Go?
To compress a File in Golang, we use the gzip command.
To zip a file or a directory in Go using the standard library, use zip. Writer type from the archive/zip package. Creating a compressed archive using this method involves going through all the files you want to include, generating a local file header for each one, and writing its contents to the resulting ZIP file.
ZIP is an archive file format that supports lossless data compression. A ZIP file may contain one or more files or directories that may have been compressed. The ZIP file format permits a number of compression algorithms, though DEFLATE is the most common.
I wrote a zip static thing that does what you're describing. Also has unit tests in case you're into that sort of thing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With