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.

Index

Package Files

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 (*DataSource) GetDirectory Uses

func (ds *DataSource) GetDirectory(ctx context.Context, dirPath, modulePath, version string) (_ *internal.VersionedDirectory, err error)

GetDirectory returns information about a directory at a path.

func (*DataSource) GetExperiments Uses

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

GetExperiments is unimplemented.

func (*DataSource) GetImports Uses

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

GetImports returns package imports as extracted from the module zip.

func (*DataSource) GetLicenses Uses

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

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

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) GetPathInfo Uses

func (ds *DataSource) GetPathInfo(ctx context.Context, path, inModulePath, inVersion string) (outModulePath, outVersion string, isPackage bool, err error)

GetPathInfo 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) 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-07-15. Refresh now. Tools for package owners.