resolution

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Overview

Package resolution provides clients required by dependency resolution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientWithRegistries

type ClientWithRegistries interface {
	resolve.Client
	// AddRegistries adds the specified registries to fetch data.
	AddRegistries(registries []Registry) error
}

ClientWithRegistries is a resolve.Client that allows package registries to be added.

type CombinedNativeClient added in v0.2.0

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

CombinedNativeClient is a ResolutionClient that combines all the native clients: MavenRegistryClient, NPMRegistryClient, PyPIRegistryClient. Individual clients are lazy-initialized when needed.

func NewCombinedNativeClient added in v0.2.0

func NewCombinedNativeClient(opts CombinedNativeClientOptions) (*CombinedNativeClient, error)

NewCombinedNativeClient makes a new CombinedNativeClient.

func (*CombinedNativeClient) AddRegistries added in v0.2.0

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

AddRegistries adds registries to the MavenRegistryClient.

func (*CombinedNativeClient) MatchingVersions added in v0.2.0

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

MatchingVersions returns versions matching the requirement specified by the VersionKey.

func (*CombinedNativeClient) Requirements added in v0.2.0

Requirements returns requirements of a version specified by the VersionKey.

func (*CombinedNativeClient) Version added in v0.2.0

Version returns metadata of a version specified by the VersionKey.

func (*CombinedNativeClient) Versions added in v0.2.0

Versions returns all the available versions of the package specified by the given PackageKey.

type CombinedNativeClientOptions added in v0.2.0

type CombinedNativeClientOptions struct {
	ProjectDir    string // The project directory to use, currently only used for NPM to find .npmrc files.
	MavenRegistry string // The default Maven registry to use.
	PyPIRegistry  string // The default PyPI registry to use.
}

CombinedNativeClientOptions contains the options each client in the CombinedNativeClient.

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)

NewDepsDevClient creates a new DepsDevClient.

type MavenRegistryClient

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

MavenRegistryClient is a client to fetch data from Maven registry.

func NewMavenRegistryClient

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

NewMavenRegistryClient makes a new MavenRegistryClient.

func (*MavenRegistryClient) AddRegistries

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

AddRegistries adds registries to the MavenRegistryClient.

func (*MavenRegistryClient) MatchingVersions

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

MatchingVersions returns versions matching the requirement specified by the VersionKey.

func (*MavenRegistryClient) Requirements

Requirements returns requirements of a version specified by the VersionKey.

func (*MavenRegistryClient) Version

Version returns metadata of a version specified by the VersionKey.

func (*MavenRegistryClient) Versions

Versions returns all the available versions of the package specified by the given PackageKey. 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.

type NPMRegistryClient added in v0.2.0

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

NPMRegistryClient is a client to fetch data from NPM registry.

func NewNPMRegistryClient added in v0.2.0

func NewNPMRegistryClient(projectDir string) (*NPMRegistryClient, error)

NewNPMRegistryClient makes a new NPMRegistryClient. projectDir is the directory (on disk) to read the project-level .npmrc config file from (for registries).

func (*NPMRegistryClient) MatchingVersions added in v0.2.0

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

MatchingVersions returns versions matching the requirement specified by the VersionKey.

func (*NPMRegistryClient) Requirements added in v0.2.0

Requirements returns requirements of a version specified by the VersionKey.

func (*NPMRegistryClient) Version added in v0.2.0

Version returns metadata of a version specified by the VersionKey.

func (*NPMRegistryClient) Versions added in v0.2.0

Versions returns all the available versions of the package specified by the given PackageKey.

type OverrideClient

type OverrideClient struct {
	resolve.Client
	// contains filtered or unexported fields
}

OverrideClient wraps a resolve.Client, allowing for custom packages & versions to be added

func NewOverrideClient

func NewOverrideClient(c resolve.Client) *OverrideClient

NewOverrideClient makes a new OverrideClient.

func (*OverrideClient) AddVersion

func (c *OverrideClient) AddVersion(v resolve.Version, deps []resolve.RequirementVersion)

AddVersion adds the specified version and dependencies to the client.

func (*OverrideClient) MatchingVersions

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

MatchingVersions returns the versions matching the requirement specified by the VersionKey.

func (*OverrideClient) Requirements

Requirements returns the requirement versions of the version specified by the VersionKey.

func (*OverrideClient) Version

Version returns the version specified by the VersionKey.

func (*OverrideClient) Versions

Versions returns the versions of a package specified by the PackageKey.

type PyPIRegistryClient added in v0.1.8

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

PyPIRegistryClient is a client to fetch data from PyPI registry.

func NewPyPIRegistryClient added in v0.1.8

func NewPyPIRegistryClient(registry string) *PyPIRegistryClient

NewPyPIRegistryClient makes a new PyPIRegistryClient.

func (*PyPIRegistryClient) MatchingVersions added in v0.1.8

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

MatchingVersions returns versions matching the requirement specified by the VersionKey.

func (*PyPIRegistryClient) Requirements added in v0.1.8

Requirements returns requirements of a version specified by the VersionKey.

func (*PyPIRegistryClient) Version added in v0.1.8

Version returns metadata of a version specified by the VersionKey.

func (*PyPIRegistryClient) Versions added in v0.1.8

Versions returns all the available versions of the package specified by the given PackageKey.

type Registry

type Registry any

Registry is the interface of a registry to fetch data.

Jump to

Keyboard shortcuts

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