Documentation ¶
Overview ¶
Package fakedatasource provides a fake implementation of the internal.DataSource interface.
Index ¶
- type FakeDataSource
- func (ds *FakeDataSource) GetImportedBy(ctx context.Context, pkgPath, modulePath string, limit int) (paths []string, err error)
- func (ds *FakeDataSource) GetImportedByCount(ctx context.Context, pkgPath, modulePath string) (int, error)
- func (ds *FakeDataSource) GetLatestInfo(ctx context.Context, unitPath, modulePath string, ...) (latest internal.LatestInfo, err error)
- func (ds *FakeDataSource) GetLatestMajorPathForV1Path(ctx context.Context, v1path string) (string, int, error)
- func (ds *FakeDataSource) GetModuleReadme(ctx context.Context, modulePath, resolvedVersion string) (*internal.Readme, error)
- func (ds *FakeDataSource) GetNestedModules(ctx context.Context, modulePath string) ([]*internal.ModuleInfo, error)
- func (ds *FakeDataSource) GetStdlibPathsWithSuffix(ctx context.Context, suffix string) ([]string, error)
- func (ds *FakeDataSource) GetSymbolHistory(ctx context.Context, packagePath, modulePath string) (*internal.SymbolHistory, error)
- func (ds *FakeDataSource) GetUnit(ctx context.Context, um *internal.UnitMeta, fields internal.FieldSet, ...) (*internal.Unit, error)
- func (ds *FakeDataSource) GetUnitMeta(ctx context.Context, path, requestedModulePath, requestedVersion string) (_ *internal.UnitMeta, err error)
- func (ds *FakeDataSource) GetVersionMap(ctx context.Context, modulePath, requestedVersion string) (*internal.VersionMap, error)
- func (ds *FakeDataSource) GetVersionMaps(ctx context.Context, paths []string, requestedVersion string) ([]*internal.VersionMap, error)
- func (ds *FakeDataSource) GetVersionsForPath(ctx context.Context, path string) ([]*internal.ModuleInfo, error)
- func (ds *FakeDataSource) InsertModule(ctx context.Context, m *internal.Module, lmv *internal.LatestModuleVersions) (isLatest bool, err error)
- func (ds *FakeDataSource) IsExcluded(ctx context.Context, path, version string) bool
- func (ds *FakeDataSource) MustInsertModule(ctx context.Context, m *internal.Module)
- func (ds *FakeDataSource) Search(ctx context.Context, q string, opts internal.SearchOptions) (results []*internal.SearchResult, err error)
- func (ds *FakeDataSource) SearchSupport() internal.SearchSupport
- func (ds *FakeDataSource) UpsertVersionMap(ctx context.Context, vm *internal.VersionMap) error
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 (*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 (*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 (*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 (*FakeDataSource) GetSymbolHistory ¶
func (ds *FakeDataSource) GetSymbolHistory(ctx context.Context, packagePath, modulePath string) (*internal.SymbolHistory, error)
func (*FakeDataSource) GetUnit ¶
func (ds *FakeDataSource) GetUnit(ctx context.Context, um *internal.UnitMeta, fields internal.FieldSet, bc internal.BuildContext) (*internal.Unit, error)
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, version string) bool
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