Giter Site home page Giter Site logo

Comments (3)

RangerMauve avatar RangerMauve commented on July 17, 2024

Hmm, not sure if HEAD would make sense here.

Let me think about diffs for a week or two.

from hypercore-fetch.

josephmturner avatar josephmturner commented on July 17, 2024

To accomplish this, we could extrapolate on the ideas discussed here and here.

If the latest version of the drive is version 100 and user wants to checkout the version of /example.txt before the last change, send a GET request to hyper://public-key/$/previous/100/example.txt. Assuming that the most recent different version of /example.txt is version 42, this would have the same effect as GET hyper://public-key/$/version/42/example.txt. A HEAD request should return just the headers, allowing for a quick overview of the version history of particular file, including file sizes, modification dates, and version numbers.

Going forward through version history, GET hyper://public-key/$/previous/42/example.txt should give version 43. GET hyper://public-key/$/previous/42/example.txt should give version 100 (current).

from hypercore-fetch.

RangerMauve avatar RangerMauve commented on July 17, 2024

To get a diff we can use the ETag versins returned on a HEAD for a file.

  • Get the current version of the drive
  • Loop
  • HEAD on the hyper://key/$/version/${version}/${file_path}
  • If 404, break the loop
  • Get whatever file info you need from the HEAD response and log them
  • Set version to the ETag

from hypercore-fetch.

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.