Cloud Source Repositories (CSR) does not serve the required meta tags for go get
to work correctly. csr-meta attaches the required meta tags. It
assumes that the repo name does not have any slashes and uses each request to
build the meta tags. Therefore
<hostname>/myproj/myrepo
corresponds to
source.developers.google.com/p/myproj/r/myrepo
Install gcloud and install Go App Engine component:
$ gcloud components install app-engine-go
Setup a custom domain for your app.
Get the application:
go get -u -d github.com/poy/csr-meta
cd $(go env GOPATH)/src/github.com/poy/csr-meta
paths:
/portmidi:
repo: https://github.com/rakyll/portmidi
You can add as many rules as you wish.
Deploy the app:
$ gcloud app deploy
That's it! You can use go get
to get the package from your custom domain.
$ go get customdomain.com/portmidi
Name | Required | Description |
---|---|---|
CACHE_AGE |
optional | The amount of time to cache package pages as a time.Duration (e.g., 24h ). It will be rounded to the nearest second. Controls the max-age directive sent in the Cache-Control HTTP header. |
HOST |
optional | The host that the code is being redirected from. It defaults to code.gopher.run . |