fetchdatasource

package
v0.0.0-...-41da83f Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package fetchdatasource provides an internal.DataSource implementation that fetches modules (rather than reading them from a database). Search and other tabs are not supported.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchDataSource

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

FetchDataSource implements the internal.DataSource interface, by trying a list of fetch.ModuleGetters to fetch modules and caching the results.

func (*FetchDataSource) GetLatestInfo

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

GetLatestInfo returns latest information for unitPath and modulePath.

func (*FetchDataSource) GetModuleReadme

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

GetModuleReadme is not implemented.

func (*FetchDataSource) GetNestedModules

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

GetNestedModules is not implemented.

func (*FetchDataSource) GetUnit

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

func (*FetchDataSource) GetUnitMeta

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

GetUnitMeta returns information about a path.

func (*FetchDataSource) Search

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

Search delegates search to any configured getters that support the SearchableModuleGetter interface, merging their results.

func (*FetchDataSource) SearchSupport

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

SearchSupport reports whether any of the configured Getters are searchable.

type Options

type Options struct {
	// List of getters to try, in order.
	Getters []fetch.ModuleGetter
	// If set, this will be used for latest-version information. To fetch modules from the proxy,
	// include a ProxyModuleGetter in Getters.
	ProxyClientForLatest *proxy.Client
	BypassLicenseCheck   bool
}

Options are parameters for creating a new FetchDataSource.

func (Options) New

func (o Options) New() *FetchDataSource

New creates a new FetchDataSource from the options.

Jump to

Keyboard shortcuts

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