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 ¶
- type FetchDataSource
- func (ds *FetchDataSource) GetLatestInfo(ctx context.Context, unitPath, modulePath string, ...) (latest internal.LatestInfo, err error)
- func (*FetchDataSource) GetModuleReadme(ctx context.Context, modulePath, resolvedVersion string) (*internal.Readme, error)
- func (ds *FetchDataSource) GetNestedModules(ctx context.Context, modulePath string) ([]*internal.ModuleInfo, error)
- func (ds *FetchDataSource) GetUnit(ctx context.Context, um *internal.UnitMeta, fields internal.FieldSet, ...) (_ *internal.Unit, err error)
- func (ds *FetchDataSource) GetUnitMeta(ctx context.Context, path, requestedModulePath, requestedVersion string) (_ *internal.UnitMeta, err error)
- func (ds *FetchDataSource) Search(ctx context.Context, q string, opts internal.SearchOptions) (_ []*internal.SearchResult, err error)
- func (ds *FetchDataSource) SearchSupport() internal.SearchSupport
- type Options
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 ¶
func (ds *FetchDataSource) GetUnit(ctx context.Context, um *internal.UnitMeta, fields internal.FieldSet, bc internal.BuildContext) (_ *internal.Unit, err error)
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
SupportsSearch 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.