client

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

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

type DepsDevClient struct {
	resolve.APIClient
	// contains filtered or unexported fields
}

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 (*MavenRegistryClient) Version added in v1.8.5

func (*MavenRegistryClient) Versions added in v1.8.5

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 (*NpmRegistryClient) Version added in v1.7.0

func (*NpmRegistryClient) Versions added in v1.7.0

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

func (*OSVClient) FindVulns

func (c *OSVClient) FindVulns(g *resolve.Graph) ([]models.Vulnerabilities, error)

type OSVOfflineClient added in v1.9.1

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

func NewOSVOfflineClient added in v1.9.1

func NewOSVOfflineClient(r reporter.Reporter, system resolve.System, downloadDBs bool, localDBPath string) (*OSVOfflineClient, error)

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 (*OverrideClient) Version

func (*OverrideClient) Versions

type Registry added in v1.9.1

type Registry struct {
	URL string
}

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)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL