Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "server [flags] package_mapping ...", Short: "Run the govanity server", Example: " govanity server go.codello.dev/govanity=github.com/codello/govanity", Long: `govanity is a simple server for Go vanity URLs. The configuration is done entirely via the command line by specifying package mappings. A package mapping looks like this: prefix=[vcs:]repo-root This maps the package prefix to the repo root using the vcs protocol. If vcs is not present, it defaults to git. If the prefix starts with a / the prefix will be matched independently of the hostname of the request. The server will then prepend the hostname of the request to the package name. Use this if you want to map the prefix to a repo, regardless of the hostname used to resolve the package. If the prefix does not start with a / the first path component is assumed to be the hostname. The prefix will only match if the request hostname matches this part of the prefix and the part matches the corresponding prefix. `, RunE: runServer, Args: cobra.MinimumNArgs(1), }
Command is the command that runs the govanity server.
Functions ¶
func PackageHandler ¶
PackageHandler returns a http.Handler that renders the package meta page for the package prefix. The rendered page will indicate that the source for the page can be found at repoRoot using vcs.
func ParsePackageMapping ¶
ParsePackageMapping converts a "prefix=[vcs:]repo-root" spec into prefix, vcs and repoRoot. If a parsing error occurs, err will be non-nil.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.