GithubHelp home page GithubHelp logo

Comments (4)

lukechampine avatar lukechampine commented on June 4, 2024

This would be cleaner if Go had a standard compression interface, like a compress.Deflater(io.Reader) io.Reader. Then you could just pass in a compress.Deflater to the update and it would handle the decompression behind the scenes.

As it stands, I don't see an easy way to do the decompression automatically. You'd need to return the archive to the user and have them decompress it. You also need a way to track the contents of the archive, probably by unpacking it into a specially named hidden folder.

Honestly, I think it would be a huge headache to make compression+archives pluggable. Instead, I would manually support zip and tar.gz. If the user wants to do otherwise, it's still possible to build out of the update primitives.

With that out of the way, the API extensions should be fairly straightforward: just add a FromZip option or equivalent. You don't even need to change the checksum/signature semantics, because they'll still be called on the supplied stream.

from go-update.

inconshreveable avatar inconshreveable commented on June 4, 2024

It seems like these are two orthogonal problems. One is compression and the other is unarchiving. Since wrapping a decompressor like gzip.NewReader or flate.NewReader is pretty easy in Go (and because it can often be taken care of for you via Content-Encoding over HTTP, I'm okay leaving that to the application to solve.

Solving the unarchiving problem is much harder, I think. When dealing with multi-file updates, you need to actually start thinking about how to add new files, how to delete files that shouldn't . Is the archive all new files, or all patches to existing files? Or a mixture? Is signing done on each file, or the whole archive? etc.

I'm inclined to leave this problem for last since it's going to require the most changes from both an API and implementation standpoint. It may even be worth it to just scope it out and say 'go-update is only about updating single files'.

from go-update.

joeblew99 avatar joeblew99 commented on June 4, 2024

did this get put into main code ?

I need it :)

from go-update.

inconshreveable avatar inconshreveable commented on June 4, 2024

sorry, there's been no work been done on this yet

from go-update.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.