Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type URI ¶
A URI is a wrapper around url.URL that makes it easier to get and manipulate Nxpkg-specific components. All URIs are valid URLs, but Nxpkg assigns special meaning to certain URL components as described below.
Nxpkg URIs can refer to repos (at an optional revision), or a file or directory thereof.
The format is "CLONEURL?REV#PATH". For example:
git://github.com/facebook/react?master git://github.com/gorilla/mux?HEAD git://github.com/golang/go?0dc31fb#src/net/http/server.go git://github.com/golang/tools?79f4a1#godoc/page.go
A Nxpkg URI is not guaranteed (or intended) to be a unique or canonical reference to a resource. A repository can be clonable at several different URLs, and any of them can be used in the URI. A given file in a repository has any number of URIs that refer to it (e.g., using the branch name vs. the commit ID, using clean vs. non-clean file paths, etc.).
func (*URI) FilePath ¶
FilePath returns the cleaned file path component of the URI (in the URL fragment). Leading slashes are removed. If it is ".", an empty string is returned.
func (*URI) ResolveFilePath ¶
ResolveFilePath returns the cleaned file path component obtained by appending p to the URI's file path. It is called "resolve" not "join" because it strips p's leading slash (if any).
func (*URI) WithFilePath ¶
WithFilePath returns a copy of u with the file path p overwriting the existing file path (if any).