client

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package client provides clients required by dependency resolution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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
}

DependencyClient is the interface of the client required by dependency resolution.

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.

func (*DepsDevClient) AddRegistries

func (d *DepsDevClient) AddRegistries(_ []Registry) error

AddRegistries is a placeholder here for DepsDevClient.

func (*DepsDevClient) LoadCache

func (d *DepsDevClient) LoadCache(path string) error

LoadCache loads the cache at the given path.

func (*DepsDevClient) WriteCache

func (d *DepsDevClient) WriteCache(path string) error

WriteCache writes cache at the given path.

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

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