-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Description
Module proxy protocol: extending the information endpoint
Given that proxy.golang.org serves as some sort of central registry for modules, it would be great if it could provide additional information in an universally readable format through the information endpoint:
GET $GOPROXY/<module>/@v/<version>.inforeturns JSON-formatted metadata about that version of the given module.
These fields may be or may be not be part of the base proxy specification, but it would be nice to have them at least on the official implementation.
Proposed additional response fields:
-
Documentation: a short sentence describing the module purpose, can be extracted in the same way as
go list -json. -
Licenses: the same license strings shown in pkg.go.dev, or
[]for unknown licenses; ideally including the github.com/google/licensecheck to SPDX conversion used here. -
Dependencies: a list with the same fields as
requiresin thego.modfile, including the// indirectcomment as an additional field. -
Hashes: for both the package and every requirement, as per the
go.sumformat. -
Additional fields: every field as produced by
go mod edit -json.
What did you do?
$ curl https://proxy.golang.org/golang.org/x/benchmarks/@v/v0.0.0-20191128100916-8f6035fd2e05.infoWhat did you expect to see?
{
"Module": "golang.org/x/benchmarks",
"Version": "v0.0.0-20191128100916-8f6035fd2e05",
"Time": "2019-11-28T10:09:16Z",
"Go": "1.13",
"Packages": [
{
"ImportPath": "golang.org/x/benchmarks/build",
"Doc": "Build is a benchmark that examines compiler and linker performance",
"Licenses": ["BSD-3-Clause"]
},
{
"ImportPath": "golang.org/x/benchmarks/driver",
"Doc": "Package driver provides common benchmarking logic shared between benchmarks",
"Licenses": ["BSD-3-Clause"]
},
{
"ImportPath": "golang.org/x/benchmarks/garbage",
"Doc": "Garbage is a benchmark that stresses garbage collector",
"Licenses": ["BSD-3-Clause"]
},
{
"ImportPath": "golang.org/x/benchmarks/http",
"Doc": "HTTP is a benchmark that examines client/server http performance",
"Licenses": ["BSD-3-Clause"]
},
{
"ImportPath": "golang.org/x/benchmarks/json",
"Doc": "JSON benchmark marshals and unmarshals ~2MB json string with a tree-like object hierarchy, in 4*GOMAXPROCS goroutines",
"Licenses": ["BSD-3-Clause"]
}
],
"Require": [
{
"Path": "golang.org/x/sys",
"Version": "v0.0.0-20190312061237-fead79001313",
"Sum": {
"GoMod": "h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=",
"Module": "h1:eh4x/QwiUD8mqV3DqaO2syciENiawp92l44B9vVCLAk="
},
"Indirect": false
}
],
"Replace": null,
"Exclude": null,
"Sum": {
"GoMod": "h1:K/nWeB/DgmmOIDotXYHRsXa8OeuO9KAJf8AT3/wwq7o=",
"Module": "h1:3NzKrPel479N37l438cSECz8erwULlLLQdr1d2+Hj4s="
},
"Licenses": ["BSD-3-Clause"]
}What did you see instead?
{
"Version": "v0.0.0-20191128100916-8f6035fd2e05",
"Time": "2019-11-28T10:09:16Z"
}Omitted fields:
I've omitted the following fields because they don't seem to be useful for this proposal:
- What operating system and processor architecture are you using?
- Does this issue reproduce with the latest release?
- What version of Go are you using?