Version: v0.0.0-...-8893da0 Latest Latest

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

Go to latest
Published: Nov 23, 2022 License: BSD-3-Clause Imports: 16 Imported by: 0



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



This section is empty.


This section is empty.


func NewGOPATHModuleGetter

func NewGOPATHModuleGetter(importPath string) (_ fetch.ModuleGetter, err error)

NewGOPATHModuleGetter returns a module getter that uses the GOPATH environment variable to find the module with the given import path.


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.

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