client

package
v2.0.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraphToInventory

func GraphToInventory(g *resolve.Graph) []*extractor.Inventory

GraphToInventory is a helper function to convert a Graph into an Inventory for use with VulnerabilityMatcher.

func PreFetch

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, userAgent string) (*DepsDevClient, error)

func (*DepsDevClient) AddRegistries

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

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

func NewMavenRegistryClient

func NewMavenRegistryClient(registry string) (*MavenRegistryClient, error)

func (*MavenRegistryClient) AddRegistries

func (c *MavenRegistryClient) AddRegistries(registries []Registry) error

func (*MavenRegistryClient) LoadCache

func (c *MavenRegistryClient) LoadCache(path string) error

func (*MavenRegistryClient) MatchingVersions

func (c *MavenRegistryClient) MatchingVersions(ctx context.Context, vk resolve.VersionKey) ([]resolve.Version, error)

func (*MavenRegistryClient) Requirements

func (*MavenRegistryClient) Version

func (*MavenRegistryClient) Versions

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

func (c *MavenRegistryClient) WriteCache(path string) error

type NpmRegistryClient

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

func NewNpmRegistryClient

func NewNpmRegistryClient(workdir string) (*NpmRegistryClient, error)

func (*NpmRegistryClient) AddRegistries

func (c *NpmRegistryClient) AddRegistries(_ []Registry) error

func (*NpmRegistryClient) LoadCache

func (c *NpmRegistryClient) LoadCache(path string) error

func (*NpmRegistryClient) MatchingVersions

func (c *NpmRegistryClient) MatchingVersions(ctx context.Context, vk resolve.VersionKey) ([]resolve.Version, error)

func (*NpmRegistryClient) Requirements

func (*NpmRegistryClient) Version

func (*NpmRegistryClient) Versions

func (*NpmRegistryClient) WriteCache

func (c *NpmRegistryClient) WriteCache(path string) 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

type Registry interface{}

Jump to

Keyboard shortcuts

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