fakedatasource

package
v0.0.0-...-86cb477 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package fakedatasource provides a fake implementation of the internal.DataSource interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeDataSource

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

FakeDataSource provides a fake implementation of the internal.DataSource interface.

func New

func New() *FakeDataSource

New returns an initialized FakeDataSource.

func (*FakeDataSource) GetImportedBy

func (ds *FakeDataSource) GetImportedBy(ctx context.Context, pkgPath, modulePath string, limit int) (paths []string, err error)

GetImportedBy returns the set of packages importing the given pkgPath.

func (*FakeDataSource) GetImportedByCount

func (ds *FakeDataSource) GetImportedByCount(ctx context.Context, pkgPath, modulePath string) (int, error)

func (*FakeDataSource) GetLatestInfo

func (ds *FakeDataSource) GetLatestInfo(ctx context.Context, unitPath, modulePath string, latestUnitMeta *internal.UnitMeta) (latest internal.LatestInfo, err error)

GetLatestInfo gets information about the latest versions of a unit and module. See LatestInfo for documentation.

func (*FakeDataSource) GetLatestMajorPathForV1Path

func (ds *FakeDataSource) GetLatestMajorPathForV1Path(ctx context.Context, v1path string) (string, int, error)

func (*FakeDataSource) GetModuleReadme

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

GetModuleReadme is not implemented.

func (*FakeDataSource) GetNestedModules

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

GetNestedModules returns the latest major version of all nested modules given a modulePath path prefix.

func (*FakeDataSource) GetStdlibPathsWithSuffix

func (ds *FakeDataSource) GetStdlibPathsWithSuffix(ctx context.Context, suffix string) ([]string, error)

func (*FakeDataSource) GetSymbolHistory

func (ds *FakeDataSource) GetSymbolHistory(ctx context.Context, packagePath, modulePath string) (*internal.SymbolHistory, error)

func (*FakeDataSource) GetUnit

GetUnit returns information about a directory, which may also be a module and/or package. The module and version must both be known. The BuildContext selects the documentation to read.

func (*FakeDataSource) GetUnitMeta

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

GetUnitMeta returns information about a path.

func (*FakeDataSource) GetVersionMap

func (ds *FakeDataSource) GetVersionMap(ctx context.Context, modulePath, requestedVersion string) (*internal.VersionMap, error)

func (*FakeDataSource) GetVersionMaps

func (ds *FakeDataSource) GetVersionMaps(ctx context.Context, paths []string, requestedVersion string) ([]*internal.VersionMap, error)

func (*FakeDataSource) GetVersionsForPath

func (ds *FakeDataSource) GetVersionsForPath(ctx context.Context, path string) ([]*internal.ModuleInfo, error)

GetVersionsForPath returns a list of tagged versions sorted in descending semver order if any exist. If none, it returns the 10 most recent from a list of pseudo-versions sorted in descending semver order.

func (*FakeDataSource) InsertModule

func (ds *FakeDataSource) InsertModule(ctx context.Context, m *internal.Module, lmv *internal.LatestModuleVersions) (isLatest bool, err error)

InsertModule inserts m into the FakeDataSource. It is only implemented for lmv == nil.

func (*FakeDataSource) IsExcluded

func (ds *FakeDataSource) IsExcluded(ctx context.Context, path string) (_ bool, err error)

func (*FakeDataSource) MustInsertModule

func (ds *FakeDataSource) MustInsertModule(ctx context.Context, m *internal.Module)

InsertModule adds the module to the FakeDataSource.

func (*FakeDataSource) Search

func (ds *FakeDataSource) Search(ctx context.Context, q string, opts internal.SearchOptions) (results []*internal.SearchResult, err error)

Search searches for packages matching the given query. It's a basic search of documentation synopses only enough to satisfy unit tests.

func (*FakeDataSource) SearchSupport

func (ds *FakeDataSource) SearchSupport() internal.SearchSupport

SearchSupport reports the search types supported by this datasource.

func (*FakeDataSource) UpsertVersionMap

func (ds *FakeDataSource) UpsertVersionMap(ctx context.Context, vm *internal.VersionMap) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL