Documentation ¶
Index ¶
- func PreFetch(ctx context.Context, c DependencyClient, ...)
- type DependencyClient
- type DepsDevClient
- type MavenRegistryClient
- func (c *MavenRegistryClient) AddRegistries(registries []Registry) error
- func (c *MavenRegistryClient) LoadCache(path string) error
- func (c *MavenRegistryClient) MatchingVersions(ctx context.Context, vk resolve.VersionKey) ([]resolve.Version, error)
- func (c *MavenRegistryClient) Requirements(ctx context.Context, vk resolve.VersionKey) ([]resolve.RequirementVersion, error)
- func (c *MavenRegistryClient) Version(ctx context.Context, vk resolve.VersionKey) (resolve.Version, error)
- func (c *MavenRegistryClient) Versions(ctx context.Context, pk resolve.PackageKey) ([]resolve.Version, error)
- func (c *MavenRegistryClient) WriteCache(path string) error
- type NpmRegistryClient
- func (c *NpmRegistryClient) AddRegistries(_ []Registry) error
- func (c *NpmRegistryClient) LoadCache(path string) error
- func (c *NpmRegistryClient) MatchingVersions(ctx context.Context, vk resolve.VersionKey) ([]resolve.Version, error)
- func (c *NpmRegistryClient) Requirements(ctx context.Context, vk resolve.VersionKey) ([]resolve.RequirementVersion, error)
- func (c *NpmRegistryClient) Version(ctx context.Context, vk resolve.VersionKey) (resolve.Version, error)
- func (c *NpmRegistryClient) Versions(ctx context.Context, pk resolve.PackageKey) ([]resolve.Version, error)
- func (c *NpmRegistryClient) WriteCache(path string) error
- type OSVClient
- type OSVOfflineClient
- type OverrideClient
- func (c *OverrideClient) AddVersion(v resolve.Version, deps []resolve.RequirementVersion)
- func (c *OverrideClient) MatchingVersions(ctx context.Context, vk resolve.VersionKey) ([]resolve.Version, error)
- func (c *OverrideClient) Requirements(ctx context.Context, vk resolve.VersionKey) ([]resolve.RequirementVersion, error)
- func (c *OverrideClient) Version(ctx context.Context, vk resolve.VersionKey) (resolve.Version, error)
- func (c *OverrideClient) Versions(ctx context.Context, pk resolve.PackageKey) ([]resolve.Version, error)
- type Registry
- type ResolutionClient
- type VulnerabilityClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PreFetch ¶ added in v1.9.0
func PreFetch(ctx context.Context, c DependencyClient, requirements []resolve.RequirementVersion, manifestPath string)
PreFetch loads cache, then makes and caches likely queries needed for resolving a package with a list of requirements
Types ¶
type DependencyClient ¶
type DependencyClient interface { resolve.Client // WriteCache writes a manifest-specific resolution cache. WriteCache(filepath string) error // LoadCache loads a manifest-specific resolution cache. LoadCache(filepath string) error // AddRegistries adds the specified registries to fetch data. AddRegistries(registries []Registry) error }
type DepsDevClient ¶
DepsDevClient is a ResolutionClient wrapping the official resolve.APIClient
func NewDepsDevClient ¶
func NewDepsDevClient(addr string) (*DepsDevClient, error)
func (*DepsDevClient) AddRegistries ¶ added in v1.9.1
func (d *DepsDevClient) AddRegistries(_ []Registry) error
func (*DepsDevClient) LoadCache ¶
func (d *DepsDevClient) LoadCache(path string) error
func (*DepsDevClient) WriteCache ¶
func (d *DepsDevClient) WriteCache(path string) error
type MavenRegistryClient ¶ added in v1.8.5
type MavenRegistryClient struct {
// contains filtered or unexported fields
}
func NewMavenRegistryClient ¶ added in v1.8.5
func NewMavenRegistryClient(registry string) (*MavenRegistryClient, error)
func (*MavenRegistryClient) AddRegistries ¶ added in v1.9.1
func (c *MavenRegistryClient) AddRegistries(registries []Registry) error
func (*MavenRegistryClient) LoadCache ¶ added in v1.8.5
func (c *MavenRegistryClient) LoadCache(path string) error
func (*MavenRegistryClient) MatchingVersions ¶ added in v1.8.5
func (c *MavenRegistryClient) MatchingVersions(ctx context.Context, vk resolve.VersionKey) ([]resolve.Version, error)
func (*MavenRegistryClient) Requirements ¶ added in v1.8.5
func (c *MavenRegistryClient) Requirements(ctx context.Context, vk resolve.VersionKey) ([]resolve.RequirementVersion, error)
func (*MavenRegistryClient) Version ¶ added in v1.8.5
func (c *MavenRegistryClient) Version(ctx context.Context, vk resolve.VersionKey) (resolve.Version, error)
func (*MavenRegistryClient) Versions ¶ added in v1.8.5
func (c *MavenRegistryClient) Versions(ctx context.Context, pk resolve.PackageKey) ([]resolve.Version, error)
TODO: we should also include versions not listed in the metadata file There exist versions in the repository but not listed in the metada file, for example version 20030203.000550 of package commons-io:commons-io https://repo1.maven.org/maven2/commons-io/commons-io/20030203.000550/. A package may depend on such version if a soft requirement of this version is declared. We need to find out if there are such versions and include them in the returned versions.
func (*MavenRegistryClient) WriteCache ¶ added in v1.8.5
func (c *MavenRegistryClient) WriteCache(path string) error
type NpmRegistryClient ¶ added in v1.7.0
type NpmRegistryClient struct {
// contains filtered or unexported fields
}
func NewNpmRegistryClient ¶ added in v1.7.0
func NewNpmRegistryClient(workdir string) (*NpmRegistryClient, error)
func (*NpmRegistryClient) AddRegistries ¶ added in v1.9.1
func (c *NpmRegistryClient) AddRegistries(_ []Registry) error
func (*NpmRegistryClient) LoadCache ¶ added in v1.7.0
func (c *NpmRegistryClient) LoadCache(path string) error
func (*NpmRegistryClient) MatchingVersions ¶ added in v1.7.0
func (c *NpmRegistryClient) MatchingVersions(ctx context.Context, vk resolve.VersionKey) ([]resolve.Version, error)
func (*NpmRegistryClient) Requirements ¶ added in v1.7.0
func (c *NpmRegistryClient) Requirements(ctx context.Context, vk resolve.VersionKey) ([]resolve.RequirementVersion, error)
func (*NpmRegistryClient) Version ¶ added in v1.7.0
func (c *NpmRegistryClient) Version(ctx context.Context, vk resolve.VersionKey) (resolve.Version, error)
func (*NpmRegistryClient) Versions ¶ added in v1.7.0
func (c *NpmRegistryClient) Versions(ctx context.Context, pk resolve.PackageKey) ([]resolve.Version, error)
func (*NpmRegistryClient) WriteCache ¶ added in v1.7.0
func (c *NpmRegistryClient) WriteCache(path string) error
type OSVClient ¶
type OSVClient struct {
// contains filtered or unexported fields
}
func NewOSVClient ¶
func NewOSVClient() *OSVClient
type OSVOfflineClient ¶ added in v1.9.1
type OSVOfflineClient struct {
// contains filtered or unexported fields
}
func NewOSVOfflineClient ¶ added in v1.9.1
func (*OSVOfflineClient) FindVulns ¶ added in v1.9.1
func (c *OSVOfflineClient) FindVulns(g *resolve.Graph) ([]models.Vulnerabilities, error)
type OverrideClient ¶
type OverrideClient struct { DependencyClient // contains filtered or unexported fields }
OverrideClient wraps a DependencyClient, allowing for custom packages & versions to be added
func NewOverrideClient ¶
func NewOverrideClient(c DependencyClient) *OverrideClient
func (*OverrideClient) AddVersion ¶
func (c *OverrideClient) AddVersion(v resolve.Version, deps []resolve.RequirementVersion)
func (*OverrideClient) MatchingVersions ¶
func (c *OverrideClient) MatchingVersions(ctx context.Context, vk resolve.VersionKey) ([]resolve.Version, error)
func (*OverrideClient) Requirements ¶
func (c *OverrideClient) Requirements(ctx context.Context, vk resolve.VersionKey) ([]resolve.RequirementVersion, error)
func (*OverrideClient) Version ¶
func (c *OverrideClient) Version(ctx context.Context, vk resolve.VersionKey) (resolve.Version, error)
func (*OverrideClient) Versions ¶
func (c *OverrideClient) Versions(ctx context.Context, pk resolve.PackageKey) ([]resolve.Version, error)
type ResolutionClient ¶
type ResolutionClient struct { DependencyClient VulnerabilityClient }
type VulnerabilityClient ¶
type VulnerabilityClient interface { // FindVulns finds the vulnerabilities affecting each of Nodes in the graph. // The returned Vulnerabilities[i] corresponds to the vulnerabilities in g.Nodes[i]. FindVulns(g *resolve.Graph) ([]models.Vulnerabilities, error) }