Documentation
¶
Overview ¶
Package resolution provides clients required by dependency resolution.
Index ¶
- type ClientWithRegistries
- type CombinedNativeClient
- func (c *CombinedNativeClient) AddRegistries(registries []Registry) error
- func (c *CombinedNativeClient) MatchingVersions(ctx context.Context, vk resolve.VersionKey) ([]resolve.Version, error)
- func (c *CombinedNativeClient) Requirements(ctx context.Context, vk resolve.VersionKey) ([]resolve.RequirementVersion, error)
- func (c *CombinedNativeClient) Version(ctx context.Context, vk resolve.VersionKey) (resolve.Version, error)
- func (c *CombinedNativeClient) Versions(ctx context.Context, pk resolve.PackageKey) ([]resolve.Version, error)
- type CombinedNativeClientOptions
- type DepsDevClient
- type MavenRegistryClient
- func (c *MavenRegistryClient) AddRegistries(registries []Registry) 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)
- type NPMRegistryClient
- 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)
- 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 PyPIRegistryClient
- func (c *PyPIRegistryClient) MatchingVersions(ctx context.Context, vk resolve.VersionKey) ([]resolve.Version, error)
- func (c *PyPIRegistryClient) Requirements(ctx context.Context, vk resolve.VersionKey) ([]resolve.RequirementVersion, error)
- func (c *PyPIRegistryClient) Version(ctx context.Context, vk resolve.VersionKey) (resolve.Version, error)
- func (c *PyPIRegistryClient) Versions(ctx context.Context, pk resolve.PackageKey) ([]resolve.Version, error)
- type Registry
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
func (c *CombinedNativeClient) Requirements(ctx context.Context, vk resolve.VersionKey) ([]resolve.RequirementVersion, error)
Requirements returns requirements of a version specified by the VersionKey.
func (*CombinedNativeClient) Version ¶ added in v0.2.0
func (c *CombinedNativeClient) Version(ctx context.Context, vk resolve.VersionKey) (resolve.Version, error)
Version returns metadata of a version specified by the VersionKey.
func (*CombinedNativeClient) Versions ¶ added in v0.2.0
func (c *CombinedNativeClient) Versions(ctx context.Context, pk resolve.PackageKey) ([]resolve.Version, error)
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.
LocalRegistry string // The local directory to store the downloaded manifests during resolution.
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 ¶
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(remote, local string) (*MavenRegistryClient, error)
NewMavenRegistryClient makes a new MavenRegistryClient.
func NewMavenRegistryClientWithAPI ¶ added in v0.2.1
func NewMavenRegistryClientWithAPI(api *datasource.MavenRegistryAPIClient) *MavenRegistryClient
NewMavenRegistryClientWithAPI makes a new MavenRegistryClient with the given Maven registry client.
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 ¶
func (c *MavenRegistryClient) Requirements(ctx context.Context, vk resolve.VersionKey) ([]resolve.RequirementVersion, error)
Requirements returns requirements of a version specified by the VersionKey.
func (*MavenRegistryClient) Version ¶
func (c *MavenRegistryClient) Version(ctx context.Context, vk resolve.VersionKey) (resolve.Version, error)
Version returns metadata of a version specified by the VersionKey.
func (*MavenRegistryClient) Versions ¶
func (c *MavenRegistryClient) Versions(ctx context.Context, pk resolve.PackageKey) ([]resolve.Version, error)
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
func (c *NPMRegistryClient) Requirements(ctx context.Context, vk resolve.VersionKey) ([]resolve.RequirementVersion, error)
Requirements returns requirements of a version specified by the VersionKey.
func (*NPMRegistryClient) Version ¶ added in v0.2.0
func (c *NPMRegistryClient) Version(ctx context.Context, vk resolve.VersionKey) (resolve.Version, error)
Version returns metadata of a version specified by the VersionKey.
func (*NPMRegistryClient) Versions ¶ added in v0.2.0
func (c *NPMRegistryClient) Versions(ctx context.Context, pk resolve.PackageKey) ([]resolve.Version, error)
Versions returns all the available versions of the package specified by the given PackageKey.
type OverrideClient ¶
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 ¶
func (c *OverrideClient) Requirements(ctx context.Context, vk resolve.VersionKey) ([]resolve.RequirementVersion, error)
Requirements returns the requirement versions of the version specified by the VersionKey.
func (*OverrideClient) Version ¶
func (c *OverrideClient) Version(ctx context.Context, vk resolve.VersionKey) (resolve.Version, error)
Version returns the version specified by the VersionKey.
func (*OverrideClient) Versions ¶
func (c *OverrideClient) Versions(ctx context.Context, pk resolve.PackageKey) ([]resolve.Version, error)
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
func (c *PyPIRegistryClient) Requirements(ctx context.Context, vk resolve.VersionKey) ([]resolve.RequirementVersion, error)
Requirements returns requirements of a version specified by the VersionKey.
func (*PyPIRegistryClient) Version ¶ added in v0.1.8
func (c *PyPIRegistryClient) Version(ctx context.Context, vk resolve.VersionKey) (resolve.Version, error)
Version returns metadata of a version specified by the VersionKey.
func (*PyPIRegistryClient) Versions ¶ added in v0.1.8
func (c *PyPIRegistryClient) Versions(ctx context.Context, pk resolve.PackageKey) ([]resolve.Version, error)
Versions returns all the available versions of the package specified by the given PackageKey.