pkgsite: golang.org/x/pkgsite/internal/localdatasource Index | Files

package localdatasource

import "golang.org/x/pkgsite/internal/localdatasource"

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.

Index

Package Files

datasource.go

type DataSource Uses

type DataSource struct {
    // contains filtered or unexported fields
}

DataSource implements an in-memory internal.DataSource used to display documentation locally. DataSource is not backed by a database or a proxy instance.

func New Uses

func New() *DataSource

New creates and returns a new local datasource that bypasses license checks by default.

func (*DataSource) GetLatestMajorVersion Uses

func (ds *DataSource) GetLatestMajorVersion(ctx context.Context, seriesPath string) (string, error)

GetLatestMajorVersion returns the latest major version of a series path. When fetching local modules, version is not accounted for, so an empty string is returned.

func (*DataSource) GetNestedModules Uses

func (ds *DataSource) GetNestedModules(ctx context.Context, modulePath string) ([]*internal.ModuleInfo, error)

GetNestedModules is not implemented.

func (*DataSource) GetUnit Uses

func (ds *DataSource) GetUnit(ctx context.Context, pathInfo *internal.UnitMeta, fields internal.FieldSet) (_ *internal.Unit, err error)

GetUnit returns information about a unit. Both the module path and package path must both be known.

func (*DataSource) GetUnitMeta Uses

func (ds *DataSource) GetUnitMeta(ctx context.Context, path, requestedModulePath, requestedVersion string) (_ *internal.UnitMeta, err error)

GetUnitMeta returns information about a path.

func (*DataSource) Load Uses

func (ds *DataSource) Load(ctx context.Context, localPath string) (err error)

Load loads a module from the given local path. Loading is required before being able to display the module.

func (*DataSource) LoadFromGOPATH Uses

func (ds *DataSource) LoadFromGOPATH(ctx context.Context, importPath string) (err error)

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.

Package localdatasource imports 11 packages (graph) and is imported by 1 packages. Updated 2020-10-28. Refresh now. Tools for package owners.