gopkg icon indicating copy to clipboard operation
gopkg copied to clipboard

Add route to retrieve versions in JSON format

Open montanaflynn opened this issue 9 years ago • 3 comments

After seeing #12 and #18 I added a route that's available by ending a path with /info/versions that returns all versions and the latest version. I only tested with a repo that doesn't have the user in the path (curl localhost:8080/yaml.v1/info/versions) as I couldn't find any "User-owned repositories" that conform to gopkg's standards.

A problem yet to be solved is getting all versions without specifying a version in the path (curl localhost:8080/yaml/info/versions) because it doesn't get past the path regex. I'm not a regex jedi so maybe you could help with that otherwise users have to add a valid version to get all the versions which kind of defeats the purpose.

montanaflynn avatar Sep 03 '15 04:09 montanaflynn

We need to consider caching of that information, and we should also pick a less populated namespace for that. We already have the potential of git and the actual repository conflicting. Having git, the repository, and the API conflicting would be unreasonable and unnecessary.

niemeyer avatar Sep 03 '15 16:09 niemeyer

Sorry, closing was non-intentional.

niemeyer avatar Sep 03 '15 16:09 niemeyer

What kind of cache would you prefer, in-memory or a persistent datastore? In-memory would obviously be easier to implement but might not be suitable based on how many servers gopkg.in runs on and what kind of resources are available.

I like the idea of moving the API routes outside of the main handler although it would require a fair bit of refactoring to keep things DRY.

montanaflynn avatar Sep 03 '15 21:09 montanaflynn

This has clearly been standing here for way too long, and it's unlikely to get done given the direction of the go tool.

niemeyer avatar Oct 18 '23 16:10 niemeyer