pkgsite: golang.org/x/pkgsite/internal/proxydatasource Index | Files

package proxydatasource

import "golang.org/x/pkgsite/internal/proxydatasource"

Package proxydatasource implements an internal.DataSource backed solely by a proxy instance.

Package proxydatasource implements an internal.DataSource backed solely by a proxy instance.

Package proxydatasource implements an internal.DataSource backed solely by a proxy instance.

Index

Package Files

datasource.go details.go legacy_datasource.go

type DataSource Uses

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

DataSource implements the frontend.DataSource interface, by querying a module proxy directly and caching the results in memory.

func New Uses

func New(proxyClient *proxy.Client) *DataSource

New returns a new direct proxy datasource.

func NewBypassingLicenseCheck Uses

func NewBypassingLicenseCheck(c *proxy.Client) *DataSource

NewBypassingLicenseCheck returns a new direct proxy datasource that bypasses license checks. That means all data will be returned for non-redistributable modules, packages and directories.

func (*DataSource) GetExperiments Uses

func (*DataSource) GetExperiments(ctx context.Context) ([]*internal.Experiment, error)

GetExperiments is unimplemented.

func (*DataSource) GetLatestMajorVersion Uses

func (ds *DataSource) GetLatestMajorVersion(ctx context.Context, seriesPath string) (_ string, err error)

GetLatestMajorVersion finds the latest major version of a modulePath that is found in the proxy by iterating through vN versions.

func (*DataSource) GetModuleInfo Uses

func (ds *DataSource) GetModuleInfo(ctx context.Context, modulePath, version string) (_ *internal.ModuleInfo, err error)

GetModuleInfo returns the ModuleInfo as fetched from the proxy for module version specified by modulePath and version.

func (*DataSource) GetNestedModules Uses

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

GetNestedModules will return an empty slice since it is not implemented in proxy mode.

func (*DataSource) GetUnit Uses

func (ds *DataSource) GetUnit(ctx context.Context, um *internal.UnitMeta, field internal.FieldSet) (_ *internal.Unit, err error)

GetUnit returns information about a directory at a path.

func (*DataSource) GetUnitMeta Uses

func (ds *DataSource) GetUnitMeta(ctx context.Context, path, inModulePath, inVersion string) (_ *internal.UnitMeta, err error)

GetUnitMeta returns information about the given path.

func (*DataSource) LegacyGetDirectory Uses

func (ds *DataSource) LegacyGetDirectory(ctx context.Context, dirPath, modulePath, version string, _ internal.FieldSet) (_ *internal.LegacyDirectory, err error)

LegacyGetDirectory returns packages contained in the given subdirectory of a module version.

func (*DataSource) LegacyGetImports Uses

func (ds *DataSource) LegacyGetImports(ctx context.Context, pkgPath, modulePath, version string) (_ []string, err error)

LegacyGetImports returns package imports as extracted from the module zip.

func (*DataSource) LegacyGetLicenses Uses

func (ds *DataSource) LegacyGetLicenses(ctx context.Context, fullPath, modulePath, resolvedVersion string) (_ []*licenses.License, err error)

LegacyGetLicenses return licenses at path for the given module path and version.

func (*DataSource) LegacyGetModuleInfo Uses

func (ds *DataSource) LegacyGetModuleInfo(ctx context.Context, modulePath, version string) (_ *internal.LegacyModuleInfo, err error)

LegacyGetModuleInfo returns the LegacyModuleInfo as fetched from the proxy for module version specified by modulePath and version.

func (*DataSource) LegacyGetModuleLicenses Uses

func (ds *DataSource) LegacyGetModuleLicenses(ctx context.Context, modulePath, version string) (_ []*licenses.License, err error)

LegacyGetModuleLicenses returns root-level licenses detected within the module zip for modulePath and version.

func (*DataSource) LegacyGetPackage Uses

func (ds *DataSource) LegacyGetPackage(ctx context.Context, pkgPath, modulePath, version string) (_ *internal.LegacyVersionedPackage, err error)

LegacyGetPackage returns a LegacyVersionedPackage for the given pkgPath and version. If such a package exists in the cache, it will be returned without querying the proxy. Otherwise, the proxy is queried to find the longest module path at that version containing the package.

func (*DataSource) LegacyGetPackageLicenses Uses

func (ds *DataSource) LegacyGetPackageLicenses(ctx context.Context, pkgPath, modulePath, version string) (_ []*licenses.License, err error)

LegacyGetPackageLicenses returns the Licenses that apply to pkgPath within the module version specified by modulePath and version.

func (*DataSource) LegacyGetPackagesInModule Uses

func (ds *DataSource) LegacyGetPackagesInModule(ctx context.Context, modulePath, version string) (_ []*internal.LegacyPackage, err error)

LegacyGetPackagesInModule returns LegacyPackages contained in the module zip corresponding to modulePath and version.

func (*DataSource) LegacyGetPsuedoVersionsForModule Uses

func (ds *DataSource) LegacyGetPsuedoVersionsForModule(ctx context.Context, modulePath string) (_ []*internal.ModuleInfo, err error)

LegacyGetPsuedoVersionsForModule returns versions from the the proxy /list endpoint, if they are pseudoversions. Otherwise, it returns an empty slice.

func (*DataSource) LegacyGetPsuedoVersionsForPackageSeries Uses

func (ds *DataSource) LegacyGetPsuedoVersionsForPackageSeries(ctx context.Context, pkgPath string) (_ []*internal.ModuleInfo, err error)

LegacyGetPsuedoVersionsForPackageSeries finds the longest module path containing pkgPath, and returns its versions from the proxy /list endpoint, if they are pseudoversions. Otherwise, it returns an empty slice.

func (*DataSource) LegacyGetTaggedVersionsForModule Uses

func (ds *DataSource) LegacyGetTaggedVersionsForModule(ctx context.Context, modulePath string) (_ []*internal.ModuleInfo, err error)

LegacyGetTaggedVersionsForModule returns versions from the the proxy /list endpoint, if they are tagged versions. Otherwise, it returns an empty slice.

func (*DataSource) LegacyGetTaggedVersionsForPackageSeries Uses

func (ds *DataSource) LegacyGetTaggedVersionsForPackageSeries(ctx context.Context, pkgPath string) (_ []*internal.ModuleInfo, err error)

LegacyGetTaggedVersionsForPackageSeries finds the longest module path containing pkgPath, and returns its versions from the proxy /list endpoint, if they are tagged versions. Otherwise, it returns an empty slice.

Package proxydatasource imports 17 packages (graph) and is imported by 1 packages. Updated 2020-09-18. Refresh now. Tools for package owners.