Involved Source Files
Package localdatasource implements an in-memory internal.DataSource used to load
and display documentation for local modules that are not available via a proxy.
Similar to proxydatasource, search and other tabs are not supported in this mode.
Package-Level Type Names (only one, which is exported)
/* sort exporteds by: | */
DataSource implements an in-memory internal.DataSource used to display documentation
locally. DataSource is not backed by a database or a proxy instance.
loadedModulesmap[string]*internal.Modulemusync.MutexsourceClient*source.Client
GetLatestInfo is not implemented.
GetModuleReadme is not implemented.
GetNestedModules is not implemented.
GetUnit returns information about a unit. Both the module path and package
path must be known.
GetUnitMeta returns information about a path.
Load loads a module from the given local path. Loading is required before
being able to display the module.
LoadFromGOPATH loads a module from GOPATH using the given import path. The full
path of the module should be GOPATH/src/importPath. If several GOPATHs exist, the
module is loaded from the first one that contains the import path. Loading is required
before being able to display the module.
fetch fetches a module using FetchLocalModule and adds it to the datasource.
If the fetching fails, an error is returned.
findModule finds the longest module path in loadedModules containing the given
package path. It iteratively checks parent directories to find an import path.
Returns an error if no module is found.
*T : golang.org/x/pkgsite/internal.DataSource
func New() *DataSource
func golang.org/x/pkgsite/cmd/pkgsite.load(ctx context.Context, ds *DataSource, pathList string)
Package-Level Functions (total 2, in which 1 are exported)
New creates and returns a new local datasource that bypasses license
checks by default.
getFullPath takes an import path, tests it relative to each GOPATH, and returns
a full path to the module. If the given import path doesn't exist in any GOPATH,
an empty string is returned.
The pages are generated with Goldsv0.3.2-preview. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.