The amount of time to cache package pages in seconds. Controls the max-age directive sent in the Cache-Control HTTP header.
host
optional
Host name to use in meta tags. If omitted, uses the App Engine default version host or the Host header on non-App Engine Standard environments. You can use this option to fix the host when using this service behind a reverse proxy or a custom dispatch file.
paths
required
Map of paths to path configurations. Each key is a path that will point to the root of a repository hosted elsewhere. The fields are documented in the Path Configuration section below.
Path Configuration
Key
Required
Description
display
optional
The last three fields of the go-source meta tag. If omitted, it is inferred from the code hosting service if possible.
If the version control system cannot be inferred (e.g. for Bitbucket or a custom domain), then this specifies the version control system as it would appear in go-import meta tag. This can be one of git, hg, svn, or bzr.
Go Vanity URLs
Go Vanity URLs is a simple App Engine Go app that allows you to set custom import paths for your Go packages.
Quickstart
Install gcloud and install Go App Engine component:
Setup a custom domain for your app.
Get the application:
Edit
vanity.yamlto add any number of git repos. E.g.,customdomain.com/portmidiwill serve the https://github.com/rakyll/portmidi repo.You can add as many rules as you wish.
Deploy the app:
That’s it! You can use
go getto get the package from your custom domain.Running in other environments
You can also deploy this as an App Engine Flexible app by changing the
app.yamlfile:This project is a normal Go HTTP server, so you can also incorporate the handler into larger Go servers.
Configuration File
cache_max_agemax-agedirective sent in theCache-ControlHTTP header.hostpathsPath Configuration
displaygo-sourcemeta tag. If omitted, it is inferred from the code hosting service if possible.repogo-importmeta tag.vcsgo-importmeta tag. This can be one ofgit,hg,svn, orbzr.