pkgsite: Index | Files

package localdatasource

import ""

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 Files


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) GetLatestInfo Uses

func (ds *DataSource) GetLatestInfo(ctx context.Context, unitPath, modulePath string) (internal.LatestInfo, error)

GetLatestInfo is not implemented.

func (*DataSource) GetModuleReadme Uses

func (*DataSource) GetModuleReadme(ctx context.Context, modulePath, resolvedVersion string) (*internal.Readme, error)

GetModuleReadme is not implemented.

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 12 packages (graph) and is imported by 1 packages. Updated 2021-01-16. Refresh now. Tools for package owners.