Description
Proposal Details
Create a golang.org/x/mod/proxy package similar in goal to the golang.org/x/mod/sumdb package.
Why? To make it easy to setup, test, and develop your own https://modproxy.example.com/ Go module proxy for <meta name="go-import" content="example.com/awesome mod https://modproxy.example.com">
custom module proxies and/or GOPROXY=https://goproxy.example.com
caching module proxies. I appreciate the https://pkg.go.dev/golang.org/x/mod/sumdb#Client and https://pkg.go.dev/golang.org/x/mod/sumdb#Server structs so that I can just plug-and-play some type MyServerOps struct {}
, sumdb.NewServer(&MyServerOps{})
and then http.ListenAndServe(blahblah)
and it works for testing. I also like being able to use a client very easily. I would appreciate a similar thing for module proxies.
This was mentioned in #31761:
golang.org/x/mod/proxy: go module proxy client and server protocol (like x/mod/sumdb; not written yet)
golang.org/x/mod/index: go module index client and server protocol (like x/mod/sumdb; not written yet)
golang.org/x/mod/gomodproxy: command: trivial go module proxy for reference and trivial uses (not published yet; maybe also “go mod proxy”)
So I think this isn't that far out. I am willing to contribute code to do this.